@sequence0/sdk 1.2.0 → 2.0.1
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/core/atomic.d.ts +76 -0
- package/dist/core/atomic.d.ts.map +1 -0
- package/dist/core/atomic.js +39 -0
- package/dist/core/atomic.js.map +1 -0
- package/dist/core/client.d.ts +238 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +536 -4
- package/dist/core/client.js.map +1 -1
- package/dist/core/delegation.d.ts +184 -0
- package/dist/core/delegation.d.ts.map +1 -0
- package/dist/core/delegation.js +37 -0
- package/dist/core/delegation.js.map +1 -0
- package/dist/core/programmable.d.ts +66 -0
- package/dist/core/programmable.d.ts.map +1 -0
- package/dist/core/programmable.js +36 -0
- package/dist/core/programmable.js.map +1 -0
- package/dist/core/solvency.d.ts +223 -0
- package/dist/core/solvency.d.ts.map +1 -0
- package/dist/core/solvency.js +267 -0
- package/dist/core/solvency.js.map +1 -0
- package/dist/core/types.d.ts +11 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/universal-account.d.ts +438 -0
- package/dist/core/universal-account.d.ts.map +1 -0
- package/dist/core/universal-account.js +597 -0
- package/dist/core/universal-account.js.map +1 -0
- package/dist/core/witness.d.ts +197 -0
- package/dist/core/witness.d.ts.map +1 -0
- package/dist/core/witness.js +298 -0
- package/dist/core/witness.js.map +1 -0
- package/dist/erc4337/types.js +2 -2
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/settlement/settlement.d.ts +152 -0
- package/dist/settlement/settlement.d.ts.map +1 -0
- package/dist/settlement/settlement.js +172 -0
- package/dist/settlement/settlement.js.map +1 -0
- package/dist/utils/discovery.js +4 -5
- package/dist/utils/discovery.js.map +1 -1
- package/dist/utils/eip712.js +2 -2
- package/dist/utils/fee.d.ts +2 -2
- package/dist/utils/fee.js +2 -2
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/http.js +6 -1
- package/dist/utils/http.js.map +1 -1
- package/dist/utils/logger.d.ts +3 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +3 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/wallet/wallet.d.ts +52 -0
- package/dist/wallet/wallet.d.ts.map +1 -1
- package/dist/wallet/wallet.js +204 -0
- package/dist/wallet/wallet.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS: Cross-Chain Atomic Composability -- all-or-nothing signing across chains
|
|
3
|
+
*
|
|
4
|
+
* Submit a batch of signing operations spanning multiple wallets and chains.
|
|
5
|
+
* Either all operations succeed and produce signatures, or the entire batch
|
|
6
|
+
* is aborted atomically. This is essential for cross-chain arbitrage, bridge
|
|
7
|
+
* transfers, and multi-leg DeFi strategies where partial execution would
|
|
8
|
+
* leave funds stranded.
|
|
9
|
+
*
|
|
10
|
+
* The agent network coordinates via a 2-phase commit protocol:
|
|
11
|
+
* Phase 1: All participating agents lock the wallets and produce partial sigs
|
|
12
|
+
* Phase 2: Partial sigs are aggregated; if any operation fails, all are rolled back
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { Sequence0 } from '@sequence0/sdk';
|
|
17
|
+
*
|
|
18
|
+
* const s0 = new Sequence0({ network: 'mainnet', ownerPrivateKey: '0x...' });
|
|
19
|
+
*
|
|
20
|
+
* const result = await s0.signAtomic({
|
|
21
|
+
* operations: [
|
|
22
|
+
* { walletId: 'eth-wallet', chain: 'ethereum', message: '0xabc...' },
|
|
23
|
+
* { walletId: 'arb-wallet', chain: 'arbitrum', message: '0xdef...' },
|
|
24
|
+
* ],
|
|
25
|
+
* deadlineBlocks: 50,
|
|
26
|
+
* timeout: 60000,
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* if (result.status === 'committed') {
|
|
30
|
+
* // All signatures available
|
|
31
|
+
* for (const [reqId, sig] of result.signatures) {
|
|
32
|
+
* console.log(`Request ${reqId}: ${sig}`);
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
import { Chain } from './types';
|
|
38
|
+
export interface AtomicOperation {
|
|
39
|
+
/** Wallet ID to sign with */
|
|
40
|
+
walletId: string;
|
|
41
|
+
/** Target blockchain */
|
|
42
|
+
chain: Chain;
|
|
43
|
+
/** Hex-encoded message to sign */
|
|
44
|
+
message: string;
|
|
45
|
+
}
|
|
46
|
+
export interface AtomicSignOptions {
|
|
47
|
+
/** Array of operations to execute atomically */
|
|
48
|
+
operations: AtomicOperation[];
|
|
49
|
+
/** Max blocks to wait for completion (default: 50) */
|
|
50
|
+
deadlineBlocks?: number;
|
|
51
|
+
/** Polling timeout in ms (default: 60000) */
|
|
52
|
+
timeout?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface AtomicSignResult {
|
|
55
|
+
/** Unique manifest identifier for this atomic batch */
|
|
56
|
+
manifestId: string;
|
|
57
|
+
/** Final status: all succeeded ('committed') or all rolled back ('aborted') */
|
|
58
|
+
status: 'committed' | 'aborted';
|
|
59
|
+
/** Map of requestId to hex-encoded signature (only populated if committed) */
|
|
60
|
+
signatures: Map<string, string>;
|
|
61
|
+
/** Error message explaining why the batch was aborted (only if aborted) */
|
|
62
|
+
error?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface AtomicOperationResult {
|
|
65
|
+
/** Request ID for this individual operation */
|
|
66
|
+
requestId: string;
|
|
67
|
+
/** Wallet ID that signed */
|
|
68
|
+
walletId: string;
|
|
69
|
+
/** Chain this operation targeted */
|
|
70
|
+
chain: Chain;
|
|
71
|
+
/** Hex-encoded signature (only if this operation succeeded) */
|
|
72
|
+
signature?: string;
|
|
73
|
+
/** Error message (only if this operation failed, triggering abort) */
|
|
74
|
+
error?: string;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=atomic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic.d.ts","sourceRoot":"","sources":["../../src/core/atomic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,MAAM,WAAW,eAAe;IAC5B,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,iBAAiB;IAC9B,gDAAgD;IAChD,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,gBAAgB;IAC7B,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,8EAA8E;IAC9E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,qBAAqB;IAClC,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,KAAK,CAAC;IACb,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* NEXUS: Cross-Chain Atomic Composability -- all-or-nothing signing across chains
|
|
4
|
+
*
|
|
5
|
+
* Submit a batch of signing operations spanning multiple wallets and chains.
|
|
6
|
+
* Either all operations succeed and produce signatures, or the entire batch
|
|
7
|
+
* is aborted atomically. This is essential for cross-chain arbitrage, bridge
|
|
8
|
+
* transfers, and multi-leg DeFi strategies where partial execution would
|
|
9
|
+
* leave funds stranded.
|
|
10
|
+
*
|
|
11
|
+
* The agent network coordinates via a 2-phase commit protocol:
|
|
12
|
+
* Phase 1: All participating agents lock the wallets and produce partial sigs
|
|
13
|
+
* Phase 2: Partial sigs are aggregated; if any operation fails, all are rolled back
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { Sequence0 } from '@sequence0/sdk';
|
|
18
|
+
*
|
|
19
|
+
* const s0 = new Sequence0({ network: 'mainnet', ownerPrivateKey: '0x...' });
|
|
20
|
+
*
|
|
21
|
+
* const result = await s0.signAtomic({
|
|
22
|
+
* operations: [
|
|
23
|
+
* { walletId: 'eth-wallet', chain: 'ethereum', message: '0xabc...' },
|
|
24
|
+
* { walletId: 'arb-wallet', chain: 'arbitrum', message: '0xdef...' },
|
|
25
|
+
* ],
|
|
26
|
+
* deadlineBlocks: 50,
|
|
27
|
+
* timeout: 60000,
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* if (result.status === 'committed') {
|
|
31
|
+
* // All signatures available
|
|
32
|
+
* for (const [reqId, sig] of result.signatures) {
|
|
33
|
+
* console.log(`Request ${reqId}: ${sig}`);
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
//# sourceMappingURL=atomic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic.js","sourceRoot":"","sources":["../../src/core/atomic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG"}
|
package/dist/core/client.d.ts
CHANGED
|
@@ -23,9 +23,14 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
import { NetworkConfig, CreateWalletOptions, HealthResponse, StatusResponse, WalletDetail, SignResultResponse } from './types';
|
|
26
|
+
import { ProgramDeployOptions, ProgramInfo } from './programmable';
|
|
27
|
+
import { AtomicSignOptions, AtomicSignResult } from './atomic';
|
|
28
|
+
import { DelegateOptions, SubDelegateOptions, DelegationGrant, DelegationTree, AuthorityStatus } from './delegation';
|
|
26
29
|
import { Wallet } from '../wallet/wallet';
|
|
27
30
|
import { WsClient } from '../utils/websocket';
|
|
28
31
|
import { UnsignedFeeTx } from '../utils/fee';
|
|
32
|
+
import { SettlementClient } from '../settlement/settlement';
|
|
33
|
+
import { UniversalAccountClient, UniversalAccountInfo, CreateUniversalAccountOptions } from './universal-account';
|
|
29
34
|
export declare class Sequence0 {
|
|
30
35
|
private config;
|
|
31
36
|
private http;
|
|
@@ -40,6 +45,10 @@ export declare class Sequence0 {
|
|
|
40
45
|
private ownerSigner;
|
|
41
46
|
/** Owner's Ethereum address (derived from private key when provided) */
|
|
42
47
|
private ownerAddress;
|
|
48
|
+
/** Optional delegate signer for AEGIS delegated signing */
|
|
49
|
+
private delegateSigner;
|
|
50
|
+
/** Delegation grant ID for delegated signing */
|
|
51
|
+
private delegationId;
|
|
43
52
|
/**
|
|
44
53
|
* Create a new Sequence0 SDK client
|
|
45
54
|
*
|
|
@@ -218,6 +227,207 @@ export declare class Sequence0 {
|
|
|
218
227
|
* ```
|
|
219
228
|
*/
|
|
220
229
|
buildFeeTx(walletId: string): Promise<UnsignedFeeTx | null>;
|
|
230
|
+
/**
|
|
231
|
+
* Deploy a WASM signing policy program to the Sequence0 chain.
|
|
232
|
+
*
|
|
233
|
+
* The WASM bytecode is uploaded to the ProgramRegistry contract and
|
|
234
|
+
* assigned a unique programId (bytes32). Once deployed, the program
|
|
235
|
+
* can be attached to any wallet owned by the deployer.
|
|
236
|
+
*
|
|
237
|
+
* @param options - Program deployment options (bytecode, metadata, limits)
|
|
238
|
+
* @returns programId as a bytes32 hex string
|
|
239
|
+
*
|
|
240
|
+
* @throws {Sequence0Error} If no ownerSigner is configured
|
|
241
|
+
* @throws {NetworkError} If the deployment transaction fails
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const programId = await s0.deployProgram({
|
|
246
|
+
* bytecode: fs.readFileSync('spending-limit.wasm'),
|
|
247
|
+
* metadataUri: 'ipfs://Qm.../metadata.json',
|
|
248
|
+
* gasLimit: 5_000_000,
|
|
249
|
+
* memoryLimit: 16,
|
|
250
|
+
* });
|
|
251
|
+
* console.log('Deployed program:', programId);
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
deployProgram(options: ProgramDeployOptions): Promise<string>;
|
|
255
|
+
/**
|
|
256
|
+
* Attach a WASM program to a wallet.
|
|
257
|
+
*
|
|
258
|
+
* Only the wallet owner can attach programs. Once attached, the program
|
|
259
|
+
* runs on every sign request for this wallet -- the agent evaluates it
|
|
260
|
+
* in a sandboxed WASM environment and rejects the request if the program
|
|
261
|
+
* returns "deny".
|
|
262
|
+
*
|
|
263
|
+
* @param walletId - The wallet to attach the program to
|
|
264
|
+
* @param programId - The program ID (bytes32 hex) from deployProgram()
|
|
265
|
+
*
|
|
266
|
+
* @throws {Sequence0Error} If no ownerSigner is configured
|
|
267
|
+
* @throws {NetworkError} If the attach transaction fails
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* await s0.attachProgram('my-wallet', programId);
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
attachProgram(walletId: string, programId: string): Promise<void>;
|
|
275
|
+
/**
|
|
276
|
+
* Detach a WASM program from a wallet.
|
|
277
|
+
*
|
|
278
|
+
* Only the wallet owner can detach programs. The program is no longer
|
|
279
|
+
* evaluated on sign requests for this wallet after detachment.
|
|
280
|
+
*
|
|
281
|
+
* @param walletId - The wallet to detach the program from
|
|
282
|
+
* @param programId - The program ID (bytes32 hex) to detach
|
|
283
|
+
*
|
|
284
|
+
* @throws {Sequence0Error} If no ownerSigner is configured
|
|
285
|
+
* @throws {NetworkError} If the detach transaction fails
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```typescript
|
|
289
|
+
* await s0.detachProgram('my-wallet', programId);
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
detachProgram(walletId: string, programId: string): Promise<void>;
|
|
293
|
+
/**
|
|
294
|
+
* Get all WASM programs attached to a wallet.
|
|
295
|
+
*
|
|
296
|
+
* @param walletId - The wallet to query
|
|
297
|
+
* @returns Array of program info objects
|
|
298
|
+
*
|
|
299
|
+
* @throws {NetworkError} If the agent is unreachable
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```typescript
|
|
303
|
+
* const programs = await s0.getWalletPrograms('my-wallet');
|
|
304
|
+
* for (const p of programs) {
|
|
305
|
+
* console.log(`${p.programId}: active=${p.isActive}, gas=${p.gasLimit}`);
|
|
306
|
+
* }
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
getWalletPrograms(walletId: string): Promise<ProgramInfo[]>;
|
|
310
|
+
/**
|
|
311
|
+
* Sign multiple transactions across chains atomically (all-or-nothing).
|
|
312
|
+
*
|
|
313
|
+
* Submits a batch of signing operations to the agent network. The agents
|
|
314
|
+
* coordinate via a 2-phase commit protocol: either all operations produce
|
|
315
|
+
* valid signatures, or the entire batch is aborted and no signatures are
|
|
316
|
+
* released.
|
|
317
|
+
*
|
|
318
|
+
* This is essential for:
|
|
319
|
+
* - Cross-chain arbitrage (buy on chain A, sell on chain B)
|
|
320
|
+
* - Bridge transfers (lock on source, mint on destination)
|
|
321
|
+
* - Multi-leg DeFi strategies
|
|
322
|
+
*
|
|
323
|
+
* @param options - Atomic signing options with operations array
|
|
324
|
+
* @returns Result with all signatures (if committed) or error (if aborted)
|
|
325
|
+
*
|
|
326
|
+
* @throws {Sequence0Error} If no ownerSigner is configured or operations are empty
|
|
327
|
+
* @throws {TimeoutError} If the atomic signing times out
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```typescript
|
|
331
|
+
* const result = await s0.signAtomic({
|
|
332
|
+
* operations: [
|
|
333
|
+
* { walletId: 'eth-wallet', chain: 'ethereum', message: '0x...' },
|
|
334
|
+
* { walletId: 'arb-wallet', chain: 'arbitrum', message: '0x...' },
|
|
335
|
+
* ],
|
|
336
|
+
* timeout: 60000,
|
|
337
|
+
* });
|
|
338
|
+
*
|
|
339
|
+
* if (result.status === 'committed') {
|
|
340
|
+
* for (const [reqId, sig] of result.signatures) {
|
|
341
|
+
* console.log(`${reqId}: ${sig}`);
|
|
342
|
+
* }
|
|
343
|
+
* } else {
|
|
344
|
+
* console.error('Atomic signing aborted:', result.error);
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
signAtomic(options: AtomicSignOptions): Promise<AtomicSignResult>;
|
|
349
|
+
/**
|
|
350
|
+
* Get a SettlementClient for MERIDIAN Universal Settlement Network operations.
|
|
351
|
+
*
|
|
352
|
+
* The settlement client provides methods to submit payment intents,
|
|
353
|
+
* query cycle status, and retrieve settlement history. Intents are
|
|
354
|
+
* batched and netted off-chain, then settled atomically via NEXUS.
|
|
355
|
+
*
|
|
356
|
+
* @returns A SettlementClient instance bound to the current agent
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* const settlement = s0.getSettlementClient();
|
|
361
|
+
*
|
|
362
|
+
* const { intentHash, cycleId } = await settlement.submitIntent(
|
|
363
|
+
* {
|
|
364
|
+
* senderWalletId: 'alice-wallet',
|
|
365
|
+
* recipientWalletId: 'bob-wallet',
|
|
366
|
+
* chain: 'ethereum',
|
|
367
|
+
* amount: '1000000000000000000',
|
|
368
|
+
* },
|
|
369
|
+
* ownerSignature,
|
|
370
|
+
* timestamp,
|
|
371
|
+
* );
|
|
372
|
+
*
|
|
373
|
+
* const cycle = await settlement.getCurrentCycle();
|
|
374
|
+
* console.log(`Cycle ${cycle.cycleId}: ${cycle.status}`);
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
getSettlementClient(): Promise<SettlementClient>;
|
|
378
|
+
/**
|
|
379
|
+
* Get a UniversalAccountClient bound to a healthy agent.
|
|
380
|
+
*
|
|
381
|
+
* The client communicates directly with the agent's `/universal/*`
|
|
382
|
+
* endpoints for account creation, balance queries, and sends.
|
|
383
|
+
*
|
|
384
|
+
* @returns A UniversalAccountClient instance
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```typescript
|
|
388
|
+
* const ua = await s0.getUniversalAccountClient();
|
|
389
|
+
*
|
|
390
|
+
* const balance = await ua.getUnifiedBalance('ua-abc123');
|
|
391
|
+
* console.log('Chains:', balance.totalChains);
|
|
392
|
+
*
|
|
393
|
+
* const route = await ua.previewRoute({
|
|
394
|
+
* accountId: 'ua-abc123',
|
|
395
|
+
* to: '0x...',
|
|
396
|
+
* amount: '1.0',
|
|
397
|
+
* token: 'ETH',
|
|
398
|
+
* });
|
|
399
|
+
* console.log(`Route: ${route.sourceChain} -> ${route.destinationChain}`);
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
getUniversalAccountClient(): Promise<UniversalAccountClient>;
|
|
403
|
+
/**
|
|
404
|
+
* Create a new universal account — one identity across all 81 chains.
|
|
405
|
+
*
|
|
406
|
+
* This is a convenience method that discovers a healthy agent,
|
|
407
|
+
* creates a UniversalAccountClient, and calls createAccount.
|
|
408
|
+
* For repeated operations, prefer `getUniversalAccountClient()`
|
|
409
|
+
* and reuse the client.
|
|
410
|
+
*
|
|
411
|
+
* @param options - Account creation options
|
|
412
|
+
* @returns The created account info with all chain addresses
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```typescript
|
|
416
|
+
* const account = await s0.createUniversalAccount({
|
|
417
|
+
* ownerSignature: '0x...',
|
|
418
|
+
* timestamp: Date.now(),
|
|
419
|
+
* });
|
|
420
|
+
*
|
|
421
|
+
* console.log('Account ID:', account.accountId);
|
|
422
|
+
* console.log('Ethereum:', account.chainAddresses.ethereum.address);
|
|
423
|
+
* console.log('Bitcoin:', account.chainAddresses.bitcoin.address);
|
|
424
|
+
* console.log('Solana:', account.chainAddresses.solana.address);
|
|
425
|
+
* ```
|
|
426
|
+
*
|
|
427
|
+
* @throws {Sequence0Error} If the creation parameters are invalid
|
|
428
|
+
* @throws {NetworkError} If no healthy agent is available
|
|
429
|
+
*/
|
|
430
|
+
createUniversalAccount(options: CreateUniversalAccountOptions): Promise<UniversalAccountInfo>;
|
|
221
431
|
/**
|
|
222
432
|
* Subscribe to real-time events from the agent network
|
|
223
433
|
*
|
|
@@ -259,5 +469,33 @@ export declare class Sequence0 {
|
|
|
259
469
|
*/
|
|
260
470
|
private warnIfHttp;
|
|
261
471
|
private generateWalletId;
|
|
472
|
+
/**
|
|
473
|
+
* Create a delegation grant for a wallet (owner only).
|
|
474
|
+
*/
|
|
475
|
+
createDelegation(walletId: string, options: DelegateOptions): Promise<DelegationGrant>;
|
|
476
|
+
/**
|
|
477
|
+
* Create a sub-delegation from an existing delegation grant.
|
|
478
|
+
*/
|
|
479
|
+
createSubDelegation(walletId: string, options: SubDelegateOptions): Promise<DelegationGrant>;
|
|
480
|
+
/**
|
|
481
|
+
* Revoke a delegation grant (cascading to all sub-grants).
|
|
482
|
+
*/
|
|
483
|
+
revokeDelegation(walletId: string, delegationId: string): Promise<void>;
|
|
484
|
+
/**
|
|
485
|
+
* List all delegation grants for a wallet.
|
|
486
|
+
*/
|
|
487
|
+
listDelegations(walletId: string): Promise<DelegationGrant[]>;
|
|
488
|
+
/**
|
|
489
|
+
* Get the delegation tree for a wallet.
|
|
490
|
+
*/
|
|
491
|
+
getDelegationTree(walletId: string): Promise<DelegationTree>;
|
|
492
|
+
/**
|
|
493
|
+
* Send heartbeat for dead-man's switch delegation grants.
|
|
494
|
+
*/
|
|
495
|
+
heartbeat(walletId: string): Promise<void>;
|
|
496
|
+
/**
|
|
497
|
+
* Check remaining authority status of a delegation.
|
|
498
|
+
*/
|
|
499
|
+
checkAuthority(delegationId: string): Promise<AuthorityStatus>;
|
|
262
500
|
}
|
|
263
501
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACH,aAAa,EACb,mBAAmB,EAEnB,cAAc,EACd,cAAc,EAEd,YAAY,EAGZ,kBAAkB,EAErB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACH,aAAa,EACb,mBAAmB,EAEnB,cAAc,EACd,cAAc,EAEd,YAAY,EAGZ,kBAAkB,EAErB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAChF,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAa,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAc,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AA4IlH,qBAAa,SAAS;I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