@tonappchain/sdk 0.7.0-rc33 → 0.7.0-rc34
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/src/agnosticSdk/AbiHandler.js +1 -1
- package/dist/src/agnosticSdk/HooksHandler.js +1 -1
- package/dist/src/errors/instances.d.ts +1 -1
- package/dist/src/errors/instances.js +3 -3
- package/dist/src/sdk/LiteSequencerClient.js +0 -3
- package/dist/src/sdk/Logger.d.ts +4 -4
- package/dist/src/sdk/Logger.js +12 -4
- package/dist/src/sdk/OperationTracker.js +4 -0
- package/dist/src/sdk/TONTransactionManager.d.ts +2 -2
- package/dist/src/sdk/TxFinalizer.js +6 -1
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ class AbiHandler {
|
|
|
56
56
|
// Build parameter list with proper tuple handling
|
|
57
57
|
const params = func.inputs
|
|
58
58
|
.map((input) => {
|
|
59
|
-
|
|
59
|
+
const paramType = this._buildParameterType(input);
|
|
60
60
|
// Add parameter name if available
|
|
61
61
|
if (input.name) {
|
|
62
62
|
return `${paramType} ${input.name}`;
|
|
@@ -31,4 +31,4 @@ export declare const missingDecimals: MetadataError;
|
|
|
31
31
|
export declare const missingJettonDataError: MetadataError;
|
|
32
32
|
export declare const zeroRawAmountError: (assetAddress: string) => TokenError;
|
|
33
33
|
export declare const sendCrossChainTransactionFailedError: (msg: string) => WalletError;
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const convertCurrencyNegativeOrZeroValueError: FormatError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertCurrencyNegativeOrZeroValueError = exports.sendCrossChainTransactionFailedError = exports.zeroRawAmountError = exports.missingJettonDataError = exports.missingDecimals = exports.missingGasLimitError = exports.missingTvmExecutorFeeError = exports.missingFeeParamsError = exports.getTONFeeInfoFetchError = exports.simulationFetchError = exports.convertCurrencyFetchError = exports.indexRequiredError = exports.unknownTokenTypeError = exports.insufficientBalanceError = exports.allContractOpenerFailedError = exports.allEndpointsFailedError = exports.noValidGroupFoundError = exports.prepareMessageGroupError = exports.invalidAssetType = exports.emptyArrayError = exports.profilingFetchError = exports.invalidMethodNameError = exports.emptySettingError = exports.prefixError = exports.notMultiplyOf8Error = exports.unsupportedFormatError = exports.unsupportedKeyError = exports.unknownWalletError = exports.evmAddressError = exports.tvmAddressError = exports.statusFetchError = exports.operationFetchError = exports.emptyContractError = void 0;
|
|
4
4
|
const errors_1 = require("./errors");
|
|
5
5
|
exports.emptyContractError = new errors_1.ContractError('unexpected empty contract code of given jetton.', 100);
|
|
6
6
|
const operationFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch OperationId: ${msg}`, 101, inner);
|
|
@@ -30,7 +30,7 @@ exports.invalidAssetType = new errors_1.FormatError('Invalid asset type', 114);
|
|
|
30
30
|
const prepareMessageGroupError = (isBocSizeValid, isDepthValid) => new errors_1.PrepareMessageGroupError(`Failed to prepare message group: BOC size valid: ${isBocSizeValid}, depth valid: ${isDepthValid}`, 115);
|
|
31
31
|
exports.prepareMessageGroupError = prepareMessageGroupError;
|
|
32
32
|
exports.noValidGroupFoundError = new errors_1.NoValidGroupFoundError('Failed to prepare valid message group', 116);
|
|
33
|
-
const allEndpointsFailedError = (inner) => new errors_1.FetchError('All endpoints failed', 117, inner);
|
|
33
|
+
const allEndpointsFailedError = (inner) => new errors_1.FetchError('All endpoints failed, last err: ' + inner.message, 117, inner);
|
|
34
34
|
exports.allEndpointsFailedError = allEndpointsFailedError;
|
|
35
35
|
const allContractOpenerFailedError = (inner) => new errors_1.FetchError('All contract opener failed', 118, inner);
|
|
36
36
|
exports.allContractOpenerFailedError = allContractOpenerFailedError;
|
|
@@ -55,4 +55,4 @@ const zeroRawAmountError = (assetAddress) => new errors_1.TokenError(`FT asset w
|
|
|
55
55
|
exports.zeroRawAmountError = zeroRawAmountError;
|
|
56
56
|
const sendCrossChainTransactionFailedError = (msg) => new errors_1.WalletError(`failed to send cross chain transaction: ${msg}`, 131);
|
|
57
57
|
exports.sendCrossChainTransactionFailedError = sendCrossChainTransactionFailedError;
|
|
58
|
-
exports.
|
|
58
|
+
exports.convertCurrencyNegativeOrZeroValueError = new errors_1.FormatError('Value cannot be negative or zero for currency conversion', 132);
|
package/dist/src/sdk/Logger.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare class ConsoleLogger implements ILogger {
|
|
|
6
6
|
error(...arg: unknown[]): void;
|
|
7
7
|
}
|
|
8
8
|
export declare class NoopLogger implements ILogger {
|
|
9
|
-
debug(): void;
|
|
10
|
-
info(): void;
|
|
11
|
-
warn(): void;
|
|
12
|
-
error(): void;
|
|
9
|
+
debug(..._arg: unknown[]): void;
|
|
10
|
+
info(..._arg: unknown[]): void;
|
|
11
|
+
warn(..._arg: unknown[]): void;
|
|
12
|
+
error(..._arg: unknown[]): void;
|
|
13
13
|
}
|
package/dist/src/sdk/Logger.js
CHANGED
|
@@ -17,9 +17,17 @@ class ConsoleLogger {
|
|
|
17
17
|
}
|
|
18
18
|
exports.ConsoleLogger = ConsoleLogger;
|
|
19
19
|
class NoopLogger {
|
|
20
|
-
debug() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
debug(..._arg) {
|
|
21
|
+
void _arg;
|
|
22
|
+
}
|
|
23
|
+
info(..._arg) {
|
|
24
|
+
void _arg;
|
|
25
|
+
}
|
|
26
|
+
warn(..._arg) {
|
|
27
|
+
void _arg;
|
|
28
|
+
}
|
|
29
|
+
error(..._arg) {
|
|
30
|
+
void _arg;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
exports.NoopLogger = NoopLogger;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OperationTracker = exports.DefaultLiteSequencerClientFactory = void 0;
|
|
4
4
|
const artifacts_1 = require("../../artifacts");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const instances_1 = require("../errors/instances");
|
|
6
7
|
const Struct_1 = require("../structs/Struct");
|
|
7
8
|
const LiteSequencerClient_1 = require("./LiteSequencerClient");
|
|
8
9
|
const Logger_1 = require("./Logger");
|
|
@@ -239,6 +240,9 @@ class OperationTracker {
|
|
|
239
240
|
return Struct_1.SimplifiedStatuses.SUCCESSFUL;
|
|
240
241
|
}
|
|
241
242
|
async convertCurrency(params, waitOptions) {
|
|
243
|
+
if (params.value <= 0n) {
|
|
244
|
+
throw instances_1.convertCurrencyNegativeOrZeroValueError;
|
|
245
|
+
}
|
|
242
246
|
this.logger.debug(`Converting currency: ${(0, Utils_1.formatObjectForLogging)(params)}`);
|
|
243
247
|
const requestFn = async () => {
|
|
244
248
|
let lastError;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IConfiguration, ILogger, IOperationTracker, ISimulator, ITONTransactionManager } from '../interfaces';
|
|
2
2
|
import type { SenderAbstraction } from '../sender';
|
|
3
|
-
import { BatchCrossChainTx, CrossChainTransactionsOptions, CrosschainTx, EvmProxyMsg, TransactionLinkerWithOperationId } from '../structs/Struct';
|
|
3
|
+
import { BatchCrossChainTx, CrossChainTransactionOptions, CrossChainTransactionsOptions, CrosschainTx, EvmProxyMsg, FeeParams, TransactionLinkerWithOperationId } from '../structs/Struct';
|
|
4
4
|
export declare class TONTransactionManager implements ITONTransactionManager {
|
|
5
5
|
private readonly config;
|
|
6
6
|
private readonly simulator;
|
|
7
7
|
private readonly operationTracker;
|
|
8
8
|
private readonly logger;
|
|
9
9
|
constructor(config: IConfiguration, simulator: ISimulator, operationTracker: IOperationTracker, logger?: ILogger);
|
|
10
|
-
|
|
10
|
+
protected buildFeeParams(options: CrossChainTransactionOptions, evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx): Promise<FeeParams>;
|
|
11
11
|
private prepareCrossChainTransaction;
|
|
12
12
|
private generateCrossChainMessages;
|
|
13
13
|
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx): Promise<TransactionLinkerWithOperationId>;
|
|
@@ -46,6 +46,9 @@ class TonTxFinalizer {
|
|
|
46
46
|
const errorMessage = error.message;
|
|
47
47
|
// Rate limit error (429) - retry
|
|
48
48
|
if (errorMessage.includes('429')) {
|
|
49
|
+
if (i > 0) {
|
|
50
|
+
await (0, Utils_1.sleep)(delay);
|
|
51
|
+
}
|
|
49
52
|
continue;
|
|
50
53
|
}
|
|
51
54
|
// Log all errors except 404 Not Found
|
|
@@ -53,8 +56,10 @@ class TonTxFinalizer {
|
|
|
53
56
|
const logMessage = error instanceof Error ? error.message : error;
|
|
54
57
|
console.warn(`Failed to fetch adjacent transactions for ${hash}:`, logMessage);
|
|
55
58
|
}
|
|
59
|
+
if (i > 0) {
|
|
60
|
+
await (0, Utils_1.sleep)(delay);
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
|
-
await (0, Utils_1.sleep)(delay);
|
|
58
63
|
}
|
|
59
64
|
return [];
|
|
60
65
|
}
|