Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"files": [
"dist"
],
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"scripts": {
"build": "tsup --config tsup.config.ts",
"lint": "eslint src --ext .ts,tsx,js,jsx",
Expand All @@ -17,9 +19,10 @@
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./style.css": "./dist/style.css"
"./styles.css": "./dist/styles.css"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/BitteSpinner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Lottie from "react-lottie-player/dist/LottiePlayerLight";
import Lottie from "react-lottie-player/dist/LottiePlayerLight.js";

import { Color } from "../../lib/animation-colors/colors";
import { hexToRgb } from "../../lib/animation-colors/hex-to-rgb";
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/transactions/ReviewTransaction.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Transaction } from "@near-wallet-selector/core";
import BN from "bn.js";
import BN from "bn.js/lib/bn.js";
import { SafeEncodedSignRequest } from "near-safe";
import { useEffect, useState } from "react";
import { useAccountBalance } from "../../../hooks/useAccountBalance";
Expand Down
4 changes: 4 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "bn.js/lib/bn.js" {
import BN from "bn.js/lib/bn.js";
export default BN;
}
4 changes: 2 additions & 2 deletions src/hooks/useTxnFees.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Transaction } from "@near-wallet-selector/core";
import BN from "bn.js";
import { formatNearAmount } from "near-api-js/lib/utils/format";
import BN from "bn.js/lib/bn.js";
import { formatNearAmount } from "near-api-js/lib/utils/format.js";
import { formatUnits } from "viem";
import { removeTrailingZeros } from "../lib/utils";
import { Cost } from "../types";
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useTxnPrice.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getLatestGasPrice } from "@mintbase-js/rpc/lib/methods/getLatestGasPrice";
import { getLatestGasPrice } from "@mintbase-js/rpc/lib/methods/getLatestGasPrice.js";
import {
Action,
FunctionCallAction,
Transaction,
} from "@near-wallet-selector/core";
import BN from "bn.js/";
import { formatNearAmount } from "near-api-js/lib/utils/format";
import { formatNearAmount } from "near-api-js/lib/utils/format.js";
import { useEffect, useMemo, useRef, useState } from "react";
import { RPC_URL } from "../lib/constants";
import { Cost } from "../types";
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import "./style.css";

export * from "./components";
export * from "./types";
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BN from "bn.js";
import BN from "bn.js/lib/bn.js";
import { clsx, type ClassValue } from "clsx";
import { formatNearAmount } from "near-api-js/lib/utils/format";
import { formatNearAmount } from "near-api-js/lib/utils/format.js";
import { twMerge } from "tailwind-merge";
import { Cost } from "../types/types";

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/types/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
FinalExecutionOutcome,
Transaction,
} from "@near-wallet-selector/core";
import BN from "bn.js";
import BN from "bn.js/lib/bn.js";
import { Account } from "near-api-js";
import { SafeEncodedSignRequest } from "near-safe";
import { SuccessInfo } from "../hooks/useTransaction";
Expand Down
2 changes: 1 addition & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AssistantTool, FunctionTool } from "openai/resources/beta/assistants";
import { FunctionDefinition } from "openai/resources/index";
import { OpenAPIV3 } from "openapi-types";

import BN from "bn.js";
import BN from "bn.js/lib/bn.js";
import { Account } from "near-api-js/lib/account";
import { SignRequestData } from "near-safe";
import { Hex } from "viem";
Expand Down
7 changes: 4 additions & 3 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig } from 'tsup'

import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
clean: true,
external: ['react', 'react-dom'],
noExternal: ['bn.js'],
minify: true,
outDir: 'dist',
sourcemap: true,
Expand All @@ -23,4 +23,5 @@ export default defineConfig({
loader: {
'.css': 'copy',
},
});
onSuccess: 'npx tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify',
});