@swapkit/toolboxes 4.23.1 → 4.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/chunk-ap5mzmjf.js +1 -0
  3. package/dist/{chunk-9psy287z.js → chunk-btth5bse.js} +1 -1
  4. package/dist/{chunk-jdh5asaw.js → chunk-nvfkjbyq.js} +1 -1
  5. package/dist/{chunk-fjyc6m34.js → chunk-xbdjxeqd.js} +1 -1
  6. package/dist/chunk-z61r1327.js +2 -0
  7. package/dist/src/aleo/index.cjs +1 -0
  8. package/dist/src/aleo/index.js +1 -0
  9. package/dist/src/aptos/index.cjs +1 -1
  10. package/dist/src/aptos/index.js +1 -1
  11. package/dist/src/cardano/index.cjs +1 -1
  12. package/dist/src/cardano/index.js +1 -1
  13. package/dist/src/cosmos/index.cjs +1 -1
  14. package/dist/src/cosmos/index.js +1 -1
  15. package/dist/src/evm/index.cjs +1 -1
  16. package/dist/src/evm/index.js +1 -1
  17. package/dist/src/hypercore/index.cjs +1 -1
  18. package/dist/src/hypercore/index.js +1 -1
  19. package/dist/src/index.cjs +1 -1
  20. package/dist/src/index.js +1 -1
  21. package/dist/src/near/index.cjs +1 -1
  22. package/dist/src/near/index.js +1 -1
  23. package/dist/src/radix/index.js +1 -1
  24. package/dist/src/ripple/index.cjs +1 -1
  25. package/dist/src/ripple/index.js +1 -1
  26. package/dist/src/solana/index.cjs +1 -1
  27. package/dist/src/solana/index.js +1 -1
  28. package/dist/src/starknet/index.cjs +1 -1
  29. package/dist/src/starknet/index.js +1 -1
  30. package/dist/src/stellar/index.cjs +1 -1
  31. package/dist/src/stellar/index.js +1 -1
  32. package/dist/src/substrate/index.cjs +1 -1
  33. package/dist/src/substrate/index.js +1 -1
  34. package/dist/src/sui/index.cjs +1 -1
  35. package/dist/src/sui/index.js +1 -1
  36. package/dist/src/ton/index.cjs +1 -1
  37. package/dist/src/ton/index.js +1 -1
  38. package/dist/src/tron/index.cjs +1 -1
  39. package/dist/src/tron/index.js +1 -1
  40. package/dist/src/utxo/index.cjs +1 -1
  41. package/dist/src/utxo/index.js +1 -1
  42. package/dist/types/aleo/helpers.d.ts +62 -0
  43. package/dist/types/aleo/index.d.ts +3 -0
  44. package/dist/types/aleo/toolbox.d.ts +40 -0
  45. package/dist/types/aleo/types.d.ts +32 -0
  46. package/dist/types/aptos/toolbox.d.ts +11 -7
  47. package/dist/types/cardano/toolbox.d.ts +2 -2
  48. package/dist/types/cosmos/thorchainUtils/messages.d.ts +2 -1
  49. package/dist/types/cosmos/thorchainUtils/registry.d.ts +1 -1
  50. package/dist/types/cosmos/toolbox/cosmos.d.ts +1 -1
  51. package/dist/types/cosmos/toolbox/thorchain.d.ts +6 -6
  52. package/dist/types/cosmos/util.d.ts +16 -2
  53. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +66 -21
  54. package/dist/types/evm/toolbox/evm.d.ts +1603 -234
  55. package/dist/types/evm/toolbox/op.d.ts +235 -11
  56. package/dist/types/evm/types.d.ts +7 -13
  57. package/dist/types/hypercore/toolbox.d.ts +2 -2
  58. package/dist/types/hypercore/types.d.ts +3 -1
  59. package/dist/types/index.d.ts +4 -0
  60. package/dist/types/near/toolbox.d.ts +22 -3
  61. package/dist/types/near/types.d.ts +4 -1
  62. package/dist/types/ripple/index.d.ts +3 -2
  63. package/dist/types/solana/toolbox.d.ts +2 -2
  64. package/dist/types/starknet/toolbox.d.ts +2 -2
  65. package/dist/types/starknet/types.d.ts +3 -12
  66. package/dist/types/stellar/toolbox.d.ts +2 -2
  67. package/dist/types/sui/toolbox.d.ts +3 -3
  68. package/dist/types/ton/toolbox.d.ts +1 -4
  69. package/dist/types/tron/toolbox.d.ts +2 -2
  70. package/dist/types/types.d.ts +2 -0
  71. package/dist/types/utxo/hdWallet.d.ts +1 -1
  72. package/dist/types/utxo/helpers/coinselect.d.ts +2 -1
  73. package/dist/types/utxo/toolbox/bitcoinCash.d.ts +7 -5
  74. package/dist/types/utxo/toolbox/utxo.d.ts +8 -5
  75. package/dist/types/utxo/toolbox/zcash.d.ts +6 -4
  76. package/package.json +9 -2
  77. package/dist/chunk-6b99avsd.js +0 -2
  78. package/dist/chunk-e02sjx7s.js +0 -1
