@tonappchain/sdk 0.7.2-alpha-7 → 0.7.2-alpha-10
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 +198 -198
- package/dist/artifacts/dev/index.d.ts +2 -2
- package/dist/artifacts/dev/index.js +2 -1
- package/dist/artifacts/dev/tac/endpoints.d.ts +1 -0
- package/dist/artifacts/dev/tac/endpoints.js +2 -1
- package/dist/artifacts/dev/ton/internal/build/CrossChainLayer.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/Executor.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/JettonProxy.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/JettonWallet.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/NFTItem.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/NFTProxy.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/build/Settings.compiled.json +1 -1
- package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.d.ts +53 -6
- package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.js +126 -17
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.d.ts +6 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.js +10 -1
- package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.d.ts +9 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.js +10 -1
- package/dist/artifacts/dev/ton/internal/wrappers/JettonWallet.d.ts +7 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonWallet.js +9 -2
- package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.d.ts +9 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.js +9 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.d.ts +7 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.js +7 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.d.ts +7 -0
- package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.js +8 -1
- package/dist/artifacts/dev/ton/internal/wrappers/Settings.d.ts +1 -0
- package/dist/artifacts/dev/ton/internal/wrappers/Settings.js +1 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/CrossChainLayerPayload.d.ts +10 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/CrossChainLayerPayload.js +24 -0
- package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.d.ts +2 -1
- package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.js +9 -1
- package/dist/artifacts/mainnet/index.d.ts +2 -2
- package/dist/artifacts/mainnet/index.js +2 -1
- package/dist/artifacts/mainnet/tac/endpoints.d.ts +1 -0
- package/dist/artifacts/mainnet/tac/endpoints.js +2 -1
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.d.ts +4 -0
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.js +7 -0
- package/dist/artifacts/testnet/index.d.ts +2 -2
- package/dist/artifacts/testnet/index.js +2 -1
- package/dist/artifacts/testnet/tac/endpoints.d.ts +1 -0
- package/dist/artifacts/testnet/tac/endpoints.js +2 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.d.ts +4 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.js +7 -0
- package/dist/src/adapters/contractOpener.js +10 -19
- package/dist/src/assets/FT.d.ts +9 -0
- package/dist/src/assets/FT.js +48 -4
- package/dist/src/errors/errors.d.ts +3 -0
- package/dist/src/errors/errors.js +8 -1
- package/dist/src/errors/index.d.ts +2 -2
- package/dist/src/errors/index.js +3 -1
- package/dist/src/errors/instances.d.ts +2 -1
- package/dist/src/errors/instances.js +4 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/interfaces/Asset.d.ts +4 -0
- package/dist/src/interfaces/ILiteSequencerClient.d.ts +1 -6
- package/dist/src/interfaces/IOperationTracker.d.ts +1 -6
- package/dist/src/interfaces/ITacExplorerClient.d.ts +8 -0
- package/dist/src/interfaces/ITacExplorerClient.js +2 -0
- package/dist/src/interfaces/ITacSDK.d.ts +5 -0
- package/dist/src/interfaces/ITxFinalizer.d.ts +2 -3
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/sdk/Configuration.d.ts +4 -3
- package/dist/src/sdk/Configuration.js +18 -6
- package/dist/src/sdk/Consts.d.ts +1 -0
- package/dist/src/sdk/Consts.js +2 -1
- package/dist/src/sdk/Fees.d.ts +20 -74
- package/dist/src/sdk/Fees.js +56 -53
- package/dist/src/sdk/LiteSequencerClient.d.ts +1 -2
- package/dist/src/sdk/LiteSequencerClient.js +0 -9
- package/dist/src/sdk/OperationTracker.d.ts +1 -2
- package/dist/src/sdk/OperationTracker.js +0 -20
- package/dist/src/sdk/Simulator.js +23 -21
- package/dist/src/sdk/StartTracking.js +4 -4
- package/dist/src/sdk/TacExplorerClient.d.ts +8 -0
- package/dist/src/sdk/TacExplorerClient.js +22 -0
- package/dist/src/sdk/TacSdk.d.ts +5 -7
- package/dist/src/sdk/TacSdk.js +10 -4
- package/dist/src/sdk/TxFinalizer.d.ts +3 -6
- package/dist/src/sdk/TxFinalizer.js +52 -42
- package/dist/src/sdk/Utils.d.ts +5 -0
- package/dist/src/sdk/Utils.js +11 -0
- package/dist/src/structs/InternalStruct.d.ts +66 -0
- package/dist/src/structs/Struct.d.ts +8 -6
- package/package.json +115 -116
|
@@ -6,6 +6,7 @@ import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, AssetLi
|
|
|
6
6
|
import { Asset } from './Asset';
|
|
7
7
|
import { IConfiguration } from './IConfiguration';
|
|
8
8
|
import { IOperationTracker } from './IOperationTracker';
|
|
9
|
+
import { ITacExplorerClient } from './ITacExplorerClient';
|
|
9
10
|
export interface ITacSDK {
|
|
10
11
|
readonly config: IConfiguration;
|
|
11
12
|
/**
|
|
@@ -182,6 +183,10 @@ export interface ITacSDK {
|
|
|
182
183
|
* Returns the operation tracker instance used for querying operation statuses and utilities.
|
|
183
184
|
*/
|
|
184
185
|
getOperationTracker(): IOperationTracker;
|
|
186
|
+
/**
|
|
187
|
+
* Returns the TAC explorer client instance used for querying blockchain explorer data.
|
|
188
|
+
*/
|
|
189
|
+
getTacExplorerClient(): ITacExplorerClient;
|
|
185
190
|
/**
|
|
186
191
|
* Prepares the transaction payloads required for a cross-chain operation without sending them.
|
|
187
192
|
* @param evmProxyMsg Encoded EVM proxy message.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import { TrackTransactionTreeParams } from "../structs/Struct";
|
|
1
2
|
export interface ITxFinalizer {
|
|
2
|
-
trackTransactionTree(address: string, hash: string, params?:
|
|
3
|
-
maxDepth?: number;
|
|
4
|
-
}): Promise<void>;
|
|
3
|
+
trackTransactionTree(address: string, hash: string, params?: TrackTransactionTreeParams): Promise<void>;
|
|
5
4
|
}
|
|
@@ -7,6 +7,7 @@ export * from './ILiteSequencerClientFactory';
|
|
|
7
7
|
export * from './ILogger';
|
|
8
8
|
export * from './IOperationTracker';
|
|
9
9
|
export * from './ISimulator';
|
|
10
|
+
export * from './ITacExplorerClient';
|
|
10
11
|
export * from './ITacSDK';
|
|
11
12
|
export * from './ITACTransactionManager';
|
|
12
13
|
export * from './ITONTransactionManager';
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./ILiteSequencerClientFactory"), exports);
|
|
|
23
23
|
__exportStar(require("./ILogger"), exports);
|
|
24
24
|
__exportStar(require("./IOperationTracker"), exports);
|
|
25
25
|
__exportStar(require("./ISimulator"), exports);
|
|
26
|
+
__exportStar(require("./ITacExplorerClient"), exports);
|
|
26
27
|
__exportStar(require("./ITacSDK"), exports);
|
|
27
28
|
__exportStar(require("./ITACTransactionManager"), exports);
|
|
28
29
|
__exportStar(require("./ITONTransactionManager"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dev, mainnet, testnet } from '../../artifacts';
|
|
2
|
-
import { IConfiguration } from '../interfaces';
|
|
2
|
+
import { IConfiguration, ILogger } from '../interfaces';
|
|
3
3
|
import { InternalTACParams, InternalTONParams } from '../structs/InternalStruct';
|
|
4
4
|
import { Network, TACParams, TONParams } from '../structs/Struct';
|
|
5
5
|
export declare class Configuration implements IConfiguration {
|
|
@@ -8,8 +8,9 @@ export declare class Configuration implements IConfiguration {
|
|
|
8
8
|
readonly TONParams: InternalTONParams;
|
|
9
9
|
readonly TACParams: InternalTACParams;
|
|
10
10
|
readonly liteSequencerEndpoints: string[];
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
readonly logger: ILogger;
|
|
12
|
+
constructor(network: Network, artifacts: typeof testnet | typeof mainnet | typeof dev, TONParams: InternalTONParams, TACParams: InternalTACParams, liteSequencerEndpoints: string[], logger: ILogger);
|
|
13
|
+
static create(network: Network, artifacts: typeof testnet | typeof mainnet | typeof dev, TONParams?: TONParams, TACParams?: TACParams, customLiteSequencerEndpoints?: string[], delay?: number, logger?: ILogger): Promise<Configuration>;
|
|
13
14
|
private static prepareTONParams;
|
|
14
15
|
private static prepareTACParams;
|
|
15
16
|
private static loadTACSettingsViaMulticall;
|
|
@@ -6,19 +6,22 @@ const ethers_1 = require("ethers");
|
|
|
6
6
|
const artifacts_1 = require("../../artifacts");
|
|
7
7
|
const adapters_1 = require("../adapters");
|
|
8
8
|
const Struct_1 = require("../structs/Struct");
|
|
9
|
+
const Fees_1 = require("./Fees");
|
|
10
|
+
const Logger_1 = require("./Logger");
|
|
9
11
|
const Utils_1 = require("./Utils");
|
|
10
12
|
const Validator_1 = require("./Validator");
|
|
11
13
|
class Configuration {
|
|
12
|
-
constructor(network, artifacts, TONParams, TACParams, liteSequencerEndpoints) {
|
|
14
|
+
constructor(network, artifacts, TONParams, TACParams, liteSequencerEndpoints, logger) {
|
|
13
15
|
this.network = network;
|
|
14
16
|
this.artifacts = artifacts;
|
|
15
17
|
this.TONParams = TONParams;
|
|
16
18
|
this.TACParams = TACParams;
|
|
17
19
|
this.liteSequencerEndpoints = liteSequencerEndpoints;
|
|
20
|
+
this.logger = logger;
|
|
18
21
|
}
|
|
19
|
-
static async create(network, artifacts, TONParams, TACParams, customLiteSequencerEndpoints, delay) {
|
|
22
|
+
static async create(network, artifacts, TONParams, TACParams, customLiteSequencerEndpoints, delay, logger = new Logger_1.NoopLogger()) {
|
|
20
23
|
const [internalTONParams, internalTACParams] = await Promise.all([
|
|
21
|
-
this.prepareTONParams(network, TONParams, delay),
|
|
24
|
+
this.prepareTONParams(network, artifacts, TONParams, delay, logger),
|
|
22
25
|
this.prepareTACParams(network, TACParams),
|
|
23
26
|
]);
|
|
24
27
|
let liteSequencerEndpoints;
|
|
@@ -31,12 +34,11 @@ class Configuration {
|
|
|
31
34
|
else {
|
|
32
35
|
liteSequencerEndpoints = customLiteSequencerEndpoints ?? artifacts.PUBLIC_LITE_SEQUENCER_ENDPOINTS;
|
|
33
36
|
}
|
|
34
|
-
return new Configuration(network, artifacts, internalTONParams, internalTACParams, liteSequencerEndpoints);
|
|
37
|
+
return new Configuration(network, artifacts, internalTONParams, internalTACParams, liteSequencerEndpoints, logger);
|
|
35
38
|
}
|
|
36
|
-
static async prepareTONParams(network, TONParams, delay) {
|
|
39
|
+
static async prepareTONParams(network, artifacts, TONParams, delay, logger = new Logger_1.NoopLogger()) {
|
|
37
40
|
let contractOpener;
|
|
38
41
|
let settingsAddress;
|
|
39
|
-
const artifacts = network === Struct_1.Network.MAINNET ? artifacts_1.mainnet : network === Struct_1.Network.TESTNET ? artifacts_1.testnet : artifacts_1.dev;
|
|
40
42
|
if (network === Struct_1.Network.DEV) {
|
|
41
43
|
if (!TONParams || !TONParams.contractOpener) {
|
|
42
44
|
throw new Error('For dev network, a custom contract opener must be provided in TONParams');
|
|
@@ -63,6 +65,15 @@ class Configuration {
|
|
|
63
65
|
const jettonMinterCode = allSettings.get((0, Utils_1.sha256toBigInt)('JettonMinterCode'));
|
|
64
66
|
const nftItemCode = allSettings.get((0, Utils_1.sha256toBigInt)('NFTItemCode'));
|
|
65
67
|
const nftCollectionCode = allSettings.get((0, Utils_1.sha256toBigInt)('NFTCollectionCode'));
|
|
68
|
+
let contractFeeUsageParams = Fees_1.DEFAULT_CONTRACT_FEE_USAGE_PARAMS;
|
|
69
|
+
const contractFeeUsageParamsCell = allSettings.get((0, Utils_1.sha256toBigInt)('ContractFeeUsageParams'));
|
|
70
|
+
if (contractFeeUsageParamsCell) {
|
|
71
|
+
const jsonString = contractFeeUsageParamsCell.beginParse().loadStringTail();
|
|
72
|
+
contractFeeUsageParams = JSON.parse(jsonString);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
logger.debug('Failed to load ContractFeeUsageParams from Settings, used default');
|
|
76
|
+
}
|
|
66
77
|
const feesParams = await this.retrieveTONFeesParams(contractOpener);
|
|
67
78
|
return {
|
|
68
79
|
contractOpener,
|
|
@@ -74,6 +85,7 @@ class Configuration {
|
|
|
74
85
|
nftItemCode,
|
|
75
86
|
nftCollectionCode,
|
|
76
87
|
feesParams,
|
|
88
|
+
contractFeeUsageParams,
|
|
77
89
|
};
|
|
78
90
|
}
|
|
79
91
|
static async prepareTACParams(network, TACParams) {
|
package/dist/src/sdk/Consts.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const FIFTEEN_MINUTES: number;
|
|
|
13
13
|
export declare const ONE_YEAR_SECONDS: number;
|
|
14
14
|
export declare const TON_DECIMALS = 9;
|
|
15
15
|
export declare const TAC_DECIMALS = 18;
|
|
16
|
+
export declare const FIVE_MINUTES: number;
|
|
16
17
|
export declare const TON_BURN_ADDRESS = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c";
|
|
17
18
|
export declare const DEFAULT_FIND_TX_TIMEOUT_MS = 60000;
|
|
18
19
|
export declare const DEFAULT_FIND_TX_RETRY_DELAY_MS = 2000;
|
package/dist/src/sdk/Consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IGNORE_MSG_VALUE_1_NANO = exports.DEFAULT_FIND_TX_MAX_DEPTH = exports.DEFAULT_FIND_TX_ARCHIVAL = exports.DEFAULT_FIND_TX_LIMIT = exports.DEFAULT_FIND_TX_RETRY_DELAY_MS = exports.DEFAULT_FIND_TX_TIMEOUT_MS = exports.TON_BURN_ADDRESS = exports.TAC_DECIMALS = exports.TON_DECIMALS = exports.ONE_YEAR_SECONDS = exports.FIFTEEN_MINUTES = exports.TAC_SYMBOL = exports.TON_SYMBOL = exports.MAX_MSG_DEPTH = exports.MAX_HIGHLOAD_GROUP_MSG_NUM = exports.MAX_EXT_MSG_SIZE = exports.SOLIDITY_METHOD_NAME_REGEX = exports.SOLIDITY_SIGNATURE_REGEX = exports.DEFAULT_DELAY = exports.MAX_ITERATION_COUNT = exports.NFT_TRANSFER_FORWARD_TON_AMOUNT = exports.JETTON_TRANSFER_FORWARD_TON_AMOUNT = void 0;
|
|
3
|
+
exports.IGNORE_MSG_VALUE_1_NANO = exports.DEFAULT_FIND_TX_MAX_DEPTH = exports.DEFAULT_FIND_TX_ARCHIVAL = exports.DEFAULT_FIND_TX_LIMIT = exports.DEFAULT_FIND_TX_RETRY_DELAY_MS = exports.DEFAULT_FIND_TX_TIMEOUT_MS = exports.TON_BURN_ADDRESS = exports.FIVE_MINUTES = exports.TAC_DECIMALS = exports.TON_DECIMALS = exports.ONE_YEAR_SECONDS = exports.FIFTEEN_MINUTES = exports.TAC_SYMBOL = exports.TON_SYMBOL = exports.MAX_MSG_DEPTH = exports.MAX_HIGHLOAD_GROUP_MSG_NUM = exports.MAX_EXT_MSG_SIZE = exports.SOLIDITY_METHOD_NAME_REGEX = exports.SOLIDITY_SIGNATURE_REGEX = exports.DEFAULT_DELAY = exports.MAX_ITERATION_COUNT = exports.NFT_TRANSFER_FORWARD_TON_AMOUNT = exports.JETTON_TRANSFER_FORWARD_TON_AMOUNT = void 0;
|
|
4
4
|
const ton_1 = require("@ton/ton");
|
|
5
5
|
exports.JETTON_TRANSFER_FORWARD_TON_AMOUNT = (0, ton_1.toNano)(0.2);
|
|
6
6
|
exports.NFT_TRANSFER_FORWARD_TON_AMOUNT = (0, ton_1.toNano)(0.3);
|
|
@@ -17,6 +17,7 @@ exports.FIFTEEN_MINUTES = 15 * 60 * 1000;
|
|
|
17
17
|
exports.ONE_YEAR_SECONDS = 365 * 24 * 3600;
|
|
18
18
|
exports.TON_DECIMALS = 9;
|
|
19
19
|
exports.TAC_DECIMALS = 18;
|
|
20
|
+
exports.FIVE_MINUTES = 5 * 60 * 1000;
|
|
20
21
|
exports.TON_BURN_ADDRESS = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c';
|
|
21
22
|
// TX TRACKING
|
|
22
23
|
exports.DEFAULT_FIND_TX_TIMEOUT_MS = 60000;
|
package/dist/src/sdk/Fees.d.ts
CHANGED
|
@@ -1,75 +1,21 @@
|
|
|
1
|
-
import { TransactionFeeCalculationStep } from '../structs/InternalStruct';
|
|
1
|
+
import { ContractFeeUsageParams, TransactionFeeCalculationStep } from '../structs/InternalStruct';
|
|
2
2
|
export declare const FIXED_POINT_SHIFT: number;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
estimatedSendTransfer: number;
|
|
23
|
-
estimatedReceiveTransfer: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
jettonProxy: {
|
|
27
|
-
accountbits: number;
|
|
28
|
-
accountCells: number;
|
|
29
|
-
gas: {
|
|
30
|
-
ownershipAssigned: number;
|
|
31
|
-
transferNotification: number;
|
|
32
|
-
errorNotification: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
jettonMinter: {
|
|
36
|
-
accountBits: number;
|
|
37
|
-
accountCells: number;
|
|
38
|
-
gas: {
|
|
39
|
-
burnNotification: number;
|
|
40
|
-
mintAfterError: number;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
nftItem: {
|
|
44
|
-
accountBits: number;
|
|
45
|
-
accountCells: number;
|
|
46
|
-
gas: {
|
|
47
|
-
send: number;
|
|
48
|
-
burn: number;
|
|
49
|
-
errorNotification: number;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
nftProxy: {
|
|
53
|
-
accountBits: number;
|
|
54
|
-
accountCells: number;
|
|
55
|
-
gas: {
|
|
56
|
-
ownershipAssigned: number;
|
|
57
|
-
errorNotification: number;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export declare const createCrossChainLayerTvmMsgToEvmStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
62
|
-
export declare const createJettonWalletInternalTransferStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
63
|
-
export declare const createJettonWalletReceiveStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
64
|
-
export declare const createJettonWalletBurnStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
65
|
-
export declare const createJettonProxyOwnershipAssignedStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
66
|
-
export declare const createJettonMinterBurnNotificationStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
67
|
-
export declare const createNftItemSendStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
68
|
-
export declare const createNftItemBurnStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
69
|
-
export declare const createNftProxyOwnershipAssignedStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
70
|
-
export declare const createErrorNotificationGasStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
71
|
-
export declare const createEstimatedSendTransferGasStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
72
|
-
export declare const createEstimatedReceiveTransferGasStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
73
|
-
export declare const createMintAfterErrorGasStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
74
|
-
export declare const createNftProxyErrorNotificationStep: (msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
75
|
-
export declare const createNftItemErrorNotificationStep: () => TransactionFeeCalculationStep;
|
|
3
|
+
/**
|
|
4
|
+
* Default contract fee usage parameters used as fallback.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_CONTRACT_FEE_USAGE_PARAMS: ContractFeeUsageParams;
|
|
7
|
+
export declare const createCrossChainLayerTvmMsgToEvmStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
8
|
+
export declare const createJettonWalletInternalTransferStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
9
|
+
export declare const createJettonWalletReceiveStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
10
|
+
export declare const createJettonWalletBurnStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
11
|
+
export declare const createJettonProxyOwnershipAssignedStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
12
|
+
export declare const createJettonMinterBurnNotificationStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
13
|
+
export declare const createNftItemSendStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
14
|
+
export declare const createNftItemBurnStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
15
|
+
export declare const createNftProxyOwnershipAssignedStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
16
|
+
export declare const createErrorNotificationGasStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
17
|
+
export declare const createEstimatedSendTransferGasStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
18
|
+
export declare const createEstimatedReceiveTransferGasStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
19
|
+
export declare const createMintAfterErrorGasStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
20
|
+
export declare const createNftProxyErrorNotificationStep: (params: ContractFeeUsageParams, msgBits: number, msgCells: number) => TransactionFeeCalculationStep;
|
|
21
|
+
export declare const createNftItemErrorNotificationStep: (params: ContractFeeUsageParams) => TransactionFeeCalculationStep;
|
package/dist/src/sdk/Fees.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNftItemErrorNotificationStep = exports.createNftProxyErrorNotificationStep = exports.createMintAfterErrorGasStep = exports.createEstimatedReceiveTransferGasStep = exports.createEstimatedSendTransferGasStep = exports.createErrorNotificationGasStep = exports.createNftProxyOwnershipAssignedStep = exports.createNftItemBurnStep = exports.createNftItemSendStep = exports.createJettonMinterBurnNotificationStep = exports.createJettonProxyOwnershipAssignedStep = exports.createJettonWalletBurnStep = exports.createJettonWalletReceiveStep = exports.createJettonWalletInternalTransferStep = exports.createCrossChainLayerTvmMsgToEvmStep = exports.
|
|
3
|
+
exports.createNftItemErrorNotificationStep = exports.createNftProxyErrorNotificationStep = exports.createMintAfterErrorGasStep = exports.createEstimatedReceiveTransferGasStep = exports.createEstimatedSendTransferGasStep = exports.createErrorNotificationGasStep = exports.createNftProxyOwnershipAssignedStep = exports.createNftItemBurnStep = exports.createNftItemSendStep = exports.createJettonMinterBurnNotificationStep = exports.createJettonProxyOwnershipAssignedStep = exports.createJettonWalletBurnStep = exports.createJettonWalletReceiveStep = exports.createJettonWalletInternalTransferStep = exports.createCrossChainLayerTvmMsgToEvmStep = exports.DEFAULT_CONTRACT_FEE_USAGE_PARAMS = exports.FIXED_POINT_SHIFT = void 0;
|
|
4
4
|
const Consts_1 = require("./Consts");
|
|
5
5
|
exports.FIXED_POINT_SHIFT = 2 ** 16;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Default contract fee usage parameters used as fallback.
|
|
8
|
+
*/
|
|
9
|
+
exports.DEFAULT_CONTRACT_FEE_USAGE_PARAMS = {
|
|
7
10
|
crossChainLayer: {
|
|
8
11
|
accountBits: 43514,
|
|
9
12
|
accountCells: 100,
|
|
@@ -27,7 +30,7 @@ exports.CONTRACT_FEE_USAGE_PARAMS = {
|
|
|
27
30
|
},
|
|
28
31
|
},
|
|
29
32
|
jettonProxy: {
|
|
30
|
-
|
|
33
|
+
accountBits: 7760,
|
|
31
34
|
accountCells: 16,
|
|
32
35
|
gas: {
|
|
33
36
|
ownershipAssigned: 8515,
|
|
@@ -61,136 +64,136 @@ exports.CONTRACT_FEE_USAGE_PARAMS = {
|
|
|
61
64
|
},
|
|
62
65
|
},
|
|
63
66
|
};
|
|
64
|
-
const createCrossChainLayerTvmMsgToEvmStep = (msgBits, msgCells) => ({
|
|
65
|
-
accountBits:
|
|
66
|
-
accountCells:
|
|
67
|
-
gasUsed:
|
|
67
|
+
const createCrossChainLayerTvmMsgToEvmStep = (params, msgBits, msgCells) => ({
|
|
68
|
+
accountBits: params.crossChainLayer.accountBits,
|
|
69
|
+
accountCells: params.crossChainLayer.accountCells,
|
|
70
|
+
gasUsed: params.crossChainLayer.gas.tvmMsgToEvm,
|
|
68
71
|
msgBits,
|
|
69
72
|
msgCells,
|
|
70
73
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
71
74
|
});
|
|
72
75
|
exports.createCrossChainLayerTvmMsgToEvmStep = createCrossChainLayerTvmMsgToEvmStep;
|
|
73
|
-
const createJettonWalletInternalTransferStep = (msgBits, msgCells) => ({
|
|
74
|
-
accountBits:
|
|
75
|
-
accountCells:
|
|
76
|
-
gasUsed:
|
|
76
|
+
const createJettonWalletInternalTransferStep = (params, msgBits, msgCells) => ({
|
|
77
|
+
accountBits: params.jettonWallet.accountBits,
|
|
78
|
+
accountCells: params.jettonWallet.accountCells,
|
|
79
|
+
gasUsed: params.jettonWallet.gas.internalTransfer,
|
|
77
80
|
msgBits,
|
|
78
81
|
msgCells,
|
|
79
82
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
80
83
|
});
|
|
81
84
|
exports.createJettonWalletInternalTransferStep = createJettonWalletInternalTransferStep;
|
|
82
|
-
const createJettonWalletReceiveStep = (msgBits, msgCells) => ({
|
|
83
|
-
accountBits:
|
|
84
|
-
accountCells:
|
|
85
|
-
gasUsed:
|
|
85
|
+
const createJettonWalletReceiveStep = (params, msgBits, msgCells) => ({
|
|
86
|
+
accountBits: params.jettonWallet.accountBits,
|
|
87
|
+
accountCells: params.jettonWallet.accountCells,
|
|
88
|
+
gasUsed: params.jettonWallet.gas.receive,
|
|
86
89
|
msgBits,
|
|
87
90
|
msgCells,
|
|
88
91
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
89
92
|
});
|
|
90
93
|
exports.createJettonWalletReceiveStep = createJettonWalletReceiveStep;
|
|
91
|
-
const createJettonWalletBurnStep = (msgBits, msgCells) => ({
|
|
92
|
-
accountBits:
|
|
93
|
-
accountCells:
|
|
94
|
-
gasUsed:
|
|
94
|
+
const createJettonWalletBurnStep = (params, msgBits, msgCells) => ({
|
|
95
|
+
accountBits: params.jettonWallet.accountBits,
|
|
96
|
+
accountCells: params.jettonWallet.accountCells,
|
|
97
|
+
gasUsed: params.jettonWallet.gas.burn,
|
|
95
98
|
msgBits,
|
|
96
99
|
msgCells,
|
|
97
100
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
98
101
|
});
|
|
99
102
|
exports.createJettonWalletBurnStep = createJettonWalletBurnStep;
|
|
100
|
-
const createJettonProxyOwnershipAssignedStep = (msgBits, msgCells) => ({
|
|
101
|
-
accountBits:
|
|
102
|
-
accountCells:
|
|
103
|
-
gasUsed:
|
|
103
|
+
const createJettonProxyOwnershipAssignedStep = (params, msgBits, msgCells) => ({
|
|
104
|
+
accountBits: params.jettonProxy.accountBits,
|
|
105
|
+
accountCells: params.jettonProxy.accountCells,
|
|
106
|
+
gasUsed: params.jettonProxy.gas.ownershipAssigned,
|
|
104
107
|
msgBits,
|
|
105
108
|
msgCells,
|
|
106
109
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
107
110
|
});
|
|
108
111
|
exports.createJettonProxyOwnershipAssignedStep = createJettonProxyOwnershipAssignedStep;
|
|
109
|
-
const createJettonMinterBurnNotificationStep = (msgBits, msgCells) => ({
|
|
110
|
-
accountBits:
|
|
111
|
-
accountCells:
|
|
112
|
-
gasUsed:
|
|
112
|
+
const createJettonMinterBurnNotificationStep = (params, msgBits, msgCells) => ({
|
|
113
|
+
accountBits: params.jettonMinter.accountBits,
|
|
114
|
+
accountCells: params.jettonMinter.accountCells,
|
|
115
|
+
gasUsed: params.jettonMinter.gas.burnNotification,
|
|
113
116
|
msgBits,
|
|
114
117
|
msgCells,
|
|
115
118
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
116
119
|
});
|
|
117
120
|
exports.createJettonMinterBurnNotificationStep = createJettonMinterBurnNotificationStep;
|
|
118
|
-
const createNftItemSendStep = (msgBits, msgCells) => ({
|
|
119
|
-
accountBits:
|
|
120
|
-
accountCells:
|
|
121
|
-
gasUsed:
|
|
121
|
+
const createNftItemSendStep = (params, msgBits, msgCells) => ({
|
|
122
|
+
accountBits: params.nftItem.accountBits,
|
|
123
|
+
accountCells: params.nftItem.accountCells,
|
|
124
|
+
gasUsed: params.nftItem.gas.send,
|
|
122
125
|
msgBits,
|
|
123
126
|
msgCells,
|
|
124
127
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
125
128
|
});
|
|
126
129
|
exports.createNftItemSendStep = createNftItemSendStep;
|
|
127
|
-
const createNftItemBurnStep = (msgBits, msgCells) => ({
|
|
128
|
-
accountBits:
|
|
129
|
-
accountCells:
|
|
130
|
-
gasUsed:
|
|
130
|
+
const createNftItemBurnStep = (params, msgBits, msgCells) => ({
|
|
131
|
+
accountBits: params.nftItem.accountBits,
|
|
132
|
+
accountCells: params.nftItem.accountCells,
|
|
133
|
+
gasUsed: params.nftItem.gas.burn,
|
|
131
134
|
msgBits,
|
|
132
135
|
msgCells,
|
|
133
136
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
134
137
|
});
|
|
135
138
|
exports.createNftItemBurnStep = createNftItemBurnStep;
|
|
136
|
-
const createNftProxyOwnershipAssignedStep = (msgBits, msgCells) => ({
|
|
137
|
-
accountBits:
|
|
138
|
-
accountCells:
|
|
139
|
-
gasUsed:
|
|
139
|
+
const createNftProxyOwnershipAssignedStep = (params, msgBits, msgCells) => ({
|
|
140
|
+
accountBits: params.nftProxy.accountBits,
|
|
141
|
+
accountCells: params.nftProxy.accountCells,
|
|
142
|
+
gasUsed: params.nftProxy.gas.ownershipAssigned,
|
|
140
143
|
msgBits,
|
|
141
144
|
msgCells,
|
|
142
145
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
143
146
|
});
|
|
144
147
|
exports.createNftProxyOwnershipAssignedStep = createNftProxyOwnershipAssignedStep;
|
|
145
|
-
const createErrorNotificationGasStep = (msgBits, msgCells) => ({
|
|
148
|
+
const createErrorNotificationGasStep = (params, msgBits, msgCells) => ({
|
|
146
149
|
accountBits: 0,
|
|
147
150
|
accountCells: 0,
|
|
148
|
-
gasUsed:
|
|
151
|
+
gasUsed: params.jettonProxy.gas.errorNotification,
|
|
149
152
|
msgBits,
|
|
150
153
|
msgCells,
|
|
151
154
|
timeDelta: 0,
|
|
152
155
|
});
|
|
153
156
|
exports.createErrorNotificationGasStep = createErrorNotificationGasStep;
|
|
154
|
-
const createEstimatedSendTransferGasStep = (msgBits, msgCells) => ({
|
|
157
|
+
const createEstimatedSendTransferGasStep = (params, msgBits, msgCells) => ({
|
|
155
158
|
accountBits: 0,
|
|
156
159
|
accountCells: 0,
|
|
157
|
-
gasUsed:
|
|
160
|
+
gasUsed: params.jettonWallet.gas.estimatedSendTransfer,
|
|
158
161
|
msgBits,
|
|
159
162
|
msgCells,
|
|
160
163
|
timeDelta: 0,
|
|
161
164
|
});
|
|
162
165
|
exports.createEstimatedSendTransferGasStep = createEstimatedSendTransferGasStep;
|
|
163
|
-
const createEstimatedReceiveTransferGasStep = (msgBits, msgCells) => ({
|
|
166
|
+
const createEstimatedReceiveTransferGasStep = (params, msgBits, msgCells) => ({
|
|
164
167
|
accountBits: 0,
|
|
165
168
|
accountCells: 0,
|
|
166
|
-
gasUsed:
|
|
169
|
+
gasUsed: params.jettonWallet.gas.estimatedReceiveTransfer,
|
|
167
170
|
msgBits,
|
|
168
171
|
msgCells,
|
|
169
172
|
timeDelta: 0,
|
|
170
173
|
});
|
|
171
174
|
exports.createEstimatedReceiveTransferGasStep = createEstimatedReceiveTransferGasStep;
|
|
172
|
-
const createMintAfterErrorGasStep = (msgBits, msgCells) => ({
|
|
173
|
-
accountBits:
|
|
174
|
-
accountCells:
|
|
175
|
-
gasUsed:
|
|
175
|
+
const createMintAfterErrorGasStep = (params, msgBits, msgCells) => ({
|
|
176
|
+
accountBits: params.jettonMinter.accountBits,
|
|
177
|
+
accountCells: params.jettonMinter.accountCells,
|
|
178
|
+
gasUsed: params.jettonMinter.gas.mintAfterError,
|
|
176
179
|
msgBits,
|
|
177
180
|
msgCells,
|
|
178
181
|
timeDelta: Consts_1.ONE_YEAR_SECONDS,
|
|
179
182
|
});
|
|
180
183
|
exports.createMintAfterErrorGasStep = createMintAfterErrorGasStep;
|
|
181
|
-
const createNftProxyErrorNotificationStep = (msgBits, msgCells) => ({
|
|
184
|
+
const createNftProxyErrorNotificationStep = (params, msgBits, msgCells) => ({
|
|
182
185
|
accountBits: 0,
|
|
183
186
|
accountCells: 0,
|
|
184
|
-
gasUsed:
|
|
187
|
+
gasUsed: params.nftProxy.gas.errorNotification,
|
|
185
188
|
msgBits,
|
|
186
189
|
msgCells,
|
|
187
190
|
timeDelta: 0,
|
|
188
191
|
});
|
|
189
192
|
exports.createNftProxyErrorNotificationStep = createNftProxyErrorNotificationStep;
|
|
190
|
-
const createNftItemErrorNotificationStep = () => ({
|
|
193
|
+
const createNftItemErrorNotificationStep = (params) => ({
|
|
191
194
|
accountBits: 0,
|
|
192
195
|
accountCells: 0,
|
|
193
|
-
gasUsed:
|
|
196
|
+
gasUsed: params.nftItem.gas.errorNotification,
|
|
194
197
|
msgBits: 0,
|
|
195
198
|
msgCells: 0,
|
|
196
199
|
timeDelta: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpClient, ILiteSequencerClient } from '../interfaces';
|
|
2
|
-
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStagesByOperationId, GetTVMExecutorFeeParams, OperationIdsByShardsKey, OperationType, StatusInfosByOperationId, SuggestedTVMExecutorFee,
|
|
2
|
+
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStagesByOperationId, GetTVMExecutorFeeParams, OperationIdsByShardsKey, OperationType, StatusInfosByOperationId, SuggestedTVMExecutorFee, TACSimulationParams, TACSimulationResult, TransactionLinker } from '../structs/Struct';
|
|
3
3
|
export declare class LiteSequencerClient implements ILiteSequencerClient {
|
|
4
4
|
private readonly endpoint;
|
|
5
5
|
private readonly maxChunkSize;
|
|
@@ -13,7 +13,6 @@ export declare class LiteSequencerClient implements ILiteSequencerClient {
|
|
|
13
13
|
getOperationStatuses(operationIds: string[], chunkSize?: number): Promise<StatusInfosByOperationId>;
|
|
14
14
|
convertCurrency(params: ConvertCurrencyParams): Promise<ConvertedCurrencyResult>;
|
|
15
15
|
simulateTACMessage(params: TACSimulationParams): Promise<TACSimulationResult>;
|
|
16
|
-
getTACGasPrice(): Promise<TacGasPriceResponse>;
|
|
17
16
|
getTVMExecutorFee(params: GetTVMExecutorFeeParams): Promise<SuggestedTVMExecutorFee>;
|
|
18
17
|
private processChunkedRequest;
|
|
19
18
|
}
|
|
@@ -166,15 +166,6 @@ class LiteSequencerClient {
|
|
|
166
166
|
throw (0, instances_1.simulationFetchError)(`endpoint ${this.endpoint} failed to complete request`, error);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
async getTACGasPrice() {
|
|
170
|
-
try {
|
|
171
|
-
const response = await this.httpClient.get(new URL('stats', 'https://explorer.tac.build/api/v2/').toString(), { transformResponse: [Utils_1.toCamelCaseTransformer] });
|
|
172
|
-
return response.data;
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
throw (0, instances_1.gasPriceFetchError)(`endpoint https://explorer.tac.build/api/v2/ failed to complete request`, error);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
169
|
async getTVMExecutorFee(params) {
|
|
179
170
|
try {
|
|
180
171
|
const response = await this.httpClient.post(new URL('/ton/calculator/ton-executor-fee', this.endpoint).toString(), params, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILiteSequencerClient, ILiteSequencerClientFactory, ILogger, IOperationTracker } from '../interfaces';
|
|
2
|
-
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStages, ExecutionStagesByOperationId, GetTVMExecutorFeeParams, Network, OperationIdsByShardsKey, OperationType, SimplifiedStatuses, StatusInfo, StatusInfosByOperationId, SuggestedTVMExecutorFee,
|
|
2
|
+
import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStages, ExecutionStagesByOperationId, GetTVMExecutorFeeParams, Network, OperationIdsByShardsKey, OperationType, SimplifiedStatuses, StatusInfo, StatusInfosByOperationId, SuggestedTVMExecutorFee, TACSimulationParams, TACSimulationResult, TransactionLinker, WaitOptions } from '../structs/Struct';
|
|
3
3
|
export declare class DefaultLiteSequencerClientFactory implements ILiteSequencerClientFactory {
|
|
4
4
|
createClients(endpoints: string[]): ILiteSequencerClient[];
|
|
5
5
|
}
|
|
@@ -18,6 +18,5 @@ export declare class OperationTracker implements IOperationTracker {
|
|
|
18
18
|
getSimplifiedOperationStatus(transactionLinker: TransactionLinker): Promise<SimplifiedStatuses>;
|
|
19
19
|
convertCurrency(params: ConvertCurrencyParams, waitOptions?: WaitOptions<ConvertedCurrencyResult>): Promise<ConvertedCurrencyResult>;
|
|
20
20
|
simulateTACMessage(params: TACSimulationParams, waitOptions?: WaitOptions<TACSimulationResult>): Promise<TACSimulationResult>;
|
|
21
|
-
getTACGasPrice(): Promise<TacGasPriceResponse>;
|
|
22
21
|
getTVMExecutorFee(params: GetTVMExecutorFeeParams, waitOptions?: WaitOptions<SuggestedTVMExecutorFee>): Promise<SuggestedTVMExecutorFee>;
|
|
23
22
|
}
|
|
@@ -287,26 +287,6 @@ class OperationTracker {
|
|
|
287
287
|
? await (0, Utils_1.waitUntilSuccess)(waitOptions, requestFn, 'OperationTracker: Simulating TAC message')
|
|
288
288
|
: await requestFn();
|
|
289
289
|
}
|
|
290
|
-
async getTACGasPrice() {
|
|
291
|
-
this.logger.debug(`Getting TAC gas price`);
|
|
292
|
-
const requestFn = async () => {
|
|
293
|
-
let lastError;
|
|
294
|
-
for (const client of this.clients) {
|
|
295
|
-
try {
|
|
296
|
-
const result = await client.getTACGasPrice();
|
|
297
|
-
this.logger.debug(`TAC gas price retrieved successfully`);
|
|
298
|
-
return result;
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
this.logger.warn(`Failed to get TAC gas price using one of the endpoints`);
|
|
302
|
-
lastError = error;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
this.logger.error('All endpoints failed to get TAC gas price');
|
|
306
|
-
throw (0, errors_1.allEndpointsFailedError)(lastError);
|
|
307
|
-
};
|
|
308
|
-
return await requestFn();
|
|
309
|
-
}
|
|
310
290
|
async getTVMExecutorFee(params, waitOptions) {
|
|
311
291
|
this.logger.debug(`get TVM executor fee: ${(0, Utils_1.formatObjectForLogging)(params)}`);
|
|
312
292
|
const requestFn = async () => {
|
|
@@ -96,42 +96,44 @@ class Simulator {
|
|
|
96
96
|
return steps.reduce((total, step) => total + this.calculateTONFees({ ...step, ...this.config.TONParams.feesParams }), 0n);
|
|
97
97
|
}
|
|
98
98
|
calculateTONCrosschainFee(msgBits, msgCells) {
|
|
99
|
-
return this.calculateTransactionPipeline([
|
|
99
|
+
return this.calculateTransactionPipeline([
|
|
100
|
+
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
101
|
+
]);
|
|
100
102
|
}
|
|
101
103
|
calculateJettonTransferCrosschainFee(msgBits, msgCells) {
|
|
102
104
|
return this.calculateTransactionPipeline([
|
|
103
|
-
(0, Fees_1.createJettonWalletInternalTransferStep)(msgBits, msgCells),
|
|
104
|
-
(0, Fees_1.createJettonWalletReceiveStep)(msgBits, msgCells),
|
|
105
|
-
(0, Fees_1.createJettonProxyOwnershipAssignedStep)(msgBits, msgCells),
|
|
106
|
-
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(msgBits, msgCells),
|
|
107
|
-
(0, Fees_1.createErrorNotificationGasStep)(msgBits, msgCells),
|
|
108
|
-
(0, Fees_1.createEstimatedSendTransferGasStep)(msgBits, msgCells),
|
|
109
|
-
(0, Fees_1.createEstimatedReceiveTransferGasStep)(msgBits, msgCells),
|
|
105
|
+
(0, Fees_1.createJettonWalletInternalTransferStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
106
|
+
(0, Fees_1.createJettonWalletReceiveStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
107
|
+
(0, Fees_1.createJettonProxyOwnershipAssignedStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
108
|
+
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
109
|
+
(0, Fees_1.createErrorNotificationGasStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
110
|
+
(0, Fees_1.createEstimatedSendTransferGasStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
111
|
+
(0, Fees_1.createEstimatedReceiveTransferGasStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
110
112
|
]);
|
|
111
113
|
}
|
|
112
114
|
calculateJettonBurnCrosschainFee(msgBits, msgCells) {
|
|
113
115
|
return this.calculateTransactionPipeline([
|
|
114
|
-
(0, Fees_1.createJettonWalletBurnStep)(msgBits, msgCells),
|
|
115
|
-
(0, Fees_1.createJettonMinterBurnNotificationStep)(msgBits, msgCells),
|
|
116
|
-
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(msgBits, msgCells),
|
|
117
|
-
(0, Fees_1.createMintAfterErrorGasStep)(msgBits, msgCells),
|
|
118
|
-
(0, Fees_1.createJettonWalletReceiveStep)(msgBits, msgCells),
|
|
116
|
+
(0, Fees_1.createJettonWalletBurnStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
117
|
+
(0, Fees_1.createJettonMinterBurnNotificationStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
118
|
+
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
119
|
+
(0, Fees_1.createMintAfterErrorGasStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
120
|
+
(0, Fees_1.createJettonWalletReceiveStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
119
121
|
]);
|
|
120
122
|
}
|
|
121
123
|
calculateNftTransferCrosschainFee(msgBits, msgCells) {
|
|
122
124
|
return this.calculateTransactionPipeline([
|
|
123
|
-
(0, Fees_1.createNftItemSendStep)(msgBits, msgCells),
|
|
124
|
-
(0, Fees_1.createNftProxyOwnershipAssignedStep)(msgBits, msgCells),
|
|
125
|
-
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(msgBits, msgCells),
|
|
126
|
-
(0, Fees_1.createNftProxyErrorNotificationStep)(msgBits, msgCells),
|
|
127
|
-
(0, Fees_1.createNftItemSendStep)(msgBits, msgCells),
|
|
125
|
+
(0, Fees_1.createNftItemSendStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
126
|
+
(0, Fees_1.createNftProxyOwnershipAssignedStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
127
|
+
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
128
|
+
(0, Fees_1.createNftProxyErrorNotificationStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
129
|
+
(0, Fees_1.createNftItemSendStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
128
130
|
]);
|
|
129
131
|
}
|
|
130
132
|
calculateNftBurnCrosschainFee(msgBits, msgCells) {
|
|
131
133
|
return this.calculateTransactionPipeline([
|
|
132
|
-
(0, Fees_1.createNftItemBurnStep)(msgBits, msgCells),
|
|
133
|
-
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(msgBits, msgCells),
|
|
134
|
-
(0, Fees_1.createNftItemErrorNotificationStep)(),
|
|
134
|
+
(0, Fees_1.createNftItemBurnStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
135
|
+
(0, Fees_1.createCrossChainLayerTvmMsgToEvmStep)(this.config.TONParams.contractFeeUsageParams, msgBits, msgCells),
|
|
136
|
+
(0, Fees_1.createNftItemErrorNotificationStep)(this.config.TONParams.contractFeeUsageParams),
|
|
135
137
|
]);
|
|
136
138
|
}
|
|
137
139
|
estimateTONFee(asset, params) {
|
|
@@ -47,10 +47,10 @@ async function startTracking(transactionLinker, network, options) {
|
|
|
47
47
|
catch (err) {
|
|
48
48
|
logger.debug('failed to get operation type: ' + err);
|
|
49
49
|
}
|
|
50
|
-
logger.debug(`
|
|
51
|
-
operationId: ${operationId}
|
|
52
|
-
operationType: ${operationType}
|
|
53
|
-
time: ${new Date().toISOString()} (${Math.floor(+new Date() / 1000)})
|
|
50
|
+
logger.debug(`
|
|
51
|
+
operationId: ${operationId}
|
|
52
|
+
operationType: ${operationType}
|
|
53
|
+
time: ${new Date().toISOString()} (${Math.floor(+new Date() / 1000)})
|
|
54
54
|
`);
|
|
55
55
|
}
|
|
56
56
|
await (0, Utils_1.sleep)(delay * 1000);
|