Skip to content

Commit ecebe8a

Browse files
authored
Remove Bitte Types Dependency (#66)
This dependency came with a lot of extra bloat (300 Mb because of wallet connect and reown). We were essentially building with all of this: ``` "dependencies": { "@mysten/sui": "^1.26.0", "@near-wallet-selector/core": "^8.9.0", "@solana/wallet-adapter-react": "^0.15.39", "@solana/web3.js": "^1.98.4", "@suiet/wallet-kit": "^0.3.4", "ai": "^4.1.51", "bn.js": "^5.2.1", "near-api-js": "^6", "openapi-types": "^12.0.0", "react": "^18.0.0", "viem": "^2.36.0", "wagmi": "^2.16.8" }, ```
1 parent 959e68b commit ecebe8a

File tree

8 files changed

+110
-1657
lines changed

8 files changed

+110
-1657
lines changed

bun.lock

Lines changed: 72 additions & 1649 deletions
Large diffs are not rendered by default.

packages/agent-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"build:cjs": "tsc -p tsconfig.cjs.json"
5050
},
5151
"dependencies": {
52-
"@bitte-ai/types": "^0.8.1",
5352
"near-api-js": "^6.3.0",
5453
"viem": "^2.37.5",
5554
"zerion-sdk": "^0.1.6"

packages/agent-sdk/src/evm/erc20.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { erc20Abi, PublicClient } from "viem";
22
import { encodeFunctionData, type Address } from "viem";
3-
import type { MetaTransaction } from "@bitte-ai/types";
4-
import type { TokenInfo } from "./types";
3+
import type { TokenInfo, MetaTransaction } from "./types";
54
import { getClientForChain } from "./client";
65

76
const NATIVE_ASSET = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";

packages/agent-sdk/src/evm/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getAddress, isHex, toHex, toBytes, zeroAddress } from "viem";
2-
import { SignRequest, MetaTransaction } from "@bitte-ai/types";
2+
import type { SignRequest, MetaTransaction } from "./types";
33
import type { Address, Hex } from "viem";
44

55
export * from "./types";
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
1-
import { type Address } from "viem";
1+
import type { Address, Hex } from "viem";
22

33
export interface TokenInfo {
44
address: Address;
55
decimals: number;
66
symbol: string;
77
name: string;
88
}
9+
10+
export interface MetaTransaction {
11+
to: Address;
12+
data: Hex;
13+
value: Hex;
14+
from?: Address;
15+
}
16+
export interface EthSendTransactionRequest {
17+
method: "eth_sendTransaction";
18+
chainId: number;
19+
params: MetaTransaction[];
20+
}
21+
export interface PersonalSignRequest {
22+
method: "personal_sign";
23+
chainId: number;
24+
params: [Hex, Address];
25+
}
26+
export interface EthSignRequest {
27+
method: "eth_sign";
28+
chainId: number;
29+
params: [Address, Hex];
30+
}
31+
export interface EthSignTypedDataRequest {
32+
method: "eth_signTypedData" | "eth_signTypedData_v4";
33+
chainId: number;
34+
params: [Address, string];
35+
}
36+
export type SignRequest =
37+
| EthSendTransactionRequest
38+
| PersonalSignRequest
39+
| EthSignRequest
40+
| EthSignTypedDataRequest;

packages/agent-sdk/src/evm/weth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MetaTransaction } from "@bitte-ai/types";
1+
import type { MetaTransaction } from "./types";
22
import {
33
type Address,
44
encodeFunctionData,

packages/agent-sdk/src/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MetaTransaction } from "@bitte-ai/types";
1+
import { MetaTransaction } from "./evm/types";
22

33
export const NULL_TRANSACTION: MetaTransaction = {
44
to: "0x0000000000000000000000000000000000000000",

packages/agent-sdk/src/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SignRequest } from "@bitte-ai/types";
1+
import { SignRequest } from "./evm/types";
22
import { errorString } from "./error";
33

44
export interface TxData {

0 commit comments

Comments
 (0)