@swapkit/toolboxes 4.3.9 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE +246 -0
- package/dist/src/aptos/index.cjs +1 -0
- package/dist/src/aptos/index.js +1 -0
- package/dist/src/cardano/index.cjs +1 -4
- package/dist/src/cardano/index.js +1 -4
- package/dist/src/cosmos/index.cjs +1 -4
- package/dist/src/cosmos/index.js +1 -4
- package/dist/src/evm/index.cjs +1 -4
- package/dist/src/evm/index.js +1 -4
- package/dist/src/index.cjs +1 -5
- package/dist/src/index.js +1 -5
- package/dist/src/near/index.cjs +1 -4
- package/dist/src/near/index.js +1 -4
- package/dist/src/radix/index.cjs +1 -4
- package/dist/src/radix/index.js +1 -4
- package/dist/src/ripple/index.cjs +1 -4
- package/dist/src/ripple/index.js +1 -4
- package/dist/src/solana/index.cjs +1 -4
- package/dist/src/solana/index.js +1 -4
- package/dist/src/starknet/index.cjs +1 -0
- package/dist/src/starknet/index.js +1 -0
- package/dist/src/stellar/index.cjs +1 -0
- package/dist/src/stellar/index.js +1 -0
- package/dist/src/substrate/index.cjs +1 -4
- package/dist/src/substrate/index.js +1 -4
- package/dist/src/sui/index.cjs +1 -4
- package/dist/src/sui/index.js +1 -4
- package/dist/src/ton/index.cjs +1 -4
- package/dist/src/ton/index.js +1 -4
- package/dist/src/tron/index.cjs +1 -4
- package/dist/src/tron/index.js +1 -4
- package/dist/src/utxo/index.cjs +1 -5
- package/dist/src/utxo/index.js +1 -5
- package/dist/types/aptos/index.d.ts +3 -0
- package/dist/types/aptos/index.d.ts.map +1 -0
- package/dist/types/aptos/toolbox.d.ts +21 -0
- package/dist/types/aptos/toolbox.d.ts.map +1 -0
- package/dist/types/aptos/types.d.ts +27 -0
- package/dist/types/aptos/types.d.ts.map +1 -0
- package/dist/types/cardano/toolbox.d.ts +19 -22
- package/dist/types/cardano/toolbox.d.ts.map +1 -1
- package/dist/types/cardano/types.d.ts +8 -3
- package/dist/types/cardano/types.d.ts.map +1 -1
- package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -1
- package/dist/types/cosmos/thorchainUtils/messages.d.ts +3 -3
- package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -1
- package/dist/types/cosmos/toolbox/cosmos.d.ts +11 -9
- package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -1
- package/dist/types/cosmos/toolbox/thorchain.d.ts +6 -51
- package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -1
- package/dist/types/cosmos/types.d.ts +2 -2
- package/dist/types/cosmos/types.d.ts.map +1 -1
- package/dist/types/evm/helpers.d.ts +34 -1
- package/dist/types/evm/helpers.d.ts.map +1 -1
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +14 -7
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -1
- package/dist/types/evm/toolbox/evm.d.ts +236 -96
- package/dist/types/evm/toolbox/evm.d.ts.map +1 -1
- package/dist/types/evm/toolbox/index.d.ts +3 -2
- package/dist/types/evm/toolbox/index.d.ts.map +1 -1
- package/dist/types/evm/toolbox/op.d.ts +13 -8
- package/dist/types/evm/toolbox/op.d.ts.map +1 -1
- package/dist/types/evm/types.d.ts +49 -27
- package/dist/types/evm/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +31 -25
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/near/helpers/core.d.ts +1 -1
- package/dist/types/near/helpers/core.d.ts.map +1 -1
- package/dist/types/near/index.d.ts +1 -1
- package/dist/types/near/index.d.ts.map +1 -1
- package/dist/types/near/toolbox.d.ts +13 -10
- package/dist/types/near/toolbox.d.ts.map +1 -1
- package/dist/types/near/types/index.d.ts +4 -0
- package/dist/types/near/types/index.d.ts.map +1 -0
- package/dist/types/near/types/toolbox.d.ts +2 -0
- package/dist/types/near/types/toolbox.d.ts.map +1 -1
- package/dist/types/radix/index.d.ts +7 -7
- package/dist/types/radix/index.d.ts.map +1 -1
- package/dist/types/ripple/currency.d.ts +5 -0
- package/dist/types/ripple/currency.d.ts.map +1 -0
- package/dist/types/ripple/index.d.ts +60 -17
- package/dist/types/ripple/index.d.ts.map +1 -1
- package/dist/types/ripple/tokens.d.ts +15 -0
- package/dist/types/ripple/tokens.d.ts.map +1 -0
- package/dist/types/solana/index.d.ts +1 -1
- package/dist/types/solana/index.d.ts.map +1 -1
- package/dist/types/solana/toolbox.d.ts +12 -10
- package/dist/types/solana/toolbox.d.ts.map +1 -1
- package/dist/types/starknet/index.d.ts +5 -0
- package/dist/types/starknet/index.d.ts.map +1 -0
- package/dist/types/starknet/toolbox.d.ts +34 -0
- package/dist/types/starknet/toolbox.d.ts.map +1 -0
- package/dist/types/starknet/types.d.ts +26 -0
- package/dist/types/starknet/types.d.ts.map +1 -0
- package/dist/types/stellar/index.d.ts +3 -0
- package/dist/types/stellar/index.d.ts.map +1 -0
- package/dist/types/stellar/toolbox.d.ts +21 -0
- package/dist/types/stellar/toolbox.d.ts.map +1 -0
- package/dist/types/stellar/types.d.ts +10 -0
- package/dist/types/stellar/types.d.ts.map +1 -0
- package/dist/types/substrate/balance.d.ts +3 -3
- package/dist/types/substrate/balance.d.ts.map +1 -1
- package/dist/types/substrate/substrate.d.ts +22 -97
- package/dist/types/substrate/substrate.d.ts.map +1 -1
- package/dist/types/substrate/types.d.ts +2 -2
- package/dist/types/substrate/types.d.ts.map +1 -1
- package/dist/types/sui/toolbox.d.ts +17 -8
- package/dist/types/sui/toolbox.d.ts.map +1 -1
- package/dist/types/sui/types.d.ts +11 -3
- package/dist/types/sui/types.d.ts.map +1 -1
- package/dist/types/ton/toolbox.d.ts +23 -13
- package/dist/types/ton/toolbox.d.ts.map +1 -1
- package/dist/types/ton/types.d.ts +9 -8
- package/dist/types/ton/types.d.ts.map +1 -1
- package/dist/types/tron/helpers/proto.d.ts +9 -0
- package/dist/types/tron/helpers/proto.d.ts.map +1 -0
- package/dist/types/tron/helpers/trongrid.d.ts +43 -3
- package/dist/types/tron/helpers/trongrid.d.ts.map +1 -1
- package/dist/types/tron/helpers/utils.d.ts +17 -0
- package/dist/types/tron/helpers/utils.d.ts.map +1 -0
- package/dist/types/tron/index.d.ts +4 -5
- package/dist/types/tron/index.d.ts.map +1 -1
- package/dist/types/tron/toolbox.d.ts +20 -18
- package/dist/types/tron/toolbox.d.ts.map +1 -1
- package/dist/types/tron/types.d.ts +31 -57
- package/dist/types/tron/types.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utxo/hdWallet.d.ts +33 -0
- package/dist/types/utxo/hdWallet.d.ts.map +1 -0
- package/dist/types/utxo/helpers/api.d.ts +49 -1
- package/dist/types/utxo/helpers/api.d.ts.map +1 -1
- package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -1
- package/dist/types/utxo/helpers/cashaddr.d.ts +13 -0
- package/dist/types/utxo/helpers/cashaddr.d.ts.map +1 -0
- package/dist/types/utxo/helpers/coinselect.d.ts +9 -5
- package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -1
- package/dist/types/utxo/helpers/txSize.d.ts +4 -3
- package/dist/types/utxo/helpers/txSize.d.ts.map +1 -1
- package/dist/types/utxo/index.d.ts +2 -1
- package/dist/types/utxo/index.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts +75 -15
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/index.d.ts +6 -5
- package/dist/types/utxo/toolbox/index.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/params.d.ts +8 -16
- package/dist/types/utxo/toolbox/params.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/utxo.d.ts +135 -46
- package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/validators.d.ts +1 -1
- package/dist/types/utxo/toolbox/validators.d.ts.map +1 -1
- package/dist/types/utxo/toolbox/zcash.d.ts +63 -10
- package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -1
- package/dist/types/utxo/types.d.ts +78 -15
- package/dist/types/utxo/types.d.ts.map +1 -1
- package/package.json +43 -53
- package/dist/src/cardano/index.cjs.map +0 -11
- package/dist/src/cardano/index.js.map +0 -11
- package/dist/src/cosmos/index.cjs.map +0 -20
- package/dist/src/cosmos/index.js.map +0 -20
- package/dist/src/evm/index.cjs.map +0 -20
- package/dist/src/evm/index.js.map +0 -20
- package/dist/src/index.cjs.map +0 -67
- package/dist/src/index.js.map +0 -67
- package/dist/src/near/index.cjs.map +0 -16
- package/dist/src/near/index.js.map +0 -16
- package/dist/src/radix/index.cjs.map +0 -10
- package/dist/src/radix/index.js.map +0 -10
- package/dist/src/ripple/index.cjs.map +0 -10
- package/dist/src/ripple/index.js.map +0 -10
- package/dist/src/solana/index.cjs.map +0 -11
- package/dist/src/solana/index.js.map +0 -11
- package/dist/src/substrate/index.cjs.map +0 -13
- package/dist/src/substrate/index.js.map +0 -13
- package/dist/src/sui/index.cjs.map +0 -11
- package/dist/src/sui/index.js.map +0 -11
- package/dist/src/ton/index.cjs.map +0 -11
- package/dist/src/ton/index.js.map +0 -11
- package/dist/src/tron/index.cjs.map +0 -13
- package/dist/src/tron/index.js.map +0 -13
- package/dist/src/utxo/index.cjs.map +0 -21
- package/dist/src/utxo/index.js.map +0 -21
- package/dist/types/tron/helpers/trc20.abi.d.ts +0 -156
- package/dist/types/tron/helpers/trc20.abi.d.ts.map +0 -1
- package/src/__tests__/address-validation-all-chains.test.ts +0 -162
- package/src/__tests__/addressValidator.test.ts +0 -162
- package/src/cardano/__tests__/toolbox.test.ts +0 -48
- package/src/cardano/index.ts +0 -2
- package/src/cardano/toolbox.ts +0 -168
- package/src/cardano/types.ts +0 -10
- package/src/cosmos/__tests__/toolbox.test.ts +0 -95
- package/src/cosmos/index.ts +0 -4
- package/src/cosmos/thorchainUtils/addressFormat.ts +0 -22
- package/src/cosmos/thorchainUtils/index.ts +0 -4
- package/src/cosmos/thorchainUtils/messages.ts +0 -212
- package/src/cosmos/thorchainUtils/registry.ts +0 -43
- package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +0 -2800
- package/src/cosmos/thorchainUtils/types/client-types.ts +0 -54
- package/src/cosmos/thorchainUtils/types/index.ts +0 -1
- package/src/cosmos/toolbox/cosmos.ts +0 -345
- package/src/cosmos/toolbox/index.ts +0 -35
- package/src/cosmos/toolbox/thorchain.ts +0 -249
- package/src/cosmos/types.ts +0 -48
- package/src/cosmos/util.ts +0 -214
- package/src/evm/__tests__/address-validation.test.ts +0 -84
- package/src/evm/__tests__/ethereum.test.ts +0 -137
- package/src/evm/__tests__/signMessage.test.ts +0 -60
- package/src/evm/api.ts +0 -10
- package/src/evm/contracts/eth/multicall.ts +0 -165
- package/src/evm/contracts/op/gasOracle.ts +0 -145
- package/src/evm/helpers.ts +0 -71
- package/src/evm/index.ts +0 -4
- package/src/evm/toolbox/baseEVMToolbox.ts +0 -698
- package/src/evm/toolbox/evm.ts +0 -66
- package/src/evm/toolbox/index.ts +0 -44
- package/src/evm/toolbox/op.ts +0 -143
- package/src/evm/types.ts +0 -146
- package/src/index.ts +0 -260
- package/src/near/__tests__/core.test.ts +0 -70
- package/src/near/helpers/core.ts +0 -85
- package/src/near/helpers/gasEstimation.ts +0 -96
- package/src/near/helpers/nep141.ts +0 -50
- package/src/near/index.ts +0 -21
- package/src/near/toolbox.ts +0 -421
- package/src/near/types/contract.ts +0 -32
- package/src/near/types/nep141.ts +0 -34
- package/src/near/types/toolbox.ts +0 -55
- package/src/near/types.ts +0 -44
- package/src/radix/index.ts +0 -138
- package/src/ripple/index.ts +0 -179
- package/src/solana/index.ts +0 -36
- package/src/solana/toolbox.ts +0 -409
- package/src/substrate/balance.ts +0 -88
- package/src/substrate/index.ts +0 -2
- package/src/substrate/substrate.ts +0 -281
- package/src/substrate/types.ts +0 -115
- package/src/sui/__tests__/toolbox.test.ts +0 -86
- package/src/sui/index.ts +0 -2
- package/src/sui/toolbox.ts +0 -166
- package/src/sui/types.ts +0 -11
- package/src/ton/__tests__/toolbox.test.ts +0 -67
- package/src/ton/index.ts +0 -2
- package/src/ton/toolbox.ts +0 -136
- package/src/ton/types.ts +0 -13
- package/src/tron/__tests__/toolbox.test.ts +0 -221
- package/src/tron/helpers/trc20.abi.ts +0 -107
- package/src/tron/helpers/trongrid.ts +0 -53
- package/src/tron/index.ts +0 -21
- package/src/tron/toolbox.ts +0 -585
- package/src/tron/types.ts +0 -83
- package/src/types.ts +0 -28
- package/src/utils.ts +0 -34
- package/src/utxo/__tests__/zcash-integration.test.ts +0 -97
- package/src/utxo/helpers/api.ts +0 -471
- package/src/utxo/helpers/bchaddrjs.ts +0 -166
- package/src/utxo/helpers/coinselect.ts +0 -92
- package/src/utxo/helpers/index.ts +0 -4
- package/src/utxo/helpers/txSize.ts +0 -137
- package/src/utxo/index.ts +0 -6
- package/src/utxo/toolbox/bitcoinCash.ts +0 -243
- package/src/utxo/toolbox/index.ts +0 -59
- package/src/utxo/toolbox/params.ts +0 -18
- package/src/utxo/toolbox/utxo.ts +0 -439
- package/src/utxo/toolbox/validators.ts +0 -36
- package/src/utxo/toolbox/zcash.ts +0 -242
- package/src/utxo/types.ts +0 -39
|
@@ -1,19 +1,28 @@
|
|
|
1
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
1
2
|
import { AssetValue } from "@swapkit/helpers";
|
|
2
3
|
import type { SuiCreateTransactionParams, SuiToolboxParams, SuiTransferParams } from "./types";
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function getSuiToolbox({ provider: providerParam, ...signerParams }?: SuiToolboxParams):
|
|
4
|
+
export declare function validateSuiAddress(address: string): boolean;
|
|
5
|
+
export declare function getSuiToolbox({ provider: providerParam, ...signerParams }?: SuiToolboxParams): {
|
|
6
|
+
broadcastTransaction: (signedTransaction: {
|
|
7
|
+
bytes: string;
|
|
8
|
+
signature: string;
|
|
9
|
+
}) => Promise<string>;
|
|
5
10
|
createTransaction: ({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
|
|
6
|
-
tx:
|
|
11
|
+
tx: Transaction;
|
|
7
12
|
txBytes: Uint8Array<ArrayBuffer>;
|
|
8
13
|
}>;
|
|
9
14
|
estimateTransactionFee: (params?: SuiCreateTransactionParams) => Promise<AssetValue>;
|
|
10
|
-
getAddress: () => string
|
|
15
|
+
getAddress: () => Promise<string>;
|
|
11
16
|
getBalance: (targetAddress?: string) => Promise<AssetValue[]>;
|
|
17
|
+
signAndBroadcastTransaction: (transaction: Transaction | Uint8Array<ArrayBuffer> | string) => Promise<string>;
|
|
12
18
|
signTransaction: (params: Uint8Array<ArrayBuffer> | SuiCreateTransactionParams | Awaited<ReturnType<({ recipient, assetValue, gasBudget, sender }: SuiCreateTransactionParams) => Promise<{
|
|
13
|
-
tx:
|
|
19
|
+
tx: Transaction;
|
|
14
20
|
txBytes: Uint8Array<ArrayBuffer>;
|
|
15
|
-
}>>>) => Promise<
|
|
21
|
+
}>>>) => Promise<{
|
|
22
|
+
bytes: string;
|
|
23
|
+
signature: string;
|
|
24
|
+
} | import("@mysten/sui/cryptography").SignatureWithBytes>;
|
|
16
25
|
transfer: ({ assetValue, gasBudget, recipient }: SuiTransferParams) => Promise<string>;
|
|
17
|
-
validateAddress:
|
|
18
|
-
}
|
|
26
|
+
validateAddress: typeof validateSuiAddress;
|
|
27
|
+
};
|
|
19
28
|
//# sourceMappingURL=toolbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/sui/toolbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/sui/toolbox.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAuC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,KAAK,EAAE,0BAA0B,EAAa,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA+C1G,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,WAMjD;AAMD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,GAAE,gBAAqB;8CAiMxC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;sEA9FZ,0BAA0B;;;;sCAtB1D,0BAA0B;;iCAhC/B,MAAM;+CA8JQ,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,MAAM;8BAtD5F,UAAU,CAAC,WAAW,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,UAAU,gDAlDJ,0BAA0B;;;OAkDI,CAAC;;;;qDAgBhD,iBAAiB;;EAgFhF"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import type { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
2
|
-
import type { GenericCreateTransactionParams, GenericTransferParams } from "@swapkit/helpers";
|
|
2
|
+
import type { ChainSigner, GenericCreateTransactionParams, GenericTransferParams } from "@swapkit/helpers";
|
|
3
3
|
import type { getSuiToolbox } from "./toolbox";
|
|
4
|
-
export type
|
|
4
|
+
export type SuiChainSigner = ChainSigner<Uint8Array, {
|
|
5
|
+
bytes: string;
|
|
6
|
+
signature: string;
|
|
7
|
+
}> & {
|
|
8
|
+
toSuiAddress: () => string;
|
|
9
|
+
signWithIntent?: (message: string, intent: string) => Promise<string> | string;
|
|
10
|
+
};
|
|
11
|
+
export type SuiWallet = ReturnType<typeof getSuiToolbox>;
|
|
5
12
|
export type SuiCreateTransactionParams = Omit<GenericCreateTransactionParams, "feeRate"> & {
|
|
6
13
|
gasBudget?: number;
|
|
7
14
|
};
|
|
8
15
|
export type SuiTransferParams = Omit<GenericTransferParams, "feeRate"> & {
|
|
9
16
|
gasBudget?: number;
|
|
10
17
|
};
|
|
18
|
+
export type SuiSigner = Ed25519Keypair | SuiChainSigner;
|
|
11
19
|
export type SuiToolboxParams = {
|
|
12
20
|
provider?: string;
|
|
13
21
|
phrase?: string;
|
|
14
|
-
signer?:
|
|
22
|
+
signer?: SuiSigner;
|
|
15
23
|
};
|
|
16
24
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sui/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sui/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG;IAC3F,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import { AssetValue } from "@swapkit/helpers";
|
|
2
|
-
import
|
|
3
|
-
import type { TONToolboxParams,
|
|
4
|
-
export declare function getTONToolbox(toolboxParams?: TONToolboxParams):
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { AssetValue, type GenericTransferParams } from "@swapkit/helpers";
|
|
2
|
+
import { Address, Cell } from "@ton/ton";
|
|
3
|
+
import type { TONToolboxParams, TONTransactionMessage } from "./types";
|
|
4
|
+
export declare function getTONToolbox(toolboxParams?: TONToolboxParams): {
|
|
5
|
+
broadcastTransaction: (transferCell: Cell) => Promise<string>;
|
|
6
|
+
createTransaction: ({ sender, ...params }: GenericTransferParams & {
|
|
7
|
+
sender?: string;
|
|
8
|
+
}) => Promise<TONTransactionMessage[]>;
|
|
9
|
+
estimateTransactionFee: ({ sender, ...params }: GenericTransferParams & {
|
|
10
|
+
sender?: string;
|
|
11
|
+
}) => Promise<AssetValue>;
|
|
12
|
+
getAddress: () => Promise<string>;
|
|
13
|
+
getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>;
|
|
14
|
+
getJettonWalletAddress: ({ jettonMasterAddress, ownerAddress, }: {
|
|
15
|
+
jettonMasterAddress: string;
|
|
16
|
+
ownerAddress: string;
|
|
17
|
+
}) => Promise<Address>;
|
|
18
|
+
sign: (messages: TONTransactionMessage[]) => Promise<Cell>;
|
|
19
|
+
signAndBroadcastTransaction: (messages: TONTransactionMessage[]) => Promise<string>;
|
|
20
|
+
transfer: ({ assetValue, recipient, memo }: GenericTransferParams) => Promise<string>;
|
|
21
|
+
validateAddress: typeof validateTonAddress;
|
|
22
|
+
};
|
|
23
|
+
export declare function validateTonAddress(address: string): boolean;
|
|
14
24
|
//# sourceMappingURL=toolbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/ton/toolbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/ton/toolbox.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEV,KAAK,qBAAqB,EAK3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,OAAO,EAEP,IAAI,EAUL,MAAM,UAAU,CAAC;AAIlB,OAAO,KAAK,EAAa,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA0BlF,wBAAgB,aAAa,CAAC,aAAa,GAAE,gBAAqB;yCAkId,IAAI;+CAtCJ,qBAAqB,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;oDAsDhC,qBAAqB,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;qEAoDrG;QACD,mBAAmB,EAAE,MAAM,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;KACtB;qBA/F6B,qBAAqB,EAAE;4CA8BA,qBAAqB,EAAE;gDAKnB,qBAAqB;;EAwH/E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,WAOjD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DerivationPathArray } from "@swapkit/helpers";
|
|
2
2
|
import type { getTONToolbox } from "./toolbox";
|
|
3
3
|
export type TONSigner = {
|
|
4
|
-
publicKey:
|
|
5
|
-
secretKey:
|
|
4
|
+
publicKey: Buffer;
|
|
5
|
+
secretKey: Buffer;
|
|
6
6
|
};
|
|
7
7
|
export type TONToolboxParams = {
|
|
8
8
|
provider?: string;
|
|
@@ -13,10 +13,11 @@ export type TONToolboxParams = {
|
|
|
13
13
|
derivationPath?: DerivationPathArray;
|
|
14
14
|
index?: number;
|
|
15
15
|
});
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
export type TONTransactionMessage = {
|
|
17
|
+
address: string;
|
|
18
|
+
amount: string;
|
|
19
|
+
payload?: string;
|
|
20
|
+
stateInit?: string;
|
|
20
21
|
};
|
|
21
|
-
export type TONWallet =
|
|
22
|
+
export type TONWallet = ReturnType<typeof getTONToolbox>;
|
|
22
23
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CACnD;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAC5E,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9G,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/proto.ts"],"names":[],"mappings":"AAwHA,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;;;EA8BpE"}
|
|
@@ -1,8 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
* Fetch account information including TRC20 balances from TronGrid API
|
|
3
|
-
*/
|
|
1
|
+
import type { TronSignedTransaction, TronTransaction } from "../types";
|
|
4
2
|
export declare function fetchAccountFromTronGrid(address: string): Promise<{
|
|
5
3
|
balance: number;
|
|
6
4
|
trc20: import("../types").TronGridTRC20Balance;
|
|
7
5
|
} | undefined>;
|
|
6
|
+
export declare function buildTrxTransaction({ from, to, amount }: {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
}): Promise<TronTransaction>;
|
|
11
|
+
export declare function buildContractTransaction({ ownerAddress, contractAddress, functionSelector, parameter, feeLimit, callValue, }: {
|
|
12
|
+
ownerAddress: string;
|
|
13
|
+
contractAddress: string;
|
|
14
|
+
functionSelector: string;
|
|
15
|
+
parameter: string;
|
|
16
|
+
feeLimit: number;
|
|
17
|
+
callValue?: number;
|
|
18
|
+
}): Promise<TronTransaction>;
|
|
19
|
+
export declare function broadcastTronTransaction(signedTx: TronSignedTransaction): Promise<string>;
|
|
20
|
+
export declare function getTronChainParameters(): Promise<{
|
|
21
|
+
bandwidthFee: number;
|
|
22
|
+
createAccountFee: number;
|
|
23
|
+
energyFee: number;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function getTronAccountResources(address: string): Promise<{
|
|
26
|
+
bandwidth: {
|
|
27
|
+
free: number;
|
|
28
|
+
total: number;
|
|
29
|
+
used: number;
|
|
30
|
+
};
|
|
31
|
+
energy: {
|
|
32
|
+
total: number;
|
|
33
|
+
used: number;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export declare function checkTronAccountExists(address: string): Promise<boolean>;
|
|
37
|
+
export declare function estimateContractEnergy(params: {
|
|
38
|
+
contractAddress: string;
|
|
39
|
+
functionSelector: string;
|
|
40
|
+
parameter: string;
|
|
41
|
+
sender: string;
|
|
42
|
+
}): Promise<number>;
|
|
43
|
+
export declare function getTrc20Allowance({ assetAddress, owner, spender, }: {
|
|
44
|
+
assetAddress: string;
|
|
45
|
+
owner: string;
|
|
46
|
+
spender: string;
|
|
47
|
+
}): Promise<bigint>;
|
|
8
48
|
//# sourceMappingURL=trongrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trongrid.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/trongrid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trongrid.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/trongrid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,qBAAqB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAmEhG,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM;;;eA+B7D;AAED,wBAAsB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,4BAiB3G;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,SAAa,GACd,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,4BA0BA;AAsBD,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,qBAAqB,mBAiB7E;AAED,wBAAsB,sBAAsB;;;;GAuB3C;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;GA2B5D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,oBAO3D;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,mBAYA;AAED,wBAAsB,iBAAiB,CAAC,EACtC,YAAY,EACZ,KAAK,EACL,OAAO,GACR,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,mBAqBA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function isValidTronAddress(address: unknown): boolean;
|
|
2
|
+
export declare function tronAddressToHex(address: string): string;
|
|
3
|
+
export declare function privateKeyToTronAddress(privateKeyHex: string): string;
|
|
4
|
+
export declare function signTronTransaction({ txID, privateKey }: {
|
|
5
|
+
txID: string;
|
|
6
|
+
privateKey: string;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function validateTransactionIntegrity({ txID, raw_data_hex }: {
|
|
9
|
+
txID: string;
|
|
10
|
+
raw_data_hex: string;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function buildTRC20Parameter(params: {
|
|
13
|
+
type: "address" | "uint256";
|
|
14
|
+
value: string;
|
|
15
|
+
}[]): string;
|
|
16
|
+
export declare function memoToHex(memo: string): string;
|
|
17
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/tron/helpers/utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,WAQlD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,UAE/C;AAMD,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,UAO5D;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,UAQ7F;AAED,wBAAgB,4BAA4B,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,QAK1G;AAcD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,UAI3F;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,UAErC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type TronWallet = Awaited<ReturnType<typeof createTronToolbox>>;
|
|
1
|
+
export { getTronPrivateKeyFromMnemonic, getTronToolbox, validateTronAddress, } from "./toolbox";
|
|
2
|
+
export type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronSignedTransaction, TronSigner, TronToolboxOptions, TronTransaction, TronTransferParams, } from "./types";
|
|
3
|
+
import type { getTronToolbox } from "./toolbox";
|
|
4
|
+
export type TronWallet = ReturnType<typeof getTronToolbox>;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tron/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tron/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,cAAc,EACd,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { AssetValue } from "@swapkit/helpers";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import { broadcastTronTransaction } from "./helpers/trongrid";
|
|
3
|
+
import { isValidTronAddress } from "./helpers/utils";
|
|
4
|
+
import type { TronApprovedParams, TronApproveParams, TronCreateTransactionParams, TronIsApprovedParams, TronToolboxOptions, TronTransaction, TronTransferParams } from "./types";
|
|
5
|
+
export declare const validateTronAddress: typeof isValidTronAddress;
|
|
5
6
|
export declare function getTronPrivateKeyFromMnemonic({ phrase, derivationPath: customPath, index, }: {
|
|
6
7
|
phrase: string;
|
|
7
8
|
derivationPath?: string;
|
|
8
9
|
index?: number;
|
|
9
|
-
}):
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
transfer: (params: TronTransferParams) => Promise<string>;
|
|
16
|
-
estimateTransactionFee: (params: TronTransferParams & {
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function getTronToolbox(options?: TronToolboxOptions): {
|
|
12
|
+
approve: ({ assetAddress, spenderAddress, amount, from }: TronApproveParams) => Promise<string>;
|
|
13
|
+
broadcastTransaction: typeof broadcastTronTransaction;
|
|
14
|
+
createTransaction: ({ recipient, assetValue, memo, sender, expiration }: TronCreateTransactionParams) => Promise<TronTransaction>;
|
|
15
|
+
estimateTransactionFee: ({ assetValue, recipient, sender }: TronTransferParams & {
|
|
17
16
|
sender?: string;
|
|
18
17
|
}) => Promise<AssetValue>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isApproved: (
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
getAddress: () => Promise<string>;
|
|
19
|
+
getApprovedAmount: ({ assetAddress, spenderAddress, from }: TronApprovedParams) => Promise<bigint>;
|
|
20
|
+
getBalance: (address: string) => Promise<AssetValue[]>;
|
|
21
|
+
getRpcUrl: () => Promise<string>;
|
|
22
|
+
isApproved: ({ assetAddress, spenderAddress, from, amount }: TronIsApprovedParams) => Promise<boolean>;
|
|
23
|
+
signAndBroadcastTransaction: (transaction: TronTransaction) => Promise<string>;
|
|
24
|
+
signTransaction: (transaction: TronTransaction) => Promise<import("./types").TronSignedTransaction>;
|
|
25
|
+
transfer: ({ recipient, assetValue, memo, expiration }: TronTransferParams) => Promise<string>;
|
|
26
|
+
validateAddress: typeof isValidTronAddress;
|
|
27
|
+
};
|
|
26
28
|
//# sourceMappingURL=toolbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/tron/toolbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbox.d.ts","sourceRoot":"","sources":["../../../src/tron/toolbox.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EASX,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,wBAAwB,EASzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,kBAAkB,EAKnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,oBAAoB,EAEpB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,mBAAmB,2BAAqB,CAAC;AActD,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,cAAc,EAAE,UAAU,EAC1B,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,UAMA;AAsDD,wBAAgB,cAAc,CAAC,OAAO,GAAE,kBAAuB;8DAmRU,iBAAiB;;6EAtDF,2BAA2B;gEAxBxC,kBAAkB,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;gEAoE9C,kBAAkB;0BAvMlD,MAAM;;iEA2MiC,oBAAoB;+CATtC,eAAe;mCAP3B,eAAe;4DA1JU,kBAAkB;;EAiOxF"}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import type { DerivationPathArray,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { DerivationPathArray, GenericCreateTransactionParams, GenericTransferParams } from "@swapkit/helpers";
|
|
2
|
+
interface TronTransactionContract {
|
|
3
|
+
parameter: {
|
|
4
|
+
value: Record<string, unknown>;
|
|
5
|
+
type_url: string;
|
|
6
|
+
};
|
|
7
|
+
type: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TronTransactionRawData {
|
|
10
|
+
contract: TronTransactionContract[];
|
|
11
|
+
ref_block_bytes: string;
|
|
12
|
+
ref_block_hash: string;
|
|
13
|
+
expiration: number;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
fee_limit?: number;
|
|
16
|
+
data?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TronTransaction {
|
|
19
|
+
txID: string;
|
|
20
|
+
raw_data: TronTransactionRawData;
|
|
21
|
+
raw_data_hex: string;
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
ret?: Array<{
|
|
24
|
+
contractRet?: string;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export interface TronSignedTransaction extends TronTransaction {
|
|
28
|
+
signature: string[];
|
|
29
|
+
}
|
|
6
30
|
export interface TronSigner {
|
|
7
31
|
getAddress(): Promise<string>;
|
|
8
32
|
signTransaction(transaction: TronTransaction): Promise<TronSignedTransaction>;
|
|
@@ -13,7 +37,7 @@ export type TronToolboxOptions = {
|
|
|
13
37
|
phrase?: string;
|
|
14
38
|
derivationPath?: DerivationPathArray;
|
|
15
39
|
index?: number;
|
|
16
|
-
} |
|
|
40
|
+
} | object;
|
|
17
41
|
export interface TronTransferParams extends GenericTransferParams {
|
|
18
42
|
expiration?: number;
|
|
19
43
|
}
|
|
@@ -23,11 +47,8 @@ export interface TronCreateTransactionParams extends Omit<GenericCreateTransacti
|
|
|
23
47
|
export type TronApproveParams = {
|
|
24
48
|
assetAddress: string;
|
|
25
49
|
spenderAddress: string;
|
|
26
|
-
feeOptionKey?: FeeOption;
|
|
27
50
|
amount?: bigint | string | number;
|
|
28
51
|
from?: string;
|
|
29
|
-
gasLimitFallback?: bigint | string | number;
|
|
30
|
-
nonce?: number;
|
|
31
52
|
};
|
|
32
53
|
export type TronApprovedParams = {
|
|
33
54
|
assetAddress: string;
|
|
@@ -44,47 +65,7 @@ export interface TronGridAccountResponse {
|
|
|
44
65
|
data: Array<{
|
|
45
66
|
address: string;
|
|
46
67
|
balance: number;
|
|
47
|
-
create_time: number;
|
|
48
|
-
latest_opration_time: number;
|
|
49
|
-
free_net_usage: number;
|
|
50
|
-
net_window_size: number;
|
|
51
|
-
net_window_optimized: boolean;
|
|
52
68
|
trc20: TronGridTRC20Balance;
|
|
53
|
-
assetV2?: Array<{
|
|
54
|
-
key: string;
|
|
55
|
-
value: number;
|
|
56
|
-
}>;
|
|
57
|
-
frozenV2?: Array<{
|
|
58
|
-
type?: string;
|
|
59
|
-
}>;
|
|
60
|
-
free_asset_net_usageV2?: Array<{
|
|
61
|
-
key: string;
|
|
62
|
-
value: number;
|
|
63
|
-
}>;
|
|
64
|
-
latest_consume_free_time?: number;
|
|
65
|
-
owner_permission?: {
|
|
66
|
-
keys: Array<{
|
|
67
|
-
address: string;
|
|
68
|
-
weight: number;
|
|
69
|
-
}>;
|
|
70
|
-
threshold: number;
|
|
71
|
-
permission_name: string;
|
|
72
|
-
};
|
|
73
|
-
active_permission?: Array<{
|
|
74
|
-
operations: string;
|
|
75
|
-
keys: Array<{
|
|
76
|
-
address: string;
|
|
77
|
-
weight: number;
|
|
78
|
-
}>;
|
|
79
|
-
threshold: number;
|
|
80
|
-
id: number;
|
|
81
|
-
type: string;
|
|
82
|
-
permission_name: string;
|
|
83
|
-
}>;
|
|
84
|
-
account_resource?: {
|
|
85
|
-
energy_window_optimized: boolean;
|
|
86
|
-
energy_window_size: number;
|
|
87
|
-
};
|
|
88
69
|
}>;
|
|
89
70
|
success: boolean;
|
|
90
71
|
meta: {
|
|
@@ -92,12 +73,5 @@ export interface TronGridAccountResponse {
|
|
|
92
73
|
page_size: number;
|
|
93
74
|
};
|
|
94
75
|
}
|
|
95
|
-
export
|
|
96
|
-
symbol: string;
|
|
97
|
-
address: string;
|
|
98
|
-
decimals: number;
|
|
99
|
-
name: string;
|
|
100
|
-
totalSupply: string;
|
|
101
|
-
owner: string;
|
|
102
|
-
}
|
|
76
|
+
export {};
|
|
103
77
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tron/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":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
import type { CardanoWallet } from "./cardano";
|
|
3
4
|
import type { CosmosWallets, ThorchainWallets } from "./cosmos";
|
|
4
5
|
import type { EVMToolboxes } from "./evm";
|
|
@@ -6,15 +7,20 @@ import type { NearWallet } from "./near";
|
|
|
6
7
|
import type { RadixWallet } from "./radix";
|
|
7
8
|
import type { RippleWallet } from "./ripple";
|
|
8
9
|
import type { SolanaWallet } from "./solana";
|
|
10
|
+
import type { StarknetWallet } from "./starknet";
|
|
11
|
+
import type { StellarWallet } from "./stellar";
|
|
9
12
|
import type { SubstrateToolboxes } from "./substrate";
|
|
10
13
|
import type { SuiWallet } from "./sui";
|
|
11
14
|
import type { TONWallet } from "./ton";
|
|
12
15
|
import type { TronWallet } from "./tron";
|
|
13
16
|
import type { UTXOToolboxes } from "./utxo";
|
|
14
17
|
type OtherWallets = {
|
|
18
|
+
[Chain.Aptos]: AptosWallet;
|
|
15
19
|
[Chain.Radix]: RadixWallet;
|
|
16
20
|
[Chain.Ripple]: RippleWallet;
|
|
17
21
|
[Chain.Solana]: SolanaWallet;
|
|
22
|
+
[Chain.Stellar]: StellarWallet;
|
|
23
|
+
[Chain.Starknet]: StarknetWallet;
|
|
18
24
|
[Chain.Ton]: TONWallet;
|
|
19
25
|
[Chain.Sui]: SuiWallet;
|
|
20
26
|
[Chain.Tron]: TronWallet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO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EAAE,SAAS,CAAC;IACvB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,YAAY,CACpG,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AssetValue, UTXOChain } from "@swapkit/helpers";
|
|
2
|
+
import type { AggregatedBalanceResult, DerivedAddress, UTXOForMultiAddressTransfer, UTXOType } from "./types";
|
|
3
|
+
type GetBalanceFn = (address: string) => Promise<AssetValue[]>;
|
|
4
|
+
type GetUtxosFn = (address: string) => Promise<UTXOType[]>;
|
|
5
|
+
type DeriveAddressFn = (params: {
|
|
6
|
+
index: number;
|
|
7
|
+
change: boolean;
|
|
8
|
+
}) => DerivedAddress | undefined | Promise<DerivedAddress | undefined>;
|
|
9
|
+
export type CreateHDWalletHelpersParams = {
|
|
10
|
+
chain: UTXOChain;
|
|
11
|
+
deriveAddress: DeriveAddressFn;
|
|
12
|
+
getBalance: GetBalanceFn;
|
|
13
|
+
getUtxos: GetUtxosFn;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates HD wallet helper methods that work with any wallet implementation.
|
|
17
|
+
* Wallet-specific logic (address derivation) is provided via callbacks.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createHDWalletHelpers({ deriveAddress, getBalance, getUtxos }: CreateHDWalletHelpersParams): {
|
|
20
|
+
deriveAddresses: (params: {
|
|
21
|
+
count: number;
|
|
22
|
+
startIndex?: number;
|
|
23
|
+
change?: boolean;
|
|
24
|
+
}) => Promise<DerivedAddress[]>;
|
|
25
|
+
getAggregatedBalance: (gapLimit?: number) => Promise<AggregatedBalanceResult>;
|
|
26
|
+
getAggregatedUtxos: (gapLimit?: number) => Promise<UTXOForMultiAddressTransfer[]>;
|
|
27
|
+
scanForAddresses: (params?: {
|
|
28
|
+
gapLimit?: number;
|
|
29
|
+
change?: boolean;
|
|
30
|
+
}) => Promise<DerivedAddress[]>;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=hdWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hdWallet.d.ts","sourceRoot":"","sources":["../../../src/utxo/hdWallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE9G,KAAK,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAC/D,KAAK,UAAU,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE3D,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB,KAAK,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;AAEvE,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,2BAA2B;8BACjE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE;iDAsC3C,OAAO,CAAC,uBAAuB,CAAC;+CAoBlC,OAAO,CAAC,2BAA2B,EAAE,CAAC;gCA9C/C;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE;EAqEjF"}
|
|
@@ -15,6 +15,30 @@ export declare function getUtxoApi(chain: UTXOChain): {
|
|
|
15
15
|
getBalance: (address: string) => Promise<number>;
|
|
16
16
|
getRawTx: (txHash: string) => Promise<string>;
|
|
17
17
|
getSuggestedTxFee: () => Promise<number>;
|
|
18
|
+
getTransactionDetails: (txHash: string) => Promise<{
|
|
19
|
+
blockId: number;
|
|
20
|
+
confirmed: boolean;
|
|
21
|
+
fee: number;
|
|
22
|
+
inputs: {
|
|
23
|
+
transaction_hash: string;
|
|
24
|
+
index: number;
|
|
25
|
+
value: number;
|
|
26
|
+
recipient: string;
|
|
27
|
+
spending_sequence: number;
|
|
28
|
+
}[];
|
|
29
|
+
isRBF: boolean;
|
|
30
|
+
outputs: {
|
|
31
|
+
index: number;
|
|
32
|
+
value: number;
|
|
33
|
+
recipient: string;
|
|
34
|
+
script_hex: string;
|
|
35
|
+
is_spent: boolean;
|
|
36
|
+
}[];
|
|
37
|
+
sequences: number[];
|
|
38
|
+
size: number;
|
|
39
|
+
txid: string;
|
|
40
|
+
weight: number;
|
|
41
|
+
}>;
|
|
18
42
|
getUtxos: (params: {
|
|
19
43
|
address: string;
|
|
20
44
|
fetchTxHex?: boolean;
|
|
@@ -50,6 +74,30 @@ export declare function createCustomUtxoApi(methods: ReturnType<typeof getUtxoAp
|
|
|
50
74
|
getBalance: (address: string) => Promise<number>;
|
|
51
75
|
getRawTx: (txHash: string) => Promise<string>;
|
|
52
76
|
getSuggestedTxFee: () => Promise<number>;
|
|
77
|
+
getTransactionDetails: (txHash: string) => Promise<{
|
|
78
|
+
blockId: number;
|
|
79
|
+
confirmed: boolean;
|
|
80
|
+
fee: number;
|
|
81
|
+
inputs: {
|
|
82
|
+
transaction_hash: string;
|
|
83
|
+
index: number;
|
|
84
|
+
value: number;
|
|
85
|
+
recipient: string;
|
|
86
|
+
spending_sequence: number;
|
|
87
|
+
}[];
|
|
88
|
+
isRBF: boolean;
|
|
89
|
+
outputs: {
|
|
90
|
+
index: number;
|
|
91
|
+
value: number;
|
|
92
|
+
recipient: string;
|
|
93
|
+
script_hex: string;
|
|
94
|
+
is_spent: boolean;
|
|
95
|
+
}[];
|
|
96
|
+
sequences: number[];
|
|
97
|
+
size: number;
|
|
98
|
+
txid: string;
|
|
99
|
+
weight: number;
|
|
100
|
+
}>;
|
|
53
101
|
getUtxos: (params: {
|
|
54
102
|
address: string;
|
|
55
103
|
fetchTxHex?: boolean;
|
|
@@ -66,7 +114,7 @@ export declare function createCustomUtxoApi(methods: ReturnType<typeof getUtxoAp
|
|
|
66
114
|
};
|
|
67
115
|
}[]>;
|
|
68
116
|
};
|
|
69
|
-
export declare function getUtxoNetwork(): (chain: Chain) =>
|
|
117
|
+
export declare function getUtxoNetwork(): (chain: Chain) => import("@swapkit/utxo-signer").BTCNetwork;
|
|
70
118
|
interface BlockchairTransaction {
|
|
71
119
|
block_id: number;
|
|
72
120
|
hash: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/utxo/helpers/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoD,KAAK,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAgUrH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS;0BAUjB,MAAM;8BACF,MAAM;iBAqHR,yBAAyB;sBAAgB,qBAAqB,EAAE;cAAQ,cAAc,EAAE;;;;;;;;0BApH1F,MAAM;uBACT,MAAM;;oCAEO,MAAM;;;;;8B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