@tonappchain/sdk 0.7.2-alpha-3 → 0.7.2-alpha-4
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.
|
@@ -55,7 +55,7 @@ class TONTransactionManager {
|
|
|
55
55
|
async prepareCrossChainTransaction(evmProxyMsg, sender, assets, options, skipAssetsBalanceValidation = false) {
|
|
56
56
|
this.logger.debug('Preparing cross-chain transaction');
|
|
57
57
|
const caller = sender.getSenderAddress();
|
|
58
|
-
const { allowSimulationError = false, isRoundTrip = undefined, calculateRollbackFee = true, validateAssetsBalance = true, } = options || {};
|
|
58
|
+
const { allowSimulationError = false, isRoundTrip = undefined, calculateRollbackFee = true, validateAssetsBalance = true, evmDataBuilder = Utils_1.buildEvmDataCell, } = options || {};
|
|
59
59
|
const { evmValidExecutors = [], tvmValidExecutors = [] } = options || {};
|
|
60
60
|
Validator_1.Validator.validateEVMAddress(evmProxyMsg.evmTargetAddress);
|
|
61
61
|
const aggregatedData = (0, Utils_1.aggregateTokens)(assets);
|
|
@@ -91,7 +91,7 @@ class TONTransactionManager {
|
|
|
91
91
|
tac: tacExecutors,
|
|
92
92
|
ton: tonExecutors,
|
|
93
93
|
};
|
|
94
|
-
const evmData = (
|
|
94
|
+
const evmData = evmDataBuilder(transactionLinker, evmProxyMsg, validExecutors);
|
|
95
95
|
const messages = await this.generateCrossChainMessages(caller, evmData, aggregatedData, feeParams);
|
|
96
96
|
return {
|
|
97
97
|
transaction: {
|
|
@@ -64,6 +64,8 @@ class TonTxFinalizer {
|
|
|
64
64
|
for (const tx of transactions) {
|
|
65
65
|
if (tx.description.type !== 'generic' || !tx.inMessage)
|
|
66
66
|
continue;
|
|
67
|
+
if (tx.inMessage.info.type === 'internal' && tx.inMessage.info.value.coins === 1n)
|
|
68
|
+
continue; // we ignore messages with 1 nanoton value as they are for notification purpose only
|
|
67
69
|
const bodySlice = tx.inMessage.body.beginParse();
|
|
68
70
|
if (bodySlice.remainingBits < 32)
|
|
69
71
|
continue;
|
|
@@ -156,6 +158,8 @@ class TonIndexerTxFinalizer {
|
|
|
156
158
|
if (transactions.length === 0)
|
|
157
159
|
continue;
|
|
158
160
|
for (const tx of transactions) {
|
|
161
|
+
if (tx.inMsg.value === '1')
|
|
162
|
+
continue; // we ignore messages with 1 nanoton value as they are for notification purpose only
|
|
159
163
|
if (!IGNORE_OPCODE.includes(Number(tx.inMsg.opcode)) && tx.inMsg.opcode !== null) {
|
|
160
164
|
const { aborted, computePh: compute_ph, action } = tx.description;
|
|
161
165
|
if (aborted ||
|
|
@@ -109,7 +109,6 @@ export type EvmProxyMsg = {
|
|
|
109
109
|
methodName?: string;
|
|
110
110
|
encodedParameters?: string;
|
|
111
111
|
gasLimit?: bigint;
|
|
112
|
-
[key: string]: unknown;
|
|
113
112
|
};
|
|
114
113
|
export type TransactionLinker = {
|
|
115
114
|
caller: string;
|
|
@@ -287,6 +286,7 @@ export type FeeParams = {
|
|
|
287
286
|
tvmExecutorFee: bigint;
|
|
288
287
|
evmEstimatedGas?: bigint;
|
|
289
288
|
};
|
|
289
|
+
export type evmDataBuilder = (transactionLinker: TransactionLinker, evmProxyMsg: EvmProxyMsg, validExecutors: ValidExecutors) => Cell;
|
|
290
290
|
export type CrossChainTransactionOptions = {
|
|
291
291
|
allowSimulationError?: boolean;
|
|
292
292
|
isRoundTrip?: boolean;
|
|
@@ -300,6 +300,7 @@ export type CrossChainTransactionOptions = {
|
|
|
300
300
|
validateAssetsBalance?: boolean;
|
|
301
301
|
waitOperationId?: boolean;
|
|
302
302
|
waitOptions?: WaitOptions<string>;
|
|
303
|
+
evmDataBuilder?: evmDataBuilder;
|
|
303
304
|
};
|
|
304
305
|
export type BatchCrossChainTransactionOptions = Omit<CrossChainTransactionOptions, 'waitOperationId' | 'waitOptions'>;
|
|
305
306
|
export type CrossChainTransactionsOptions = {
|