@swapkit/toolboxes 4.19.0 → 4.20.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chunk-3pne8gaa.js +1 -0
  3. package/dist/chunk-44m22jy1.js +1 -0
  4. package/dist/chunk-54gntgt1.js +2 -0
  5. package/dist/chunk-ntbvmmch.js +2 -0
  6. package/dist/chunk-x9db9hmg.js +1 -0
  7. package/dist/chunk-xs0j1eze.js +2 -0
  8. package/dist/src/aptos/index.js +1 -1
  9. package/dist/src/cardano/index.cjs +1 -1
  10. package/dist/src/cardano/index.js +1 -1
  11. package/dist/src/cosmos/index.cjs +1 -1
  12. package/dist/src/cosmos/index.js +1 -1
  13. package/dist/src/evm/index.cjs +1 -1
  14. package/dist/src/evm/index.js +1 -1
  15. package/dist/src/hypercore/index.cjs +1 -1
  16. package/dist/src/hypercore/index.js +1 -1
  17. package/dist/src/index.cjs +1 -1
  18. package/dist/src/index.js +1 -1
  19. package/dist/src/near/index.cjs +1 -1
  20. package/dist/src/near/index.js +1 -1
  21. package/dist/src/radix/index.cjs +1 -1
  22. package/dist/src/radix/index.js +1 -1
  23. package/dist/src/ripple/index.cjs +1 -1
  24. package/dist/src/ripple/index.js +1 -1
  25. package/dist/src/solana/index.js +1 -1
  26. package/dist/src/starknet/index.js +1 -1
  27. package/dist/src/stellar/index.js +1 -1
  28. package/dist/src/substrate/index.cjs +1 -1
  29. package/dist/src/substrate/index.js +1 -1
  30. package/dist/src/sui/index.js +1 -1
  31. package/dist/src/ton/index.cjs +1 -1
  32. package/dist/src/ton/index.js +1 -1
  33. package/dist/src/tron/index.cjs +1 -1
  34. package/dist/src/tron/index.js +1 -1
  35. package/dist/src/utxo/index.js +1 -1
  36. package/dist/types/cardano/toolbox.d.ts +1 -1
  37. package/dist/types/cosmos/toolbox/cosmos.d.ts +2 -3
  38. package/dist/types/evm/helpers.d.ts +11 -1
  39. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +90 -5
  40. package/dist/types/evm/toolbox/evm.d.ts +1584 -88
  41. package/dist/types/evm/toolbox/op.d.ts +72 -4
  42. package/dist/types/evm/types.d.ts +7 -7
  43. package/dist/types/near/toolbox.d.ts +1 -2
  44. package/dist/types/radix/index.d.ts +2 -2
  45. package/dist/types/ripple/index.d.ts +4 -8
  46. package/dist/types/substrate/substrate.d.ts +1 -1
  47. package/dist/types/ton/toolbox.d.ts +6 -6
  48. package/dist/types/ton/types.d.ts +5 -0
  49. package/dist/types/tron/index.d.ts +2 -2
  50. package/dist/types/tron/toolbox.d.ts +3 -1
  51. package/dist/types/tron/types.d.ts +5 -0
  52. package/package.json +4 -2
