@t402/wdk 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/index.d.ts +198 -1
- package/dist/cjs/adapters/index.js +255 -0
- package/dist/cjs/adapters/index.js.map +1 -1
- package/dist/cjs/adapters/svm-adapter.d.ts +146 -2
- package/dist/cjs/adapters/svm-adapter.js +255 -2
- package/dist/cjs/adapters/svm-adapter.js.map +1 -1
- package/dist/cjs/adapters/ton-adapter.d.ts +57 -2
- package/dist/cjs/adapters/ton-adapter.js +75 -2
- package/dist/cjs/adapters/ton-adapter.js.map +1 -1
- package/dist/cjs/adapters/tron-adapter.d.ts +57 -2
- package/dist/cjs/adapters/tron-adapter.js +101 -0
- package/dist/cjs/adapters/tron-adapter.js.map +1 -1
- package/dist/cjs/index-DnEI5M6d.d.ts +1798 -0
- package/dist/cjs/index.d.ts +702 -1118
- package/dist/cjs/index.js +3905 -246
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/integrations/index.d.ts +9 -0
- package/dist/cjs/integrations/index.js +249 -0
- package/dist/cjs/integrations/index.js.map +1 -0
- package/dist/cjs/testing/index.d.ts +62 -0
- package/dist/cjs/testing/index.js +129 -0
- package/dist/cjs/testing/index.js.map +1 -0
- package/dist/cjs/types-BwK8Xgvg.d.ts +967 -0
- package/dist/esm/adapters/index.d.mts +198 -1
- package/dist/esm/adapters/index.mjs +14 -3
- package/dist/esm/adapters/svm-adapter.d.mts +146 -2
- package/dist/esm/adapters/svm-adapter.mjs +18 -3
- package/dist/esm/adapters/ton-adapter.d.mts +57 -2
- package/dist/esm/adapters/ton-adapter.mjs +8 -3
- package/dist/esm/adapters/tron-adapter.d.mts +57 -2
- package/dist/esm/adapters/tron-adapter.mjs +2 -1
- package/dist/esm/chunk-2KWVW77U.mjs +353 -0
- package/dist/esm/chunk-2KWVW77U.mjs.map +1 -0
- package/dist/esm/chunk-7CG77QAN.mjs +153 -0
- package/dist/esm/chunk-7CG77QAN.mjs.map +1 -0
- package/dist/esm/chunk-BJTO5JO5.mjs +11 -0
- package/dist/esm/chunk-BJTO5JO5.mjs.map +1 -0
- package/dist/esm/{chunk-YWBJJV5M.mjs → chunk-KWX6CJIH.mjs} +72 -1
- package/dist/esm/chunk-KWX6CJIH.mjs.map +1 -0
- package/dist/esm/{chunk-HB2DGKQ3.mjs → chunk-QZKUU2O6.mjs} +102 -1
- package/dist/esm/chunk-QZKUU2O6.mjs.map +1 -0
- package/dist/esm/chunk-TVSNUSFZ.mjs +219 -0
- package/dist/esm/chunk-TVSNUSFZ.mjs.map +1 -0
- package/dist/esm/index-D5kvtDfm.d.mts +1798 -0
- package/dist/esm/index.d.mts +702 -1118
- package/dist/esm/index.mjs +2934 -70
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/integrations/index.d.mts +9 -0
- package/dist/esm/integrations/index.mjs +16 -0
- package/dist/esm/integrations/index.mjs.map +1 -0
- package/dist/esm/testing/index.d.mts +62 -0
- package/dist/esm/testing/index.mjs +101 -0
- package/dist/esm/testing/index.mjs.map +1 -0
- package/dist/esm/types-BwK8Xgvg.d.mts +967 -0
- package/package.json +69 -20
- package/dist/cjs/types-V7c-qhn6.d.ts +0 -489
- package/dist/esm/chunk-HB2DGKQ3.mjs.map +0 -1
- package/dist/esm/chunk-MCFHZSF7.mjs +0 -107
- package/dist/esm/chunk-MCFHZSF7.mjs.map +0 -1
- package/dist/esm/chunk-YWBJJV5M.mjs.map +0 -1
- package/dist/esm/types-V7c-qhn6.d.mts +0 -489
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t402/wdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"main": "./dist/cjs/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -16,35 +16,39 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "T402 Team",
|
|
19
|
-
"repository":
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/t402-io/t402.git",
|
|
22
|
+
"directory": "sdks/typescript/packages/wdk"
|
|
23
|
+
},
|
|
20
24
|
"description": "T402 Payment Protocol integration with Tether Wallet Development Kit (WDK)",
|
|
21
25
|
"devDependencies": {
|
|
22
|
-
"@eslint/js": "^9.
|
|
23
|
-
"@ledgerhq/hw-app-eth": "^7.
|
|
24
|
-
"@ledgerhq/hw-transport-web-ble": "^6.
|
|
25
|
-
"@ledgerhq/hw-transport-webhid": "^6.
|
|
26
|
-
"@ledgerhq/hw-transport-webusb": "^6.
|
|
26
|
+
"@eslint/js": "^9.39.2",
|
|
27
|
+
"@ledgerhq/hw-app-eth": "^7.4.0",
|
|
28
|
+
"@ledgerhq/hw-transport-web-ble": "^6.31.0",
|
|
29
|
+
"@ledgerhq/hw-transport-webhid": "^6.31.0",
|
|
30
|
+
"@ledgerhq/hw-transport-webusb": "^6.30.0",
|
|
27
31
|
"@trezor/connect": "^9.7.1",
|
|
28
|
-
"@types/node": "^25.2.
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
30
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
+
"@types/node": "^25.2.3",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
31
35
|
"@vitest/coverage-v8": "^3.2.4",
|
|
32
36
|
"eslint": "^9.24.0",
|
|
33
37
|
"eslint-plugin-import": "^2.31.0",
|
|
34
|
-
"eslint-plugin-jsdoc": "^62.
|
|
35
|
-
"eslint-plugin-prettier": "^5.
|
|
36
|
-
"glob": "^13.0.
|
|
37
|
-
"prettier": "3.
|
|
38
|
-
"tsup": "^8.
|
|
38
|
+
"eslint-plugin-jsdoc": "^62.6.0",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
40
|
+
"glob": "^13.0.5",
|
|
41
|
+
"prettier": "3.8.1",
|
|
42
|
+
"tsup": "^8.5.1",
|
|
39
43
|
"tsx": "^4.21.0",
|
|
40
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.9.3",
|
|
41
45
|
"vite": "^7.3.1",
|
|
42
|
-
"vite-tsconfig-paths": "^
|
|
46
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
43
47
|
"vitest": "^3.2.4"
|
|
44
48
|
},
|
|
45
49
|
"dependencies": {
|
|
46
|
-
"@t402/core": "2.
|
|
47
|
-
"@t402/evm": "2.
|
|
50
|
+
"@t402/core": "2.6.0",
|
|
51
|
+
"@t402/evm": "2.6.0"
|
|
48
52
|
},
|
|
49
53
|
"peerDependencies": {
|
|
50
54
|
"viem": "^2.0.0",
|
|
@@ -52,12 +56,17 @@
|
|
|
52
56
|
"@ledgerhq/hw-transport-web-ble": ">=6.0.0",
|
|
53
57
|
"@ledgerhq/hw-transport-webhid": ">=6.0.0",
|
|
54
58
|
"@ledgerhq/hw-transport-webusb": ">=6.0.0",
|
|
55
|
-
"@tetherto/wdk": ">=1.0.0-beta.0",
|
|
59
|
+
"@tetherto/wdk": ">=1.0.0-beta.5 <2.0.0",
|
|
56
60
|
"@tetherto/wdk-wallet-evm": ">=1.0.0-beta.0",
|
|
57
61
|
"@tetherto/wdk-wallet-solana": ">=1.0.0-beta.0",
|
|
58
62
|
"@tetherto/wdk-wallet-ton": ">=1.0.0-beta.0",
|
|
59
63
|
"@tetherto/wdk-wallet-tron": ">=1.0.0-beta.0",
|
|
60
64
|
"@tetherto/wdk-protocol-bridge-usdt0-evm": ">=1.0.0-beta.0",
|
|
65
|
+
"@tetherto/wdk-protocol-swap-velora-evm": ">=1.0.0-beta.0",
|
|
66
|
+
"@tetherto/wdk-protocol-lending-aave-evm": ">=1.0.0-beta.0",
|
|
67
|
+
"@tetherto/wdk-pricing-provider": ">=1.0.0-beta.0",
|
|
68
|
+
"@tetherto/wdk-pricing-bitfinex-http": ">=1.0.0-beta.0",
|
|
69
|
+
"@tetherto/wdk-secret-manager": ">=1.0.0-beta.0",
|
|
61
70
|
"@trezor/connect": ">=9.0.0",
|
|
62
71
|
"@ton/core": ">=0.53.0",
|
|
63
72
|
"@solana/kit": ">=2.0.0"
|
|
@@ -81,6 +90,21 @@
|
|
|
81
90
|
"@tetherto/wdk-protocol-bridge-usdt0-evm": {
|
|
82
91
|
"optional": true
|
|
83
92
|
},
|
|
93
|
+
"@tetherto/wdk-protocol-swap-velora-evm": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"@tetherto/wdk-protocol-lending-aave-evm": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"@tetherto/wdk-pricing-provider": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"@tetherto/wdk-pricing-bitfinex-http": {
|
|
103
|
+
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"@tetherto/wdk-secret-manager": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
84
108
|
"@ledgerhq/hw-app-eth": {
|
|
85
109
|
"optional": true
|
|
86
110
|
},
|
|
@@ -153,11 +177,36 @@
|
|
|
153
177
|
"types": "./dist/cjs/adapters/tron-adapter.d.ts",
|
|
154
178
|
"default": "./dist/cjs/adapters/tron-adapter.js"
|
|
155
179
|
}
|
|
180
|
+
},
|
|
181
|
+
"./integrations": {
|
|
182
|
+
"import": {
|
|
183
|
+
"types": "./dist/esm/integrations/index.d.mts",
|
|
184
|
+
"default": "./dist/esm/integrations/index.mjs"
|
|
185
|
+
},
|
|
186
|
+
"require": {
|
|
187
|
+
"types": "./dist/cjs/integrations/index.d.ts",
|
|
188
|
+
"default": "./dist/cjs/integrations/index.js"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"./testing": {
|
|
192
|
+
"import": {
|
|
193
|
+
"types": "./dist/esm/testing/index.d.mts",
|
|
194
|
+
"default": "./dist/esm/testing/index.mjs"
|
|
195
|
+
},
|
|
196
|
+
"require": {
|
|
197
|
+
"types": "./dist/cjs/testing/index.d.ts",
|
|
198
|
+
"default": "./dist/cjs/testing/index.js"
|
|
199
|
+
}
|
|
156
200
|
}
|
|
157
201
|
},
|
|
202
|
+
"sideEffects": false,
|
|
158
203
|
"files": [
|
|
159
204
|
"dist"
|
|
160
205
|
],
|
|
206
|
+
"homepage": "https://t402.io",
|
|
207
|
+
"publishConfig": {
|
|
208
|
+
"access": "public"
|
|
209
|
+
},
|
|
161
210
|
"scripts": {
|
|
162
211
|
"start": "tsx --env-file=.env index.ts",
|
|
163
212
|
"build": "tsup",
|
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Type definitions for T402 WDK integration
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* EVM chain configuration
|
|
9
|
-
*/
|
|
10
|
-
interface EvmChainConfig {
|
|
11
|
-
/** RPC endpoint URL */
|
|
12
|
-
provider: string;
|
|
13
|
-
/** Chain ID */
|
|
14
|
-
chainId: number;
|
|
15
|
-
/** CAIP-2 network identifier */
|
|
16
|
-
network: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* T402 WDK configuration options
|
|
20
|
-
*/
|
|
21
|
-
interface T402WDKConfig {
|
|
22
|
-
/** Ethereum mainnet configuration */
|
|
23
|
-
ethereum?: EvmChainConfig | string;
|
|
24
|
-
/** Arbitrum One configuration */
|
|
25
|
-
arbitrum?: EvmChainConfig | string;
|
|
26
|
-
/** Base mainnet configuration */
|
|
27
|
-
base?: EvmChainConfig | string;
|
|
28
|
-
/** Ink mainnet configuration */
|
|
29
|
-
ink?: EvmChainConfig | string;
|
|
30
|
-
/** Berachain mainnet configuration */
|
|
31
|
-
berachain?: EvmChainConfig | string;
|
|
32
|
-
/** Unichain mainnet configuration */
|
|
33
|
-
unichain?: EvmChainConfig | string;
|
|
34
|
-
/** Polygon mainnet configuration */
|
|
35
|
-
polygon?: EvmChainConfig | string;
|
|
36
|
-
/** Custom chains */
|
|
37
|
-
[key: string]: EvmChainConfig | string | undefined;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Normalized chain configuration
|
|
41
|
-
*/
|
|
42
|
-
interface NormalizedChainConfig {
|
|
43
|
-
provider: string;
|
|
44
|
-
chainId: number;
|
|
45
|
-
network: string;
|
|
46
|
-
name: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Token balance information
|
|
50
|
-
*/
|
|
51
|
-
interface TokenBalance {
|
|
52
|
-
/** Token contract address */
|
|
53
|
-
token: Address;
|
|
54
|
-
/** Token symbol */
|
|
55
|
-
symbol: string;
|
|
56
|
-
/** Balance in smallest units */
|
|
57
|
-
balance: bigint;
|
|
58
|
-
/** Formatted balance (human-readable) */
|
|
59
|
-
formatted: string;
|
|
60
|
-
/** Decimals */
|
|
61
|
-
decimals: number;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Chain balance information
|
|
65
|
-
*/
|
|
66
|
-
interface ChainBalance {
|
|
67
|
-
/** Chain name (e.g., "arbitrum") */
|
|
68
|
-
chain: string;
|
|
69
|
-
/** CAIP-2 network identifier */
|
|
70
|
-
network: string;
|
|
71
|
-
/** Native token balance */
|
|
72
|
-
native: bigint;
|
|
73
|
-
/** Token balances */
|
|
74
|
-
tokens: TokenBalance[];
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Aggregated balance across all chains
|
|
78
|
-
*/
|
|
79
|
-
interface AggregatedBalance {
|
|
80
|
-
/** Total USDT0 balance across all chains */
|
|
81
|
-
totalUsdt0: bigint;
|
|
82
|
-
/** Total USDC balance across all chains */
|
|
83
|
-
totalUsdc: bigint;
|
|
84
|
-
/** Per-chain balances */
|
|
85
|
-
chains: ChainBalance[];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Bridge parameters for cross-chain transfers
|
|
89
|
-
*/
|
|
90
|
-
interface BridgeParams {
|
|
91
|
-
/** Source chain name */
|
|
92
|
-
fromChain: string;
|
|
93
|
-
/** Destination chain name */
|
|
94
|
-
toChain: string;
|
|
95
|
-
/** Amount to bridge in smallest units */
|
|
96
|
-
amount: bigint;
|
|
97
|
-
/** Recipient address (optional, defaults to same wallet on target chain) */
|
|
98
|
-
recipient?: Address;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Bridge result
|
|
102
|
-
*/
|
|
103
|
-
interface BridgeResult {
|
|
104
|
-
/** Transaction hash on source chain */
|
|
105
|
-
txHash: string;
|
|
106
|
-
/** Estimated time for bridge completion in seconds */
|
|
107
|
-
estimatedTime: number;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* EIP-712 typed data domain
|
|
111
|
-
*/
|
|
112
|
-
interface TypedDataDomain {
|
|
113
|
-
name: string;
|
|
114
|
-
version: string;
|
|
115
|
-
chainId: number;
|
|
116
|
-
verifyingContract: Address;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* EIP-712 typed data types
|
|
120
|
-
*/
|
|
121
|
-
type TypedDataTypes = Record<string, Array<{
|
|
122
|
-
name: string;
|
|
123
|
-
type: string;
|
|
124
|
-
}>>;
|
|
125
|
-
/**
|
|
126
|
-
* T402 Signer interface for WDK
|
|
127
|
-
* Compatible with @t402/core signer requirements
|
|
128
|
-
*/
|
|
129
|
-
interface T402WDKSigner {
|
|
130
|
-
/** Get wallet address */
|
|
131
|
-
readonly address: Address;
|
|
132
|
-
/** Sign EIP-712 typed data */
|
|
133
|
-
signTypedData(params: {
|
|
134
|
-
domain: TypedDataDomain;
|
|
135
|
-
types: TypedDataTypes;
|
|
136
|
-
primaryType: string;
|
|
137
|
-
message: Record<string, unknown>;
|
|
138
|
-
}): Promise<`0x${string}`>;
|
|
139
|
-
/** Sign a message */
|
|
140
|
-
signMessage?(message: string | Uint8Array): Promise<`0x${string}`>;
|
|
141
|
-
/** Get token balance */
|
|
142
|
-
getTokenBalance?(tokenAddress: Address): Promise<bigint>;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* WDK Account interface (matches @tetherto/wdk account structure)
|
|
146
|
-
*
|
|
147
|
-
* This is the canonical definition used across all @t402/wdk-* packages.
|
|
148
|
-
* Implementors (Tether WDK) provide these methods; T402 code consumes them.
|
|
149
|
-
*/
|
|
150
|
-
interface WDKAccount {
|
|
151
|
-
/** Get the account's address */
|
|
152
|
-
getAddress(): Promise<string>;
|
|
153
|
-
/** Get the account's native balance */
|
|
154
|
-
getBalance(): Promise<bigint>;
|
|
155
|
-
/** Get the account's token balance */
|
|
156
|
-
getTokenBalance(tokenAddress: string): Promise<bigint>;
|
|
157
|
-
/** Sign a message */
|
|
158
|
-
signMessage(message: string): Promise<string>;
|
|
159
|
-
/** Sign typed data (EIP-712) */
|
|
160
|
-
signTypedData(params: {
|
|
161
|
-
domain: Record<string, unknown>;
|
|
162
|
-
types: Record<string, unknown>;
|
|
163
|
-
primaryType: string;
|
|
164
|
-
message: Record<string, unknown>;
|
|
165
|
-
}): Promise<string>;
|
|
166
|
-
/** Send a transaction */
|
|
167
|
-
sendTransaction(params: {
|
|
168
|
-
to: string;
|
|
169
|
-
value?: bigint;
|
|
170
|
-
data?: string;
|
|
171
|
-
}): Promise<string>;
|
|
172
|
-
/** Estimate gas for a transaction (optional — not all implementations support this) */
|
|
173
|
-
estimateGas?(params: {
|
|
174
|
-
to: string;
|
|
175
|
-
value?: bigint;
|
|
176
|
-
data?: string;
|
|
177
|
-
}): Promise<bigint>;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Alias for WDKAccount — preferred naming for use in @t402/wdk-* packages.
|
|
181
|
-
*/
|
|
182
|
-
type WdkAccount = WDKAccount;
|
|
183
|
-
/**
|
|
184
|
-
* WDK instance interface (matches @tetherto/wdk structure)
|
|
185
|
-
*/
|
|
186
|
-
interface WDKInstance {
|
|
187
|
-
registerWallet<T>(name: string, manager: T, config: Record<string, unknown>): WDKInstance;
|
|
188
|
-
registerProtocol<T>(name: string, protocol: T): WDKInstance;
|
|
189
|
-
getAccount(chain: string, index: number): Promise<WDKAccount>;
|
|
190
|
-
executeProtocol(name: string, params: Record<string, unknown>): Promise<{
|
|
191
|
-
txHash: string;
|
|
192
|
-
}>;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* WDK constructor type
|
|
196
|
-
*/
|
|
197
|
-
interface WDKConstructor {
|
|
198
|
-
new (seedPhrase: string): WDKInstance;
|
|
199
|
-
getRandomSeedPhrase(): string;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Balance cache configuration for T402WDK
|
|
203
|
-
*/
|
|
204
|
-
interface T402BalanceCacheConfig {
|
|
205
|
-
/** Whether caching is enabled (default: true) */
|
|
206
|
-
enabled?: boolean;
|
|
207
|
-
/** TTL for native balance in milliseconds (default: 15000 = 15 seconds) */
|
|
208
|
-
nativeBalanceTTL?: number;
|
|
209
|
-
/** TTL for token balance in milliseconds (default: 30000 = 30 seconds) */
|
|
210
|
-
tokenBalanceTTL?: number;
|
|
211
|
-
/** TTL for aggregated balances in milliseconds (default: 60000 = 60 seconds) */
|
|
212
|
-
aggregatedBalanceTTL?: number;
|
|
213
|
-
/** Maximum cache entries (default: 500) */
|
|
214
|
-
maxSize?: number;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Extended T402 WDK configuration with cache options
|
|
218
|
-
*/
|
|
219
|
-
interface T402WDKOptions {
|
|
220
|
-
/** Balance cache configuration */
|
|
221
|
-
cache?: T402BalanceCacheConfig;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Supported blockchain families
|
|
225
|
-
*/
|
|
226
|
-
type ChainFamily = 'evm' | 'svm' | 'ton' | 'tron';
|
|
227
|
-
/**
|
|
228
|
-
* Solana chain configuration
|
|
229
|
-
*/
|
|
230
|
-
interface SvmChainConfig {
|
|
231
|
-
/** RPC endpoint URL */
|
|
232
|
-
rpcUrl: string;
|
|
233
|
-
/** Commitment level */
|
|
234
|
-
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
235
|
-
/** Network type */
|
|
236
|
-
network?: 'mainnet' | 'testnet' | 'devnet';
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* TON chain configuration
|
|
240
|
-
*/
|
|
241
|
-
interface TonChainConfig {
|
|
242
|
-
/** API endpoint URL */
|
|
243
|
-
endpoint: string;
|
|
244
|
-
/** Network type */
|
|
245
|
-
network?: 'mainnet' | 'testnet';
|
|
246
|
-
/** API key for TON Center */
|
|
247
|
-
apiKey?: string;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* TRON chain configuration
|
|
251
|
-
*/
|
|
252
|
-
interface TronChainConfig {
|
|
253
|
-
/** Full host URL (e.g., https://api.trongrid.io) */
|
|
254
|
-
fullHost: string;
|
|
255
|
-
/** Network type */
|
|
256
|
-
network?: 'mainnet' | 'shasta' | 'nile';
|
|
257
|
-
/** API key for TronGrid */
|
|
258
|
-
apiKey?: string;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Multi-chain configuration
|
|
262
|
-
*/
|
|
263
|
-
interface MultiChainConfig {
|
|
264
|
-
/** EVM chains configuration */
|
|
265
|
-
evm?: Record<string, EvmChainConfig | string>;
|
|
266
|
-
/** Solana configuration */
|
|
267
|
-
svm?: SvmChainConfig;
|
|
268
|
-
/** TON configuration */
|
|
269
|
-
ton?: TonChainConfig;
|
|
270
|
-
/** TRON configuration */
|
|
271
|
-
tron?: TronChainConfig;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* WDK wallet modules registry
|
|
275
|
-
* All modules are optional - only register what you need
|
|
276
|
-
*/
|
|
277
|
-
interface WDKWalletModules {
|
|
278
|
-
/** EVM wallet manager (@tetherto/wdk-wallet-evm) */
|
|
279
|
-
evm?: unknown;
|
|
280
|
-
/** EVM ERC-4337 wallet manager (@tetherto/wdk-wallet-evm-erc4337) */
|
|
281
|
-
evmErc4337?: unknown;
|
|
282
|
-
/** Solana wallet manager (@tetherto/wdk-wallet-solana) */
|
|
283
|
-
solana?: unknown;
|
|
284
|
-
/** TON wallet manager (@tetherto/wdk-wallet-ton) */
|
|
285
|
-
ton?: unknown;
|
|
286
|
-
/** TON gasless wallet manager (@tetherto/wdk-wallet-ton-gasless) */
|
|
287
|
-
tonGasless?: unknown;
|
|
288
|
-
/** TRON wallet manager (@tetherto/wdk-wallet-tron) */
|
|
289
|
-
tron?: unknown;
|
|
290
|
-
/** Bitcoin wallet manager (@tetherto/wdk-wallet-btc) */
|
|
291
|
-
btc?: unknown;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* WDK protocol modules registry
|
|
295
|
-
* All modules are optional - only register what you need
|
|
296
|
-
*/
|
|
297
|
-
interface WDKProtocolModules {
|
|
298
|
-
/** USDT0 bridge for EVM (@tetherto/wdk-protocol-bridge-usdt0-evm) */
|
|
299
|
-
bridgeUsdt0Evm?: unknown;
|
|
300
|
-
/** USDT0 bridge for TON (@tetherto/wdk-protocol-bridge-usdt0-ton) */
|
|
301
|
-
bridgeUsdt0Ton?: unknown;
|
|
302
|
-
/** Velora swap for EVM (@tetherto/wdk-protocol-swap-velora-evm) */
|
|
303
|
-
swapVeloraEvm?: unknown;
|
|
304
|
-
/** Aave lending for EVM (@tetherto/wdk-protocol-lending-aave-evm) */
|
|
305
|
-
lendingAaveEvm?: unknown;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Unified WDK modules registration
|
|
309
|
-
*/
|
|
310
|
-
interface WDKModulesConfig {
|
|
311
|
-
/** Wallet modules */
|
|
312
|
-
wallets?: WDKWalletModules;
|
|
313
|
-
/** Protocol modules */
|
|
314
|
-
protocols?: WDKProtocolModules;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* WDK TON account interface (compatible with @tetherto/wdk-wallet-ton)
|
|
318
|
-
*/
|
|
319
|
-
interface WDKTonAccount {
|
|
320
|
-
/** Get wallet address */
|
|
321
|
-
getAddress(): Promise<string>;
|
|
322
|
-
/** Get TON balance */
|
|
323
|
-
getBalance(): Promise<bigint>;
|
|
324
|
-
/** Get Jetton balance */
|
|
325
|
-
getJettonBalance(jettonMaster: string): Promise<bigint>;
|
|
326
|
-
/** Sign a message */
|
|
327
|
-
signMessage(message: Uint8Array): Promise<Uint8Array>;
|
|
328
|
-
/** Send TON transaction */
|
|
329
|
-
sendTransaction(params: {
|
|
330
|
-
to: string;
|
|
331
|
-
value: bigint;
|
|
332
|
-
body?: string;
|
|
333
|
-
bounce?: boolean;
|
|
334
|
-
}): Promise<string>;
|
|
335
|
-
/** Get current sequence number */
|
|
336
|
-
getSeqno(): Promise<number>;
|
|
337
|
-
/** Transfer Jettons */
|
|
338
|
-
transferJetton?(params: {
|
|
339
|
-
jettonMaster: string;
|
|
340
|
-
to: string;
|
|
341
|
-
amount: bigint;
|
|
342
|
-
forwardPayload?: string;
|
|
343
|
-
}): Promise<string>;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* WDK Solana account interface (compatible with @tetherto/wdk-wallet-solana)
|
|
347
|
-
*/
|
|
348
|
-
interface WDKSolanaAccount {
|
|
349
|
-
/** Get wallet address (base58) */
|
|
350
|
-
getAddress(): Promise<string>;
|
|
351
|
-
/** Get SOL balance */
|
|
352
|
-
getBalance(): Promise<bigint>;
|
|
353
|
-
/** Get SPL token balance */
|
|
354
|
-
getTokenBalance(mint: string): Promise<bigint>;
|
|
355
|
-
/** Sign a message */
|
|
356
|
-
sign(message: Uint8Array): Promise<Uint8Array>;
|
|
357
|
-
/** Sign a transaction */
|
|
358
|
-
signTransaction(transaction: Uint8Array): Promise<Uint8Array>;
|
|
359
|
-
/** Send SOL */
|
|
360
|
-
sendTransaction(params: {
|
|
361
|
-
recipient: string;
|
|
362
|
-
value: bigint;
|
|
363
|
-
}): Promise<string>;
|
|
364
|
-
/** Transfer SPL token */
|
|
365
|
-
transfer(params: {
|
|
366
|
-
token: string;
|
|
367
|
-
recipient: string;
|
|
368
|
-
amount: bigint;
|
|
369
|
-
}): Promise<string>;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* WDK TRON account interface (compatible with @tetherto/wdk-wallet-tron)
|
|
373
|
-
*/
|
|
374
|
-
interface WDKTronAccount {
|
|
375
|
-
/** Get wallet address (base58) */
|
|
376
|
-
getAddress(): Promise<string>;
|
|
377
|
-
/** Get TRX balance */
|
|
378
|
-
getBalance(): Promise<bigint>;
|
|
379
|
-
/** Get TRC20 token balance */
|
|
380
|
-
getTrc20Balance(contractAddress: string): Promise<bigint>;
|
|
381
|
-
/** Sign a transaction */
|
|
382
|
-
signTransaction(transaction: unknown): Promise<unknown>;
|
|
383
|
-
/** Send signed transaction */
|
|
384
|
-
sendTransaction(signedTx: unknown): Promise<string>;
|
|
385
|
-
/** Transfer TRC20 token */
|
|
386
|
-
transferTrc20?(params: {
|
|
387
|
-
contractAddress: string;
|
|
388
|
-
to: string;
|
|
389
|
-
amount: bigint;
|
|
390
|
-
}): Promise<string>;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Extended WDK instance interface with multi-chain support
|
|
394
|
-
*/
|
|
395
|
-
interface WDKInstanceMultiChain extends WDKInstance {
|
|
396
|
-
/** Get TON account */
|
|
397
|
-
getTonAccount?(index: number): Promise<WDKTonAccount>;
|
|
398
|
-
/** Get Solana account */
|
|
399
|
-
getSolanaAccount?(index: number): Promise<WDKSolanaAccount>;
|
|
400
|
-
/** Get TRON account */
|
|
401
|
-
getTronAccount?(index: number): Promise<WDKTronAccount>;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Configuration for T402WDK.create() factory method
|
|
405
|
-
*/
|
|
406
|
-
interface T402WDKCreateConfig {
|
|
407
|
-
/** BIP-39 mnemonic seed phrase */
|
|
408
|
-
seedPhrase: string;
|
|
409
|
-
/** Chain name → RPC URL mapping for EVM chains */
|
|
410
|
-
chains: Record<string, string>;
|
|
411
|
-
/** WDK modules to register */
|
|
412
|
-
modules: WDKModulesConfig;
|
|
413
|
-
/** Additional options */
|
|
414
|
-
options?: T402WDKOptions;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* A signer entry for use with T402 HTTP clients
|
|
418
|
-
*/
|
|
419
|
-
interface SignerEntry {
|
|
420
|
-
/** Payment scheme (e.g., "exact") */
|
|
421
|
-
scheme: string;
|
|
422
|
-
/** CAIP-2 network identifier (e.g., "eip155:42161") */
|
|
423
|
-
network: string;
|
|
424
|
-
/** The signer instance */
|
|
425
|
-
signer: unknown;
|
|
426
|
-
/** Chain family (evm, ton, svm, tron) */
|
|
427
|
-
family: ChainFamily;
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Options for getAllSigners()
|
|
431
|
-
*/
|
|
432
|
-
interface GetAllSignersOptions {
|
|
433
|
-
/** HD wallet account index (default: 0) */
|
|
434
|
-
accountIndex?: number;
|
|
435
|
-
/** Filter by payment schemes (default: ["exact"]) */
|
|
436
|
-
schemes?: string[];
|
|
437
|
-
/** Include non-EVM chain signers (default: true) */
|
|
438
|
-
includeNonEvm?: boolean;
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Options for T402WDK.fromWDK()
|
|
442
|
-
*/
|
|
443
|
-
interface FromWDKOptions {
|
|
444
|
-
/** HD wallet account index for auto-discovery (default: 0) */
|
|
445
|
-
defaultAccountIndex?: number;
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Swap quote result
|
|
449
|
-
*/
|
|
450
|
-
interface SwapQuote {
|
|
451
|
-
/** Input token address */
|
|
452
|
-
inputToken: string;
|
|
453
|
-
/** Output token address */
|
|
454
|
-
outputToken: string;
|
|
455
|
-
/** Input amount in smallest units */
|
|
456
|
-
inputAmount: bigint;
|
|
457
|
-
/** Expected output amount in smallest units */
|
|
458
|
-
outputAmount: bigint;
|
|
459
|
-
/** Price impact percentage */
|
|
460
|
-
priceImpact: number;
|
|
461
|
-
/** Swap route (token addresses) */
|
|
462
|
-
route: string[];
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Swap execution result
|
|
466
|
-
*/
|
|
467
|
-
interface SwapResult {
|
|
468
|
-
/** Transaction hash */
|
|
469
|
-
txHash: string;
|
|
470
|
-
/** Actual input amount */
|
|
471
|
-
inputAmount: bigint;
|
|
472
|
-
/** Actual output amount */
|
|
473
|
-
outputAmount: bigint;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Parameters for swap operations
|
|
477
|
-
*/
|
|
478
|
-
interface SwapParams {
|
|
479
|
-
/** Chain name (e.g., "ethereum", "arbitrum") */
|
|
480
|
-
chain: string;
|
|
481
|
-
/** Input token address */
|
|
482
|
-
fromToken: string;
|
|
483
|
-
/** Amount to swap in smallest units */
|
|
484
|
-
amount: bigint;
|
|
485
|
-
/** Maximum slippage tolerance (0-1, default: 0.005 = 0.5%) */
|
|
486
|
-
maxSlippage?: number;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export type { AggregatedBalance as A, BridgeParams as B, ChainFamily as C, EvmChainConfig as E, FromWDKOptions as F, GetAllSignersOptions as G, MultiChainConfig as M, NormalizedChainConfig as N, SignerEntry as S, T402WDKCreateConfig as T, WDKSolanaAccount as W, WDKTonAccount as a, WDKTronAccount as b, WDKInstance as c, WDKConstructor as d, WDKModulesConfig as e, WDKWalletModules as f, WDKProtocolModules as g, T402WDKConfig as h, T402WDKOptions as i, ChainBalance as j, BridgeResult as k, SwapQuote as l, SwapParams as m, SwapResult as n, T402BalanceCacheConfig as o, TokenBalance as p, TypedDataDomain as q, TypedDataTypes as r, T402WDKSigner as s, WDKAccount as t, WdkAccount as u, SvmChainConfig as v, TonChainConfig as w, TronChainConfig as x, WDKInstanceMultiChain as y };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/adapters/tron-adapter.ts"],"sourcesContent":["/**\n * TRON Signer Adapter for WDK\n *\n * Wraps a Tether WDK TRON account to implement T402's ClientTronSigner interface.\n * This allows WDK-managed TRON wallets to be used for T402 payments.\n */\n\nimport type { WDKTronAccount } from '../types.js'\n\n/**\n * SignTransactionParams matching T402's @t402/tron interface\n */\nexport interface SignTransactionParams {\n /** TRC20 contract address */\n contractAddress: string\n /** Recipient address (T-prefix base58check) */\n to: string\n /** Amount to transfer (in smallest units) */\n amount: string\n /** Fee limit in SUN (optional, defaults to 100 TRX) */\n feeLimit?: number\n /** Transaction expiration time in milliseconds (optional) */\n expiration?: number\n}\n\n/**\n * Block info for transaction building\n */\nexport interface BlockInfo {\n /** Reference block bytes (hex) */\n refBlockBytes: string\n /** Reference block hash (hex) */\n refBlockHash: string\n /** Expiration timestamp in milliseconds */\n expiration: number\n}\n\n/**\n * ClientTronSigner interface matching T402's @t402/tron\n */\nexport interface ClientTronSigner {\n readonly address: string\n signTransaction(params: SignTransactionParams): Promise<string>\n getBlockInfo(): Promise<BlockInfo>\n}\n\n// TronWeb-compatible types\ninterface TronWebTransaction {\n txID: string\n raw_data: {\n contract: unknown[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n }\n raw_data_hex: string\n signature?: string[]\n}\n\ninterface TronWebBlock {\n block_header: {\n raw_data: {\n number: number\n txTrieRoot: string\n witness_address: string\n parentHash: string\n version: number\n timestamp: number\n }\n witness_signature: string\n }\n blockID: string\n}\n\n/**\n * WDKTronSignerAdapter - Adapts a WDK TRON account to T402's ClientTronSigner\n *\n * @example\n * ```typescript\n * const adapter = await createWDKTronSigner(wdkTronAccount);\n * const signedTx = await adapter.signTransaction({\n * contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',\n * to: 'TRecipientAddress...',\n * amount: '1000000', // 1 USDT\n * });\n * ```\n */\nexport class WDKTronSignerAdapter implements ClientTronSigner {\n private _account: WDKTronAccount\n private _address: string | null = null\n private _initialized = false\n private _rpcUrl: string\n\n constructor(account: WDKTronAccount, rpcUrl = 'https://api.trongrid.io') {\n if (!account) {\n throw new Error('WDK TRON account is required')\n }\n this._account = account\n this._rpcUrl = rpcUrl\n }\n\n /**\n * Get the wallet address (T-prefix base58check)\n * @throws Error if not initialized\n */\n get address(): string {\n if (!this._address) {\n throw new Error(\n 'TRON signer not initialized. Call initialize() first or use createWDKTronSigner().',\n )\n }\n return this._address\n }\n\n /**\n * Check if the adapter is initialized\n */\n get isInitialized(): boolean {\n return this._initialized\n }\n\n /**\n * Initialize the adapter by fetching the address\n * Must be called before using the signer\n */\n async initialize(): Promise<void> {\n if (this._initialized) {\n return\n }\n\n this._address = await this._account.getAddress()\n this._initialized = true\n }\n\n /**\n * Sign a TRC20 transfer transaction\n *\n * This method:\n * 1. Builds a TRC20 transfer transaction\n * 2. Signs it using the WDK account\n * 3. Returns the hex-encoded signed transaction\n *\n * @param params - Transaction parameters\n * @returns Hex-encoded signed transaction\n */\n async signTransaction(params: SignTransactionParams): Promise<string> {\n if (!params.contractAddress) {\n throw new Error('contractAddress is required')\n }\n if (!params.to) {\n throw new Error('recipient address (to) is required')\n }\n if (!params.amount || BigInt(params.amount) <= 0n) {\n throw new Error('amount must be a positive value')\n }\n\n // Get block info for transaction\n const blockInfo = await this.getBlockInfo()\n\n // Default fee limit: 100 TRX = 100_000_000 SUN\n const feeLimit = params.feeLimit ?? 100_000_000\n\n // Build the TRC20 transfer transaction\n const transaction = await this.buildTrc20Transaction({\n contractAddress: params.contractAddress,\n to: params.to,\n amount: params.amount,\n feeLimit,\n refBlockBytes: blockInfo.refBlockBytes,\n refBlockHash: blockInfo.refBlockHash,\n expiration: params.expiration ?? blockInfo.expiration,\n })\n\n // Sign the transaction using WDK account\n const signedTx = await this._account.signTransaction(transaction)\n\n // Serialize to hex format\n return this.serializeTransaction(signedTx as TronWebTransaction)\n }\n\n /**\n * Get the current reference block info for transaction building\n * This is required for TRON's replay protection mechanism\n */\n async getBlockInfo(): Promise<BlockInfo> {\n try {\n const response = await fetch(`${this._rpcUrl}/wallet/getnowblock`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({}),\n })\n\n if (!response.ok) {\n throw new Error(`Failed to get block info: ${response.status}`)\n }\n\n const block = (await response.json()) as TronWebBlock\n\n // Extract reference block bytes (last 4 bytes of block number)\n const blockNum = block.block_header.raw_data.number\n const refBlockBytes = blockNum.toString(16).padStart(8, '0').slice(-4)\n\n // Reference block hash (first 8 bytes of block ID)\n const refBlockHash = block.blockID.slice(16, 32)\n\n // Expiration: block timestamp + 60 seconds\n const expiration = block.block_header.raw_data.timestamp + 60000\n\n return {\n refBlockBytes,\n refBlockHash,\n expiration,\n }\n } catch (error) {\n throw new Error(\n `Failed to get TRON block info: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n\n /**\n * Build a TRC20 transfer transaction\n */\n private async buildTrc20Transaction(params: {\n contractAddress: string\n to: string\n amount: string\n feeLimit: number\n refBlockBytes: string\n refBlockHash: string\n expiration: number\n }): Promise<TronWebTransaction> {\n // Build TRC20 transfer function call\n // transfer(address,uint256) = 0xa9059cbb\n const functionSelector = 'transfer(address,uint256)'\n\n // Encode parameters\n const toAddressHex = this.addressToHex(params.to).slice(2).padStart(64, '0')\n const amountHex = BigInt(params.amount).toString(16).padStart(64, '0')\n const parameter = toAddressHex + amountHex\n\n try {\n const response = await fetch(`${this._rpcUrl}/wallet/triggersmartcontract`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n owner_address: this.addressToHex(this._address!),\n contract_address: this.addressToHex(params.contractAddress),\n function_selector: functionSelector,\n parameter,\n fee_limit: params.feeLimit,\n }),\n })\n\n if (!response.ok) {\n throw new Error(`Failed to build transaction: ${response.status}`)\n }\n\n const result = await response.json()\n\n if (result.result?.code) {\n throw new Error(`Transaction build failed: ${result.result.message}`)\n }\n\n return result.transaction as TronWebTransaction\n } catch (error) {\n throw new Error(\n `Failed to build TRC20 transaction: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n\n /**\n * Serialize a signed transaction to hex format\n */\n private serializeTransaction(signedTx: TronWebTransaction): string {\n // Return the raw_data_hex with signature appended\n if (signedTx.signature && signedTx.signature.length > 0) {\n return JSON.stringify(signedTx)\n }\n return signedTx.raw_data_hex\n }\n\n /**\n * Convert TRON base58 address to hex format\n */\n private addressToHex(address: string): string {\n // If already hex, return as-is\n if (address.startsWith('41') || address.startsWith('0x')) {\n return address.startsWith('0x') ? '41' + address.slice(2) : address\n }\n\n // Convert base58 to hex using simple algorithm\n const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n let num = BigInt(0)\n for (const char of address) {\n num = num * BigInt(58) + BigInt(ALPHABET.indexOf(char))\n }\n\n // Convert to hex and take first 42 chars (21 bytes)\n let hex = num.toString(16)\n // Handle leading zeros\n let leadingZeros = 0\n for (const char of address) {\n if (char === '1') leadingZeros++\n else break\n }\n hex = '00'.repeat(leadingZeros) + hex\n\n // TRON address is 21 bytes = 42 hex chars\n return hex.slice(0, 42)\n }\n\n /**\n * Get TRX balance in SUN\n */\n async getBalance(): Promise<bigint> {\n return this._account.getBalance()\n }\n\n /**\n * Get TRC20 token balance\n * @param contractAddress - TRC20 contract address\n */\n async getTrc20Balance(contractAddress: string): Promise<bigint> {\n return this._account.getTrc20Balance(contractAddress)\n }\n}\n\n/**\n * Create an initialized WDK TRON signer\n *\n * @param account - WDK TRON account from @tetherto/wdk-wallet-tron\n * @param rpcUrl - Optional custom RPC URL (default: https://api.trongrid.io)\n * @returns Initialized ClientTronSigner\n *\n * @example\n * ```typescript\n * import { T402WDK } from '@t402/wdk';\n *\n * const wallet = new T402WDK(seedPhrase, config);\n * const tronSigner = await wallet.getTronSigner();\n *\n * // Use with T402 client\n * const client = createT402HTTPClient({\n * signers: [{ scheme: 'exact', network: 'tron:mainnet', signer: tronSigner }]\n * });\n * ```\n */\nexport async function createWDKTronSigner(\n account: WDKTronAccount,\n rpcUrl?: string,\n): Promise<WDKTronSignerAdapter> {\n const adapter = new WDKTronSignerAdapter(account, rpcUrl)\n await adapter.initialize()\n return adapter\n}\n"],"mappings":";AAwFO,IAAM,uBAAN,MAAuD;AAAA,EACpD;AAAA,EACA,WAA0B;AAAA,EAC1B,eAAe;AAAA,EACf;AAAA,EAER,YAAY,SAAyB,SAAS,2BAA2B;AACvE,QAAI,CAAC,SAAS;AACZ,YAAM,IAAI,MAAM,8BAA8B;AAAA,IAChD;AACA,SAAK,WAAW;AAChB,SAAK,UAAU;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,UAAkB;AACpB,QAAI,CAAC,KAAK,UAAU;AAClB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,gBAAyB;AAC3B,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,aAA4B;AAChC,QAAI,KAAK,cAAc;AACrB;AAAA,IACF;AAEA,SAAK,WAAW,MAAM,KAAK,SAAS,WAAW;AAC/C,SAAK,eAAe;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,gBAAgB,QAAgD;AACpE,QAAI,CAAC,OAAO,iBAAiB;AAC3B,YAAM,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AACA,QAAI,CAAC,OAAO,IAAI;AACd,YAAM,IAAI,MAAM,oCAAoC;AAAA,IACtD;AACA,QAAI,CAAC,OAAO,UAAU,OAAO,OAAO,MAAM,KAAK,IAAI;AACjD,YAAM,IAAI,MAAM,iCAAiC;AAAA,IACnD;AAGA,UAAM,YAAY,MAAM,KAAK,aAAa;AAG1C,UAAM,WAAW,OAAO,YAAY;AAGpC,UAAM,cAAc,MAAM,KAAK,sBAAsB;AAAA,M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