@tonappchain/sdk 0.7.0-rc10 → 0.7.0-rc12
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/LICENSE +20 -20
- package/README.md +191 -191
- package/dist/adapters/contractOpener.d.ts +5 -5
- package/dist/adapters/retryableContractOpener.d.ts +4 -4
- package/dist/assets/AssetCache.d.ts +3 -3
- package/dist/assets/AssetFactory.d.ts +4 -4
- package/dist/assets/FT.d.ts +3 -3
- package/dist/assets/NFT.d.ts +5 -5
- package/dist/assets/TON.d.ts +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/interfaces/{IAsset.d.ts → Asset.d.ts} +6 -6
- package/dist/interfaces/{IContractOpener.d.ts → ContractOpener.d.ts} +2 -2
- package/dist/interfaces/ISimulator.d.ts +6 -6
- package/dist/interfaces/ITacSDK.d.ts +12 -12
- package/dist/interfaces/ITransactionManager.d.ts +5 -5
- package/dist/interfaces/{ISender.d.ts → SenderAbstraction.d.ts} +6 -6
- package/dist/interfaces/{IWallet.d.ts → WalletInstanse.d.ts} +1 -1
- package/dist/interfaces/index.d.ts +4 -4
- package/dist/interfaces/index.js +4 -4
- package/dist/sdk/AxiosHttpClient.d.ts +1 -1
- package/dist/sdk/Configuration.d.ts +1 -1
- package/dist/sdk/LiteSequencerClient.d.ts +1 -1
- package/dist/sdk/LiteSequencerClient.js +6 -9
- package/dist/sdk/OperationTracker.d.ts +1 -1
- package/dist/sdk/Simulator.d.ts +7 -7
- package/dist/sdk/Simulator.js +1 -1
- package/dist/sdk/StartTracking.d.ts +1 -1
- package/dist/sdk/StartTracking.js +4 -4
- package/dist/sdk/TacSdk.d.ts +9 -9
- package/dist/sdk/TransactionManager.d.ts +6 -6
- package/dist/sdk/TxFinalizer.d.ts +1 -1
- package/dist/sdk/Utils.d.ts +2 -2
- package/dist/sender/BatchSender.d.ts +6 -6
- package/dist/sender/RawSender.d.ts +8 -8
- package/dist/sender/SenderFactory.d.ts +2 -2
- package/dist/sender/TonConnectSender.d.ts +5 -5
- package/dist/sender/TonConnectSender.js +1 -1
- package/dist/sender/index.d.ts +1 -1
- package/dist/sender/index.js +1 -1
- package/dist/structs/InternalStruct.d.ts +9 -11
- package/dist/structs/Struct.d.ts +17 -21
- package/dist/wrappers/HighloadWalletV3.d.ts +2 -2
- package/package.json +66 -66
- /package/dist/interfaces/{IAsset.js → Asset.js} +0 -0
- /package/dist/interfaces/{IContractOpener.js → ContractOpener.js} +0 -0
- /package/dist/interfaces/{ISender.js → SenderAbstraction.js} +0 -0
- /package/dist/interfaces/{IWallet.js → WalletInstanse.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -14,11 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.JettonWalletOpCodes = exports.JettonWallet = exports.HighloadWalletV3 = exports.readJettonMetadata = exports.SimplifiedStatuses = exports.Network = exports.TransactionManager = exports.
|
|
17
|
+
exports.JettonWalletOpCodes = exports.JettonWallet = exports.HighloadWalletV3 = exports.readJettonMetadata = exports.SimplifiedStatuses = exports.Network = exports.TransactionManager = exports.TacSdk = exports.startTrackingMultiple = exports.startTracking = exports.Simulator = exports.OperationTracker = exports.NoopLogger = exports.ConsoleLogger = exports.LiteSequencerClient = exports.Configuration = exports.AxiosHttpClient = exports.orbsOpener = exports.liteClientOpener = void 0;
|
|
18
18
|
var contractOpener_1 = require("./adapters/contractOpener");
|
|
19
19
|
Object.defineProperty(exports, "liteClientOpener", { enumerable: true, get: function () { return contractOpener_1.liteClientOpener; } });
|
|
20
20
|
Object.defineProperty(exports, "orbsOpener", { enumerable: true, get: function () { return contractOpener_1.orbsOpener; } });
|
|
21
|
+
__exportStar(require("./assets"), exports);
|
|
21
22
|
__exportStar(require("./errors"), exports);
|
|
23
|
+
__exportStar(require("./interfaces"), exports);
|
|
24
|
+
var AxiosHttpClient_1 = require("./sdk/AxiosHttpClient");
|
|
25
|
+
Object.defineProperty(exports, "AxiosHttpClient", { enumerable: true, get: function () { return AxiosHttpClient_1.AxiosHttpClient; } });
|
|
22
26
|
var Configuration_1 = require("./sdk/Configuration");
|
|
23
27
|
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return Configuration_1.Configuration; } });
|
|
24
28
|
var LiteSequencerClient_1 = require("./sdk/LiteSequencerClient");
|
|
@@ -35,17 +39,13 @@ Object.defineProperty(exports, "startTracking", { enumerable: true, get: functio
|
|
|
35
39
|
Object.defineProperty(exports, "startTrackingMultiple", { enumerable: true, get: function () { return StartTracking_1.startTrackingMultiple; } });
|
|
36
40
|
var TacSdk_1 = require("./sdk/TacSdk");
|
|
37
41
|
Object.defineProperty(exports, "TacSdk", { enumerable: true, get: function () { return TacSdk_1.TacSdk; } });
|
|
38
|
-
var AxiosHttpClient_1 = require("./sdk/AxiosHttpClient");
|
|
39
|
-
Object.defineProperty(exports, "AxiosHttpClient", { enumerable: true, get: function () { return AxiosHttpClient_1.AxiosHttpClient; } });
|
|
40
42
|
var TransactionManager_1 = require("./sdk/TransactionManager");
|
|
41
43
|
Object.defineProperty(exports, "TransactionManager", { enumerable: true, get: function () { return TransactionManager_1.TransactionManager; } });
|
|
42
44
|
__exportStar(require("./sender"), exports);
|
|
43
|
-
__exportStar(require("./interfaces"), exports);
|
|
44
45
|
__exportStar(require("./structs/Struct"), exports);
|
|
45
46
|
var Struct_1 = require("./structs/Struct");
|
|
46
47
|
Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return Struct_1.Network; } });
|
|
47
48
|
Object.defineProperty(exports, "SimplifiedStatuses", { enumerable: true, get: function () { return Struct_1.SimplifiedStatuses; } });
|
|
48
|
-
__exportStar(require("./assets"), exports);
|
|
49
49
|
var ContentUtils_1 = require("./wrappers/ContentUtils");
|
|
50
50
|
Object.defineProperty(exports, "readJettonMetadata", { enumerable: true, get: function () { return ContentUtils_1.readJettonMetadata; } });
|
|
51
51
|
var HighloadWalletV3_1 = require("./wrappers/HighloadWalletV3");
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import type { Cell } from '@ton/ton';
|
|
2
2
|
import { AssetType, FeeParams } from '../structs/Struct';
|
|
3
|
-
export interface
|
|
3
|
+
export interface Asset {
|
|
4
4
|
address: string;
|
|
5
5
|
type: AssetType;
|
|
6
6
|
rawAmount: bigint;
|
|
7
|
-
clone:
|
|
7
|
+
clone: Asset;
|
|
8
8
|
/**
|
|
9
9
|
* Returns a new asset instance with the specified transfer amount.
|
|
10
10
|
* Use { rawAmount } for base units (e.g., nano units), or { amount } for human-readable units if supported by the implementation.
|
|
11
11
|
* Does not mutate the current asset instance.
|
|
12
12
|
* @param amount Object specifying either rawAmount (bigint base units) or amount (number in human units).
|
|
13
|
-
* @returns Promise that resolves to a new
|
|
13
|
+
* @returns Promise that resolves to a new Asset reflecting the requested amount.
|
|
14
14
|
*/
|
|
15
15
|
withAmount(amount: {
|
|
16
16
|
rawAmount: bigint;
|
|
17
17
|
} | {
|
|
18
18
|
amount: number;
|
|
19
|
-
}): Promise<
|
|
19
|
+
}): Promise<Asset>;
|
|
20
20
|
/**
|
|
21
21
|
* Increases the transfer amount by the specified value and returns a new asset instance.
|
|
22
22
|
* Does not mutate the current asset instance.
|
|
23
23
|
* @param amount Object specifying either rawAmount (bigint base units) or amount (number in human units).
|
|
24
|
-
* @returns Promise that resolves to a new
|
|
24
|
+
* @returns Promise that resolves to a new Asset with the increased amount.
|
|
25
25
|
*/
|
|
26
26
|
addAmount(amount: {
|
|
27
27
|
rawAmount: bigint;
|
|
28
28
|
} | {
|
|
29
29
|
amount: number;
|
|
30
|
-
}): Promise<
|
|
30
|
+
}): Promise<Asset>;
|
|
31
31
|
/**
|
|
32
32
|
* Resolves the corresponding EVM token address for this asset.
|
|
33
33
|
* Useful when bridging or interacting with EVM-compatible networks.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Address, Contract, OpenedContract } from '@ton/ton';
|
|
2
1
|
import { SandboxContract } from '@ton/sandbox';
|
|
2
|
+
import type { Address, Contract, OpenedContract } from '@ton/ton';
|
|
3
3
|
import { ContractState } from '../structs/Struct';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ContractOpener {
|
|
5
5
|
/**
|
|
6
6
|
* Opens a contract for interaction using the underlying client (lite client, sandbox, etc.).
|
|
7
7
|
* @param src Contract source instance to open.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SenderAbstraction } from '../sender';
|
|
2
2
|
import { CrosschainTx, EvmProxyMsg, ExecutionFeeEstimationResult, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinker } from '../structs/Struct';
|
|
3
|
-
import {
|
|
3
|
+
import { Asset } from './Asset';
|
|
4
4
|
export interface ISimulator {
|
|
5
5
|
/**
|
|
6
6
|
* Simulates a TAC message execution without sending it to the chain.
|
|
@@ -14,7 +14,7 @@ export interface ISimulator {
|
|
|
14
14
|
* @param txs Cross-chain transactions to simulate.
|
|
15
15
|
* @returns Promise with results, one for each input transaction.
|
|
16
16
|
*/
|
|
17
|
-
simulateTransactions(sender:
|
|
17
|
+
simulateTransactions(sender: SenderAbstraction, txs: CrosschainTx[]): Promise<TACSimulationResult[]>;
|
|
18
18
|
/**
|
|
19
19
|
* Suggests the TON executor fee for a given set of assets and target fee symbol.
|
|
20
20
|
* @param assets Assets involved in execution.
|
|
@@ -22,7 +22,7 @@ export interface ISimulator {
|
|
|
22
22
|
* @param tvmValidExecutors Whitelist of permitted TVM executors (optional).
|
|
23
23
|
* @returns Promise with suggested fee information.
|
|
24
24
|
*/
|
|
25
|
-
getTVMExecutorFeeInfo(assets:
|
|
25
|
+
getTVMExecutorFeeInfo(assets: Asset[], feeSymbol: string, tvmValidExecutors?: string[]): Promise<SuggestedTONExecutorFee>;
|
|
26
26
|
/**
|
|
27
27
|
* Computes simulation info and fees for a single transaction, using the provided sender context.
|
|
28
28
|
* @param evmProxyMsg Encoded EVM proxy message.
|
|
@@ -30,7 +30,7 @@ export interface ISimulator {
|
|
|
30
30
|
* @param assets Optional list of assets to attach to the transaction.
|
|
31
31
|
* @returns Promise with execution fee estimation details.
|
|
32
32
|
*/
|
|
33
|
-
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender:
|
|
33
|
+
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[]): Promise<ExecutionFeeEstimationResult>;
|
|
34
34
|
/**
|
|
35
35
|
* Computes simulation info for a transaction tied to an existing TransactionLinker.
|
|
36
36
|
* @param evmProxyMsg Encoded EVM proxy message.
|
|
@@ -43,5 +43,5 @@ export interface ISimulator {
|
|
|
43
43
|
* @param calculateRollbackFee If true, includes rollback fee in estimation.
|
|
44
44
|
* @returns Promise with fee estimation and execution info.
|
|
45
45
|
*/
|
|
46
|
-
getSimulationInfoForTransaction(evmProxyMsg: EvmProxyMsg, transactionLinker: TransactionLinker, assets:
|
|
46
|
+
getSimulationInfoForTransaction(evmProxyMsg: EvmProxyMsg, transactionLinker: TransactionLinker, assets: Asset[], allowSimulationError?: boolean, isRoundTrip?: boolean, evmValidExecutors?: string[], tvmValidExecutors?: string[], calculateRollbackFee?: boolean): Promise<ExecutionFeeEstimationResult>;
|
|
47
47
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Wallet } from 'ethers';
|
|
2
|
-
import type { ISender } from '../sender';
|
|
3
|
-
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, CrossChainTransactionOptions, CrosschainTx, EVMAddress, EvmProxyMsg, ExecutionFeeEstimationResult, NFTAddressType, NFTItemData, OperationIdsByShardsKey, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinkerWithOperationId, TVMAddress, UserWalletBalanceExtended, WaitOptions } from '../structs/Struct';
|
|
4
|
-
import { IConfiguration } from './IConfiguration';
|
|
5
|
-
import { IAsset } from './IAsset';
|
|
6
2
|
import { FT, NFT } from '../assets';
|
|
3
|
+
import type { SenderAbstraction } from '../sender';
|
|
4
|
+
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, CrossChainTransactionOptions, CrosschainTx, EVMAddress, EvmProxyMsg, ExecutionFeeEstimationResult, NFTAddressType, NFTItemData, OperationIdsByShardsKey, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinkerWithOperationId, TVMAddress, UserWalletBalanceExtended, WaitOptions } from '../structs/Struct';
|
|
7
5
|
import { JettonMasterData } from '../wrappers/JettonMaster';
|
|
6
|
+
import { Asset } from './Asset';
|
|
7
|
+
import { IConfiguration } from './IConfiguration';
|
|
8
8
|
export interface ITacSDK {
|
|
9
9
|
readonly config: IConfiguration;
|
|
10
10
|
/**
|
|
@@ -34,9 +34,9 @@ export interface ITacSDK {
|
|
|
34
34
|
* Creates a typed asset wrapper instance based on provided arguments.
|
|
35
35
|
* Pass FT, NFT collection or NFT item parameters; the returned type will match the input.
|
|
36
36
|
* @param args Parameters that describe the asset to wrap (FT/NFT collection/NFT item).
|
|
37
|
-
* @returns Promise resolving to a generic
|
|
37
|
+
* @returns Promise resolving to a generic Asset. Use overloads for stronger typing.
|
|
38
38
|
*/
|
|
39
|
-
getAsset(args: AssetFromFTArg | AssetFromNFTCollectionArg | AssetFromNFTItemArg): Promise<
|
|
39
|
+
getAsset(args: AssetFromFTArg | AssetFromNFTCollectionArg | AssetFromNFTItemArg): Promise<Asset>;
|
|
40
40
|
getAsset(args: AssetFromFTArg): Promise<FT>;
|
|
41
41
|
getAsset(args: AssetFromNFTCollectionArg): Promise<NFT>;
|
|
42
42
|
getAsset(args: AssetFromNFTItemArg): Promise<NFT>;
|
|
@@ -65,7 +65,7 @@ export interface ITacSDK {
|
|
|
65
65
|
* @param txs Array of cross-chain transactions to simulate.
|
|
66
66
|
* @returns Promise with an array of results matching the input order.
|
|
67
67
|
*/
|
|
68
|
-
simulateTransactions(sender:
|
|
68
|
+
simulateTransactions(sender: SenderAbstraction, txs: CrosschainTx[]): Promise<TACSimulationResult[]>;
|
|
69
69
|
/**
|
|
70
70
|
* Computes fee and execution information for a prospective transaction.
|
|
71
71
|
* @param evmProxyMsg Encoded EVM proxy message.
|
|
@@ -73,7 +73,7 @@ export interface ITacSDK {
|
|
|
73
73
|
* @param assets Optional list of assets attached to the transaction.
|
|
74
74
|
* @returns Promise with the fee estimation and execution breakdown.
|
|
75
75
|
*/
|
|
76
|
-
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender:
|
|
76
|
+
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[]): Promise<ExecutionFeeEstimationResult>;
|
|
77
77
|
/**
|
|
78
78
|
* Suggests optimal TON-side executor fee for a given asset set and fee symbol.
|
|
79
79
|
* @param assets Assets to be processed on TON side.
|
|
@@ -81,7 +81,7 @@ export interface ITacSDK {
|
|
|
81
81
|
* @param tvmValidExecutors Optional whitelist of allowed TVM executors.
|
|
82
82
|
* @returns Promise with suggested fee details.
|
|
83
83
|
*/
|
|
84
|
-
getTVMExecutorFeeInfo(assets:
|
|
84
|
+
getTVMExecutorFeeInfo(assets: Asset[], feeSymbol: string, tvmValidExecutors?: string[]): Promise<SuggestedTONExecutorFee>;
|
|
85
85
|
/**
|
|
86
86
|
* Sends a single cross-chain transaction and optionally waits for tracking information.
|
|
87
87
|
* @param evmProxyMsg Encoded EVM proxy message to be bridged.
|
|
@@ -91,7 +91,7 @@ export interface ITacSDK {
|
|
|
91
91
|
* @param waitOptions Optional waiting policy for operation id resolution.
|
|
92
92
|
* @returns Promise with a TransactionLinkerWithOperationId to track the operation across chains.
|
|
93
93
|
*/
|
|
94
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender:
|
|
94
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[], options?: CrossChainTransactionOptions, waitOptions?: WaitOptions<string>): Promise<TransactionLinkerWithOperationId>;
|
|
95
95
|
/**
|
|
96
96
|
* Sends multiple cross-chain transactions in one batch and optionally waits for tracking info.
|
|
97
97
|
* @param sender Sender abstraction for signing/sending TVM messages.
|
|
@@ -99,7 +99,7 @@ export interface ITacSDK {
|
|
|
99
99
|
* @param waitOptions Optional waiting policy for operation ids by shard keys.
|
|
100
100
|
* @returns Promise with an array of TransactionLinkerWithOperationId for each submitted transaction.
|
|
101
101
|
*/
|
|
102
|
-
sendCrossChainTransactions(sender:
|
|
102
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: CrosschainTx[], waitOptions?: WaitOptions<OperationIdsByShardsKey>): Promise<TransactionLinkerWithOperationId[]>;
|
|
103
103
|
/**
|
|
104
104
|
* Bridges tokens/value from EVM to TON chain via the executor.
|
|
105
105
|
* @param signer Ethers Wallet used to sign the EVM-side transaction.
|
|
@@ -110,7 +110,7 @@ export interface ITacSDK {
|
|
|
110
110
|
* @param tvmValidExecutors Optional whitelist of allowed TVM executors.
|
|
111
111
|
* @returns Promise resolving to the EVM transaction hash or bridge identifier.
|
|
112
112
|
*/
|
|
113
|
-
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?:
|
|
113
|
+
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?: Asset[], tvmExecutorFee?: bigint, tvmValidExecutors?: string[]): Promise<string>;
|
|
114
114
|
/**
|
|
115
115
|
* Returns the user's Jetton wallet address for a given Jetton master (token) address.
|
|
116
116
|
* @param userAddress TVM user address.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Wallet } from 'ethers';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SenderAbstraction } from '../sender';
|
|
3
3
|
import { CrossChainTransactionOptions, CrosschainTx, EvmProxyMsg, OperationIdsByShardsKey, TransactionLinkerWithOperationId, WaitOptions } from '../structs/Struct';
|
|
4
|
-
import {
|
|
4
|
+
import { Asset } from './Asset';
|
|
5
5
|
export interface ITransactionManager {
|
|
6
6
|
/**
|
|
7
7
|
* Sends a single cross-chain transaction.
|
|
@@ -12,7 +12,7 @@ export interface ITransactionManager {
|
|
|
12
12
|
* @param waitOptions Optional policy to wait for operation id resolution.
|
|
13
13
|
* @returns Transaction linker with operation id for tracking.
|
|
14
14
|
*/
|
|
15
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender:
|
|
15
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[], options?: CrossChainTransactionOptions, waitOptions?: WaitOptions<string>): Promise<TransactionLinkerWithOperationId>;
|
|
16
16
|
/**
|
|
17
17
|
* Sends multiple cross-chain transactions in a batch.
|
|
18
18
|
* @param sender Sender abstraction for TVM message sending.
|
|
@@ -20,7 +20,7 @@ export interface ITransactionManager {
|
|
|
20
20
|
* @param waitOptions Optional policy for waiting on operation ids by shard keys.
|
|
21
21
|
* @returns Array of transaction linkers, one per submitted transaction.
|
|
22
22
|
*/
|
|
23
|
-
sendCrossChainTransactions(sender:
|
|
23
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: CrosschainTx[], waitOptions?: WaitOptions<OperationIdsByShardsKey>): Promise<TransactionLinkerWithOperationId[]>;
|
|
24
24
|
/**
|
|
25
25
|
* Bridges native EVM value and optional assets to TON chain via executor.
|
|
26
26
|
* @param signer Ethers Wallet used to sign EVM transaction.
|
|
@@ -31,5 +31,5 @@ export interface ITransactionManager {
|
|
|
31
31
|
* @param tvmValidExecutors Optional whitelist of allowed TVM executors.
|
|
32
32
|
* @returns EVM transaction hash or bridge identifier.
|
|
33
33
|
*/
|
|
34
|
-
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?:
|
|
34
|
+
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?: Asset[], tvmExecutorFee?: bigint, tvmValidExecutors?: string[]): Promise<string>;
|
|
35
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SendResult, ShardTransaction } from '../structs/InternalStruct';
|
|
2
|
-
import type { IAsset, IContractOpener } from './index';
|
|
3
2
|
import { Network } from '../structs/Struct';
|
|
4
|
-
|
|
3
|
+
import type { Asset, ContractOpener } from './index';
|
|
4
|
+
export interface SenderAbstraction {
|
|
5
5
|
/**
|
|
6
6
|
* Sends a single shard transaction on the specified chain.
|
|
7
7
|
* @param shardTransaction Prepared transaction payload to send.
|
|
@@ -9,7 +9,7 @@ export interface ISender {
|
|
|
9
9
|
* @param contractOpener Optional contract opener to use for sending.
|
|
10
10
|
* @returns Promise with low-level send result.
|
|
11
11
|
*/
|
|
12
|
-
sendShardTransaction(shardTransaction: ShardTransaction, chain?: Network, contractOpener?:
|
|
12
|
+
sendShardTransaction(shardTransaction: ShardTransaction, chain?: Network, contractOpener?: ContractOpener): Promise<SendResult>;
|
|
13
13
|
/**
|
|
14
14
|
* Sends multiple shard transactions as a batch.
|
|
15
15
|
* @param shardTransactions Array of prepared shard transactions to send.
|
|
@@ -17,7 +17,7 @@ export interface ISender {
|
|
|
17
17
|
* @param contractOpener Optional contract opener to use for sending.
|
|
18
18
|
* @returns Promise with an array of low-level send results in the same order.
|
|
19
19
|
*/
|
|
20
|
-
sendShardTransactions(shardTransactions: ShardTransaction[], chain?: Network, contractOpener?:
|
|
20
|
+
sendShardTransactions(shardTransactions: ShardTransaction[], chain?: Network, contractOpener?: ContractOpener): Promise<SendResult[]>;
|
|
21
21
|
/**
|
|
22
22
|
* Returns the TVM address of the underlying sender wallet.
|
|
23
23
|
*/
|
|
@@ -26,10 +26,10 @@ export interface ISender {
|
|
|
26
26
|
* Returns the TON balance of the sender wallet using the provided opener.
|
|
27
27
|
* @param contractOpener Contract opener used for on-chain queries.
|
|
28
28
|
*/
|
|
29
|
-
getBalance(contractOpener:
|
|
29
|
+
getBalance(contractOpener: ContractOpener): Promise<bigint>;
|
|
30
30
|
/**
|
|
31
31
|
* Returns the balance of a given asset for the sender wallet.
|
|
32
32
|
* @param asset Asset wrapper instance to query balance for.
|
|
33
33
|
*/
|
|
34
|
-
getBalanceOf(asset:
|
|
34
|
+
getBalanceOf(asset: Asset): Promise<bigint>;
|
|
35
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Contract, ContractProvider, MessageRelaxed, SendMode } from '@ton/ton';
|
|
2
|
-
export interface
|
|
2
|
+
export interface WalletInstanse extends Contract {
|
|
3
3
|
/**
|
|
4
4
|
* Returns current wallet seqno, used for nonce/ordering.
|
|
5
5
|
* @param provider Contract provider to query the wallet.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './Asset';
|
|
2
|
+
export * from './ContractOpener';
|
|
2
3
|
export * from './IConfiguration';
|
|
3
|
-
export * from './IContractOpener';
|
|
4
4
|
export * from './IHttpClient';
|
|
5
5
|
export * from './ILiteSequencerClient';
|
|
6
6
|
export * from './ILiteSequencerClientFactory';
|
|
7
7
|
export * from './ILogger';
|
|
8
8
|
export * from './IOperationTracker';
|
|
9
|
-
export * from './ISender';
|
|
10
9
|
export * from './ISimulator';
|
|
11
10
|
export * from './ITacSDK';
|
|
12
11
|
export * from './ITransactionManager';
|
|
13
|
-
export * from './
|
|
12
|
+
export * from './SenderAbstraction';
|
|
13
|
+
export * from './WalletInstanse';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -14,16 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./Asset"), exports);
|
|
18
|
+
__exportStar(require("./ContractOpener"), exports);
|
|
18
19
|
__exportStar(require("./IConfiguration"), exports);
|
|
19
|
-
__exportStar(require("./IContractOpener"), exports);
|
|
20
20
|
__exportStar(require("./IHttpClient"), exports);
|
|
21
21
|
__exportStar(require("./ILiteSequencerClient"), exports);
|
|
22
22
|
__exportStar(require("./ILiteSequencerClientFactory"), exports);
|
|
23
23
|
__exportStar(require("./ILogger"), exports);
|
|
24
24
|
__exportStar(require("./IOperationTracker"), exports);
|
|
25
|
-
__exportStar(require("./ISender"), exports);
|
|
26
25
|
__exportStar(require("./ISimulator"), exports);
|
|
27
26
|
__exportStar(require("./ITacSDK"), exports);
|
|
28
27
|
__exportStar(require("./ITransactionManager"), exports);
|
|
29
|
-
__exportStar(require("./
|
|
28
|
+
__exportStar(require("./SenderAbstraction"), exports);
|
|
29
|
+
__exportStar(require("./WalletInstanse"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IHttpClient } from '../interfaces';
|
|
2
1
|
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import { IHttpClient } from '../interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Axios-based HTTP client that isolates SDK traffic from any global axios configuration.
|
|
5
5
|
* It uses its own axios instance, so external/global interceptors and defaults won't affect SDK requests.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mainnet, testnet } from '@tonappchain/artifacts';
|
|
2
|
-
import { InternalTACParams, InternalTONParams } from '../structs/InternalStruct';
|
|
3
2
|
import { IConfiguration } from '../interfaces';
|
|
3
|
+
import { InternalTACParams, InternalTONParams } from '../structs/InternalStruct';
|
|
4
4
|
import { Network, TACParams, TONParams } from '../structs/Struct';
|
|
5
5
|
export declare class Configuration implements IConfiguration {
|
|
6
6
|
readonly network: Network;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStagesByOperationId, OperationIdsByShardsKey, OperationType, StatusInfosByOperationId, TransactionLinker } from '../structs/Struct';
|
|
2
1
|
import { IHttpClient } from '../interfaces';
|
|
2
|
+
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStagesByOperationId, OperationIdsByShardsKey, OperationType, StatusInfosByOperationId, TransactionLinker } from '../structs/Struct';
|
|
3
3
|
export declare class LiteSequencerClient {
|
|
4
4
|
private readonly endpoint;
|
|
5
5
|
private readonly maxChunkSize;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LiteSequencerClient = void 0;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
|
-
const Utils_1 = require("./Utils");
|
|
6
5
|
const AxiosHttpClient_1 = require("./AxiosHttpClient");
|
|
6
|
+
const Utils_1 = require("./Utils");
|
|
7
7
|
class LiteSequencerClient {
|
|
8
8
|
constructor(endpoint, maxChunkSize = 100, httpClient = new AxiosHttpClient_1.AxiosHttpClient()) {
|
|
9
9
|
this.endpoint = endpoint;
|
|
@@ -116,21 +116,18 @@ class LiteSequencerClient {
|
|
|
116
116
|
async convertCurrency(params) {
|
|
117
117
|
try {
|
|
118
118
|
const payload = {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
currency: params.currency,
|
|
120
|
+
value: params.value.toString(),
|
|
121
121
|
};
|
|
122
122
|
const response = await this.httpClient.post(new URL('convert_currency', this.endpoint).toString(), payload, {
|
|
123
123
|
transformResponse: [Utils_1.toCamelCaseTransformer],
|
|
124
124
|
});
|
|
125
125
|
const raw = response.data.response;
|
|
126
126
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
decimals: raw.decimals,
|
|
128
|
+
spotValue: BigInt(raw.spotValue),
|
|
129
129
|
emaValue: BigInt(raw.emaValue),
|
|
130
|
-
|
|
131
|
-
spotValueInUSD: Number(raw.spotValueInUSD),
|
|
132
|
-
emaValueInUSD: Number(raw.emaValueInUSD),
|
|
133
|
-
currencyType: raw.currencyType,
|
|
130
|
+
currency: raw.currency,
|
|
134
131
|
tacPrice: {
|
|
135
132
|
spot: BigInt(raw.tacPrice.spot),
|
|
136
133
|
ema: BigInt(raw.tacPrice.ema),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILiteSequencerClient, ILiteSequencerClientFactory, ILogger, IOperationTracker } from '../interfaces';
|
|
2
2
|
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStages, ExecutionStagesByOperationId, Network, OperationIdsByShardsKey, OperationType, SimplifiedStatuses, StatusInfo, StatusInfosByOperationId, TransactionLinker, WaitOptions } from '../structs/Struct';
|
|
3
3
|
export declare class DefaultLiteSequencerClientFactory implements ILiteSequencerClientFactory {
|
|
4
4
|
createClients(endpoints: string[]): ILiteSequencerClient[];
|
package/dist/sdk/Simulator.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IConfiguration, ILogger, ISimulator } from '../interfaces';
|
|
3
|
-
import { IAsset, CrosschainTx, EvmProxyMsg, ExecutionFeeEstimationResult, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinker } from '../structs/Struct';
|
|
1
|
+
import { Asset, IConfiguration, ILogger, ISimulator } from '../interfaces';
|
|
4
2
|
import { IHttpClient } from '../interfaces';
|
|
3
|
+
import type { SenderAbstraction } from '../sender';
|
|
4
|
+
import { CrosschainTx, EvmProxyMsg, ExecutionFeeEstimationResult, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinker } from '../structs/Struct';
|
|
5
5
|
export declare class Simulator implements ISimulator {
|
|
6
6
|
private readonly config;
|
|
7
7
|
private readonly logger;
|
|
8
8
|
private readonly httpClient;
|
|
9
9
|
constructor(config: IConfiguration, logger?: ILogger, httpClient?: IHttpClient);
|
|
10
10
|
simulateTACMessage(req: TACSimulationRequest): Promise<TACSimulationResult>;
|
|
11
|
-
simulateTransactions(sender:
|
|
11
|
+
simulateTransactions(sender: SenderAbstraction, txs: CrosschainTx[]): Promise<TACSimulationResult[]>;
|
|
12
12
|
private buildTACSimulationRequest;
|
|
13
|
-
getTVMExecutorFeeInfo(assets:
|
|
13
|
+
getTVMExecutorFeeInfo(assets: Asset[], feeSymbol: string, tvmValidExecutors?: string[]): Promise<SuggestedTONExecutorFee>;
|
|
14
14
|
private getFeeInfo;
|
|
15
|
-
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender:
|
|
16
|
-
getSimulationInfoForTransaction(evmProxyMsg: EvmProxyMsg, transactionLinker: TransactionLinker, assets:
|
|
15
|
+
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[]): Promise<ExecutionFeeEstimationResult>;
|
|
16
|
+
getSimulationInfoForTransaction(evmProxyMsg: EvmProxyMsg, transactionLinker: TransactionLinker, assets: Asset[], allowSimulationError?: boolean, isRoundTrip?: boolean, evmValidExecutors?: string[], tvmValidExecutors?: string[], calculateRollbackFee?: boolean): Promise<ExecutionFeeEstimationResult>;
|
|
17
17
|
}
|
package/dist/sdk/Simulator.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Simulator = void 0;
|
|
4
4
|
const ton_1 = require("@ton/ton");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const AxiosHttpClient_1 = require("./AxiosHttpClient");
|
|
6
7
|
const Logger_1 = require("./Logger");
|
|
7
8
|
const Utils_1 = require("./Utils");
|
|
8
9
|
const Validator_1 = require("./Validator");
|
|
9
|
-
const AxiosHttpClient_1 = require("./AxiosHttpClient");
|
|
10
10
|
class Simulator {
|
|
11
11
|
constructor(config, logger = new Logger_1.NoopLogger(), httpClient = new AxiosHttpClient_1.AxiosHttpClient()) {
|
|
12
12
|
this.config = config;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TxFinalizerConfig } from '../structs/InternalStruct';
|
|
2
1
|
import { ILogger } from '../interfaces';
|
|
2
|
+
import { TxFinalizerConfig } from '../structs/InternalStruct';
|
|
3
3
|
import { ExecutionStages, Network, TransactionLinker } from '../structs/Struct';
|
|
4
4
|
export declare function startTracking(transactionLinker: TransactionLinker, network: Network, options?: {
|
|
5
5
|
customLiteSequencerEndpoints?: string[];
|
|
@@ -51,10 +51,10 @@ async function startTracking(transactionLinker, network, options) {
|
|
|
51
51
|
catch (err) {
|
|
52
52
|
logger.debug('failed to get operation type: ' + err);
|
|
53
53
|
}
|
|
54
|
-
logger.debug(`
|
|
55
|
-
operationId: ${operationId}
|
|
56
|
-
operationType: ${operationType}
|
|
57
|
-
time: ${new Date().toISOString()} (${Math.floor(+new Date() / 1000)})
|
|
54
|
+
logger.debug(`
|
|
55
|
+
operationId: ${operationId}
|
|
56
|
+
operationType: ${operationType}
|
|
57
|
+
time: ${new Date().toISOString()} (${Math.floor(+new Date() / 1000)})
|
|
58
58
|
`);
|
|
59
59
|
}
|
|
60
60
|
await (0, Utils_1.sleep)(delay * 1000);
|
package/dist/sdk/TacSdk.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Wallet } from 'ethers';
|
|
2
2
|
import { FT, NFT } from '../assets';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { Asset, IConfiguration, ILogger, ITacSDK } from '../interfaces';
|
|
4
|
+
import type { SenderAbstraction } from '../sender';
|
|
5
|
+
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, CrossChainTransactionOptions, CrosschainTx, EVMAddress, EvmProxyMsg, ExecutionFeeEstimationResult, NFTAddressType, NFTItemData, OperationIdsByShardsKey, SDKParams, SuggestedTONExecutorFee, TACSimulationRequest, TACSimulationResult, TransactionLinkerWithOperationId, TVMAddress, UserWalletBalanceExtended, WaitOptions } from '../structs/Struct';
|
|
6
6
|
import { JettonMasterData } from '../wrappers/JettonMaster';
|
|
7
7
|
export declare class TacSdk implements ITacSDK {
|
|
8
8
|
readonly config: IConfiguration;
|
|
@@ -15,14 +15,14 @@ export declare class TacSdk implements ITacSDK {
|
|
|
15
15
|
nativeTACAddress(): Promise<string>;
|
|
16
16
|
get getTrustedTACExecutors(): string[];
|
|
17
17
|
get getTrustedTONExecutors(): string[];
|
|
18
|
-
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender:
|
|
19
|
-
getTVMExecutorFeeInfo(assets:
|
|
20
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender:
|
|
21
|
-
sendCrossChainTransactions(sender:
|
|
22
|
-
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?:
|
|
18
|
+
getTransactionSimulationInfo(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[]): Promise<ExecutionFeeEstimationResult>;
|
|
19
|
+
getTVMExecutorFeeInfo(assets: Asset[], feeSymbol: string, tvmValidExecutors?: string[]): Promise<SuggestedTONExecutorFee>;
|
|
20
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[], options?: CrossChainTransactionOptions, waitOptions?: WaitOptions<string>): Promise<TransactionLinkerWithOperationId>;
|
|
21
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: CrosschainTx[], waitOptions?: WaitOptions<OperationIdsByShardsKey>): Promise<TransactionLinkerWithOperationId[]>;
|
|
22
|
+
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?: Asset[], tvmExecutorFee?: bigint, tvmValidExecutors?: string[]): Promise<string>;
|
|
23
23
|
isContractDeployedOnTVM(address: string): Promise<boolean>;
|
|
24
24
|
simulateTACMessage(req: TACSimulationRequest): Promise<TACSimulationResult>;
|
|
25
|
-
simulateTransactions(sender:
|
|
25
|
+
simulateTransactions(sender: SenderAbstraction, txs: CrosschainTx[]): Promise<TACSimulationResult[]>;
|
|
26
26
|
getAsset(args: AssetFromFTArg): Promise<FT>;
|
|
27
27
|
getAsset(args: AssetFromNFTCollectionArg): Promise<NFT>;
|
|
28
28
|
getAsset(args: AssetFromNFTItemArg): Promise<NFT>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Cell } from '@ton/ton';
|
|
2
2
|
import { Wallet } from 'ethers';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { Asset, IConfiguration, ILogger, IOperationTracker, ISimulator, ITransactionManager } from '../interfaces';
|
|
4
|
+
import type { SenderAbstraction } from '../sender';
|
|
5
|
+
import { CrossChainTransactionOptions, CrosschainTx, EvmProxyMsg, OperationIdsByShardsKey, TransactionLinker, TransactionLinkerWithOperationId, ValidExecutors, WaitOptions } from '../structs/Struct';
|
|
6
6
|
export declare class TransactionManager implements ITransactionManager {
|
|
7
7
|
private readonly config;
|
|
8
8
|
private readonly simulator;
|
|
@@ -14,9 +14,9 @@ export declare class TransactionManager implements ITransactionManager {
|
|
|
14
14
|
});
|
|
15
15
|
private prepareCrossChainTransaction;
|
|
16
16
|
private generateCrossChainMessages;
|
|
17
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender:
|
|
18
|
-
sendCrossChainTransactions(sender:
|
|
17
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: Asset[], options?: CrossChainTransactionOptions, waitOptions?: WaitOptions<string>): Promise<TransactionLinkerWithOperationId>;
|
|
18
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: CrosschainTx[], waitOptions?: WaitOptions<OperationIdsByShardsKey>): Promise<TransactionLinkerWithOperationId[]>;
|
|
19
19
|
private prepareCrossChainTransactions;
|
|
20
20
|
private waitForOperationIds;
|
|
21
|
-
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?:
|
|
21
|
+
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?: Asset[], tvmExecutorFee?: bigint, tvmValidExecutors?: string[]): Promise<string>;
|
|
22
22
|
}
|
package/dist/sdk/Utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Address, Cell } from '@ton/ton';
|
|
2
2
|
import { AbiCoder } from 'ethers';
|
|
3
3
|
import { FT, NFT, TON } from '../assets';
|
|
4
|
+
import { Asset } from '../interfaces';
|
|
4
5
|
import { RandomNumberByTimestamp } from '../structs/InternalStruct';
|
|
5
|
-
import { IAsset } from '../interfaces';
|
|
6
6
|
import { EvmProxyMsg, FeeParams, TransactionLinker, ValidExecutors, WaitOptions } from '../structs/Struct';
|
|
7
7
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
8
8
|
export declare function generateRandomNumber(interval: number): number;
|
|
@@ -19,7 +19,7 @@ export declare const toCamelCaseTransformer: (data: string) => any;
|
|
|
19
19
|
export declare const generateFeeData: (feeParams?: FeeParams) => Cell | undefined;
|
|
20
20
|
export declare function waitUntilSuccess<T, A extends unknown[]>(options: WaitOptions<T> | undefined, operation: (...args: A) => Promise<T>, ...args: A): Promise<T>;
|
|
21
21
|
export declare function formatObjectForLogging(obj: unknown): string;
|
|
22
|
-
export declare function aggregateTokens(assets?:
|
|
22
|
+
export declare function aggregateTokens(assets?: Asset[]): Promise<{
|
|
23
23
|
jettons: FT[];
|
|
24
24
|
nfts: NFT[];
|
|
25
25
|
ton?: TON;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { Asset, ContractOpener, SenderAbstraction } from '../interfaces';
|
|
1
2
|
import type { SendResult, ShardTransaction } from '../structs/InternalStruct';
|
|
2
|
-
import type { IAsset, IContractOpener, ISender } from '../interfaces';
|
|
3
3
|
import { Network } from '../structs/Struct';
|
|
4
4
|
import { HighloadWalletV3 } from '../wrappers/HighloadWalletV3';
|
|
5
|
-
export declare class BatchSender implements
|
|
5
|
+
export declare class BatchSender implements SenderAbstraction {
|
|
6
6
|
private wallet;
|
|
7
7
|
private secretKey;
|
|
8
8
|
private lastCreatedAt;
|
|
9
9
|
constructor(wallet: HighloadWalletV3, secretKey: Buffer);
|
|
10
|
-
getBalanceOf(asset:
|
|
11
|
-
getBalance(contractOpener:
|
|
12
|
-
sendShardTransactions(shardTransactions: ShardTransaction[], _chain: Network, contractOpener:
|
|
10
|
+
getBalanceOf(asset: Asset): Promise<bigint>;
|
|
11
|
+
getBalance(contractOpener: ContractOpener): Promise<bigint>;
|
|
12
|
+
sendShardTransactions(shardTransactions: ShardTransaction[], _chain: Network, contractOpener: ContractOpener): Promise<SendResult[]>;
|
|
13
13
|
private prepareGroups;
|
|
14
14
|
private sendGroup;
|
|
15
15
|
getSenderAddress(): string;
|
|
16
|
-
sendShardTransaction(shardTransaction: ShardTransaction, _chain: Network, contractOpener:
|
|
16
|
+
sendShardTransaction(shardTransaction: ShardTransaction, _chain: Network, contractOpener: ContractOpener): Promise<SendResult>;
|
|
17
17
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { Asset, ContractOpener } from '../interfaces';
|
|
2
|
+
import { SenderAbstraction, WalletInstanse } from '../interfaces';
|
|
1
3
|
import type { SendResult, ShardTransaction } from '../structs/InternalStruct';
|
|
2
|
-
import type { IAsset, IContractOpener } from '../interfaces';
|
|
3
4
|
import { Network } from '../structs/Struct';
|
|
4
|
-
|
|
5
|
-
export declare class RawSender implements ISender {
|
|
5
|
+
export declare class RawSender implements SenderAbstraction {
|
|
6
6
|
private wallet;
|
|
7
7
|
private secretKey;
|
|
8
8
|
private maxBatchSize;
|
|
9
|
-
constructor(wallet:
|
|
10
|
-
getBalanceOf(asset:
|
|
11
|
-
getBalance(contractOpener:
|
|
12
|
-
sendShardTransactions(shardTransactions: ShardTransaction[], _chain: Network, contractOpener:
|
|
9
|
+
constructor(wallet: WalletInstanse, secretKey: Buffer, maxBatchSize?: number);
|
|
10
|
+
getBalanceOf(asset: Asset): Promise<bigint>;
|
|
11
|
+
getBalance(contractOpener: ContractOpener): Promise<bigint>;
|
|
12
|
+
sendShardTransactions(shardTransactions: ShardTransaction[], _chain: Network, contractOpener: ContractOpener): Promise<SendResult[]>;
|
|
13
13
|
private prepareBatches;
|
|
14
14
|
private sendBatch;
|
|
15
15
|
getSenderAddress(): string;
|
|
16
|
-
sendShardTransaction(shardTransaction: ShardTransaction, _chain: Network, contractOpener:
|
|
16
|
+
sendShardTransaction(shardTransaction: ShardTransaction, _chain: Network, contractOpener: ContractOpener): Promise<SendResult>;
|
|
17
17
|
}
|