@@ -0,0 +1,32 @@
1
+ import type { ChainSigner, DerivationPathArray, GenericCreateTransactionParams, GenericTransferParams } from "@swapkit/helpers";
2
+ import type { getAleoToolbox } from "./toolbox";
3
+ export type AleoWallet = ReturnType<typeof getAleoToolbox>;
4
+ export type AleoChainSigner = ChainSigner<AleoUnsignedTransaction, AleoTransaction>;
5
+ export type AleoToolboxParams = {
6
+ phrase?: string;
7
+ derivationPath?: DerivationPathArray;
8
+ } | {
9
+ signer?: AleoChainSigner;
10
+ };
11
+ export type AleoCreateTransactionParams = Omit<GenericCreateTransactionParams, "feeRate"> & {
12
+ priorityFee?: number;
13
+ };
14
+ export type AleoTransferParams = Omit<GenericTransferParams, "feeRate"> & {
15
+ priorityFee?: number;
16
+ };
17
+ export type AleoTransaction = string | {
18
+ toString: () => string;
19
+ };
20
+ export type AleoRecord = {
21
+ microcredits: bigint;
22
+ plaintext: string;
23
+ spent: boolean;
24
+ transactionId: string;
25
+ };
26
+ export type AleoUnsignedTransaction = {
27
+ functionName: string;
28
+ inputs: [string, string];
29
+ priorityFee: number;
30
+ programName: string;
31
+ sender: string;
32
+ };
@@ -3,18 +3,22 @@ import type { AptosCreateTransactionParams, AptosExtensionProvider, AptosToolbox
3
3
  export declare function validateAptosAddress(address: string): boolean;
4
4
  export declare function getAptosToolbox({ derivationPath, provider: providerParam, ...signerParams }?: AptosToolboxParams): {
5
5
  broadcastTransaction: ({ senderAuthenticator, transaction, }: {
6
- senderAuthenticator: Awaited<ReturnType<(transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>>>;
7
- transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>;
6
+ senderAuthenticator: Awaited<ReturnType<(transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>>>;
7
+ transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>;
8
8
  }) => Promise<string>;
9
- createTransaction: ({ recipient, assetValue, maxGasAmount, sender: _senderAddress, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>;
9
+ createTransaction: ({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>;
10
10
  estimateTransactionFee: (params?: AptosCreateTransactionParams) => Promise<AssetValue>;
11
11
  getAddress: () => Promise<"" | `0x${string}`>;
12
12
  getBalance: (targetAddress?: string) => Promise<AssetValue[]>;
13
- signAndBroadcastTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<string>;
14
- signTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>;
15
- transfer: ({ assetValue, maxGasAmount, recipient }: AptosTransferParams) => Promise<string>;
13
+ signAndBroadcastTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<string>;
14
+ signTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>;
15
+ transfer: ({ assetValue, maxGasAmount, recipient, sweep }: AptosTransferParams) => Promise<string>;
16
16
  validateAddress: typeof validateAptosAddress;
17
17
  };
18
+ /**
19
+ * Extension wallets control gas parameters themselves, so the fee reserve for a native sweep cannot
20
+ * be computed at build time, and this factory has no Aptos client for token balance lookups.
21
+ */
18
22
  export declare function createAptosExtensionTransfer({ provider }: {
19
23
  provider: AptosExtensionProvider;
20
- }): ({ assetValue, recipient }: AptosTransferParams) => Promise<string>;
24
+ }): ({ assetValue, recipient, sweep }: AptosTransferParams) => Promise<string>;
@@ -14,7 +14,7 @@ export declare function getCardanoToolbox(toolboxParams?: {
14
14
  index?: number;
15
15
  derivationPath?: DerivationPathArray;
16
16
  }): {
17
- createTransaction: ({ sender, recipient, assetValue, memo, pureLovelaceOnly, }: CardanoCreateTransactionParams) => Promise<{
17
+ createTransaction: ({ sender, recipient, assetValue, memo, pureLovelaceOnly, sweep, }: CardanoCreateTransactionParams) => Promise<{
18
18
  tx: Transaction;
19
19
  unsignedTx: string;
20
20
  }>;
@@ -23,7 +23,7 @@ export declare function getCardanoToolbox(toolboxParams?: {
23
23
  getBalance: (addressParam?: string) => Promise<AssetValue[]>;
24
24
  signAndBroadcastTransaction: (txInput: string) => Promise<string>;
25
25
  signTransaction: (tx: string) => Promise<string>;
26
- transfer: ({ recipient, assetValue, memo }: CardanoTransferParams) => Promise<string>;
26
+ transfer: ({ recipient, assetValue, memo, sweep }: CardanoTransferParams) => Promise<string>;
27
27
  validateAddress: typeof validateCardanoAddress;
28
28
  };
29
29
  export type CardanoWallet = ReturnType<typeof getCardanoToolbox>;
@@ -86,7 +86,7 @@ export declare function createTransaction(params: ThorchainCreateTransactionPara
86
86
  };
87
87
  })[];
88
88
  sequence: number;
89
- }> | Promise<{
89
+ } | {
90
90
  accountNumber: number;
91
91
  chainId: import("@swapkit/types").ChainId.Maya | import("@swapkit/types").ChainId.THORChain;
92
92
  fee: {
@@ -110,6 +110,7 @@ export declare function createTransaction(params: ThorchainCreateTransactionPara
110
110
  })[];
111
111
  sequence: number;
112
112
  }>;
113
+ export declare function resolveThorchainSweepAssetValue({ assetValue, sender, }: Pick<ThorchainCreateTransactionParams, "assetValue" | "sender">): Promise<AssetValue>;
113
114
  export declare function buildTransferTx({ sender, recipient, assetValue, memo, asSignable, asAminoMessage, sequence, accountNumber, }: ThorchainCreateTransactionParams): Promise<{
114
115
  accountNumber: number;
115
116
  chainId: import("@swapkit/types").ChainId.Maya | import("@swapkit/types").ChainId.THORChain;
@@ -1,3 +1,3 @@
1
1
  import { type TCLikeChain } from "@swapkit/helpers";
2
2
  export declare function createDefaultRegistry(): Promise<import("@cosmjs/proto-signing/build").Registry>;
3
- export declare function createDefaultAminoTypes(chain: TCLikeChain): Promise<import("@cosmjs/stargate/build").AminoTypes>;
3
+ export declare function createDefaultAminoTypes(chain: TCLikeChain, addressPrefix?: string): Promise<import("@cosmjs/stargate/build").AminoTypes>;
@@ -47,7 +47,7 @@ export declare function createCosmosToolbox({ chain, ...toolboxParams }: CosmosT
47
47
  getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@cosmjs/proto-signing/build").DirectSecp256k1Wallet>;
48
48
  signAndBroadcastTransaction: (transaction: CosmosTransaction) => Promise<string>;
49
49
  signTransaction: (transaction: CosmosTransaction) => Promise<TxRaw>;
50
- transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, }: GenericTransferParams) => Promise<string>;
50
+ transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, sweep, }: GenericTransferParams) => Promise<string>;
51
51
  validateAddress: (address: string) => boolean;
52
52
  verifySignature: ({ signature, message, address, }: {
53
53
  signature: string;
@@ -1,5 +1,5 @@
1
1
  import type { Pubkey, Secp256k1HdWallet } from "@cosmjs/amino";
2
- import { type GenericTransferParams, SwapKitNumber, type TCLikeChain } from "@swapkit/helpers";
2
+ import { type GenericTransferParams, type TCLikeChain } from "@swapkit/helpers";
3
3
  import type { CosmosTransaction } from "@swapkit/helpers/api";
4
4
  import { buildEncodedTxBody, createDefaultRegistry, createTransaction, parseAminoMessageForDirectSigning } from "../thorchainUtils";
5
5
  import type { CosmosToolboxParams, MultiSigSigner, MultisigTx } from "../types";
@@ -63,13 +63,13 @@ export declare function createThorchainToolbox({ chain, ...toolboxParams }: Cosm
63
63
  createDefaultRegistry: typeof createDefaultRegistry;
64
64
  createMultisig: typeof createMultisig;
65
65
  createTransaction: typeof createTransaction;
66
- deposit: ({ assetValue, memo, recipient, }: Omit<GenericTransferParams, "recipient"> & {
66
+ deposit: ({ assetValue, memo, recipient, sweep, }: Omit<GenericTransferParams, "recipient"> & {
67
67
  recipient?: string;
68
68
  }) => Promise<string>;
69
69
  getFees: () => Promise<{
70
- average: SwapKitNumber;
71
- fast: SwapKitNumber;
72
- fastest: SwapKitNumber;
70
+ average: import("@swapkit/helpers").SwapKitNumber;
71
+ fast: import("@swapkit/helpers").SwapKitNumber;
72
+ fastest: import("@swapkit/helpers").SwapKitNumber;
73
73
  }>;
74
74
  importSignature: typeof importSignature;
75
75
  parseAminoMessageForDirectSigning: typeof parseAminoMessageForDirectSigning;
@@ -85,7 +85,7 @@ export declare function createThorchainToolbox({ chain, ...toolboxParams }: Cosm
85
85
  }>;
86
86
  signTransaction: (transaction: CosmosTransaction) => Promise<import("cosmjs-types/cosmos/tx/v1beta1/tx").TxRaw>;
87
87
  signWithPrivateKey: typeof signWithPrivateKey;
88
- transfer: ({ assetValue, memo, recipient, }: Omit<GenericTransferParams, "recipient"> & {
88
+ transfer: ({ assetValue, memo, recipient, sweep, }: Omit<GenericTransferParams, "recipient"> & {
89
89
  recipient?: string;
90
90
  }) => Promise<string>;
91
91
  createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<ArrayBufferLike>>;
@@ -1,6 +1,6 @@
1
1
  import type { OfflineSigner } from "@cosmjs/proto-signing";
2
2
  import type { SigningStargateClientOptions } from "@cosmjs/stargate";
3
- import { AssetValue, type CosmosChain } from "@swapkit/helpers";
3
+ import { AssetValue, type CosmosChain, SwapKitNumber, type TCLikeChain } from "@swapkit/helpers";
4
4
  import type { CosmosCreateTransactionParams } from "./types";
5
5
  export declare const USK_KUJIRA_FACTORY_DENOM = "FACTORY/KUJIRA1QK00H5ATUTPSV900X202PXX42NPJR9THG58DNQPA72F2P7M2LUASE444A7/UUSK";
6
6
  export declare const YUM_KUJIRA_FACTORY_DENOM = "FACTORY/KUJIRA1YGFXN0ER40KLCNCK8THLTUPRDXLCK6WVNPKF2K/UYUM";
@@ -32,6 +32,7 @@ export declare function getDefaultChainFee(chain: CosmosChain): {
32
32
  }[];
33
33
  gas: string;
34
34
  };
35
+ export declare function getThorchainNativeFee(chain: TCLikeChain): Promise<SwapKitNumber>;
35
36
  export declare const getMsgSendDenom: (symbol: string, isThorchain?: boolean) => string;
36
37
  export declare const getDenomWithChain: ({ symbol, chain }: AssetValue) => string;
37
38
  export declare function createStargateClient(url: string): Promise<import("@cosmjs/stargate/build").StargateClient>;
@@ -40,7 +41,7 @@ export declare function createOfflineStargateClient(wallet: OfflineSigner, regis
40
41
  /**
41
42
  * Used to build tx for Cosmos and Kujira
42
43
  */
43
- export declare function cosmosCreateTransaction({ sender, recipient, assetValue, memo, feeRate, sequence, accountNumber, }: CosmosCreateTransactionParams): Promise<{
44
+ export declare function cosmosCreateTransaction({ sender, recipient, assetValue, memo, feeRate, sequence, accountNumber, sweep, }: CosmosCreateTransactionParams): Promise<{
44
45
  accountNumber: number;
45
46
  chainId: import("@swapkit/types").ChainId;
46
47
  fee: {
@@ -64,6 +65,19 @@ export declare function cosmosCreateTransaction({ sender, recipient, assetValue,
64
65
  }[];
65
66
  sequence: number;
66
67
  }>;
68
+ export declare function getFeeAmountForDenom(fees: readonly {
69
+ amount: string;
70
+ denom: string;
71
+ }[], denom: string): bigint;
72
+ export declare function getSweepAssetValue({ assetValue, balances, denom, feeAmount, }: {
73
+ assetValue: AssetValue;
74
+ balances: readonly {
75
+ amount: string;
76
+ denom: string;
77
+ }[];
78
+ denom: string;
79
+ feeAmount?: bigint;
80
+ }): AssetValue;
67
81
  /**
68
82
  * Converts a Cosmos denom and amount to an AssetValue with proper decimal handling
69
83
  * @param denom - The denomination string
@@ -1,16 +1,28 @@
1
1
  import { type Asset, AssetValue, type ChainSigner, type EVMChain, FeeOption } from "@swapkit/helpers";
2
- import { BrowserProvider, Contract, type ContractTransaction, type Fragment, type HDNodeWallet, type JsonFragment, type JsonRpcSigner, type Provider, type Signer } from "ethers";
2
+ import { BrowserProvider, Contract, type ContractTransaction, type Fragment, type HDNodeWallet, type JsonFragment, type JsonRpcSigner, type Provider, type Signer, type TransactionRequest } from "ethers";
3
3
  import type { ApproveParams, CallParams, EIP1559TxParams, EstimateCallParams, EVMCreateTransactionParams, EVMTransferParams, EVMTxParams, IsApprovedParams, SignTypedDataParams } from "../types";
4
+ type GasPrices = {
5
+ [key in FeeOption]: {
6
+ gasPrice?: bigint;
7
+ l1GasPrice?: bigint;
8
+ maxFeePerGas?: bigint;
9
+ maxPriorityFeePerGas?: bigint;
10
+ };
11
+ };
4
12
  type ToolboxWrapParams<P = Provider | BrowserProvider, T = {}> = T & {
13
+ estimateGasPrices?: () => Promise<GasPrices>;
14
+ estimateAdditionalFee?: (tx: TransactionRequest) => Promise<bigint | undefined>;
5
15
  isEIP1559Compatible?: boolean;
6
16
  provider: P;
7
17
  signer?: Signer;
8
18
  chain: EVMChain;
9
19
  };
10
20
  export declare const MAX_APPROVAL: bigint;
11
- export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S extends (ChainSigner<EVMTransferParams, string> & Signer) | JsonRpcSigner | HDNodeWallet | undefined>({ chain, provider, signer, isEIP1559Compatible, }: {
21
+ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S extends (ChainSigner<EVMTransferParams, string> & Signer) | JsonRpcSigner | HDNodeWallet | undefined>({ chain, provider, signer, isEIP1559Compatible, estimateGasPrices: estimateGasPricesOverride, estimateAdditionalFee, }: {
12
22
  signer: S;
13
23
  provider: P;
24
+ estimateGasPrices?: () => Promise<GasPrices>;
25
+ estimateAdditionalFee?: (tx: TransactionRequest) => Promise<bigint | undefined>;
14
26
  isEIP1559Compatible?: boolean;
15
27
  chain?: EVMChain;
16
28
  }): {
@@ -55,7 +67,29 @@ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S e
55
67
  blockTag?: import("ethers").BlockTag;
56
68
  enableCcipRead?: boolean;
57
69
  }>;
58
- createTransaction: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: EVMCreateTransactionParams) => Promise<{
70
+ createTransaction: ({ assetValue, authorizations, memo, recipient, data, feeOptionKey, gasLimit, sender: fromOverride, sweep, type, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: EVMCreateTransactionParams) => Promise<{
71
+ gasLimit: bigint;
72
+ value: string;
73
+ data: string;
74
+ from: string;
75
+ to: string;
76
+ maxFeePerGas: bigint;
77
+ maxPriorityFeePerGas: bigint;
78
+ gasPrice?: undefined;
79
+ type?: number | undefined;
80
+ nonce?: number | undefined;
81
+ } | {
82
+ gasLimit: bigint;
83
+ value: string;
84
+ data: string;
85
+ from: string;
86
+ to: string;
87
+ gasPrice: bigint;
88
+ maxFeePerGas?: undefined;
89
+ maxPriorityFeePerGas?: undefined;
90
+ type?: number | undefined;
91
+ nonce?: number | undefined;
92
+ } | {
59
93
  value: string;
60
94
  to: string;
61
95
  data: string;
@@ -73,7 +107,29 @@ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S e
73
107
  blockTag?: import("ethers").BlockTag;
74
108
  enableCcipRead?: boolean;
75
109
  }>;
76
- createTransferTx: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: EVMCreateTransactionParams) => Promise<{
110
+ createTransferTx: ({ assetValue, authorizations, memo, recipient, data, feeOptionKey, gasLimit, sender: fromOverride, sweep, type, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: EVMCreateTransactionParams) => Promise<{
111
+ gasLimit: bigint;
112
+ value: string;
113
+ data: string;
114
+ from: string;
115
+ to: string;
116
+ maxFeePerGas: bigint;
117
+ maxPriorityFeePerGas: bigint;
118
+ gasPrice?: undefined;
119
+ type?: number | undefined;
120
+ nonce?: number | undefined;
121
+ } | {
122
+ gasLimit: bigint;
123
+ value: string;
124
+ data: string;
125
+ from: string;
126
+ to: string;
127
+ gasPrice: bigint;
128
+ maxFeePerGas?: undefined;
129
+ maxPriorityFeePerGas?: undefined;
130
+ type?: number | undefined;
131
+ nonce?: number | undefined;
132
+ } | {
77
133
  value: string;
78
134
  to: string;
79
135
  data: string;
@@ -100,12 +156,7 @@ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S e
100
156
  txOverrides?: EVMTxParams;
101
157
  data?: string;
102
158
  }) => Promise<bigint>;
103
- estimateGasPrices: () => Promise<{ [key in FeeOption]: {
104
- l1GasPrice?: bigint;
105
- gasPrice?: bigint;
106
- maxFeePerGas?: bigint;
107
- maxPriorityFeePerGas?: bigint;
108
- }; }>;
159
+ estimateGasPrices: () => Promise<GasPrices>;
109
160
  estimateTransactionFee: ({ feeOption, ...txObject }: EIP1559TxParams & {
110
161
  feeOption: FeeOption;
111
162
  }) => Promise<AssetValue>;
@@ -113,8 +164,9 @@ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S e
113
164
  getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>;
114
165
  getNetworkParams: () => import("@swapkit/helpers").NetworkParams | undefined;
115
166
  isApproved: ({ assetAddress, spenderAddress, from, amount }: IsApprovedParams) => Promise<boolean>;
116
- sendTransaction: ({ feeOptionKey, ...tx }: EVMTxParams & {
167
+ sendTransaction: ({ feeOptionKey, sweep, ...tx }: EVMTxParams & {
117
168
  feeOptionKey?: FeeOption;
169
+ sweep?: boolean;
118
170
  }) => Promise<string>;
119
171
  signAuthorization: ((params: {
120
172
  address: string;
@@ -123,7 +175,7 @@ export declare function BaseEVMToolbox<P extends Provider | BrowserProvider, S e
123
175
  }) => Promise<import("ethers").Authorization>) | undefined;
124
176
  signMessage: ((message: string | Uint8Array) => Promise<string>) | undefined;
125
177
  signTypedData: (({ domain, types, value }: SignTypedDataParams) => Promise<string>) | undefined;
126
- transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, ...tx }: EVMTransferParams) => Promise<string>;
178
+ transfer: ({ assetValue, memo, recipient, feeOptionKey, sender, sweep, ...tx }: EVMTransferParams) => Promise<string>;
127
179
  validateAddress: typeof validateEVMAddress;
128
180
  };
129
181
  export declare function validateEVMAddress(address: string): boolean;
@@ -135,7 +187,7 @@ export declare function isStateChangingCall({ abi, funcName }: {
135
187
  funcName: string;
136
188
  }): any;
137
189
  export declare function toChecksumAddress(address: string): string;
138
- export declare function getEIP1193SendTransaction(provider: Provider | BrowserProvider): ({ value, ...params }: EVMTxParams | ContractTransaction) => Promise<string>;
190
+ export declare function getEIP1193SendTransaction(provider: Provider | BrowserProvider, includeGasFields?: boolean): ({ value, ...params }: EVMTxParams | ContractTransaction) => Promise<string>;
139
191
  export declare function getChecksumAddressFromAsset(asset: Asset, chain: EVMChain): string;
140
192
  export declare const ContractAddress: Record<EVMChain, string>;
141
193
  export declare function getTokenAddress({ chain, symbol, ticker }: Asset, baseAssetChain: EVMChain): string | null;
@@ -161,14 +213,7 @@ export declare function getEstimateGasPrices({ chain, provider, isEIP1559Compati
161
213
  provider: Provider;
162
214
  isEIP1559Compatible?: boolean;
163
215
  chain: EVMChain;
164
- }): () => Promise<{
165
- [key in FeeOption]: {
166
- l1GasPrice?: bigint;
167
- gasPrice?: bigint;
168
- maxFeePerGas?: bigint;
169
- maxPriorityFeePerGas?: bigint;
170
- };
171
- }>;
216
+ }): () => Promise<GasPrices>;
172
217
  export declare const isEIP7702Transaction: (tx: EVMTxParams) => boolean;
173
218
  export declare const isEIP1559Transaction: (tx: EVMTxParams) => boolean;
174
219
  type EVMTxType = "eip7702" | "eip1559" | "legacy";