@swapkit/toolboxes 6.4.0 → 6.4.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/CHANGELOG.md +10 -0
- package/dist/chunk-1shb645r.js +1 -0
- package/dist/{chunk-exyqap7m.js → chunk-pz8xe0qj.js} +1 -1
- package/dist/{chunk-xdkdc1f0.js → chunk-qk8kg62t.js} +1 -1
- package/dist/chunk-vdabez6b.js +2 -0
- package/dist/src/aleo/index.js +1 -1
- package/dist/src/aptos/index.js +1 -1
- package/dist/src/cardano/index.js +1 -1
- package/dist/src/cosmos/index.js +1 -1
- package/dist/src/evm/index.js +1 -1
- package/dist/src/hypercore/index.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/lightspark/index.js +1 -1
- package/dist/src/near/index.js +1 -1
- package/dist/src/radix/index.js +1 -1
- package/dist/src/ripple/index.js +1 -1
- package/dist/src/solana/index.js +1 -1
- package/dist/src/starknet/index.js +1 -1
- package/dist/src/stellar/index.js +1 -1
- package/dist/src/substrate/index.js +1 -1
- package/dist/src/sui/index.js +1 -1
- package/dist/src/ton/index.js +1 -1
- package/dist/src/tron/index.js +1 -1
- package/dist/src/utxo/index.js +1 -1
- package/dist/types/evm/helpers.d.ts +4 -0
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +1 -1
- package/dist/types/evm/toolbox/evm.d.ts +24 -24
- package/dist/types/evm/toolbox/op.d.ts +2 -2
- package/dist/types/hypercore/payin.d.ts +0 -1
- package/dist/types/sui/__tests__/grpcClientMock.d.ts +37 -0
- package/package.json +2 -2
- package/dist/chunk-ncc6qmj6.js +0 -1
- package/dist/chunk-ygq25ce3.js +0 -2
|
@@ -172,7 +172,7 @@ export declare function ETHToolbox(params: EVMToolboxParams): {
|
|
|
172
172
|
chainId?: bigint;
|
|
173
173
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
174
174
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
175
|
-
signTypedData: ((
|
|
175
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
176
176
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
177
177
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
178
178
|
};
|
|
@@ -344,7 +344,7 @@ export declare const ADIToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
344
344
|
chainId?: bigint;
|
|
345
345
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
346
346
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
347
|
-
signTypedData: ((
|
|
347
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
348
348
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
349
349
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
350
350
|
};
|
|
@@ -516,7 +516,7 @@ export declare const ARBToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
516
516
|
chainId?: bigint;
|
|
517
517
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
518
518
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
519
|
-
signTypedData: ((
|
|
519
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
520
520
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
521
521
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
522
522
|
};
|
|
@@ -688,7 +688,7 @@ export declare const ARCToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
688
688
|
chainId?: bigint;
|
|
689
689
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
690
690
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
691
|
-
signTypedData: ((
|
|
691
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
692
692
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
693
693
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
694
694
|
};
|
|
@@ -860,7 +860,7 @@ export declare const AURORAToolbox: ({ provider, ...toolboxParams }: EVMToolboxP
|
|
|
860
860
|
chainId?: bigint;
|
|
861
861
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
862
862
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
863
|
-
signTypedData: ((
|
|
863
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
864
864
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
865
865
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
866
866
|
};
|
|
@@ -1032,7 +1032,7 @@ export declare const AVAXToolbox: ({ provider, ...toolboxParams }: EVMToolboxPar
|
|
|
1032
1032
|
chainId?: bigint;
|
|
1033
1033
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1034
1034
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1035
|
-
signTypedData: ((
|
|
1035
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1036
1036
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1037
1037
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1038
1038
|
};
|
|
@@ -1210,7 +1210,7 @@ export declare const BASEToolbox: ({ provider, ...toolboxSignerParams }: EVMTool
|
|
|
1210
1210
|
chainId?: bigint;
|
|
1211
1211
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1212
1212
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1213
|
-
signTypedData: ((
|
|
1213
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1214
1214
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1215
1215
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1216
1216
|
};
|
|
@@ -1382,7 +1382,7 @@ export declare const BERAToolbox: ({ provider, ...toolboxParams }: EVMToolboxPar
|
|
|
1382
1382
|
chainId?: bigint;
|
|
1383
1383
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1384
1384
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1385
|
-
signTypedData: ((
|
|
1385
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1386
1386
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1387
1387
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1388
1388
|
};
|
|
@@ -1554,7 +1554,7 @@ export declare const BSCToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
1554
1554
|
chainId?: bigint;
|
|
1555
1555
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1556
1556
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1557
|
-
signTypedData: ((
|
|
1557
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1558
1558
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1559
1559
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1560
1560
|
};
|
|
@@ -1726,7 +1726,7 @@ export declare const BotanixToolbox: ({ provider, ...toolboxParams }: EVMToolbox
|
|
|
1726
1726
|
chainId?: bigint;
|
|
1727
1727
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1728
1728
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1729
|
-
signTypedData: ((
|
|
1729
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1730
1730
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1731
1731
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1732
1732
|
};
|
|
@@ -1898,7 +1898,7 @@ export declare const COREToolbox: ({ provider, ...toolboxParams }: EVMToolboxPar
|
|
|
1898
1898
|
chainId?: bigint;
|
|
1899
1899
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
1900
1900
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
1901
|
-
signTypedData: ((
|
|
1901
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
1902
1902
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
1903
1903
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
1904
1904
|
};
|
|
@@ -2070,7 +2070,7 @@ export declare const CORNToolbox: ({ provider, ...toolboxParams }: EVMToolboxPar
|
|
|
2070
2070
|
chainId?: bigint;
|
|
2071
2071
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2072
2072
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2073
|
-
signTypedData: ((
|
|
2073
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2074
2074
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2075
2075
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2076
2076
|
};
|
|
@@ -2242,7 +2242,7 @@ export declare const CROToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
2242
2242
|
chainId?: bigint;
|
|
2243
2243
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2244
2244
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2245
|
-
signTypedData: ((
|
|
2245
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2246
2246
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2247
2247
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2248
2248
|
};
|
|
@@ -2414,7 +2414,7 @@ export declare const GNOToolbox: ({ provider, ...toolboxParams }: EVMToolboxPara
|
|
|
2414
2414
|
chainId?: bigint;
|
|
2415
2415
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2416
2416
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2417
|
-
signTypedData: ((
|
|
2417
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2418
2418
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2419
2419
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2420
2420
|
};
|
|
@@ -2586,7 +2586,7 @@ export declare const HOODToolbox: ({ provider, ...toolboxParams }: EVMToolboxPar
|
|
|
2586
2586
|
chainId?: bigint;
|
|
2587
2587
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2588
2588
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2589
|
-
signTypedData: ((
|
|
2589
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2590
2590
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2591
2591
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2592
2592
|
};
|
|
@@ -2758,7 +2758,7 @@ export declare const HYPEREVMToolbox: ({ provider, ...toolboxParams }: EVMToolbo
|
|
|
2758
2758
|
chainId?: bigint;
|
|
2759
2759
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2760
2760
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2761
|
-
signTypedData: ((
|
|
2761
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2762
2762
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2763
2763
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2764
2764
|
};
|
|
@@ -2930,7 +2930,7 @@ export declare const LINEAToolbox: ({ provider, ...toolboxParams }: EVMToolboxPa
|
|
|
2930
2930
|
chainId?: bigint;
|
|
2931
2931
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
2932
2932
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
2933
|
-
signTypedData: ((
|
|
2933
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
2934
2934
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
2935
2935
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
2936
2936
|
};
|
|
@@ -3102,7 +3102,7 @@ export declare const MATICToolbox: ({ provider, ...toolboxParams }: EVMToolboxPa
|
|
|
3102
3102
|
chainId?: bigint;
|
|
3103
3103
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3104
3104
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3105
|
-
signTypedData: ((
|
|
3105
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3106
3106
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3107
3107
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3108
3108
|
};
|
|
@@ -3274,7 +3274,7 @@ export declare const MEGAETHToolbox: ({ provider, ...toolboxParams }: EVMToolbox
|
|
|
3274
3274
|
chainId?: bigint;
|
|
3275
3275
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3276
3276
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3277
|
-
signTypedData: ((
|
|
3277
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3278
3278
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3279
3279
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3280
3280
|
};
|
|
@@ -3446,7 +3446,7 @@ export declare const MONADToolbox: ({ provider, ...toolboxParams }: EVMToolboxPa
|
|
|
3446
3446
|
chainId?: bigint;
|
|
3447
3447
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3448
3448
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3449
|
-
signTypedData: ((
|
|
3449
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3450
3450
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3451
3451
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3452
3452
|
};
|
|
@@ -3618,7 +3618,7 @@ export declare const PLASMAToolbox: ({ provider, ...toolboxParams }: EVMToolboxP
|
|
|
3618
3618
|
chainId?: bigint;
|
|
3619
3619
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3620
3620
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3621
|
-
signTypedData: ((
|
|
3621
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3622
3622
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3623
3623
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3624
3624
|
};
|
|
@@ -3790,7 +3790,7 @@ export declare const SONICToolbox: ({ provider, ...toolboxParams }: EVMToolboxPa
|
|
|
3790
3790
|
chainId?: bigint;
|
|
3791
3791
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3792
3792
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3793
|
-
signTypedData: ((
|
|
3793
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3794
3794
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3795
3795
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3796
3796
|
};
|
|
@@ -3968,7 +3968,7 @@ export declare const UNIToolbox: ({ provider, ...toolboxSignerParams }: EVMToolb
|
|
|
3968
3968
|
chainId?: bigint;
|
|
3969
3969
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
3970
3970
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
3971
|
-
signTypedData: ((
|
|
3971
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
3972
3972
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
3973
3973
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
3974
3974
|
};
|
|
@@ -4140,7 +4140,7 @@ export declare const XLayerToolbox: ({ provider, ...toolboxParams }: EVMToolboxP
|
|
|
4140
4140
|
chainId?: bigint;
|
|
4141
4141
|
}) => Promise<import("ethers").Authorization>) | undefined;
|
|
4142
4142
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
4143
|
-
signTypedData: ((
|
|
4143
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
4144
4144
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
4145
4145
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
4146
4146
|
};
|
|
@@ -184,7 +184,7 @@ export declare function createOPStackToolbox(chain: Chain.Optimism | Chain.Base
|
|
|
184
184
|
chainId?: bigint;
|
|
185
185
|
}) => Promise<Authorization>) | undefined;
|
|
186
186
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
187
|
-
signTypedData: ((
|
|
187
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
188
188
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
189
189
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
190
190
|
};
|
|
@@ -362,7 +362,7 @@ export declare const OPToolbox: ({ provider, ...toolboxSignerParams }: EVMToolbo
|
|
|
362
362
|
chainId?: bigint;
|
|
363
363
|
}) => Promise<Authorization>) | undefined;
|
|
364
364
|
signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
|
|
365
|
-
signTypedData: ((
|
|
365
|
+
signTypedData: ((params: import("..").SignTypedDataParams) => Promise<string>) | undefined;
|
|
366
366
|
transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: import("..").EVMTransferParams) => Promise<string>;
|
|
367
367
|
validateAddress: typeof import("./baseEVMToolbox").validateEVMAddress;
|
|
368
368
|
};
|
|
@@ -12,5 +12,4 @@ interface AssertSendAssetPayloadParams {
|
|
|
12
12
|
submitTo: string;
|
|
13
13
|
typedData: HyperCoreTypedData;
|
|
14
14
|
}
|
|
15
|
-
export declare function sanitizeTypedDataForSigner<TTypedData extends HyperCoreTypedData>(typedData: TTypedData): TTypedData;
|
|
16
15
|
export declare function assertSendAssetPayload({ action, allowedEndpoints, expectedAmount, expectedDestination, expectedFromSubAccount, expectedSourceDex, expectedToken, submitTo, typedData, }: AssertSendAssetPayloadParams): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SUI_COIN_TYPE = "0x2::sui::SUI";
|
|
2
|
+
export declare const LONG_SUI_COIN_TYPE = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
3
|
+
type MockCoin = {
|
|
4
|
+
balance: string;
|
|
5
|
+
digest: string;
|
|
6
|
+
objectId: string;
|
|
7
|
+
version: string;
|
|
8
|
+
};
|
|
9
|
+
type MockStatus = {
|
|
10
|
+
success: true;
|
|
11
|
+
error: null;
|
|
12
|
+
} | {
|
|
13
|
+
success: false;
|
|
14
|
+
error: {
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const suiRpc: {
|
|
19
|
+
balances: {
|
|
20
|
+
balance: string;
|
|
21
|
+
coinType: string;
|
|
22
|
+
}[];
|
|
23
|
+
calls: {
|
|
24
|
+
method: string;
|
|
25
|
+
params: unknown;
|
|
26
|
+
}[];
|
|
27
|
+
clientUrls: string[];
|
|
28
|
+
coinPages: Record<string, MockCoin[][]>;
|
|
29
|
+
count(method: string): number;
|
|
30
|
+
danglingNextPage: boolean;
|
|
31
|
+
error: Error | undefined;
|
|
32
|
+
reset(): void;
|
|
33
|
+
simulateStatus: MockStatus;
|
|
34
|
+
};
|
|
35
|
+
export declare function mockSuiGrpc(): void;
|
|
36
|
+
export declare function restoreSuiGrpc(): void;
|
|
37
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"dependencies": { "@swapkit/helpers": "6.
|
|
2
|
+
"dependencies": { "@swapkit/helpers": "6.3.0", "@swapkit/utxo-signer": "3.1.1" },
|
|
3
3
|
"description": "SwapKit - Toolboxes",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@aptos-labs/ts-sdk": "7.0.1",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"type-check:go": "tsgo"
|
|
136
136
|
},
|
|
137
137
|
"type": "module",
|
|
138
|
-
"version": "6.4.
|
|
138
|
+
"version": "6.4.1"
|
|
139
139
|
}
|
package/dist/chunk-ncc6qmj6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as N,A as m,B as n,C as o,D as p,E as q,F as r,G as s,H as t,I as u,J as v,K as w,L as x,M as y,N as z,O as A,P as B,Q as C,R as D,S as E,T as F,U as G,V as H,W as I,X as J,Y as K,Z as L,_ as M,aa as O,ba as P,ca as Q,da as R,ea as S,fa as T,ga as U,o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-ygq25ce3.js";import"./chunk-xdkdc1f0.js";import"./chunk-exyqap7m.js";export{w as ADIToolbox,x as ARBToolbox,y as ARCToolbox,z as AURORAToolbox,A as AVAXToolbox,B as BASEToolbox,C as BERAToolbox,D as BSCToolbox,b as BaseEVMToolbox,E as BotanixToolbox,F as COREToolbox,G as CORNToolbox,H as CROToolbox,k as ContractAddress,v as ETHToolbox,I as GNOToolbox,J as HOODToolbox,K as HYPEREVMToolbox,L as LINEAToolbox,M as MATICToolbox,a as MAX_APPROVAL,N as MEGAETHToolbox,O as MONADToolbox,u as OPToolbox,P as PLASMAToolbox,Q as SONICToolbox,R as UNIToolbox,S as XLayerToolbox,e as createContract,t as createOPStackToolbox,j as getChecksumAddressFromAsset,f as getCreateContract,m as getCreateContractTxObject,i as getEIP1193SendTransaction,q as getEVMTxType,n as getEstimateGasPrices,T as getEvmToolbox,U as getEvmToolboxAsync,l as getTokenAddress,d as isBrowserProvider,p as isEIP1559Transaction,o as isEIP7702Transaction,g as isStateChangingCall,r as maxBigInt,s as scaleEIP1559Fees,h as toChecksumAddress,c as validateEVMAddress};
|
package/dist/chunk-ygq25ce3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ia as Ie}from"./chunk-xdkdc1f0.js";import{ja as ye}from"./chunk-exyqap7m.js";import{Chain as x}from"@swapkit/helpers";import{match as Bn}from"ts-pattern";import{Chain as g,getChainConfig as J,getRPCUrl as Et,SKConfig as _t,SwapKitError as j}from"@swapkit/helpers";import{FallbackProvider as Ct,getAddress as _e,Interface as Ft,JsonRpcProvider as se,Network as At}from"ethers";import{match as Ce}from"ts-pattern";function Mt(e){return new se(e)}async function Rn(e,t){return Mt(t||await Et(e))}function Fe(e){let t=_t.get("rpcUrls")[e]?.filter(Boolean)??[];if(t.length===0)throw new j("helpers_chain_no_public_or_set_rpc_url",{chain:e});let{chainId:n}=J(e),o=At.from(Number(n)),[a]=t;if(t.length===1)return new se(a,o,{staticNetwork:o});return new Ct(t.map((r,i)=>({priority:i+1,provider:new se(r,o,{staticNetwork:o}),stallTimeout:2000})),o,{quorum:1})}function B(e){return e>0n?`0x${e.toString(16)}`:"0x0"}function Ae(e){let{explorerUrl:t,chainIdHex:n,rpcUrls:o}=J(e);return function(){return e!==g.Ethereum?{...Gt({chain:e}),blockExplorerUrls:[t],chainId:n,rpcUrls:o}:void 0}}function Me(e){return![g.Adi,g.Arbitrum,g.BinanceSmartChain,g.Robinhood].includes(e)}function Gt({chain:e}){let{name:t,nativeCurrency:n,baseDecimal:o}=J(e);return Ce(e).with(g.Arbitrum,()=>({chainName:"Arbitrum One",nativeCurrency:{decimals:o,name:"Ethereum",symbol:g.Ethereum}})).with(g.Aurora,()=>({chainName:"Aurora Mainnet",nativeCurrency:{decimals:o,name:"Ethereum",symbol:g.Ethereum}})).with(g.Avalanche,()=>({chainName:"Avalanche Network",nativeCurrency:{decimals:o,name:"Avalanche",symbol:e}})).with(g.Base,()=>({chainName:"Base Mainnet",nativeCurrency:{decimals:o,name:"Ethereum",symbol:g.Ethereum}})).with(g.Berachain,()=>({chainName:"Berachain",nativeCurrency:{decimals:o,name:"Berachain",symbol:"BERA"}})).with(g.XLayer,()=>({chainName:"X Layer",nativeCurrency:{decimals:o,name:"OKB",symbol:"OKB"}})).with(g.BinanceSmartChain,()=>({chainName:"BNB Smart Chain Mainnet",nativeCurrency:{decimals:o,name:"Binance Coin",symbol:"BNB"}})).with(g.Gnosis,()=>({chainName:"Gnosis",nativeCurrency:{decimals:o,name:"xDAI",symbol:"XDAI"}})).with(g.Optimism,()=>({chainName:"OP Mainnet",nativeCurrency:{decimals:o,name:"Ethereum",symbol:g.Ethereum}})).with(g.Polygon,()=>({chainName:"Polygon Mainnet",nativeCurrency:{decimals:o,name:"Polygon",symbol:g.Polygon}})).with(g.Robinhood,()=>({chainName:"Robinhood Chain",nativeCurrency:{decimals:o,name:"Ethereum",symbol:g.Ethereum}})).otherwise(()=>({chainName:t,nativeCurrency:{decimals:o,name:n,symbol:n}}))}async function Ge(e,t){if(!("authorize"in e))throw Error("Signer does not support EIP-7702 authorization. Requires ethers.js v6.14+");let n={...t,nonce:t.nonce!==void 0?BigInt(t.nonce):void 0};return await e.authorize(n)}var Ee=(e)=>typeof e==="string"&&/^0x[a-fA-F0-9]{64}$/.test(e),Bt=(e)=>{try{return typeof e==="string"&&!!_e(e)}catch{return!1}};function Ot(e,t){let n=t!==void 0?`index ${t}: `:"",o=(a,r)=>{throw new j({errorKey:"toolbox_evm_invalid_eip7702_authorization",info:{field:a,message:`${n}${r}`}})};Ce(e).when(({chainId:a})=>typeof a!=="bigint",()=>o("chainId","chainId must be a bigint")).when(({address:a})=>!Bt(a),()=>o("address","address must be a valid checksummed address")).when(({nonce:a})=>typeof a!=="bigint"||a<0n,()=>o("nonce","nonce must be a non-negative bigint")).when(({signature:a})=>!a,()=>o("signature","signature is required")).when(({signature:a})=>typeof a?.yParity!=="number"||![0,1].includes(a.yParity),()=>o("signature.yParity","yParity must be 0 or 1")).when(({signature:a})=>!Ee(a?.r),()=>o("signature.r","r must be a 32-byte hex string")).when(({signature:a})=>!Ee(a?.s),()=>o("signature.s","s must be a 32-byte hex string")).otherwise(()=>{})}function It(e){return[{key:"name",type:"string"},{key:"version",type:"string"},{key:"chainId",type:"uint256"},{key:"verifyingContract",type:"address"},{key:"salt",type:"bytes32"}].filter(({key:t})=>e[t]!=null).map(({key:t,type:n})=>({name:t,type:n}))}function ce(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ue(e,t){if(e.isTuple()&&e.components){let n=ce(e.name);return t[n]=e.components.map((o)=>({name:o.name,type:ue(o,t)})),n}if(e.isArray()){let n=e.arrayChildren;if(n?.isTuple()&&n.components){let o=ce(e.name.replace(/s$/,""));return t[o]=n.components.map((a)=>({name:a.name,type:ue(a,t)})),`${o}[]`}return`${n?.type??"bytes"}[]`}return e.type}function le(e,t){if(typeof e==="bigint")return e;if(t?.isTuple()&&typeof e?.toObject==="function"){let n=e.toObject(),o={};for(let[a,r]of(t.components??[]).entries())o[r.name]=le(n[r.name]??e[a],r);return o}if(Array.isArray(e)){let n=t?.arrayChildren;return e.map((o)=>le(o,n??void 0))}return e}function Nn({chain:e,abi:t,data:n,to:o}){let r=new Ft(t).parseTransaction({data:n});if(!r)throw new j({errorKey:"toolbox_evm_invalid_params",info:{error:"Could not decode calldata"}});let i={},s=ce(r.name);i[s]=r.fragment.inputs.map((p)=>({name:p.name,type:ue(p,i)}));let c={};for(let[p,y]of r.fragment.inputs.entries())c[y.name]=le(r.args[p],y);let{chainId:l}=J(e),u={chainId:Number(l),verifyingContract:_e(o)},b=It(u);return{domain:u,message:c,primaryType:s,types:{EIP712Domain:b,...i}}}function Be(e,t){if(!Array.isArray(e)||e.length===0)throw new j({errorKey:"toolbox_evm_invalid_eip7702_authorization",info:{message:"EIP-7702 transactions require at least one authorization"}});for(let[n,o]of e.entries())if(Ot(o,n),t!==void 0&&o.chainId!==t)throw new j({errorKey:"toolbox_evm_invalid_eip7702_authorization",info:{field:"chainId",message:`index ${n}: authorization chainId (${o.chainId}) does not match transaction chainId (${t})`}})}import{Chain as T,derivationPathToString as _n,FeeOption as Cn,resolveDerivationPath as Fn}from"@swapkit/helpers";import{HDNodeWallet as An}from"ethers";import{match as Mn,P as tt}from"ts-pattern";var Oe=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"}];import{AssetValue as Vt,applyFeeMultiplierToBigInt as M,Chain as O,EVMChains as St,FeeOption as d,isGasAsset as Rt,SwapKitError as m,SwapKitNumber as Q}from"@swapkit/helpers";import{erc20ABI as z}from"@swapkit/helpers/contracts";import{BrowserProvider as Nt,Contract as Re,getAddress as ee,getBytes as kt,Interface as Ne,isError as U,resolveAddress as Lt,Transaction as pe}from"ethers";import{match as ke}from"ts-pattern";function Y(e){return{getBalance:Ie(e)}}function Un(e){return e}var be=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function te({chain:e=O.Ethereum,provider:t,signer:n,isEIP1559Compatible:o=!0,estimateGasPrices:a,estimateAdditionalFee:r}){let i=a??X({chain:e,isEIP1559Compatible:o,provider:t}),s=We({chain:e,estimateAdditionalFee:r,estimateGasPrices:i,isEIP1559Compatible:o,provider:t,signer:n});return{approve:Zt({chain:e,isEIP1559Compatible:o,provider:t,signer:n}),approvedAmount:ze({chain:e,provider:t}),broadcastTransaction:(c)=>t.broadcastTransaction(c),call:ae({chain:e,isEIP1559Compatible:o,provider:t,signer:n}),createApprovalTx:pn({chain:e,provider:t,signer:n}),createContract:Ut({chain:e,provider:t}),createContractTxObject:W({chain:e,provider:t}),createTransaction:s,createTransferTx:s,EIP1193SendTransaction:oe(t),estimateCall:Ke({provider:t,signer:n}),estimateGasLimit:tn({chain:e,provider:t,signer:n}),estimateGasPrices:i,estimateTransactionFee:fn({chain:e,isEIP1559Compatible:o,provider:t}),getAddress:()=>n?n.getAddress():void 0,getBalance:Y(e).getBalance,getNetworkParams:Ae(e),isApproved:Qt({chain:e,provider:t}),sendTransaction:je({chain:e,estimateGasPrices:i,isEIP1559Compatible:o,provider:t,signer:n}),signAuthorization:nn({signer:n}),signMessage:n?(c)=>n.signMessage(c):void 0,signTypedData:n?({domain:c,types:l,value:u})=>n.signTypedData(c,l,u):void 0,transfer:en({chain:e,estimateAdditionalFee:r,estimateGasPrices:i,isEIP1559Compatible:o,provider:t,signer:n}),validateAddress:Dt}}function Dt(e){try{return ee(e),!0}catch{return!1}}function ne(e){return e instanceof Nt}function ge(e,t,n){return new Re(e,Ne.from(t),n)}function Ut({provider:e}){return function(n,o){return new Re(n,Ne.from(o),e)}}var Ht=["payable","nonpayable"];function zt({abi:e,funcName:t}){let n=e.find((o)=>o.name===t);if(!n)throw new m("toolbox_evm_no_abi_fragment",{funcName:t});return n.stateMutability&&Ht.includes(n.stateMutability)}function $n(e){return ee(e)}var Kt=30000,Ve=new WeakMap,Se=()=>{};function qt(e,t,n){let o=Date.now();for(let[r,i]of e)if(i.held===0&&o-i.at>Kt)e.delete(r);let a=e.get(t);if(!a||n>=a.next){let r={at:o,held:1,next:n+1,released:new Set};return e.set(t,r),{floor:r,nonce:n}}a.held+=1;for(let r of[...a.released].sort((i,s)=>i-s))if(a.released.delete(r),r>=n)return{floor:a,nonce:r};return{floor:a,nonce:a.next++}}async function Le({address:e,nonce:t,provider:n}){if(t!==void 0&&t!==null)return{nonce:t,release:Se,settle:Se};let{chainId:o}=await n.getNetwork(),a=Ve.get(n)??new Map;Ve.set(n,a);let r=`${o}:${e.toLowerCase()}`,i=await n.getTransactionCount(e,"pending"),{floor:s,nonce:c}=qt(a,r,i),l=!1,u=(b)=>{if(l)return;if(l=!0,s.held-=1,s.at=Date.now(),b)s.released.add(c)};return{nonce:c,release:()=>u(!0),settle:()=>u(!1)}}function Z(e,t=0){if(!e||t>3)return"";if(typeof e==="string")return e.toLowerCase();if(typeof e!=="object")return"";let{error:n,info:o,message:a,shortMessage:r}=e;return[(typeof r==="string"?r:typeof a==="string"?a:"").toLowerCase(),Z(n,t+1),Z(o?.error,t+1)].filter(Boolean).join(" ")}function fe(e){if(U(e,"NONCE_EXPIRED")||U(e,"REPLACEMENT_UNDERPRICED"))return!0;let t=Z(e);return/nonce (?:is )?too low/.test(t)||t.includes("replacement transaction underpriced")}function de(e){let t=Z(e);return t.includes("already known")||t.includes("known transaction")||t.includes("already imported")}function De(e){return U(e,"NETWORK_ERROR")||U(e,"SERVER_ERROR")||U(e,"TIMEOUT")}function jt(e){return De(e)||U(e,"UNSUPPORTED_OPERATION")}function Ue(e){return De(e)||de(e)}function He(e,t){return e.getTransaction(t).then((n)=>n!==null,()=>!1)}async function Wt({provider:e,signer:t,txObject:n}){try{let o=pe.from(await t.signTransaction(n)).hash;return o&&await He(e,o)?o:null}catch{return null}}function oe(e,t=!1){return function({value:o,...a}){if(!ne(e))throw new m("toolbox_evm_provider_not_eip1193_compatible");let r={...a,gasPrice:"gasPrice"in a?a.gasPrice:void 0,maxFeePerGas:"maxFeePerGas"in a?a.maxFeePerGas:void 0,maxPriorityFeePerGas:"maxPriorityFeePerGas"in a?a.maxPriorityFeePerGas:void 0},{gasLimit:i,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:l,...u}=r,b={...u,...t&&i!==void 0&&{gas:B(BigInt(i))},...t&&s!==void 0&&{gasPrice:B(BigInt(s))},...t&&c!==void 0&&{maxFeePerGas:B(BigInt(c))},...t&&l!==void 0&&{maxPriorityFeePerGas:B(BigInt(l))},value:B(BigInt(o||0))};return e.send("eth_sendTransaction",[b])}}function Jn(e,t){let n=xe(e,t);if(n)return ee(n.toLowerCase());throw new m("toolbox_evm_invalid_gas_asset_address")}var Xt=St.reduce((e,t)=>(e[t]="0x0000000000000000000000000000000000000000",e),{}),$t={...Xt,[O.Optimism]:"0x4200000000000000000000000000000000000042",[O.Polygon]:"0x0000000000000000000000000000000000001010"},Jt=[O.Arbitrum,O.Aurora,O.Base,O.Optimism,O.Robinhood];function xe({chain:e,symbol:t,ticker:n},o){try{let a=e===O.BinanceSmartChain&&t==="BNB"&&n==="BNB",r=e===O.Hyperevm&&t==="HYPE"&&n==="HYPE",i=e===o&&t===o&&n===o,s=Jt.includes(e)&&t==="ETH"&&n==="ETH",c=e===O.Arc&&t==="USDC"&&n==="USDC";if(i||a||r||s||c)return $t[o];return ee(t.slice(n.length+1).replace(/^0X/,""))}catch{return null}}function W({provider:e}){return async({contractAddress:t,abi:n,funcName:o,funcParams:a=[],txOverrides:r})=>{let i=await ge(t,n,e).getFunction(o).populateTransaction(...a.concat(r).filter((s)=>typeof s<"u"));return{...i,value:B(BigInt(i.value||0))}}}function X({chain:e,provider:t,isEIP1559Compatible:n=!0}){return ke(e).with(O.Gnosis,()=>async function(){try{let{gasPrice:a,maxPriorityFeePerGas:r}=await t.getFeeData();if(!a||r===null)throw new m("toolbox_evm_no_fee_data");return{[d.Average]:{maxFeePerGas:M(a,d.Average),maxPriorityFeePerGas:M(r,d.Average)},[d.Fast]:{maxFeePerGas:M(a,d.Fast),maxPriorityFeePerGas:M(r,d.Fast)},[d.Fastest]:{maxFeePerGas:M(a,d.Fastest),maxPriorityFeePerGas:M(r,d.Fastest)}}}catch(a){throw new m("toolbox_evm_gas_estimation_error",{error:a.msg??a.toString()})}}).with(O.Arbitrum,()=>async function(){try{let{gasPrice:a}=await t.getFeeData();if(!a)throw new m("toolbox_evm_no_fee_data");let r=a*12n/10n;return{[d.Average]:{gasPrice:r},[d.Fast]:{gasPrice:M(r,d.Fast)},[d.Fastest]:{gasPrice:M(r,d.Fastest)}}}catch(a){throw new m("toolbox_evm_gas_estimation_error",{error:a.msg??a.toString()})}}).otherwise(()=>async function(){try{let{maxFeePerGas:a,maxPriorityFeePerGas:r,gasPrice:i}=await t.getFeeData();if(n){if(a===null||r===null)throw new m("toolbox_evm_no_fee_data");return{[d.Average]:{maxFeePerGas:a,maxPriorityFeePerGas:r},[d.Fast]:{maxFeePerGas:M(a,d.Fast),maxPriorityFeePerGas:M(r,d.Fast)},[d.Fastest]:{maxFeePerGas:M(a,d.Fastest),maxPriorityFeePerGas:M(r,d.Fastest)}}}if(!i)throw new m("toolbox_evm_no_gas_price");return{[d.Average]:{gasPrice:i},[d.Fast]:{gasPrice:M(i,d.Fast)},[d.Fastest]:{gasPrice:M(i,d.Fastest)}}}catch(a){throw new m("toolbox_evm_gas_estimation_error",{error:a.msg??a.toString()})}})}async function Yt({chain:e,contract:t,contractProvider:n,feeOption:o,funcName:a,funcParams:r,isEIP1559Compatible:i,provider:s,signer:c,txOverrides:l}){let u=l?.from||await c.getAddress();if(!u)throw new m("toolbox_evm_no_signer_address");let b=t.connect(c),p=X({chain:e,isEIP1559Compatible:i,provider:s}),[{maxFeePerGas:y,maxPriorityFeePerGas:f,gasPrice:P},A]=await Promise.all([p().then((_)=>_[o]),t.getFunction(a).estimateGas(...r,l)]),C=typeof u==="string"?u:await Lt(u,n),{nonce:G,release:R,settle:k}=await Le({address:C,nonce:l?.nonce,provider:c.provider??s});try{let _=await b[a](...r,{...l,gasLimit:A,gasPrice:P,maxFeePerGas:y,maxPriorityFeePerGas:f,nonce:G});return typeof _?.hash==="string"?_?.hash:_}catch(_){if(fe(_)){let E=l?.nonce!=null?"caller":"pending",w={address:C,error:_,nonce:G,nonceSource:E};throw new m({errorKey:"toolbox_evm_nonce_conflict",info:w},w)}if(!Ue(_))R();throw _}finally{k()}}function ae({provider:e,isEIP1559Compatible:t,signer:n,chain:o}){return async function({callProvider:r,contractAddress:i,abi:s,funcName:c,funcParams:l=[],txOverrides:u={},feeOption:b=d.Fast}){let p=r||e;if(!i)throw new m("toolbox_evm_invalid_params",{error:"contractAddress must be provided"});let y=zt({abi:s,funcName:c});if(y&&ne(p)&&n){let A=W({chain:o,provider:p}),C=u?.from||await n?.getAddress(),G=await A({abi:s,contractAddress:i,funcName:c,funcParams:l,txOverrides:{...u,from:C}});return oe(p)(G)}let f=ge(i,s,p);if(y){if(!n)throw new m("toolbox_evm_no_signer");return Yt({chain:o,contract:f,contractProvider:p,feeOption:b,funcName:c,funcParams:l,isEIP1559Compatible:t,provider:e,signer:n,txOverrides:u})}let P=await f[c]?.(...l);return typeof P?.hash==="string"?P?.hash:P}}function ze({provider:e,chain:t}){return function({assetAddress:o,spenderAddress:a,from:r}){return ae({chain:t,isEIP1559Compatible:!0,provider:e})({abi:z,contractAddress:o,funcName:"allowance",funcParams:[r,a]})}}function Qt({provider:e,chain:t}){return async function({assetAddress:o,spenderAddress:a,from:r,amount:i=be}){let s=await ze({chain:t,provider:e})({assetAddress:o,from:r,spenderAddress:a});return Q.fromBigInt(s).gte(Q.fromBigInt(BigInt(i)))}}function Zt({signer:e,isEIP1559Compatible:t=!0,provider:n,chain:o}){return async function({assetAddress:r,spenderAddress:i,feeOptionKey:s=d.Fast,amount:c,gasLimitFallback:l,from:u,nonce:b}){let p=[i,BigInt(c||be)],y=await e?.getAddress()||u,f={abi:z,contractAddress:r,funcName:"approve",funcParams:p,signer:e,txOverrides:{from:y}};if(ne(n)){let A=W({chain:o,provider:n}),C=oe(n),G=await A(f);return C(G)}return ae({chain:o,isEIP1559Compatible:t,provider:n,signer:e})({...f,feeOption:s,funcParams:p,txOverrides:{from:y,gasLimit:l?BigInt(l.toString()):void 0,nonce:b}})}}function en({chain:e,estimateGasPrices:t,estimateAdditionalFee:n,signer:o,isEIP1559Compatible:a=!0,provider:r}){return async function({assetValue:s,memo:c,recipient:l,feeOptionKey:u=d.Fast,sender:b,sweep:p,...y}){let f=b||await o?.getAddress(),P=je({chain:e,estimateGasPrices:t,isEIP1559Compatible:a,provider:r,signer:o});if(!f)throw new m("toolbox_evm_no_from_address");let A=await We({chain:e,estimateAdditionalFee:n,estimateGasPrices:t,isEIP1559Compatible:a,provider:r,signer:o})({assetValue:s,feeOptionKey:u,memo:c,recipient:l,sender:f,sweep:p,...y});return P({...A,feeOptionKey:u,sweep:p})}}function Ke({provider:e,signer:t}){return function({contractAddress:o,abi:a,funcName:r,funcParams:i=[],txOverrides:s}){if(!o)throw new m("toolbox_evm_no_contract_address");let c=ge(o,a,e);return t?c.connect(t).getFunction(r).estimateGas(...i,s):c.getFunction(r).estimateGas(...i,s)}}function tn({provider:e,signer:t}){return async function({assetValue:o,recipient:a,memo:r,data:i,sender:s,funcName:c,funcParams:l,txOverrides:u}){let b=o.bigIntValue,p=o.isGasAsset?null:xe(o,o.chain);if(p&&c)return Ke({provider:e,signer:t})({abi:z,contractAddress:p,funcName:c,funcParams:l,txOverrides:u});let{hexlify:y,toUtf8Bytes:f}=await import("ethers");return e.estimateGas({data:i?i:r?y(f(r)):void 0,from:s,to:a,value:b})}}function nn({signer:e}){if(!e)return;return(t)=>Ge(e,t)}var qe=(e)=>e.type===4||(e.authorizations?.length??0)>0,on=(e)=>!qe(e)&&(e.type===2||!!e.maxFeePerGas||!!e.maxPriorityFeePerGas),an=(e,t=!0)=>{if(qe(e))return"eip7702";if(on(e)||t)return"eip1559";return"legacy"};function rn(e,t){if(e==="legacy"){if(t.gasPrice===void 0)throw new m("toolbox_evm_no_fee_data");return{gasPrice:B(t.gasPrice)}}if(t.maxFeePerGas===void 0||t.maxPriorityFeePerGas===void 0)throw new m("toolbox_evm_no_fee_data");return{maxFeePerGas:B(t.maxFeePerGas),maxPriorityFeePerGas:B(t.maxPriorityFeePerGas)}}function je({chain:e,estimateGasPrices:t,provider:n,signer:o,isEIP1559Compatible:a=!0}){return async function({feeOptionKey:i=d.Fast,sweep:s,...c}){let{from:l,to:u,data:b,value:p,...y}=c;if(!o)throw new m("toolbox_evm_no_signer");if(!u)throw new m("toolbox_evm_no_to_address");let f={...y,data:b||"0x",from:l,to:u,value:BigInt(p||0)};if(ne(n))return oe(n,s)(f);let P=l||await o.getAddress(),{chainId:A}=await n.getNetwork(),C=o.provider??n,{nonce:G,release:R,settle:k}=await Le({address:P,nonce:c.nonce,provider:C}),_=async()=>{let E=an(f,a);if(E==="eip7702")Be(f.authorizations||[],A);let w=ke(E).with("eip7702",()=>4).with("eip1559",()=>2).otherwise(()=>0),V={...f,chainId:A,nonce:G,type:w,...E==="eip7702"&&{authorizationList:f.authorizations}},F=t??X({chain:e,isEIP1559Compatible:a,provider:n}),S=(E==="legacy"?f.gasPrice!==void 0:f.maxFeePerGas!==void 0&&f.maxPriorityFeePerGas!==void 0)?{}:rn(E,(await F())[i]),h;try{h=B(f.gasLimit?BigInt(f.gasLimit):await n.estimateGas(V)*11n/10n)}catch(I){throw new m("toolbox_evm_error_estimating_gas_limit",{error:I})}return{...V,gasLimit:h,...S}};try{let E=await _().catch((w)=>{throw R(),w});try{return(await o.sendTransaction(E)).hash}catch(w){let V=c.nonce!=null?"caller":"pending",F={address:P,error:w,nonce:G,nonceSource:V};if(fe(w))throw new m({errorKey:"toolbox_evm_nonce_conflict",info:F},F);if(de(w)){let h=await Wt({provider:C,signer:o,txObject:{...E,from:P}});if(h)return h;throw new m({errorKey:"toolbox_evm_tx_already_known",info:F},F)}if(!jt(w))throw R(),new m({errorKey:"toolbox_evm_error_sending_transaction",info:F},F);let L=U(w,"UNSUPPORTED_OPERATION"),S;try{S=await o.signTransaction({...E,from:P})}catch(h){if(L)R();let I={...F,fallbackError:h};throw new m({errorKey:"toolbox_evm_error_sending_transaction",info:I},I)}try{return(await C.broadcastTransaction(S)).hash}catch(h){let I={...F,fallbackError:h};if(de(h)){let H=pe.from(S).hash;if(H)return H}if(fe(h)){let H=pe.from(S).hash;if(H&&await He(C,H))return H;throw new m({errorKey:"toolbox_evm_nonce_conflict",info:I},I)}if(L&&!Ue(h))R();throw new m({errorKey:"toolbox_evm_error_sending_transaction",info:I},I)}}}finally{k()}}}function D(e,t){throw new m({errorKey:"toolbox_sweep_amount_too_low",info:{balance:e.toString(),fee:t.toString()}})}function sn(e,t){if(t){if(e.maxFeePerGas===void 0||e.maxPriorityFeePerGas===void 0)throw new m("toolbox_evm_no_fee_data");return{feeFields:{maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas},feePerGas:e.maxFeePerGas}}if(e.gasPrice===void 0)throw new m("toolbox_evm_no_fee_data");return{feeFields:{gasPrice:e.gasPrice},feePerGas:e.gasPrice}}function Pe(e,t){if(e>t)return e;return t}function cn(e){return kt(e).reduce((t,n)=>t+(n===0?4n:16n),21000n)}function me(e){let n=(e instanceof Error?e.message:String(e)).toLowerCase();return n.includes("insufficient funds")||n.includes("insufficient balance")||n.includes("gas required exceeds allowance")}async function un({balance:e,estimateAdditionalFee:t,feeOptionKey:n,l2Reserve:o,sweepTx:a,valueBeforeL1Fee:r}){if(!t)return 0n;let i=await t({...a,value:r})??0n,s=M(i,n),c=r-s;if(c<=0n)D(e,o+s);let l=await t({...a,value:c})??i;return M(Pe(i,l),n)}async function ln({chain:e,data:t,estimateGasPrices:n,estimateAdditionalFee:o,feeOptionKey:a,from:r,isEIP1559Compatible:i,provider:s,recipient:c,transaction:l}){let u=await s.getBalance(r),b=n??X({chain:e,isEIP1559Compatible:i,provider:s}),{feeFields:p,feePerGas:y}=sn((await b())[a],i),f={...l,...p,data:t,from:r,to:c},P=cn(t)*y;if(u-P<=0n)D(u,P);let A=(u-P)/2n,C;try{C=await s.estimateGas({...f,value:A})}catch(h){if(!me(h))throw h;try{C=await s.estimateGas({...f,value:0n})}catch(I){if(me(I))D(u,P);throw I}}let G=C*y;if(u-G<=0n)D(u,G);let _=C*11n/10n*y,E=u>_?u-_:0n,w;try{w=await s.estimateGas({...f,value:E})}catch(h){if(!me(h))throw h;D(u,_)}let V=w*y,F=u-V;if(F<=0n)D(u,V);let L=await un({balance:u,estimateAdditionalFee:o,feeOptionKey:a,l2Reserve:V,sweepTx:{...f,gasLimit:w},valueBeforeL1Fee:F}),S=F-L;if(S<=0n)D(u,V+L);return{...f,gasLimit:w,value:B(S)}}async function mn({chain:e,contractAddress:t,from:n,provider:o}){let a=await ae({chain:e,provider:o})({abi:z,contractAddress:t,funcName:"balanceOf",funcParams:[n]});if(typeof a!=="bigint")throw new m({errorKey:"toolbox_evm_invalid_transaction",info:{error:"Invalid ERC20 balance"}});return a}function We({chain:e,estimateAdditionalFee:t,estimateGasPrices:n,isEIP1559Compatible:o=!0,provider:a,signer:r}){return async function({assetValue:s,authorizations:c,memo:l,recipient:u,data:b,feeOptionKey:p=d.Fast,gasLimit:y,sender:f,sweep:P,type:A,maxFeePerGas:C,maxPriorityFeePerGas:G,gasPrice:R,...k}){let _=s.getBaseValue("bigint"),E=f||await r?.getAddress();if(!E)throw new m("toolbox_evm_no_from_address");if(P&&(A===4||(c?.length??0)>0))throw new m({errorKey:"toolbox_not_supported",info:{chain:e,reason:"EIP-7702 sweep transactions are not supported"}});if(Rt(s)){let{hexlify:L,toUtf8Bytes:S}=await import("ethers"),h=b||L(S(l||""));if(!P)return{...k,...c!==void 0&&{authorizations:c},data:h,from:E,...y!==void 0&&{gasLimit:y},to:u,...A!==void 0&&{type:A},value:B(_)};return ln({chain:e,data:h,estimateAdditionalFee:t,estimateGasPrices:n,feeOptionKey:p,from:E,isEIP1559Compatible:o,provider:a,recipient:u,transaction:{nonce:k.nonce,type:A}})}let w=xe(s,e);if(!w)throw new m("toolbox_evm_no_contract_address");let V=W({chain:e,provider:a}),F=P?await mn({chain:e,contractAddress:w,from:E,provider:a}):_;if(P&&F<=0n)throw new m({errorKey:"toolbox_sweep_amount_too_low",info:{asset:s.toString(),balance:F.toString()}});return V({abi:z,contractAddress:w,funcName:"transfer",funcParams:[u,F],txOverrides:{from:E,gasLimit:y,gasPrice:R,maxFeePerGas:C,maxPriorityFeePerGas:G,nonce:k.nonce}})}}function pn({provider:e,signer:t,chain:n}){return async function({assetAddress:a,spenderAddress:r,amount:i,from:s,nonce:c}){let l=await t?.getAddress()||s,u=W({chain:n,provider:e}),b=["bigint","number"].includes(typeof i)?i:i||be;return await u({abi:z,contractAddress:a,funcName:"approve",funcParams:[r,BigInt(b)],txOverrides:{from:l,nonce:c}})}}function fn({provider:e,isEIP1559Compatible:t=!0,chain:n}){return async function({feeOption:a=d.Fast,...r}){let s=await X({chain:n,isEIP1559Compatible:t,provider:e})(),c=await e.estimateGas(r),l=Vt.from({chain:n}),{gasPrice:u,maxFeePerGas:b,maxPriorityFeePerGas:p}=s[a];if(!t&&u)return l.set(Q.fromBigInt(u*c,l.decimal));if(b&&p){let y=(b+p)*c;return l.set(Q.fromBigInt(y,l.decimal))}throw new m("toolbox_evm_no_gas_price")}}import{applyFeeMultiplierToBigInt as K,Chain as Je,derivationPathToString as dn,FeeOption as N,getChainConfig as yn,resolveDerivationPath as bn,SwapKitError as q}from"@swapkit/helpers";import{Contract as gn,HDNodeWallet as xn}from"ethers";import{match as Pn,P as $e}from"ts-pattern";var Xe=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"DecimalsUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"GasPriceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"L1BaseFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"OverheadUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"ScalarUpdated",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"gasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1Fee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1GasUsed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_gasUsed",type:"uint256"}],name:"getOperatorFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1BaseFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"overhead",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"scalar",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_decimals",type:"uint256"}],name:"setDecimals",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_baseFee",type:"uint256"}],name:"setL1BaseFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_overhead",type:"uint256"}],name:"setOverhead",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_scalar",type:"uint256"}],name:"setScalar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];var Tn="0x420000000000000000000000000000000000000f";function re(e){return new gn(Tn,Xe,e)}function Ye(e){return async function(){let n=re(e);if(n&&"l1BaseFee"in n)return await n?.l1BaseFee();return}}function Qe(e){return async function({from:n,to:o,nonce:a,...r}){let{Transaction:i}=await import("ethers");if(!o)throw new q("toolbox_evm_invalid_transaction",{error:"Missing to address"});return i.from({...r,authorizationList:r.authorizationList,nonce:a??(n?await e.getTransactionCount(n,"pending"):0),to:o}).unsignedSerialized}}function we(e,t){return async function(o){let a=re(e),r=o.chainId??t??(await e.getNetwork()).chainId,i=await Qe(e)({...o,chainId:r});if(a&&"getL1Fee"in a){let s=await a.getL1Fee(i);if(typeof s!=="bigint")throw new q({errorKey:"toolbox_evm_invalid_transaction",info:{error:"Invalid OP-stack L1 fee"}});return s}return}}function he(e){return async function(n){let o=re(e);if(o&&"getOperatorFee"in o){let a=await o.getOperatorFee(n);if(typeof a!=="bigint")throw new q({errorKey:"toolbox_evm_invalid_transaction",info:{error:"Invalid OP-stack operator fee"}});return a}return 0n}}function wn(e,t){let n=we(e,t),o=he(e);return async function(r){if(r.gasLimit===void 0||r.gasLimit===null)throw new q({errorKey:"toolbox_evm_invalid_transaction",info:{error:"Missing gas limit for OP-stack fee estimation"}});let[i,s]=await Promise.all([n(r),o(BigInt(r.gasLimit.toString()))]);return(i??0n)+s}}function Ze(e){return async function(n){let a=(await e.getFeeData()).gasPrice??0n,r=await e.estimateGas(n);return a*r}}function hn(e){return async function(n){let o=await we(e)(n)??0n,a=await Ze(e)(n),r=n.gasLimit??await e.estimateGas(n),i=await he(e)(BigInt(r.toString()));return o+a+i}}function vn(e){return async function(n){let o=re(e),a=await Qe(e)(n);if(o&&"getL1GasUsed"in o)return o.getL1GasUsed(a)}}function Te({feeOption:e,maxFeePerGas:t,maxPriorityFeePerGas:n}){let o=K(t,e),a=K(n,e);return{maxFeePerGas:Pe(o,a),maxPriorityFeePerGas:a}}function En(e){return async function(){try{let{maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:a}=await e.getFeeData(),r=await Ye(e)(),i=a;if(!(n&&o))throw new q("toolbox_evm_no_fee_data");return{[N.Average]:{gasPrice:i,l1GasPrice:r,...Te({feeOption:N.Average,maxFeePerGas:n,maxPriorityFeePerGas:o})},[N.Fast]:{gasPrice:K(i,N.Fast),l1GasPrice:K(r||0n,N.Fast),...Te({feeOption:N.Fast,maxFeePerGas:n,maxPriorityFeePerGas:o})},[N.Fastest]:{gasPrice:K(i,N.Fastest),l1GasPrice:K(r||0n,N.Fastest),...Te({feeOption:N.Fastest,maxFeePerGas:n,maxPriorityFeePerGas:o})}}}catch(n){throw new q("toolbox_evm_gas_estimation_error",{error:n.msg??n.toString()})}}}function ie(e){return function({provider:n,...o}){let a=Pn(o).with({phrase:$e.string},({phrase:p,derivationPath:y,index:f=0})=>xn.fromPhrase(p,void 0,dn(bn({chain:e,derivationPath:y,index:f}))).connect(n)).with({signer:$e.any},({signer:p})=>p).otherwise(()=>{return}),r=Ye(n),i=BigInt(yn(e).chainId),s=we(n,i),c=wn(n,i),l=he(n),u=e===Je.Optimism?En(n):void 0;return{...te({chain:e,estimateAdditionalFee:c,estimateGasPrices:u,provider:n,signer:a}),estimateL1Gas:vn(n),estimateL1GasCost:s,estimateL2GasCost:Ze(n),estimateOperatorFee:l,estimateTotalGasCost:hn(n),getBalance:Y(e).getBalance,getL1GasPrice:r}}}var et=ie(Je.Optimism);function nt(e){let t=v(T.Ethereum)(e);async function n(o,a="0x5ba1e12693dc8f9c48aad8770482f4739beed696",r="aggregate",i=Cn.Fast){let s=await t.createContractTxObject({abi:Oe,contractAddress:a,funcName:r,funcParams:[o]});return t.sendTransaction({...s,feeOptionKey:i})}return{...t,multicall:n}}var ot=v(T.Adi),at=v(T.Arbitrum),rt=v(T.Arc),it=v(T.Aurora),st=v(T.Avalanche),ct=ie(T.Base),ut=v(T.Berachain),lt=v(T.BinanceSmartChain),fo=v(T.Botanix),mt=v(T.Core),pt=v(T.Corn),ft=v(T.Cronos),dt=v(T.Gnosis),yt=v(T.Robinhood),bt=v(T.Hyperevm),gt=v(T.Linea),xt=v(T.Polygon),Pt=v(T.MegaETH),Tt=v(T.Monad),wt=v(T.Plasma),ve=v(T.Sonic),ht=ie(T.Unichain),vt=v(T.XLayer);function v(e){return function({provider:n,...o}){let a=Me(e),r=Mn(o).with({phrase:tt.string},({phrase:s,derivationPath:c,index:l=0})=>An.fromPhrase(s,void 0,_n(Fn({chain:e,derivationPath:c,index:l}))).connect(n)).with({signer:tt.any},({signer:s})=>s).otherwise(()=>{return});return te({chain:e,isEIP1559Compatible:a,provider:n,signer:r})}}function On(e,t){return Bn(e).with(x.Adi,()=>ot(t)).with(x.Arbitrum,()=>at(t)).with(x.Arc,()=>rt(t)).with(x.Aurora,()=>it(t)).with(x.Avalanche,()=>st(t)).with(x.Base,()=>ct(t)).with(x.Berachain,()=>ut(t)).with(x.BinanceSmartChain,()=>lt(t)).with(x.Botanix,()=>ve(t)).with(x.Core,()=>mt(t)).with(x.Corn,()=>pt(t)).with(x.Cronos,()=>ft(t)).with(x.Ethereum,()=>nt(t)).with(x.Gnosis,()=>dt(t)).with(x.Hyperevm,()=>bt(t)).with(x.Linea,()=>gt(t)).with(x.MegaETH,()=>Pt(t)).with(x.Monad,()=>Tt(t)).with(x.Optimism,()=>et(t)).with(x.Plasma,()=>wt(t)).with(x.Polygon,()=>xt(t)).with(x.Robinhood,()=>yt(t)).with(x.Sonic,()=>ve(t)).with(x.Unichain,()=>ht(t)).with(x.XLayer,()=>vt(t)).exhaustive()}async function Po(e,t){let n={...t,provider:t?.provider||Fe(e)};return On(e,n)}
|
|
2
|
-
export{Y as b,Un as c,Mt as d,Rn as e,Fe as f,B as g,Ae as h,Me as i,Ge as j,Ot as k,It as l,Nn as m,Be as n,be as o,te as p,Dt as q,ne as r,ge as s,Ut as t,zt as u,$n as v,oe as w,Jn as x,$t as y,xe as z,W as A,X as B,qe as C,on as D,an as E,Pe as F,Te as G,ie as H,et as I,nt as J,ot as K,at as L,rt as M,it as N,st as O,ct as P,ut as Q,lt as R,fo as S,mt as T,pt as U,ft as V,dt as W,yt as X,bt as Y,gt as Z,xt as _,Pt as $,Tt as aa,wt as ba,ve as ca,ht as da,vt as ea,On as fa,Po as ga};
|