@@ -33,11 +33,79 @@ export declare function OPToolbox({ provider, ...toolboxSignerParams }: EVMToolb
33
33
  approvedAmount: ({ assetAddress, spenderAddress, from }: import("..").IsApprovedParams) => Promise<bigint>;
34
34
  broadcastTransaction: ((signedTx: string) => Promise<import("ethers").TransactionResponse>) | ((signedTx: string) => Promise<import("ethers").TransactionResponse>);
35
35
  call: <T>({ callProvider, contractAddress, abi, funcName, funcParams, txOverrides, feeOption, }: import("..").CallParams) => Promise<T>;
36
- createApprovalTx: ({ assetAddress, spenderAddress, amount, from: fromParam }: import("..").ApproveParams) => Promise<import("ethers").ContractTransaction>;
36
+ createApprovalTx: ({ assetAddress, spenderAddress, amount, from: fromParam }: import("..").ApproveParams) => Promise<{
37
+ value: string;
38
+ to: string;
39
+ data: string;
40
+ from?: string;
41
+ type?: number;
42
+ nonce?: number;
43
+ gasLimit?: bigint;
44
+ gasPrice?: bigint;
45
+ maxPriorityFeePerGas?: bigint;
46
+ maxFeePerGas?: bigint;
47
+ chainId?: bigint;
48
+ accessList?: import("ethers").AccessList;
49
+ authorizationList?: Array<Authorization>;
50
+ customData?: any;
51
+ blockTag?: import("ethers").BlockTag;
52
+ enableCcipRead?: boolean;
53
+ }>;
37
54
  createContract: (address: string, abi: readonly (import("ethers").JsonFragment | import("ethers").Fragment)[]) => Contract;
38
- createContractTxObject: ({ contractAddress, abi, funcName, funcParams, txOverrides }: import("..").CallParams) => Promise<import("ethers").ContractTransaction>;
39
- createTransaction: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: import("..").EVMCreateTransactionParams) => Promise<import("ethers").ContractTransaction>;
40
- createTransferTx: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: import("..").EVMCreateTransactionParams) => Promise<import("ethers").ContractTransaction>;
55
+ createContractTxObject: ({ contractAddress, abi, funcName, funcParams, txOverrides }: import("..").CallParams) => Promise<{
56
+ value: string;
57
+ to: string;
58
+ data: string;
59
+ from?: string;
60
+ type?: number;
61
+ nonce?: number;
62
+ gasLimit?: bigint;
63
+ gasPrice?: bigint;
64
+ maxPriorityFeePerGas?: bigint;
65
+ maxFeePerGas?: bigint;
66
+ chainId?: bigint;
67
+ accessList?: import("ethers").AccessList;
68
+ authorizationList?: Array<Authorization>;
69
+ customData?: any;
70
+ blockTag?: import("ethers").BlockTag;
71
+ enableCcipRead?: boolean;
72
+ }>;
73
+ createTransaction: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: import("..").EVMCreateTransactionParams) => Promise<{
74
+ value: string;
75
+ to: string;
76
+ data: string;
77
+ from?: string;
78
+ type?: number;
79
+ nonce?: number;
80
+ gasLimit?: bigint;
81
+ gasPrice?: bigint;
82
+ maxPriorityFeePerGas?: bigint;
83
+ maxFeePerGas?: bigint;
84
+ chainId?: bigint;
85
+ accessList?: import("ethers").AccessList;
86
+ authorizationList?: Array<Authorization>;
87
+ customData?: any;
88
+ blockTag?: import("ethers").BlockTag;
89
+ enableCcipRead?: boolean;
90
+ }>;
91
+ createTransferTx: ({ assetValue, memo, recipient, data, sender: fromOverride, maxFeePerGas, maxPriorityFeePerGas, gasPrice, ...tx }: import("..").EVMCreateTransactionParams) => Promise<{
92
+ value: string;
93
+ to: string;
94
+ data: string;
95
+ from?: string;
96
+ type?: number;
97
+ nonce?: number;
98
+ gasLimit?: bigint;
99
+ gasPrice?: bigint;
100
+ maxPriorityFeePerGas?: bigint;
101
+ maxFeePerGas?: bigint;
102
+ chainId?: bigint;
103
+ accessList?: import("ethers").AccessList;
104
+ authorizationList?: Array<Authorization>;
105
+ customData?: any;
106
+ blockTag?: import("ethers").BlockTag;
107
+ enableCcipRead?: boolean;
108
+ }>;
41
109
  EIP1193SendTransaction: ({ value, ...params }: import("..").EVMTxParams | import("ethers").ContractTransaction) => Promise<string>;
42
110
  estimateCall: ({ contractAddress, abi, funcName, funcParams, txOverrides }: import("..").EstimateCallParams) => Promise<bigint>;
