agentwallet-sdk 3.1.2 → 3.2.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/identity/agent-identity.d.ts +276 -0
- package/dist/identity/agent-identity.d.ts.map +1 -0
- package/dist/identity/agent-identity.js +300 -0
- package/dist/identity/agent-identity.js.map +1 -0
- package/dist/identity/erc6551.d.ts +441 -0
- package/dist/identity/erc6551.d.ts.map +1 -0
- package/dist/identity/erc6551.js +517 -0
- package/dist/identity/erc6551.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 AgentNexus / agentwallet-sdk contributors
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* ERC-6551: Token Bound Accounts (TBA)
|
|
26
|
+
*
|
|
27
|
+
* Implements the ERC-6551 registry interaction layer, enabling any ERC-721 NFT
|
|
28
|
+
* to own a smart contract wallet. Each agent NFT (ERC-8004) gets a unique,
|
|
29
|
+
* deterministic TBA address derived from its contract + tokenId + chainId.
|
|
30
|
+
*
|
|
31
|
+
* Architecture:
|
|
32
|
+
* ERC-8004 NFT → ERC-6551 TBA → AgentWallet (x402 + payments) → TaskBridge earnings
|
|
33
|
+
*
|
|
34
|
+
* Canonical registry: 0x000000006551c19487814612785009DA0394A50 (all EVM chains)
|
|
35
|
+
* Spec: https://eips.ethereum.org/EIPS/eip-6551
|
|
36
|
+
*
|
|
37
|
+
* @module identity/erc6551
|
|
38
|
+
*/
|
|
39
|
+
import { type Address, type Hash, type Hex, type WalletClient, type Chain } from 'viem';
|
|
40
|
+
/**
|
|
41
|
+
* Canonical ERC-6551 Registry address — same on all EVM chains.
|
|
42
|
+
* Deployed via CREATE2 with deterministic address per EIP-6551.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ERC6551_REGISTRY_ADDRESS: Address;
|
|
45
|
+
/**
|
|
46
|
+
* Default ERC-6551 account implementation deployed by the reference implementation team.
|
|
47
|
+
* This is the Tokenbound reference implementation on Base mainnet.
|
|
48
|
+
* Audited by OpenZeppelin. Source: https://github.com/tokenbound/reference
|
|
49
|
+
*/
|
|
50
|
+
export declare const ERC6551_DEFAULT_IMPLEMENTATION: Address;
|
|
51
|
+
/**
|
|
52
|
+
* Base mainnet chain ID.
|
|
53
|
+
*/
|
|
54
|
+
export declare const BASE_CHAIN_ID = 8453;
|
|
55
|
+
/**
|
|
56
|
+
* Default salt for TBA derivation (matches Tokenbound reference tooling default).
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_SALT: Hex;
|
|
59
|
+
/**
|
|
60
|
+
* Canonical ERC-6551 Registry ABI from EIP-6551 specification.
|
|
61
|
+
* Source: https://eips.ethereum.org/EIPS/eip-6551
|
|
62
|
+
*/
|
|
63
|
+
export declare const ERC6551RegistryAbi: readonly [{
|
|
64
|
+
readonly name: "createAccount";
|
|
65
|
+
readonly type: "function";
|
|
66
|
+
readonly stateMutability: "nonpayable";
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly name: "implementation";
|
|
69
|
+
readonly type: "address";
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "salt";
|
|
72
|
+
readonly type: "bytes32";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "chainId";
|
|
75
|
+
readonly type: "uint256";
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "tokenContract";
|
|
78
|
+
readonly type: "address";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "tokenId";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}];
|
|
83
|
+
readonly outputs: readonly [{
|
|
84
|
+
readonly name: "account";
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
}];
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "account";
|
|
89
|
+
readonly type: "function";
|
|
90
|
+
readonly stateMutability: "view";
|
|
91
|
+
readonly inputs: readonly [{
|
|
92
|
+
readonly name: "implementation";
|
|
93
|
+
readonly type: "address";
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "salt";
|
|
96
|
+
readonly type: "bytes32";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "chainId";
|
|
99
|
+
readonly type: "uint256";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "tokenContract";
|
|
102
|
+
readonly type: "address";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "tokenId";
|
|
105
|
+
readonly type: "uint256";
|
|
106
|
+
}];
|
|
107
|
+
readonly outputs: readonly [{
|
|
108
|
+
readonly name: "account";
|
|
109
|
+
readonly type: "address";
|
|
110
|
+
}];
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "AccountCreated";
|
|
113
|
+
readonly type: "event";
|
|
114
|
+
readonly inputs: readonly [{
|
|
115
|
+
readonly name: "account";
|
|
116
|
+
readonly type: "address";
|
|
117
|
+
readonly indexed: false;
|
|
118
|
+
}, {
|
|
119
|
+
readonly name: "implementation";
|
|
120
|
+
readonly type: "address";
|
|
121
|
+
readonly indexed: true;
|
|
122
|
+
}, {
|
|
123
|
+
readonly name: "salt";
|
|
124
|
+
readonly type: "bytes32";
|
|
125
|
+
readonly indexed: false;
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "chainId";
|
|
128
|
+
readonly type: "uint256";
|
|
129
|
+
readonly indexed: false;
|
|
130
|
+
}, {
|
|
131
|
+
readonly name: "tokenContract";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
readonly indexed: true;
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "tokenId";
|
|
136
|
+
readonly type: "uint256";
|
|
137
|
+
readonly indexed: true;
|
|
138
|
+
}];
|
|
139
|
+
}];
|
|
140
|
+
/**
|
|
141
|
+
* Minimal ABI for the ERC-6551 Account (TBA) — the wallet owned by the NFT.
|
|
142
|
+
* Implements IERC6551Account + IERC6551Executable per the reference implementation.
|
|
143
|
+
*/
|
|
144
|
+
export declare const ERC6551AccountAbi: readonly [{
|
|
145
|
+
readonly name: "execute";
|
|
146
|
+
readonly type: "function";
|
|
147
|
+
readonly stateMutability: "payable";
|
|
148
|
+
readonly inputs: readonly [{
|
|
149
|
+
readonly name: "to";
|
|
150
|
+
readonly type: "address";
|
|
151
|
+
}, {
|
|
152
|
+
readonly name: "value";
|
|
153
|
+
readonly type: "uint256";
|
|
154
|
+
}, {
|
|
155
|
+
readonly name: "data";
|
|
156
|
+
readonly type: "bytes";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "operation";
|
|
159
|
+
readonly type: "uint8";
|
|
160
|
+
}];
|
|
161
|
+
readonly outputs: readonly [{
|
|
162
|
+
readonly name: "result";
|
|
163
|
+
readonly type: "bytes";
|
|
164
|
+
}];
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "token";
|
|
167
|
+
readonly type: "function";
|
|
168
|
+
readonly stateMutability: "view";
|
|
169
|
+
readonly inputs: readonly [];
|
|
170
|
+
readonly outputs: readonly [{
|
|
171
|
+
readonly name: "chainId";
|
|
172
|
+
readonly type: "uint256";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "tokenContract";
|
|
175
|
+
readonly type: "address";
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "tokenId";
|
|
178
|
+
readonly type: "uint256";
|
|
179
|
+
}];
|
|
180
|
+
}, {
|
|
181
|
+
readonly name: "owner";
|
|
182
|
+
readonly type: "function";
|
|
183
|
+
readonly stateMutability: "view";
|
|
184
|
+
readonly inputs: readonly [];
|
|
185
|
+
readonly outputs: readonly [{
|
|
186
|
+
readonly name: "";
|
|
187
|
+
readonly type: "address";
|
|
188
|
+
}];
|
|
189
|
+
}, {
|
|
190
|
+
readonly name: "state";
|
|
191
|
+
readonly type: "function";
|
|
192
|
+
readonly stateMutability: "view";
|
|
193
|
+
readonly inputs: readonly [];
|
|
194
|
+
readonly outputs: readonly [{
|
|
195
|
+
readonly name: "";
|
|
196
|
+
readonly type: "uint256";
|
|
197
|
+
}];
|
|
198
|
+
}, {
|
|
199
|
+
readonly name: "isValidSigner";
|
|
200
|
+
readonly type: "function";
|
|
201
|
+
readonly stateMutability: "view";
|
|
202
|
+
readonly inputs: readonly [{
|
|
203
|
+
readonly name: "signer";
|
|
204
|
+
readonly type: "address";
|
|
205
|
+
}, {
|
|
206
|
+
readonly name: "context";
|
|
207
|
+
readonly type: "bytes";
|
|
208
|
+
}];
|
|
209
|
+
readonly outputs: readonly [{
|
|
210
|
+
readonly name: "magicValue";
|
|
211
|
+
readonly type: "bytes4";
|
|
212
|
+
}];
|
|
213
|
+
}];
|
|
214
|
+
/**
|
|
215
|
+
* Configuration for the ERC6551Client.
|
|
216
|
+
*/
|
|
217
|
+
export interface TBAConfig {
|
|
218
|
+
/** ERC-6551 registry address. Defaults to canonical address if omitted. */
|
|
219
|
+
registryAddress?: Address;
|
|
220
|
+
/** TBA implementation contract address. Defaults to Tokenbound reference impl. */
|
|
221
|
+
implementationAddress?: Address;
|
|
222
|
+
/** Target chain. Defaults to 'base' (Base mainnet, chainId 8453). */
|
|
223
|
+
chain?: 'base' | 'base-sepolia' | 'ethereum' | 'arbitrum' | 'polygon';
|
|
224
|
+
/** RPC URL override. Uses chain default if omitted. */
|
|
225
|
+
rpcUrl?: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A fully resolved Token Bound Account.
|
|
229
|
+
*/
|
|
230
|
+
export interface TBAAccount {
|
|
231
|
+
/** The TBA's smart contract address (deterministic via CREATE2). */
|
|
232
|
+
address: Address;
|
|
233
|
+
/** The ERC-721 NFT contract that owns this TBA. */
|
|
234
|
+
nftContract: Address;
|
|
235
|
+
/** The ERC-721 token ID that owns this TBA. */
|
|
236
|
+
tokenId: bigint;
|
|
237
|
+
/** Salt used for TBA derivation. */
|
|
238
|
+
salt: Hex;
|
|
239
|
+
/** Chain ID on which this TBA lives. */
|
|
240
|
+
chainId: number;
|
|
241
|
+
/** Implementation contract used for this TBA. */
|
|
242
|
+
implementation: Address;
|
|
243
|
+
/** Whether this TBA is deployed on-chain (vs. just computed). */
|
|
244
|
+
isDeployed: boolean;
|
|
245
|
+
/** Current owner of the TBA (= NFT owner). Null if not yet resolved. */
|
|
246
|
+
owner: Address | null;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Result of an ERC-6551 TBA execution call.
|
|
250
|
+
*/
|
|
251
|
+
export interface TBAExecuteResult {
|
|
252
|
+
/** Transaction hash of the execute() call. */
|
|
253
|
+
txHash: Hash;
|
|
254
|
+
/** ABI-encoded return data from the called contract. */
|
|
255
|
+
returnData: Hex | null;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parameters for executing a call from a TBA.
|
|
259
|
+
*/
|
|
260
|
+
export interface TBAExecuteParams {
|
|
261
|
+
/** Target contract address. */
|
|
262
|
+
to: Address;
|
|
263
|
+
/** ETH value to send (in wei). */
|
|
264
|
+
value?: bigint;
|
|
265
|
+
/** Calldata for the target. Use '0x' for plain ETH transfers. */
|
|
266
|
+
data?: Hex;
|
|
267
|
+
/** Operation type: 0 = CALL (default), 1 = DELEGATECALL. */
|
|
268
|
+
operation?: 0 | 1;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* ERC-6551 Token Bound Account client.
|
|
272
|
+
*
|
|
273
|
+
* Enables any ERC-721 NFT to own a smart contract wallet (TBA). Used to attach
|
|
274
|
+
* an autonomous spending account to every agent identity NFT (ERC-8004).
|
|
275
|
+
*
|
|
276
|
+
* All write operations require a WalletClient — keys never leave the caller's device.
|
|
277
|
+
* The TBA address is deterministic: same NFT + same salt = same address, always.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* import { ERC6551Client } from 'agentwallet-sdk';
|
|
282
|
+
*
|
|
283
|
+
* const client = new ERC6551Client({ chain: 'base' });
|
|
284
|
+
*
|
|
285
|
+
* // Compute the TBA address before deploying
|
|
286
|
+
* const tbaAddress = await client.getTBAAddress('0xNFTContract', 1n);
|
|
287
|
+
*
|
|
288
|
+
* // Deploy it on-chain
|
|
289
|
+
* const { address } = await client.createTBA(walletClient, '0xNFTContract', 1n);
|
|
290
|
+
*
|
|
291
|
+
* // Execute a call from the TBA (the agent acts)
|
|
292
|
+
* const result = await client.executeTBA(walletClient, address, {
|
|
293
|
+
* to: '0xTarget',
|
|
294
|
+
* value: parseEther('0.01'),
|
|
295
|
+
* data: '0x',
|
|
296
|
+
* });
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
export declare class ERC6551Client {
|
|
300
|
+
private readonly publicClient;
|
|
301
|
+
private readonly registryAddress;
|
|
302
|
+
private readonly implementationAddress;
|
|
303
|
+
private readonly chain;
|
|
304
|
+
private readonly chainId;
|
|
305
|
+
constructor(config?: TBAConfig);
|
|
306
|
+
/**
|
|
307
|
+
* Compute the deterministic TBA address for an NFT (off-chain, no RPC needed).
|
|
308
|
+
*
|
|
309
|
+
* Uses the ERC-6551 registry's CREATE2 formula:
|
|
310
|
+
* address = keccak256(0xff ++ registry ++ salt' ++ keccak256(initCode))
|
|
311
|
+
* where salt' and initCode encode the chain + token details.
|
|
312
|
+
*
|
|
313
|
+
* This mirrors the registry's on-chain `account()` view function but does not
|
|
314
|
+
* require a network call. Use `getTBAAddress()` for on-chain verification.
|
|
315
|
+
*
|
|
316
|
+
* @param nftContract - Address of the ERC-721 contract
|
|
317
|
+
* @param tokenId - Token ID of the agent NFT
|
|
318
|
+
* @param salt - Optional salt (defaults to 0x000...0)
|
|
319
|
+
* @returns Deterministic TBA address
|
|
320
|
+
*/
|
|
321
|
+
computeTBAAddress(nftContract: Address, tokenId: bigint, salt?: Hex): Address;
|
|
322
|
+
/**
|
|
323
|
+
* Get the deterministic TBA address for an NFT via on-chain registry view call.
|
|
324
|
+
*
|
|
325
|
+
* Calls the registry's `account()` view function — authoritative and gas-free.
|
|
326
|
+
* For offline computation, use `computeTBAAddress()` instead.
|
|
327
|
+
*
|
|
328
|
+
* @param nftContract - Address of the ERC-721 contract
|
|
329
|
+
* @param tokenId - Token ID of the agent NFT
|
|
330
|
+
* @param salt - Optional salt (defaults to 0x000...0)
|
|
331
|
+
* @returns Deterministic TBA address from registry
|
|
332
|
+
*/
|
|
333
|
+
getTBAAddress(nftContract: Address, tokenId: bigint, salt?: Hex): Promise<Address>;
|
|
334
|
+
/**
|
|
335
|
+
* Deploy a Token Bound Account for an agent NFT.
|
|
336
|
+
*
|
|
337
|
+
* Calls `createAccount()` on the ERC-6551 registry. If the TBA is already
|
|
338
|
+
* deployed, the registry returns the existing address without reverting.
|
|
339
|
+
* Idempotent and safe to call multiple times.
|
|
340
|
+
*
|
|
341
|
+
* Non-custodial: the walletClient signs the transaction locally.
|
|
342
|
+
* The deployer does NOT need to own the NFT — anyone can deploy a TBA.
|
|
343
|
+
*
|
|
344
|
+
* @param walletClient - WalletClient to sign the deployment transaction
|
|
345
|
+
* @param nftContract - Address of the ERC-721 contract
|
|
346
|
+
* @param tokenId - Token ID of the agent NFT
|
|
347
|
+
* @param salt - Optional salt for address uniqueness (defaults to 0x000...0)
|
|
348
|
+
* @returns Deployed TBAAccount with address and deployment metadata
|
|
349
|
+
*/
|
|
350
|
+
createTBA(walletClient: WalletClient, nftContract: Address, tokenId: bigint, salt?: Hex): Promise<TBAAccount>;
|
|
351
|
+
/**
|
|
352
|
+
* Execute a call from a Token Bound Account (the agent acts autonomously).
|
|
353
|
+
*
|
|
354
|
+
* The TBA's `execute()` function routes the call through the NFT owner
|
|
355
|
+
* authorization check before dispatching to the target contract.
|
|
356
|
+
*
|
|
357
|
+
* Only the NFT owner (or an approved ERC-6551 operator) can execute calls.
|
|
358
|
+
* This is the primary mechanism by which agents interact with DeFi protocols,
|
|
359
|
+
* TaskBridge, and other on-chain systems.
|
|
360
|
+
*
|
|
361
|
+
* @param walletClient - WalletClient owning the NFT (authorized to execute)
|
|
362
|
+
* @param tbaAddress - Address of the deployed TBA
|
|
363
|
+
* @param params - Call parameters (to, value, data, operation)
|
|
364
|
+
* @returns Transaction hash and raw return data
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* // Agent pays for a TaskBridge task
|
|
369
|
+
* const result = await client.executeTBA(walletClient, tbaAddress, {
|
|
370
|
+
* to: TASKBRIDGE_CONTRACT,
|
|
371
|
+
* value: parseEther('0.1'),
|
|
372
|
+
* data: encodeFunctionData({ abi: TaskBridgeAbi, functionName: 'bidTask', args: [taskId] }),
|
|
373
|
+
* });
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
executeTBA(walletClient: WalletClient, tbaAddress: Address, params: TBAExecuteParams): Promise<TBAExecuteResult>;
|
|
377
|
+
/**
|
|
378
|
+
* Check whether a TBA is deployed on-chain.
|
|
379
|
+
*
|
|
380
|
+
* A TBA address can be computed deterministically before deployment.
|
|
381
|
+
* This function checks if the contract actually exists at that address.
|
|
382
|
+
*
|
|
383
|
+
* @param tbaAddress - TBA address to check
|
|
384
|
+
* @returns true if code exists at tbaAddress (TBA is deployed)
|
|
385
|
+
*/
|
|
386
|
+
isTBADeployed(tbaAddress: Address): Promise<boolean>;
|
|
387
|
+
/**
|
|
388
|
+
* Get the current owner of a Token Bound Account.
|
|
389
|
+
*
|
|
390
|
+
* Returns the address that owns the underlying NFT, which is the authorized
|
|
391
|
+
* principal for this agent TBA. This is the human (or parent agent) who
|
|
392
|
+
* controls the agent.
|
|
393
|
+
*
|
|
394
|
+
* @param tbaAddress - Address of the deployed TBA
|
|
395
|
+
* @returns Address of the NFT owner (human principal)
|
|
396
|
+
*/
|
|
397
|
+
getTBAOwner(tbaAddress: Address): Promise<Address>;
|
|
398
|
+
/**
|
|
399
|
+
* Get the full TBA account details for an NFT.
|
|
400
|
+
*
|
|
401
|
+
* Computes the deterministic address, checks deployment status, and resolves
|
|
402
|
+
* the owner if deployed. A single call to get everything you need about a TBA.
|
|
403
|
+
*
|
|
404
|
+
* @param nftContract - ERC-721 contract address
|
|
405
|
+
* @param tokenId - Token ID
|
|
406
|
+
* @param salt - Optional salt (defaults to 0x000...0)
|
|
407
|
+
* @returns Full TBAAccount details
|
|
408
|
+
*/
|
|
409
|
+
getTBAAccount(nftContract: Address, tokenId: bigint, salt?: Hex): Promise<TBAAccount>;
|
|
410
|
+
/**
|
|
411
|
+
* Get the NFT token info bound to a deployed TBA.
|
|
412
|
+
*
|
|
413
|
+
* Calls the TBA's `token()` function to retrieve the NFT contract + tokenId
|
|
414
|
+
* that governs ownership of this account.
|
|
415
|
+
*
|
|
416
|
+
* @param tbaAddress - Address of the deployed TBA
|
|
417
|
+
* @returns Chain ID, NFT contract, and token ID
|
|
418
|
+
*/
|
|
419
|
+
getTBAToken(tbaAddress: Address): Promise<{
|
|
420
|
+
chainId: bigint;
|
|
421
|
+
tokenContract: Address;
|
|
422
|
+
tokenId: bigint;
|
|
423
|
+
}>;
|
|
424
|
+
/**
|
|
425
|
+
* Get the current execution state (nonce) of a TBA.
|
|
426
|
+
* Increments on each execute() call — use for replay protection.
|
|
427
|
+
*
|
|
428
|
+
* @param tbaAddress - Address of the deployed TBA
|
|
429
|
+
* @returns Current state value (uint256)
|
|
430
|
+
*/
|
|
431
|
+
getTBAState(tbaAddress: Address): Promise<bigint>;
|
|
432
|
+
/** Registry address used by this client. */
|
|
433
|
+
get registry(): Address;
|
|
434
|
+
/** Implementation address used by this client. */
|
|
435
|
+
get implementation(): Address;
|
|
436
|
+
/** Chain this client is connected to. */
|
|
437
|
+
get connectedChain(): Chain;
|
|
438
|
+
/** Chain ID this client is connected to. */
|
|
439
|
+
get connectedChainId(): number;
|
|
440
|
+
}
|
|
441
|
+
//# sourceMappingURL=erc6551.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc6551.d.ts","sourceRoot":"","sources":["../../src/identity/erc6551.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAWL,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,GAAG,EAER,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,MAAM,CAAC;AAKd;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,OACM,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,OACC,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,GAA0E,CAAC;AAItG;;;GAGG;AACH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