@1llet.xyz/erc4337-gasless-sdk 0.4.71 → 0.4.73
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/index.d.mts +156 -82
- package/dist/index.d.ts +156 -82
- package/dist/index.js +700 -170
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +684 -162
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Chain, Address, Hash,
|
|
2
|
-
import * as StellarSdk from 'stellar-sdk';
|
|
1
|
+
import { Chain, Address, Hex, Hash, PublicClient, WalletClient } from 'viem';
|
|
3
2
|
import { Address as Address$1 } from 'abitype';
|
|
4
3
|
import z from 'zod';
|
|
4
|
+
import * as StellarSdk from 'stellar-sdk';
|
|
5
|
+
import * as _defuse_protocol_one_click_sdk_typescript from '@defuse-protocol/one-click-sdk-typescript';
|
|
5
6
|
|
|
6
7
|
interface Token {
|
|
7
8
|
symbol: string;
|
|
@@ -69,6 +70,24 @@ interface ApprovalSupportResult {
|
|
|
69
70
|
fundedAmount?: string;
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
declare class BundlerClient {
|
|
74
|
+
private bundlerUrl;
|
|
75
|
+
private entryPointAddress;
|
|
76
|
+
constructor(config: EvmChainConfig, entryPointAddress: Address);
|
|
77
|
+
private call;
|
|
78
|
+
estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
|
|
79
|
+
sendUserOperation(userOp: UserOperation): Promise<Hash>;
|
|
80
|
+
waitForUserOperation(userOpHash: Hash, timeout?: number): Promise<UserOpReceipt>;
|
|
81
|
+
requestApprovalSupport(token: Address, owner: Address, spender: Address, amount: bigint): Promise<ApprovalSupportResult>;
|
|
82
|
+
scheduleUserOp(userOp: UserOperation, condition: {
|
|
83
|
+
token: string;
|
|
84
|
+
minAmount: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
status: string;
|
|
87
|
+
taskId: string;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
|
|
72
91
|
/**
|
|
73
92
|
* ERC-4337 Account Abstraction Client
|
|
74
93
|
*/
|
|
@@ -84,6 +103,19 @@ declare class AccountAbstraction {
|
|
|
84
103
|
private entryPointAddress;
|
|
85
104
|
private factoryAddress;
|
|
86
105
|
constructor(chainConfig: EvmChainConfig);
|
|
106
|
+
getBundlerClient(): BundlerClient;
|
|
107
|
+
getChainId(): number;
|
|
108
|
+
getPublicClient(): PublicClient;
|
|
109
|
+
buildUserOperation(transaction: {
|
|
110
|
+
target: Address;
|
|
111
|
+
value: bigint;
|
|
112
|
+
data: Hex;
|
|
113
|
+
}): Promise<UserOperation>;
|
|
114
|
+
buildBatchUserOperation(transactions: {
|
|
115
|
+
target: Address;
|
|
116
|
+
value: bigint;
|
|
117
|
+
data: Hex;
|
|
118
|
+
}[]): Promise<UserOperation>;
|
|
87
119
|
connect(signer?: Hex | WalletClient): Promise<{
|
|
88
120
|
owner: Address;
|
|
89
121
|
smartAccount: Address;
|
|
@@ -159,22 +191,97 @@ declare global {
|
|
|
159
191
|
}
|
|
160
192
|
}
|
|
161
193
|
|
|
162
|
-
declare
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
194
|
+
declare const ChainKeyEnum: z.ZodEnum<{
|
|
195
|
+
Optimism: "Optimism";
|
|
196
|
+
Arbitrum: "Arbitrum";
|
|
197
|
+
Base: "Base";
|
|
198
|
+
Unichain: "Unichain";
|
|
199
|
+
Polygon: "Polygon";
|
|
200
|
+
Avalanche: "Avalanche";
|
|
201
|
+
WorldChain: "WorldChain";
|
|
202
|
+
Stellar: "Stellar";
|
|
203
|
+
Monad: "Monad";
|
|
204
|
+
BNB: "BNB";
|
|
205
|
+
GNOSIS: "GNOSIS";
|
|
206
|
+
Ethereum: "Ethereum";
|
|
207
|
+
Stacks: "Stacks";
|
|
208
|
+
}>;
|
|
209
|
+
type ChainKey = z.infer<typeof ChainKeyEnum>;
|
|
210
|
+
interface NearIntentAsset {
|
|
211
|
+
assetId: string;
|
|
212
|
+
name: string;
|
|
213
|
+
decimals: number;
|
|
214
|
+
}
|
|
215
|
+
interface NearIntentInformation {
|
|
216
|
+
support: boolean;
|
|
217
|
+
assetsId: NearIntentAsset[];
|
|
218
|
+
needMemo: boolean;
|
|
219
|
+
}
|
|
220
|
+
interface CCTPInformation {
|
|
221
|
+
supportCCTP: boolean;
|
|
222
|
+
domain: number;
|
|
223
|
+
}
|
|
224
|
+
interface CircleInformation {
|
|
225
|
+
supportCirclePaymaster: boolean;
|
|
226
|
+
cCTPInformation?: CCTPInformation;
|
|
227
|
+
aproxFromFee: number;
|
|
228
|
+
}
|
|
229
|
+
interface StargateInformation {
|
|
230
|
+
support: boolean;
|
|
231
|
+
}
|
|
232
|
+
interface CrossChainInformation {
|
|
233
|
+
circleInformation?: CircleInformation;
|
|
234
|
+
nearIntentInformation: NearIntentInformation | null;
|
|
235
|
+
stargateInformation?: StargateInformation;
|
|
236
|
+
}
|
|
237
|
+
interface EvmInformation {
|
|
238
|
+
chain: any;
|
|
239
|
+
rpcUrl: string | null;
|
|
240
|
+
supports7702: boolean;
|
|
241
|
+
erc4337: boolean;
|
|
242
|
+
bundlerUrl?: string;
|
|
243
|
+
entryPointAddress?: Address$1;
|
|
244
|
+
factoryAddress?: Address$1;
|
|
245
|
+
paymasterAddress?: Address$1;
|
|
246
|
+
}
|
|
247
|
+
interface NonEvmInformation {
|
|
248
|
+
networkPassphrase?: string;
|
|
249
|
+
serverURL?: string;
|
|
250
|
+
}
|
|
251
|
+
interface Asset {
|
|
252
|
+
name: string;
|
|
253
|
+
decimals: number;
|
|
254
|
+
address?: Address$1 | string;
|
|
255
|
+
coingeckoId?: string;
|
|
256
|
+
supportsStargate?: boolean;
|
|
257
|
+
}
|
|
258
|
+
interface ChainConfig {
|
|
259
|
+
assets: Asset[];
|
|
260
|
+
evm?: EvmInformation;
|
|
261
|
+
nonEvm?: NonEvmInformation;
|
|
262
|
+
crossChainInformation: CrossChainInformation;
|
|
171
263
|
}
|
|
172
264
|
|
|
265
|
+
declare const BASE: ChainConfig;
|
|
266
|
+
|
|
267
|
+
declare const AVALANCHE: ChainConfig;
|
|
268
|
+
|
|
269
|
+
declare const OPTIMISM: ChainConfig;
|
|
270
|
+
|
|
271
|
+
declare const UNICHAIN: ChainConfig;
|
|
272
|
+
|
|
173
273
|
declare const BASE_MAINNET: ChainConfig$1;
|
|
174
274
|
declare const OPTIMISM_MAINNET: ChainConfig$1;
|
|
175
275
|
declare const GNOSIS_MAINNET: ChainConfig$1;
|
|
176
276
|
declare const BASE_SEPOLIA: ChainConfig$1;
|
|
277
|
+
declare const AVALANCHE_MAINNET: ChainConfig$1;
|
|
278
|
+
declare const BSC_MAINNET: ChainConfig$1;
|
|
279
|
+
declare const POLYGON_MAINNET: ChainConfig$1;
|
|
280
|
+
declare const ARBITRUM_MAINNET: ChainConfig$1;
|
|
281
|
+
declare const UNICHAIN_MAINNET: ChainConfig$1;
|
|
282
|
+
declare const MONAD_MAINNET: ChainConfig$1;
|
|
177
283
|
declare const STELLAR_MAINNET: ChainConfig$1;
|
|
284
|
+
declare const STACKS_MAINNET: ChainConfig$1;
|
|
178
285
|
declare const CHAIN_CONFIGS: Record<number, ChainConfig$1>;
|
|
179
286
|
|
|
180
287
|
declare const entryPointAbi: readonly [{
|
|
@@ -333,75 +440,6 @@ declare class StellarService {
|
|
|
333
440
|
getKeypair(pk: string): StellarSdk.Keypair;
|
|
334
441
|
}
|
|
335
442
|
|
|
336
|
-
declare const ChainKeyEnum: z.ZodEnum<{
|
|
337
|
-
Optimism: "Optimism";
|
|
338
|
-
Arbitrum: "Arbitrum";
|
|
339
|
-
Base: "Base";
|
|
340
|
-
Unichain: "Unichain";
|
|
341
|
-
Polygon: "Polygon";
|
|
342
|
-
Avalanche: "Avalanche";
|
|
343
|
-
WorldChain: "WorldChain";
|
|
344
|
-
Stellar: "Stellar";
|
|
345
|
-
Monad: "Monad";
|
|
346
|
-
BNB: "BNB";
|
|
347
|
-
GNOSIS: "GNOSIS";
|
|
348
|
-
}>;
|
|
349
|
-
type ChainKey = z.infer<typeof ChainKeyEnum>;
|
|
350
|
-
interface NearIntentAsset {
|
|
351
|
-
assetId: string;
|
|
352
|
-
name: string;
|
|
353
|
-
decimals: number;
|
|
354
|
-
}
|
|
355
|
-
interface NearIntentInformation {
|
|
356
|
-
support: boolean;
|
|
357
|
-
assetsId: NearIntentAsset[];
|
|
358
|
-
needMemo: boolean;
|
|
359
|
-
}
|
|
360
|
-
interface CCTPInformation {
|
|
361
|
-
supportCCTP: boolean;
|
|
362
|
-
domain: number;
|
|
363
|
-
}
|
|
364
|
-
interface CircleInformation {
|
|
365
|
-
supportCirclePaymaster: boolean;
|
|
366
|
-
cCTPInformation?: CCTPInformation;
|
|
367
|
-
aproxFromFee: number;
|
|
368
|
-
}
|
|
369
|
-
interface StargateInformation {
|
|
370
|
-
support: boolean;
|
|
371
|
-
}
|
|
372
|
-
interface CrossChainInformation {
|
|
373
|
-
circleInformation?: CircleInformation;
|
|
374
|
-
nearIntentInformation: NearIntentInformation | null;
|
|
375
|
-
stargateInformation?: StargateInformation;
|
|
376
|
-
}
|
|
377
|
-
interface EvmInformation {
|
|
378
|
-
chain: any;
|
|
379
|
-
rpcUrl: string | null;
|
|
380
|
-
supports7702: boolean;
|
|
381
|
-
erc4337: boolean;
|
|
382
|
-
bundlerUrl?: string;
|
|
383
|
-
entryPointAddress?: Address$1;
|
|
384
|
-
factoryAddress?: Address$1;
|
|
385
|
-
paymasterAddress?: Address$1;
|
|
386
|
-
}
|
|
387
|
-
interface NonEvmInformation {
|
|
388
|
-
networkPassphrase?: string;
|
|
389
|
-
serverURL?: string;
|
|
390
|
-
}
|
|
391
|
-
interface Asset {
|
|
392
|
-
name: string;
|
|
393
|
-
decimals: number;
|
|
394
|
-
address?: Address$1 | string;
|
|
395
|
-
coingeckoId?: string;
|
|
396
|
-
supportsStargate?: boolean;
|
|
397
|
-
}
|
|
398
|
-
interface ChainConfig {
|
|
399
|
-
assets: Asset[];
|
|
400
|
-
evm?: EvmInformation;
|
|
401
|
-
nonEvm?: NonEvmInformation;
|
|
402
|
-
crossChainInformation: CrossChainInformation;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
443
|
declare const STELLAR: ChainConfig;
|
|
406
444
|
|
|
407
445
|
interface FacilitatorPaymentPayload {
|
|
@@ -430,6 +468,8 @@ interface SettleResponse {
|
|
|
430
468
|
attestation: string;
|
|
431
469
|
};
|
|
432
470
|
data?: any;
|
|
471
|
+
estimatedReceived?: string;
|
|
472
|
+
minAmount?: string;
|
|
433
473
|
}
|
|
434
474
|
interface BridgeContext {
|
|
435
475
|
paymentPayload?: FacilitatorPaymentPayload;
|
|
@@ -443,6 +483,7 @@ interface BridgeContext {
|
|
|
443
483
|
facilitatorPrivateKey?: string;
|
|
444
484
|
feeRecipient?: string;
|
|
445
485
|
depositTxHash?: string;
|
|
486
|
+
sourceAA?: AccountAbstraction;
|
|
446
487
|
}
|
|
447
488
|
interface BridgeStrategy {
|
|
448
489
|
name: string;
|
|
@@ -452,8 +493,15 @@ interface BridgeStrategy {
|
|
|
452
493
|
|
|
453
494
|
declare class TransferManager {
|
|
454
495
|
private strategies;
|
|
496
|
+
private router;
|
|
455
497
|
constructor();
|
|
456
|
-
execute(context: BridgeContext): Promise<SettleResponse>;
|
|
498
|
+
execute(context: BridgeContext, logCallback?: (msg: string) => void): Promise<SettleResponse>;
|
|
499
|
+
/**
|
|
500
|
+
* Specialized method for Base/Unichain -> Stacks flow.
|
|
501
|
+
* 1. EVM (Base/Unichain) -> Ethereum (CCTP)
|
|
502
|
+
* 2. Ethereum -> Stacks (Stacks Bridge)
|
|
503
|
+
*/
|
|
504
|
+
executeEVMToStacks(context: BridgeContext, sourceAA: AccountAbstraction, ethPrivateKey: string, logCallback?: (msg: string) => void): Promise<SettleResponse>;
|
|
457
505
|
}
|
|
458
506
|
|
|
459
507
|
declare class NearStrategy implements BridgeStrategy {
|
|
@@ -461,6 +509,14 @@ declare class NearStrategy implements BridgeStrategy {
|
|
|
461
509
|
canHandle(context: BridgeContext): boolean;
|
|
462
510
|
execute(context: BridgeContext): Promise<SettleResponse>;
|
|
463
511
|
}
|
|
512
|
+
declare function getNearQuote(sourceChain: ChainKey, destChain: ChainKey, amount: string, destToken?: string, sourceToken?: string, recipient?: string, senderAddress?: string, options?: {
|
|
513
|
+
dry?: boolean;
|
|
514
|
+
}): Promise<{
|
|
515
|
+
quote: _defuse_protocol_one_click_sdk_typescript.QuoteResponse;
|
|
516
|
+
depositAddress: string;
|
|
517
|
+
amountAtomicTotal: bigint;
|
|
518
|
+
amountAtomicNet: string;
|
|
519
|
+
}>;
|
|
464
520
|
declare function getNearSimulation(sourceChain: ChainKey, destChain: ChainKey, amount: string, destToken?: string, sourceToken?: string): Promise<{
|
|
465
521
|
success: boolean;
|
|
466
522
|
amountSent: number;
|
|
@@ -526,4 +582,22 @@ declare class UniswapService {
|
|
|
526
582
|
}
|
|
527
583
|
declare const uniswapService: UniswapService;
|
|
528
584
|
|
|
529
|
-
|
|
585
|
+
interface MultiHopStep {
|
|
586
|
+
aa: AccountAbstraction;
|
|
587
|
+
buildUserOp: () => Promise<UserOperation>;
|
|
588
|
+
waitCondition?: () => Promise<boolean>;
|
|
589
|
+
description: string;
|
|
590
|
+
}
|
|
591
|
+
declare class RouterService {
|
|
592
|
+
/**
|
|
593
|
+
* Orchestrates a Multi-Hop transfer by signing ALL UserOps upfront (Reverse Order),
|
|
594
|
+
* and then executing them sequentially (Forward Order) with polling support.
|
|
595
|
+
*
|
|
596
|
+
* @param steps Array of MultiHopStep ordered by execution (Source -> Intermediate -> Dest)
|
|
597
|
+
* @param onLog Optional callback for logging progress
|
|
598
|
+
*/
|
|
599
|
+
executeMultiHop(steps: MultiHopStep[], onLog?: (msg: string) => void): Promise<boolean>;
|
|
600
|
+
private pollCondition;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export { ARBITRUM_MAINNET, AVALANCHE, AVALANCHE_MAINNET, AccountAbstraction, type ApprovalSupportResult, BASE, BASE_MAINNET, BASE_SEPOLIA, BSC_MAINNET, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, MONAD_MAINNET, NearStrategy, OPTIMISM, OPTIMISM_MAINNET, POLYGON_MAINNET, RouterService, STACKS_MAINNET, STELLAR, STELLAR_MAINNET, StargateStrategy, StellarService, type Token, TransferManager, UNICHAIN, UNICHAIN_MAINNET, UniswapService, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, getNearQuote, getNearSimulation, getStargateSimulation, smartAccountAbi, uniswapService };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Chain, Address, Hash,
|
|
2
|
-
import * as StellarSdk from 'stellar-sdk';
|
|
1
|
+
import { Chain, Address, Hex, Hash, PublicClient, WalletClient } from 'viem';
|
|
3
2
|
import { Address as Address$1 } from 'abitype';
|
|
4
3
|
import z from 'zod';
|
|
4
|
+
import * as StellarSdk from 'stellar-sdk';
|
|
5
|
+
import * as _defuse_protocol_one_click_sdk_typescript from '@defuse-protocol/one-click-sdk-typescript';
|
|
5
6
|
|
|
6
7
|
interface Token {
|
|
7
8
|
symbol: string;
|
|
@@ -69,6 +70,24 @@ interface ApprovalSupportResult {
|
|
|
69
70
|
fundedAmount?: string;
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
declare class BundlerClient {
|
|
74
|
+
private bundlerUrl;
|
|
75
|
+
private entryPointAddress;
|
|
76
|
+
constructor(config: EvmChainConfig, entryPointAddress: Address);
|
|
77
|
+
private call;
|
|
78
|
+
estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
|
|
79
|
+
sendUserOperation(userOp: UserOperation): Promise<Hash>;
|
|
80
|
+
waitForUserOperation(userOpHash: Hash, timeout?: number): Promise<UserOpReceipt>;
|
|
81
|
+
requestApprovalSupport(token: Address, owner: Address, spender: Address, amount: bigint): Promise<ApprovalSupportResult>;
|
|
82
|
+
scheduleUserOp(userOp: UserOperation, condition: {
|
|
83
|
+
token: string;
|
|
84
|
+
minAmount: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
status: string;
|
|
87
|
+
taskId: string;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
|
|
72
91
|
/**
|
|
73
92
|
* ERC-4337 Account Abstraction Client
|
|
74
93
|
*/
|
|
@@ -84,6 +103,19 @@ declare class AccountAbstraction {
|
|
|
84
103
|
private entryPointAddress;
|
|
85
104
|
private factoryAddress;
|
|
86
105
|
constructor(chainConfig: EvmChainConfig);
|
|
106
|
+
getBundlerClient(): BundlerClient;
|
|
107
|
+
getChainId(): number;
|
|
108
|
+
getPublicClient(): PublicClient;
|
|
109
|
+
buildUserOperation(transaction: {
|
|
110
|
+
target: Address;
|
|
111
|
+
value: bigint;
|
|
112
|
+
data: Hex;
|
|
113
|
+
}): Promise<UserOperation>;
|
|
114
|
+
buildBatchUserOperation(transactions: {
|
|
115
|
+
target: Address;
|
|
116
|
+
value: bigint;
|
|
117
|
+
data: Hex;
|
|
118
|
+
}[]): Promise<UserOperation>;
|
|
87
119
|
connect(signer?: Hex | WalletClient): Promise<{
|
|
88
120
|
owner: Address;
|
|
89
121
|
smartAccount: Address;
|
|
@@ -159,22 +191,97 @@ declare global {
|
|
|
159
191
|
}
|
|
160
192
|
}
|
|
161
193
|
|
|
162
|
-
declare
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
194
|
+
declare const ChainKeyEnum: z.ZodEnum<{
|
|
195
|
+
Optimism: "Optimism";
|
|
196
|
+
Arbitrum: "Arbitrum";
|
|
197
|
+
Base: "Base";
|
|
198
|
+
Unichain: "Unichain";
|
|
199
|
+
Polygon: "Polygon";
|
|
200
|
+
Avalanche: "Avalanche";
|
|
201
|
+
WorldChain: "WorldChain";
|
|
202
|
+
Stellar: "Stellar";
|
|
203
|
+
Monad: "Monad";
|
|
204
|
+
BNB: "BNB";
|
|
205
|
+
GNOSIS: "GNOSIS";
|
|
206
|
+
Ethereum: "Ethereum";
|
|
207
|
+
Stacks: "Stacks";
|
|
208
|
+
}>;
|
|
209
|
+
type ChainKey = z.infer<typeof ChainKeyEnum>;
|
|
210
|
+
interface NearIntentAsset {
|
|
211
|
+
assetId: string;
|
|
212
|
+
name: string;
|
|
213
|
+
decimals: number;
|
|
214
|
+
}
|
|
215
|
+
interface NearIntentInformation {
|
|
216
|
+
support: boolean;
|
|
217
|
+
assetsId: NearIntentAsset[];
|
|
218
|
+
needMemo: boolean;
|
|
219
|
+
}
|
|
220
|
+
interface CCTPInformation {
|
|
221
|
+
supportCCTP: boolean;
|
|
222
|
+
domain: number;
|
|
223
|
+
}
|
|
224
|
+
interface CircleInformation {
|
|
225
|
+
supportCirclePaymaster: boolean;
|
|
226
|
+
cCTPInformation?: CCTPInformation;
|
|
227
|
+
aproxFromFee: number;
|
|
228
|
+
}
|
|
229
|
+
interface StargateInformation {
|
|
230
|
+
support: boolean;
|
|
231
|
+
}
|
|
232
|
+
interface CrossChainInformation {
|
|
233
|
+
circleInformation?: CircleInformation;
|
|
234
|
+
nearIntentInformation: NearIntentInformation | null;
|
|
235
|
+
stargateInformation?: StargateInformation;
|
|
236
|
+
}
|
|
237
|
+
interface EvmInformation {
|
|
238
|
+
chain: any;
|
|
239
|
+
rpcUrl: string | null;
|
|
240
|
+
supports7702: boolean;
|
|
241
|
+
erc4337: boolean;
|
|
242
|
+
bundlerUrl?: string;
|
|
243
|
+
entryPointAddress?: Address$1;
|
|
244
|
+
factoryAddress?: Address$1;
|
|
245
|
+
paymasterAddress?: Address$1;
|
|
246
|
+
}
|
|
247
|
+
interface NonEvmInformation {
|
|
248
|
+
networkPassphrase?: string;
|
|
249
|
+
serverURL?: string;
|
|
250
|
+
}
|
|
251
|
+
interface Asset {
|
|
252
|
+
name: string;
|
|
253
|
+
decimals: number;
|
|
254
|
+
address?: Address$1 | string;
|
|
255
|
+
coingeckoId?: string;
|
|
256
|
+
supportsStargate?: boolean;
|
|
257
|
+
}
|
|
258
|
+
interface ChainConfig {
|
|
259
|
+
assets: Asset[];
|
|
260
|
+
evm?: EvmInformation;
|
|
261
|
+
nonEvm?: NonEvmInformation;
|
|
262
|
+
crossChainInformation: CrossChainInformation;
|
|
171
263
|
}
|
|
172
264
|
|
|
265
|
+
declare const BASE: ChainConfig;
|
|
266
|
+
|
|
267
|
+
declare const AVALANCHE: ChainConfig;
|
|
268
|
+
|
|
269
|
+
declare const OPTIMISM: ChainConfig;
|
|
270
|
+
|
|
271
|
+
declare const UNICHAIN: ChainConfig;
|
|
272
|
+
|
|
173
273
|
declare const BASE_MAINNET: ChainConfig$1;
|
|
174
274
|
declare const OPTIMISM_MAINNET: ChainConfig$1;
|
|
175
275
|
declare const GNOSIS_MAINNET: ChainConfig$1;
|
|
176
276
|
declare const BASE_SEPOLIA: ChainConfig$1;
|
|
277
|
+
declare const AVALANCHE_MAINNET: ChainConfig$1;
|
|
278
|
+
declare const BSC_MAINNET: ChainConfig$1;
|
|
279
|
+
declare const POLYGON_MAINNET: ChainConfig$1;
|
|
280
|
+
declare const ARBITRUM_MAINNET: ChainConfig$1;
|
|
281
|
+
declare const UNICHAIN_MAINNET: ChainConfig$1;
|
|
282
|
+
declare const MONAD_MAINNET: ChainConfig$1;
|
|
177
283
|
declare const STELLAR_MAINNET: ChainConfig$1;
|
|
284
|
+
declare const STACKS_MAINNET: ChainConfig$1;
|
|
178
285
|
declare const CHAIN_CONFIGS: Record<number, ChainConfig$1>;
|
|
179
286
|
|
|
180
287
|
declare const entryPointAbi: readonly [{
|
|
@@ -333,75 +440,6 @@ declare class StellarService {
|
|
|
333
440
|
getKeypair(pk: string): StellarSdk.Keypair;
|
|
334
441
|
}
|
|
335
442
|
|
|
336
|
-
declare const ChainKeyEnum: z.ZodEnum<{
|
|
337
|
-
Optimism: "Optimism";
|
|
338
|
-
Arbitrum: "Arbitrum";
|
|
339
|
-
Base: "Base";
|
|
340
|
-
Unichain: "Unichain";
|
|
341
|
-
Polygon: "Polygon";
|
|
342
|
-
Avalanche: "Avalanche";
|
|
343
|
-
WorldChain: "WorldChain";
|
|
344
|
-
Stellar: "Stellar";
|
|
345
|
-
Monad: "Monad";
|
|
346
|
-
BNB: "BNB";
|
|
347
|
-
GNOSIS: "GNOSIS";
|
|
348
|
-
}>;
|
|
349
|
-
type ChainKey = z.infer<typeof ChainKeyEnum>;
|
|
350
|
-
interface NearIntentAsset {
|
|
351
|
-
assetId: string;
|
|
352
|
-
name: string;
|
|
353
|
-
decimals: number;
|
|
354
|
-
}
|
|
355
|
-
interface NearIntentInformation {
|
|
356
|
-
support: boolean;
|
|
357
|
-
assetsId: NearIntentAsset[];
|
|
358
|
-
needMemo: boolean;
|
|
359
|
-
}
|
|
360
|
-
interface CCTPInformation {
|
|
361
|
-
supportCCTP: boolean;
|
|
362
|
-
domain: number;
|
|
363
|
-
}
|
|
364
|
-
interface CircleInformation {
|
|
365
|
-
supportCirclePaymaster: boolean;
|
|
366
|
-
cCTPInformation?: CCTPInformation;
|
|
367
|
-
aproxFromFee: number;
|
|
368
|
-
}
|
|
369
|
-
interface StargateInformation {
|
|
370
|
-
support: boolean;
|
|
371
|
-
}
|
|
372
|
-
interface CrossChainInformation {
|
|
373
|
-
circleInformation?: CircleInformation;
|
|
374
|
-
nearIntentInformation: NearIntentInformation | null;
|
|
375
|
-
stargateInformation?: StargateInformation;
|
|
376
|
-
}
|
|
377
|
-
interface EvmInformation {
|
|
378
|
-
chain: any;
|
|
379
|
-
rpcUrl: string | null;
|
|
380
|
-
supports7702: boolean;
|
|
381
|
-
erc4337: boolean;
|
|
382
|
-
bundlerUrl?: string;
|
|
383
|
-
entryPointAddress?: Address$1;
|
|
384
|
-
factoryAddress?: Address$1;
|
|
385
|
-
paymasterAddress?: Address$1;
|
|
386
|
-
}
|
|
387
|
-
interface NonEvmInformation {
|
|
388
|
-
networkPassphrase?: string;
|
|
389
|
-
serverURL?: string;
|
|
390
|
-
}
|
|
391
|
-
interface Asset {
|
|
392
|
-
name: string;
|
|
393
|
-
decimals: number;
|
|
394
|
-
address?: Address$1 | string;
|
|
395
|
-
coingeckoId?: string;
|
|
396
|
-
supportsStargate?: boolean;
|
|
397
|
-
}
|
|
398
|
-
interface ChainConfig {
|
|
399
|
-
assets: Asset[];
|
|
400
|
-
evm?: EvmInformation;
|
|
401
|
-
nonEvm?: NonEvmInformation;
|
|
402
|
-
crossChainInformation: CrossChainInformation;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
443
|
declare const STELLAR: ChainConfig;
|
|
406
444
|
|
|
407
445
|
interface FacilitatorPaymentPayload {
|
|
@@ -430,6 +468,8 @@ interface SettleResponse {
|
|
|
430
468
|
attestation: string;
|
|
431
469
|
};
|
|
432
470
|
data?: any;
|
|
471
|
+
estimatedReceived?: string;
|
|
472
|
+
minAmount?: string;
|
|
433
473
|
}
|
|
434
474
|
interface BridgeContext {
|
|
435
475
|
paymentPayload?: FacilitatorPaymentPayload;
|
|
@@ -443,6 +483,7 @@ interface BridgeContext {
|
|
|
443
483
|
facilitatorPrivateKey?: string;
|
|
444
484
|
feeRecipient?: string;
|
|
445
485
|
depositTxHash?: string;
|
|
486
|
+
sourceAA?: AccountAbstraction;
|
|
446
487
|
}
|
|
447
488
|
interface BridgeStrategy {
|
|
448
489
|
name: string;
|
|
@@ -452,8 +493,15 @@ interface BridgeStrategy {
|
|
|
452
493
|
|
|
453
494
|
declare class TransferManager {
|
|
454
495
|
private strategies;
|
|
496
|
+
private router;
|
|
455
497
|
constructor();
|
|
456
|
-
execute(context: BridgeContext): Promise<SettleResponse>;
|
|
498
|
+
execute(context: BridgeContext, logCallback?: (msg: string) => void): Promise<SettleResponse>;
|
|
499
|
+
/**
|
|
500
|
+
* Specialized method for Base/Unichain -> Stacks flow.
|
|
501
|
+
* 1. EVM (Base/Unichain) -> Ethereum (CCTP)
|
|
502
|
+
* 2. Ethereum -> Stacks (Stacks Bridge)
|
|
503
|
+
*/
|
|
504
|
+
executeEVMToStacks(context: BridgeContext, sourceAA: AccountAbstraction, ethPrivateKey: string, logCallback?: (msg: string) => void): Promise<SettleResponse>;
|
|
457
505
|
}
|
|
458
506
|
|
|
459
507
|
declare class NearStrategy implements BridgeStrategy {
|
|
@@ -461,6 +509,14 @@ declare class NearStrategy implements BridgeStrategy {
|
|
|
461
509
|
canHandle(context: BridgeContext): boolean;
|
|
462
510
|
execute(context: BridgeContext): Promise<SettleResponse>;
|
|
463
511
|
}
|
|
512
|
+
declare function getNearQuote(sourceChain: ChainKey, destChain: ChainKey, amount: string, destToken?: string, sourceToken?: string, recipient?: string, senderAddress?: string, options?: {
|
|
513
|
+
dry?: boolean;
|
|
514
|
+
}): Promise<{
|
|
515
|
+
quote: _defuse_protocol_one_click_sdk_typescript.QuoteResponse;
|
|
516
|
+
depositAddress: string;
|
|
517
|
+
amountAtomicTotal: bigint;
|
|
518
|
+
amountAtomicNet: string;
|
|
519
|
+
}>;
|
|
464
520
|
declare function getNearSimulation(sourceChain: ChainKey, destChain: ChainKey, amount: string, destToken?: string, sourceToken?: string): Promise<{
|
|
465
521
|
success: boolean;
|
|
466
522
|
amountSent: number;
|
|
@@ -526,4 +582,22 @@ declare class UniswapService {
|
|
|
526
582
|
}
|
|
527
583
|
declare const uniswapService: UniswapService;
|
|
528
584
|
|
|
529
|
-
|
|
585
|
+
interface MultiHopStep {
|
|
586
|
+
aa: AccountAbstraction;
|
|
587
|
+
buildUserOp: () => Promise<UserOperation>;
|
|
588
|
+
waitCondition?: () => Promise<boolean>;
|
|
589
|
+
description: string;
|
|
590
|
+
}
|
|
591
|
+
declare class RouterService {
|
|
592
|
+
/**
|
|
593
|
+
* Orchestrates a Multi-Hop transfer by signing ALL UserOps upfront (Reverse Order),
|
|
594
|
+
* and then executing them sequentially (Forward Order) with polling support.
|
|
595
|
+
*
|
|
596
|
+
* @param steps Array of MultiHopStep ordered by execution (Source -> Intermediate -> Dest)
|
|
597
|
+
* @param onLog Optional callback for logging progress
|
|
598
|
+
*/
|
|
599
|
+
executeMultiHop(steps: MultiHopStep[], onLog?: (msg: string) => void): Promise<boolean>;
|
|
600
|
+
private pollCondition;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export { ARBITRUM_MAINNET, AVALANCHE, AVALANCHE_MAINNET, AccountAbstraction, type ApprovalSupportResult, BASE, BASE_MAINNET, BASE_SEPOLIA, BSC_MAINNET, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, MONAD_MAINNET, NearStrategy, OPTIMISM, OPTIMISM_MAINNET, POLYGON_MAINNET, RouterService, STACKS_MAINNET, STELLAR, STELLAR_MAINNET, StargateStrategy, StellarService, type Token, TransferManager, UNICHAIN, UNICHAIN_MAINNET, UniswapService, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, getNearQuote, getNearSimulation, getStargateSimulation, smartAccountAbi, uniswapService };
|