43
111
  estimateGasLimit: ({ assetValue, recipient, memo, data, sender, funcName, funcParams, txOverrides, }: import("..").EVMTransferParams & {
@@ -1,6 +1,6 @@
1
1
  import type { AssetValue, ChainSigner, DerivationPathArray, FeeOption, GenericCreateTransactionParams, GenericTransferParams } from "@swapkit/helpers";
2
2
  import { Chain } from "@swapkit/helpers";
3
- import type { BigNumberish, BrowserProvider, JsonFragment, JsonRpcSigner, Provider, Signer, Transaction, TypedDataField } from "ethers";
3
+ import type { BigNumberish, BrowserProvider, JsonFragment, JsonRpcSigner, Provider, Signer, TransactionRequest, TypedDataField } from "ethers";
4
4
  import type { getProvider } from "./index";
5
5
  import type { ADIToolbox, ARBToolbox, AURORAToolbox, AVAXToolbox, BASEToolbox, BERAToolbox, BSCToolbox, COREToolbox, CORNToolbox, CROToolbox, ETHToolbox, GNOToolbox, HYPEREVMToolbox, LINEAToolbox, MATICToolbox, MEGAETHToolbox, MONADToolbox, OPToolbox, PLASMAToolbox, SONICToolbox, UNIToolbox, XLayerToolbox } from "./toolbox";
6
6
  export declare enum EthNetwork {
@@ -30,7 +30,7 @@ export type CallParams = {
30
30
  abi: readonly JsonFragment[];
31
31
  funcName: string;
32
32
  funcParams?: unknown[];
33
- txOverrides?: Partial<Transaction>;
33
+ txOverrides?: TransactionRequest;
34
34
  feeOption?: FeeOption;
35
35
  };
36
36
  export type EstimateCallParams = Pick<CallParams, "contractAddress" | "abi" | "funcName" | "funcParams" | "txOverrides">;
@@ -54,9 +54,9 @@ export type EVMMaxSendableAmountsParams = {
54
54
  funcName?: string;
55
55
  contractAddress?: string;
56
56
  funcParams?: unknown[];
57
- txOverrides?: Partial<Transaction>;
57
+ txOverrides?: TransactionRequest;
58
58
  };
59
- export type EVMTxBaseParams<T = bigint> = {
59
+ export type EVMTxBaseParams<T = BigNumberish> = {
60
60
  to?: string;
61
61
  from?: string;
62
62
  nonce?: number;
@@ -65,12 +65,12 @@ export type EVMTxBaseParams<T = bigint> = {
65
65
  value?: T;
66
66
  chainId?: T;
67
67
  };
68
- export type EIP1559TxParams<T = bigint> = EVMTxBaseParams<T> & {
68
+ export type EIP1559TxParams<T = BigNumberish> = EVMTxBaseParams<T> & {
69
69
  type?: number;
70
70
  maxFeePerGas?: T;
71
71
  maxPriorityFeePerGas?: T;
72
72
  };
73
- export type LegacyEVMTxParams<T = bigint> = EVMTxBaseParams<T> & {
73
+ export type LegacyEVMTxParams<T = BigNumberish> = EVMTxBaseParams<T> & {
74
74
  gasPrice?: T;
75
75
  };
76
76
  export type { Authorization, TypedDataDomain, TypedDataField } from "ethers";
@@ -86,7 +86,7 @@ export interface EIP712TypedData {
86
86
  primaryType: string;
87
87
  types: Record<string, TypedDataField[]>;
88
88
  }
89
- export type EIP7702TxParams<T = bigint> = EIP1559TxParams<T> & {
89
+ export type EIP7702TxParams<T = BigNumberish> = EIP1559TxParams<T> & {
90
90
  type?: 4;
91
91
  authorizations?: import("ethers").Authorization[];
92
92
  };
@@ -1,5 +1,4 @@
1
1
  import type { Account, Contract } from "@near-js/accounts";
2
- import { JsonRpcProvider } from "@near-js/providers";
3
2
  import type { SignedTransaction, Transaction } from "@near-js/transactions";
4
3
  import { AssetValue } from "@swapkit/helpers";
5
4
  import { getNearSignerFromPhrase, getNearSignerFromPrivateKey, validateNearAddress } from "./helpers/core";
@@ -22,7 +21,7 @@ export declare function getNearToolbox(toolboxParams?: NearToolboxParams): {
22
21
  getAddress: () => Promise<string>;
23
22
  getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>;
24
23
  getGasPrice: () => Promise<string>;
25
- getNearProvider: () => Promise<JsonRpcProvider>;
24
+ getNearProvider: () => Promise<import("@near-js/providers").JsonRpcProvider>;
26
25
  getPublicKey: () => Promise<string>;
27
26
  getSignerFromPhrase: typeof getNearSignerFromPhrase;
28
27
  getSignerFromPrivateKey: typeof getNearSignerFromPrivateKey;
@@ -1,4 +1,4 @@
1
- import { GatewayApiClient } from "@radixdlt/babylon-gateway-api-sdk";
1
+ import type { GatewayApiClient } from "@radixdlt/babylon-gateway-api-sdk";
2
2
  import { AssetValue, type SKConfigIntegrations } from "@swapkit/helpers";
3
3
  export type RadixWallet = ReturnType<typeof getRadixToolbox>;
4
4
  export declare function validateRadixAddress(address: string): boolean;
@@ -7,7 +7,7 @@ export declare function getRadixToolbox({ dappConfig }?: {
7
7
  }): {
8
8
  getAddress: () => string;
9
9
  getBalance: (address: string) => Promise<AssetValue[]>;
10
- networkApi: GatewayApiClient;
10
+ getNetworkApi: () => Promise<GatewayApiClient>;
11
11
  signAndBroadcast: (params: any) => Promise<string>;
12
12
  validateAddress: typeof validateRadixAddress;
13
13
  };
@@ -1,10 +1,9 @@
1
1
  import { AssetValue, type ChainSigner, type GenericTransferParams } from "@swapkit/helpers";
2
- import type { Transaction as RippleTransaction } from "xrpl";
3
- import { type Payment } from "xrpl";
2
+ import type { Payment, Transaction as RippleTransaction } from "xrpl";
4
3
  export * from "./currency";
5
4
  export * from "./tokens";
6
5
  export type RippleWallet = ReturnType<typeof getRippleToolbox>;
7
- export { hashes, type Transaction as RippleTransaction } from "xrpl";
6
+ export type { Transaction as RippleTransaction } from "xrpl";
8
7
  export declare const XRPL_TOKEN_ERROR_CODES: {
9
8
  readonly tecFROZEN: "tecFROZEN";
10
9
  readonly tecNO_AUTH: "tecNO_AUTH";
@@ -65,7 +64,7 @@ export declare function getRippleToolbox(params?: RippleToolboxParams): {
65
64
  }) => Promise<Payment>;
66
65
  disconnect: () => void;
67
66
  estimateTransactionFee: () => Promise<AssetValue>;
68
- getAddress: () => string | Promise<string>;
67
+ getAddress: () => Promise<string>;
69
68
  getBalance: (checkAddress?: string) => Promise<AssetValue[]>;
70
69
  getTrustLines: (address?: string) => Promise<TrustLineInfo[]>;
71
70
  hasTrustLine: ({ address, currency, issuer, }: {
@@ -76,10 +75,7 @@ export declare function getRippleToolbox(params?: RippleToolboxParams): {
76
75
  setTrustLine: ({ currency, issuer, limit, sender }: TrustLineParams) => Promise<RippleTransaction>;
77
76
  setTrustLineAndBroadcast: (params: TrustLineParams) => Promise<string>;
78
77
  signAndBroadcastTransaction: (tx: RippleTransaction) => Promise<string>;
79
- signTransaction: (tx: RippleTransaction) => {
80
- tx_blob: string;
81
- hash: string;
82
- } | Promise<{
78
+ signTransaction: (tx: RippleTransaction) => Promise<{
83
79
  tx_blob: string;
84
80
  hash: string;
85
81
  }>;
@@ -1,4 +1,4 @@
1
- import { ApiPromise } from "@polkadot/api";
1
+ import type { ApiPromise } from "@polkadot/api";
2
2
  import type { SubmittableExtrinsic } from "@polkadot/api/types";
3
3
  import type { KeyringPair } from "@polkadot/keyring/types";
4
4
  import type { Callback, IKeyringPair, ISubmittableResult, Signer } from "@polkadot/types/types";
@@ -1,12 +1,12 @@
1
1
  import { AssetValue, type GenericTransferParams } from "@swapkit/helpers";
2
- import { Address, Cell } from "@ton/ton";
3
- import type { TONToolboxParams, TONTransactionMessage } from "./types";
2
+ import { Address, Cell } from "@ton/core";
3
+ import type { TONToolboxParams, TONToolboxTransaction, TONTransactionInput } from "./types";
4
4
  export declare function getTONToolbox(toolboxParams?: TONToolboxParams): {
5
5
  broadcastTransaction: (transferCell: Cell) => Promise<string>;
6
- createTransaction: ({ sender, ...params }: GenericTransferParams & {
6
+ createTransaction: ({ sender, sweep, ...params }: GenericTransferParams & {
7
7
  sender?: string;
8
8
  sweep?: boolean;
9
- }) => Promise<TONTransactionMessage[]>;
9
+ }) => Promise<TONToolboxTransaction>;
10
10
  estimateTransactionFee: ({ sender, ...params }: GenericTransferParams & {
11
11
  sender?: string;
12
12
  }) => Promise<AssetValue>;
@@ -16,8 +16,8 @@ export declare function getTONToolbox(toolboxParams?: TONToolboxParams): {
16
16
  jettonMasterAddress: string;
17
17
  ownerAddress: string;
18
18
  }) => Promise<Address>;
19
- sign: (messages: TONTransactionMessage[]) => Promise<Cell>;
20
- signAndBroadcastTransaction: (messages: TONTransactionMessage[]) => Promise<string>;
19
+ sign: (transactionInput: TONTransactionInput) => Promise<Cell>;
20
+ signAndBroadcastTransaction: (transaction: TONTransactionInput) => Promise<string>;
21
21
  transfer: ({ assetValue, recipient, memo, sweep }: GenericTransferParams & {
22
22
  sweep?: boolean;
23
23
  }) => Promise<string>;
@@ -20,4 +20,9 @@ export type TONTransactionMessage = {
20
20
  stateInit?: string;
21
21
  sendMode?: number;
22
22
  };
23
+ export type TONToolboxTransaction = {
24
+ messages: TONTransactionMessage[];
25
+ sendMode: number;
26
+ };
27
+ export type TONTransactionInput = TONToolboxTransaction | TONTransactionMessage[];
23
28
  export type TONWallet = ReturnType<typeof getTONToolbox>;
@@ -1,4 +1,4 @@
1
- export { getTronPrivateKeyFromMnemonic, getTronToolbox, validateTronAddress, } from "./toolbox";
2
- export type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronSignedTransaction, TronSigner, TronToolboxOptions, TronTransaction, TronTransferParams, } from "./types";
1
+ export { getTronPrivateKeyFromMnemonic, getTronToolbox, validateTronAddress, withTronTransactionData, withTronTransactionValue, } from "./toolbox";
2
+ export type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronSignedTransaction, TronSigner, TronToolboxOptions, TronTransaction, TronTransactionMetadata, TronTransactionWithMetadata, TronTransferParams, } from "./types";
3
3
  import type { getTronToolbox } from "./toolbox";
4
4
  export type TronWallet = ReturnType<typeof getTronToolbox>;
@@ -1,8 +1,10 @@
1
1
  import { AssetValue } from "@swapkit/helpers";
2
2
  import { broadcastTronTransaction } from "./helpers/trongrid";
3
3
  import { isValidTronAddress } from "./helpers/utils";
4
- import type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronToolboxOptions, TronTransaction, TronTransferParams } from "./types";
4
+ import type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronToolboxOptions, TronTransaction, TronTransactionWithMetadata, TronTransferParams } from "./types";
5
5
  export declare const validateTronAddress: typeof isValidTronAddress;
6
+ export declare function withTronTransactionValue<TTransaction extends TronTransaction>(transaction: TTransaction, value: string | number | bigint): TTransaction & Required<Pick<TronTransactionWithMetadata, "value">>;
7
+ export declare function withTronTransactionData<TTransaction extends TronTransaction>(transaction: TTransaction, data?: string): TTransaction & Pick<TronTransactionWithMetadata, "data">;
6
8
  export declare function getTronPrivateKeyFromMnemonic({ phrase, derivationPath: customPath, index, }: {
7
9
  phrase: string;
8
10
  derivationPath?: string;
@@ -24,6 +24,11 @@ export interface TronTransaction {
24
24
  contractRet?: string;
25
25
  }>;
26
26
  }
27
+ export type TronTransactionMetadata = {
28
+ data?: string;
29
+ value?: string;
30
+ };
31
+ export type TronTransactionWithMetadata = TronTransaction & TronTransactionMetadata;
27
32
  export interface TronSignedTransaction extends TronTransaction {
28
33
  signature: string[];
29
34
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "dependencies": { "@swapkit/helpers": "4.15.1", "@swapkit/utxo-signer": "2.2.2" },
2
+ "dependencies": { "@swapkit/helpers": "4.15.3", "@swapkit/utxo-signer": "2.2.2" },
3
3
  "description": "SwapKit - Toolboxes",
4
4
  "devDependencies": {
5
5
  "@aptos-labs/ts-sdk": "7.0.1",
@@ -49,6 +49,7 @@
49
49
  "micro-key-producer": "0.8.6",
50
50
  "near-seed-phrase": "0.2.1",
51
51
  "protobufjs": "8.0.3",
52
+ "ripple-address-codec": "5.0.1",
52
53
  "starknet": "10.0.2",
53
54
  "ts-pattern": "5.9.0",
54
55
  "xrpl": "4.6.0"
@@ -182,6 +183,7 @@
182
183
  "micro-key-producer": "0.8.6",
183
184
  "near-seed-phrase": "0.2.1",
184
185
  "protobufjs": "8.0.3",
186
+ "ripple-address-codec": "5.0.1",
185
187
  "starknet": "10.0.2",
186
188
  "ts-pattern": "5.9.0",
187
189
  "xrpl": "4.6.0"
@@ -196,5 +198,5 @@
196
198
  "type-check:go": "tsgo"
197
199
  },
198
200
  "type": "module",
199
- "version": "4.19.0"
201
+ "version": "4.20.1"
200
202
  }