@tonappchain/sdk 0.7.3-rc1 → 0.7.3-rc2

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.
Files changed (46) hide show
  1. package/dist/artifacts/dev/index.d.ts +2 -2
  2. package/dist/artifacts/dev/index.js +2 -1
  3. package/dist/artifacts/dev/ton/endpoints.d.ts +1 -0
  4. package/dist/artifacts/dev/ton/endpoints.js +2 -1
  5. package/dist/artifacts/mainnet/index.d.ts +2 -2
  6. package/dist/artifacts/mainnet/index.js +2 -1
  7. package/dist/artifacts/mainnet/ton/endpoints.d.ts +1 -0
  8. package/dist/artifacts/mainnet/ton/endpoints.js +2 -1
  9. package/dist/artifacts/testnet/index.d.ts +2 -2
  10. package/dist/artifacts/testnet/index.js +2 -1
  11. package/dist/artifacts/testnet/ton/endpoints.d.ts +1 -0
  12. package/dist/artifacts/testnet/ton/endpoints.js +2 -1
  13. package/dist/src/adapters/RetryableContractOpener.d.ts +6 -1
  14. package/dist/src/adapters/RetryableContractOpener.js +35 -8
  15. package/dist/src/adapters/ToncenterV3Indexer.d.ts +34 -0
  16. package/dist/src/adapters/ToncenterV3Indexer.js +123 -0
  17. package/dist/src/adapters/index.d.ts +1 -0
  18. package/dist/src/adapters/index.js +1 -0
  19. package/dist/src/assets/FT.js +1 -1
  20. package/dist/src/errors/index.d.ts +1 -1
  21. package/dist/src/errors/index.js +3 -1
  22. package/dist/src/errors/instances.d.ts +2 -0
  23. package/dist/src/errors/instances.js +5 -1
  24. package/dist/src/interfaces/ContractOpener.d.ts +1 -1
  25. package/dist/src/interfaces/ILiteSequencerClient.d.ts +5 -1
  26. package/dist/src/interfaces/IOperationTracker.d.ts +6 -0
  27. package/dist/src/interfaces/ITACTransactionManager.d.ts +4 -3
  28. package/dist/src/interfaces/ITacSDK.d.ts +26 -5
  29. package/dist/src/interfaces/IToncenterV3Indexer.d.ts +35 -0
  30. package/dist/src/interfaces/IToncenterV3Indexer.js +2 -0
  31. package/dist/src/interfaces/index.d.ts +1 -0
  32. package/dist/src/interfaces/index.js +1 -0
  33. package/dist/src/sdk/Consts.d.ts +2 -0
  34. package/dist/src/sdk/Consts.js +3 -1
  35. package/dist/src/sdk/LiteSequencerClient.d.ts +2 -1
  36. package/dist/src/sdk/LiteSequencerClient.js +22 -1
  37. package/dist/src/sdk/OperationTracker.d.ts +1 -0
  38. package/dist/src/sdk/OperationTracker.js +18 -0
  39. package/dist/src/sdk/TACTransactionManager.d.ts +3 -2
  40. package/dist/src/sdk/TACTransactionManager.js +45 -35
  41. package/dist/src/sdk/TacSdk.d.ts +6 -2
  42. package/dist/src/sdk/TacSdk.js +36 -2
  43. package/dist/src/sdk/Utils.js +2 -2
  44. package/dist/src/structs/InternalStruct.d.ts +8 -3
  45. package/dist/src/structs/Struct.d.ts +55 -2
  46. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import { DEV_AGNOSTIC_PROXY_ADDRESS as AGNOSTIC_PROXY_ADDRESS, DEV_MULTICALL_3_ADDRESS as MULTICALL_3_ADDRESS, DEV_TAC_SETTINGS_ADDRESS as TAC_SETTINGS_ADDRESS, DEV_TAC_SMART_ACCOUNT_FACTORY_ADDRESS as TAC_SMART_ACCOUNT_FACTORY_ADDRESS } from './tac/addresses';
2
2
  import { DEV_PUBLIC_LITE_SEQUENCER_ENDPOINTS as PUBLIC_LITE_SEQUENCER_ENDPOINTS, DEV_TAC_RPC_ENDPOINT as TAC_RPC_ENDPOINT, DEV_TAC_EXPLORER_API_ENDPOINT as TAC_EXPLORER_API_ENDPOINT } from "./tac/endpoints";
3
3
  import { DEV_TON_SETTINGS_ADDRESS as TON_SETTINGS_ADDRESS } from './ton/addresses';
4
- import { DEV_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, DEV_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, DEV_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC } from "./ton/endpoints";
4
+ import { DEV_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, DEV_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, DEV_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC, DEV_TONCENTER_V3_INDEXER_ENDPOINT as TONCENTER_V3_INDEXER_ENDPOINT } from "./ton/endpoints";
5
5
  export * as tac from "./tac";
6
6
  export { PUBLIC_LITE_SEQUENCER_ENDPOINTS, TAC_RPC_ENDPOINT, TAC_EXPLORER_API_ENDPOINT };
7
7
  export * as ton from "./ton";
8
- export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC };
8
+ export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC, TONCENTER_V3_INDEXER_ENDPOINT };
9
9
  export { AGNOSTIC_PROXY_ADDRESS, MULTICALL_3_ADDRESS, TAC_SETTINGS_ADDRESS, TAC_SMART_ACCOUNT_FACTORY_ADDRESS, TON_SETTINGS_ADDRESS };
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
36
+ exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TONCENTER_V3_INDEXER_ENDPOINT = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
37
37
  const addresses_1 = require("./tac/addresses");
38
38
  Object.defineProperty(exports, "AGNOSTIC_PROXY_ADDRESS", { enumerable: true, get: function () { return addresses_1.DEV_AGNOSTIC_PROXY_ADDRESS; } });
39
39
  Object.defineProperty(exports, "MULTICALL_3_ADDRESS", { enumerable: true, get: function () { return addresses_1.DEV_MULTICALL_3_ADDRESS; } });
@@ -49,5 +49,6 @@ const endpoints_2 = require("./ton/endpoints");
49
49
  Object.defineProperty(exports, "DEFAULT_LITESERVERS", { enumerable: true, get: function () { return endpoints_2.DEV_DEFAULT_LITESERVERS; } });
50
50
  Object.defineProperty(exports, "TON_PUBLIC_RPC_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.DEV_TON_PUBLIC_RPC_ENDPOINT; } });
51
51
  Object.defineProperty(exports, "TON_RPC_ENDPOINT_BY_TAC", { enumerable: true, get: function () { return endpoints_2.DEV_TON_RPC_ENDPOINT_BY_TAC; } });
52
+ Object.defineProperty(exports, "TONCENTER_V3_INDEXER_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.DEV_TONCENTER_V3_INDEXER_ENDPOINT; } });
52
53
  exports.tac = __importStar(require("./tac"));
53
54
  exports.ton = __importStar(require("./ton"));
@@ -1,3 +1,4 @@
1
1
  export declare const DEV_DEFAULT_LITESERVERS = "";
2
2
  export declare const DEV_TON_PUBLIC_RPC_ENDPOINT = "";
3
3
  export declare const DEV_TON_RPC_ENDPOINT_BY_TAC = "";
4
+ export declare const DEV_TONCENTER_V3_INDEXER_ENDPOINT = "";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEV_TON_RPC_ENDPOINT_BY_TAC = exports.DEV_TON_PUBLIC_RPC_ENDPOINT = exports.DEV_DEFAULT_LITESERVERS = void 0;
3
+ exports.DEV_TONCENTER_V3_INDEXER_ENDPOINT = exports.DEV_TON_RPC_ENDPOINT_BY_TAC = exports.DEV_TON_PUBLIC_RPC_ENDPOINT = exports.DEV_DEFAULT_LITESERVERS = void 0;
4
4
  exports.DEV_DEFAULT_LITESERVERS = "";
5
5
  exports.DEV_TON_PUBLIC_RPC_ENDPOINT = "";
6
6
  exports.DEV_TON_RPC_ENDPOINT_BY_TAC = "";
7
+ exports.DEV_TONCENTER_V3_INDEXER_ENDPOINT = "";
@@ -1,9 +1,9 @@
1
1
  import { MAINNET_AGNOSTIC_PROXY_ADDRESS as AGNOSTIC_PROXY_ADDRESS, MAINNET_MULTICALL_3_ADDRESS as MULTICALL_3_ADDRESS, MAINNET_TAC_SETTINGS_ADDRESS as TAC_SETTINGS_ADDRESS, MAINNET_TAC_SMART_ACCOUNT_FACTORY_ADDRESS as TAC_SMART_ACCOUNT_FACTORY_ADDRESS } from './tac/addresses';
2
2
  import { MAINNET_PUBLIC_LITE_SEQUENCER_ENDPOINTS as PUBLIC_LITE_SEQUENCER_ENDPOINTS, MAINNET_TAC_RPC_ENDPOINT as TAC_RPC_ENDPOINT, MAINNET_TAC_EXPLORER_API_ENDPOINT as TAC_EXPLORER_API_ENDPOINT } from "./tac/endpoints";
3
3
  import { MAINNET_TON_SETTINGS_ADDRESS as TON_SETTINGS_ADDRESS } from './ton/addresses';
4
- import { MAINNET_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, MAINNET_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, MAINNET_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC } from "./ton/endpoints";
4
+ import { MAINNET_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, MAINNET_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, MAINNET_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC, MAINNET_TONCENTER_V3_INDEXER_ENDPOINT as TONCENTER_V3_INDEXER_ENDPOINT } from "./ton/endpoints";
5
5
  export * as tac from "./tac";
6
6
  export { PUBLIC_LITE_SEQUENCER_ENDPOINTS, TAC_RPC_ENDPOINT, TAC_EXPLORER_API_ENDPOINT };
7
7
  export * as ton from "./ton";
8
- export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC };
8
+ export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC, TONCENTER_V3_INDEXER_ENDPOINT };
9
9
  export { AGNOSTIC_PROXY_ADDRESS, MULTICALL_3_ADDRESS, TAC_SETTINGS_ADDRESS, TAC_SMART_ACCOUNT_FACTORY_ADDRESS, TON_SETTINGS_ADDRESS };
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
36
+ exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TONCENTER_V3_INDEXER_ENDPOINT = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
37
37
  const addresses_1 = require("./tac/addresses");
38
38
  Object.defineProperty(exports, "AGNOSTIC_PROXY_ADDRESS", { enumerable: true, get: function () { return addresses_1.MAINNET_AGNOSTIC_PROXY_ADDRESS; } });
39
39
  Object.defineProperty(exports, "MULTICALL_3_ADDRESS", { enumerable: true, get: function () { return addresses_1.MAINNET_MULTICALL_3_ADDRESS; } });
@@ -49,5 +49,6 @@ const endpoints_2 = require("./ton/endpoints");
49
49
  Object.defineProperty(exports, "DEFAULT_LITESERVERS", { enumerable: true, get: function () { return endpoints_2.MAINNET_DEFAULT_LITESERVERS; } });
50
50
  Object.defineProperty(exports, "TON_PUBLIC_RPC_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.MAINNET_TON_PUBLIC_RPC_ENDPOINT; } });
51
51
  Object.defineProperty(exports, "TON_RPC_ENDPOINT_BY_TAC", { enumerable: true, get: function () { return endpoints_2.MAINNET_TON_RPC_ENDPOINT_BY_TAC; } });
52
+ Object.defineProperty(exports, "TONCENTER_V3_INDEXER_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.MAINNET_TONCENTER_V3_INDEXER_ENDPOINT; } });
52
53
  exports.tac = __importStar(require("./tac"));
53
54
  exports.ton = __importStar(require("./ton"));
@@ -1,3 +1,4 @@
1
1
  export declare const MAINNET_DEFAULT_LITESERVERS = "https://ton.org/global.config.json";
2
2
  export declare const MAINNET_TON_PUBLIC_RPC_ENDPOINT = "https://toncenter.com/api/v2/jsonRPC";
3
3
  export declare const MAINNET_TON_RPC_ENDPOINT_BY_TAC = "https://toncenter-mainnet.tac.build";
4
+ export declare const MAINNET_TONCENTER_V3_INDEXER_ENDPOINT = "https://toncenter-mainnet.tac.build/api/v3/";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAINNET_TON_RPC_ENDPOINT_BY_TAC = exports.MAINNET_TON_PUBLIC_RPC_ENDPOINT = exports.MAINNET_DEFAULT_LITESERVERS = void 0;
3
+ exports.MAINNET_TONCENTER_V3_INDEXER_ENDPOINT = exports.MAINNET_TON_RPC_ENDPOINT_BY_TAC = exports.MAINNET_TON_PUBLIC_RPC_ENDPOINT = exports.MAINNET_DEFAULT_LITESERVERS = void 0;
4
4
  exports.MAINNET_DEFAULT_LITESERVERS = 'https://ton.org/global.config.json';
5
5
  exports.MAINNET_TON_PUBLIC_RPC_ENDPOINT = 'https://toncenter.com/api/v2/jsonRPC';
6
6
  exports.MAINNET_TON_RPC_ENDPOINT_BY_TAC = 'https://toncenter-mainnet.tac.build';
7
+ exports.MAINNET_TONCENTER_V3_INDEXER_ENDPOINT = 'https://toncenter-mainnet.tac.build/api/v3/';
@@ -1,9 +1,9 @@
1
1
  import { TESTNET_AGNOSTIC_PROXY_ADDRESS as AGNOSTIC_PROXY_ADDRESS, TESTNET_MULTICALL_3_ADDRESS as MULTICALL_3_ADDRESS, TESTNET_TAC_SETTINGS_ADDRESS as TAC_SETTINGS_ADDRESS, TESTNET_TAC_SMART_ACCOUNT_FACTORY_ADDRESS as TAC_SMART_ACCOUNT_FACTORY_ADDRESS } from './tac/addresses';
2
2
  import { TESTNET_PUBLIC_LITE_SEQUENCER_ENDPOINTS as PUBLIC_LITE_SEQUENCER_ENDPOINTS, TESTNET_TAC_RPC_ENDPOINT as TAC_RPC_ENDPOINT, TESTNET_TAC_EXPLORER_API_ENDPOINT as TAC_EXPLORER_API_ENDPOINT } from "./tac/endpoints";
3
3
  import { TESTNET_TON_SETTINGS_ADDRESS as TON_SETTINGS_ADDRESS } from './ton/addresses';
4
- import { TESTNET_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, TESTNET_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, TESTNET_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC } from "./ton/endpoints";
4
+ import { TESTNET_DEFAULT_LITESERVERS as DEFAULT_LITESERVERS, TESTNET_TON_PUBLIC_RPC_ENDPOINT as TON_PUBLIC_RPC_ENDPOINT, TESTNET_TON_RPC_ENDPOINT_BY_TAC as TON_RPC_ENDPOINT_BY_TAC, TESTNET_TONCENTER_V3_INDEXER_ENDPOINT as TONCENTER_V3_INDEXER_ENDPOINT } from "./ton/endpoints";
5
5
  export * as tac from "./tac";
6
6
  export { PUBLIC_LITE_SEQUENCER_ENDPOINTS, TAC_RPC_ENDPOINT, TAC_EXPLORER_API_ENDPOINT };
7
7
  export * as ton from "./ton";
8
- export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC };
8
+ export { DEFAULT_LITESERVERS, TON_PUBLIC_RPC_ENDPOINT, TON_RPC_ENDPOINT_BY_TAC, TONCENTER_V3_INDEXER_ENDPOINT };
9
9
  export { AGNOSTIC_PROXY_ADDRESS, MULTICALL_3_ADDRESS, TAC_SETTINGS_ADDRESS, TAC_SMART_ACCOUNT_FACTORY_ADDRESS, TON_SETTINGS_ADDRESS };
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
36
+ exports.TON_SETTINGS_ADDRESS = exports.TAC_SMART_ACCOUNT_FACTORY_ADDRESS = exports.TAC_SETTINGS_ADDRESS = exports.MULTICALL_3_ADDRESS = exports.AGNOSTIC_PROXY_ADDRESS = exports.TONCENTER_V3_INDEXER_ENDPOINT = exports.TON_RPC_ENDPOINT_BY_TAC = exports.TON_PUBLIC_RPC_ENDPOINT = exports.DEFAULT_LITESERVERS = exports.ton = exports.TAC_EXPLORER_API_ENDPOINT = exports.TAC_RPC_ENDPOINT = exports.PUBLIC_LITE_SEQUENCER_ENDPOINTS = exports.tac = void 0;
37
37
  const addresses_1 = require("./tac/addresses");
38
38
  Object.defineProperty(exports, "AGNOSTIC_PROXY_ADDRESS", { enumerable: true, get: function () { return addresses_1.TESTNET_AGNOSTIC_PROXY_ADDRESS; } });
39
39
  Object.defineProperty(exports, "MULTICALL_3_ADDRESS", { enumerable: true, get: function () { return addresses_1.TESTNET_MULTICALL_3_ADDRESS; } });
@@ -49,5 +49,6 @@ const endpoints_2 = require("./ton/endpoints");
49
49
  Object.defineProperty(exports, "DEFAULT_LITESERVERS", { enumerable: true, get: function () { return endpoints_2.TESTNET_DEFAULT_LITESERVERS; } });
50
50
  Object.defineProperty(exports, "TON_PUBLIC_RPC_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.TESTNET_TON_PUBLIC_RPC_ENDPOINT; } });
51
51
  Object.defineProperty(exports, "TON_RPC_ENDPOINT_BY_TAC", { enumerable: true, get: function () { return endpoints_2.TESTNET_TON_RPC_ENDPOINT_BY_TAC; } });
52
+ Object.defineProperty(exports, "TONCENTER_V3_INDEXER_ENDPOINT", { enumerable: true, get: function () { return endpoints_2.TESTNET_TONCENTER_V3_INDEXER_ENDPOINT; } });
52
53
  exports.tac = __importStar(require("./tac"));
53
54
  exports.ton = __importStar(require("./ton"));
@@ -1,3 +1,4 @@
1
1
  export declare const TESTNET_DEFAULT_LITESERVERS = "https://ton.org/testnet-global.config.json";
2
2
  export declare const TESTNET_TON_PUBLIC_RPC_ENDPOINT = "https://testnet.toncenter.com/api/v2/jsonRPC";
3
3
  export declare const TESTNET_TON_RPC_ENDPOINT_BY_TAC = "https://toncenter-spb.tac.build";
4
+ export declare const TESTNET_TONCENTER_V3_INDEXER_ENDPOINT = "https://toncenter-spb.tac.build/api/v3/";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TESTNET_TON_RPC_ENDPOINT_BY_TAC = exports.TESTNET_TON_PUBLIC_RPC_ENDPOINT = exports.TESTNET_DEFAULT_LITESERVERS = void 0;
3
+ exports.TESTNET_TONCENTER_V3_INDEXER_ENDPOINT = exports.TESTNET_TON_RPC_ENDPOINT_BY_TAC = exports.TESTNET_TON_PUBLIC_RPC_ENDPOINT = exports.TESTNET_DEFAULT_LITESERVERS = void 0;
4
4
  exports.TESTNET_DEFAULT_LITESERVERS = 'https://ton.org/testnet-global.config.json';
5
5
  exports.TESTNET_TON_PUBLIC_RPC_ENDPOINT = 'https://testnet.toncenter.com/api/v2/jsonRPC';
6
6
  exports.TESTNET_TON_RPC_ENDPOINT_BY_TAC = 'https://toncenter-spb.tac.build';
7
+ exports.TESTNET_TONCENTER_V3_INDEXER_ENDPOINT = 'https://toncenter-spb.tac.build/api/v3/';
@@ -7,8 +7,12 @@ export interface OpenerConfig {
7
7
  opener: ContractOpener;
8
8
  /** Number of retry attempts before falling back to the next opener. */
9
9
  retries: number;
10
- /** Delay in milliseconds between retries for this opener. */
10
+ /** Base delay in milliseconds between retries for this opener. */
11
11
  retryDelay: number;
12
+ /** Upper bound for exponential backoff delay in milliseconds. */
13
+ maxRetryDelay?: number;
14
+ /** Exponential backoff multiplier applied after each failed retry. */
15
+ retryBackoffMultiplier?: number;
12
16
  }
13
17
  export declare class RetryableContractOpener implements ContractOpener {
14
18
  private readonly openerConfigs;
@@ -32,6 +36,7 @@ export declare class RetryableContractOpener implements ContractOpener {
32
36
  private executeWithFallback;
33
37
  private trySingleAttempt;
34
38
  private tryWithRetries;
39
+ private getRetryDelay;
35
40
  private isContractExecutionError;
36
41
  private isTransportError;
37
42
  private createRetryableContract;
@@ -22,9 +22,7 @@ class RetryableContractOpener {
22
22
  }
23
23
  }
24
24
  setLogger(logger) {
25
- if (!this.logger) {
26
- this.logger = logger;
27
- }
25
+ this.logger = logger;
28
26
  this.applyLoggerToOpeners(logger);
29
27
  }
30
28
  applyLoggerToOpeners(logger) {
@@ -199,13 +197,24 @@ class RetryableContractOpener {
199
197
  return { success: false, lastError };
200
198
  }
201
199
  if (attempt < config.retries) {
202
- this.logger?.debug(`[RetryableContractOpener] ${operationContext}: attempt ${attempt + 1}/${config.retries + 1} failed (${lastError.message}), retrying in ${config.retryDelay}ms`);
203
- await sleep(config.retryDelay);
200
+ const retryDelay = this.getRetryDelay(config, attempt);
201
+ this.logger?.debug(`[RetryableContractOpener] ${operationContext}: attempt ${attempt + 1}/${config.retries + 1} failed (${lastError.message}), retrying in ${retryDelay}ms`);
202
+ await sleep(retryDelay);
204
203
  }
205
204
  }
206
205
  }
207
206
  return { success: false, lastError };
208
207
  }
208
+ getRetryDelay(config, attempt) {
209
+ const baseDelay = config.retryDelay ?? Consts_1.DEFAULT_RETRY_DELAY_MS;
210
+ const maxRetryDelay = config.maxRetryDelay ?? Consts_1.DEFAULT_RETRY_MAX_DELAY_MS;
211
+ const backoffMultiplier = config.retryBackoffMultiplier ?? Consts_1.DEFAULT_RETRY_BACKOFF_MULTIPLIER;
212
+ if (baseDelay === 0 || maxRetryDelay === 0) {
213
+ return 0;
214
+ }
215
+ const calculatedDelay = baseDelay * backoffMultiplier ** attempt;
216
+ return Math.min(Math.round(calculatedDelay), maxRetryDelay);
217
+ }
209
218
  isContractExecutionError(error) {
210
219
  const errorWithExit = error;
211
220
  if (typeof errorWithExit.exitCode === 'number' ||
@@ -269,18 +278,36 @@ async function createDefaultRetryableOpener(tonRpcEndpoint, networkType, maxRetr
269
278
  timeout: Consts_1.DEFAULT_HTTP_CLIENT_TIMEOUT_MS,
270
279
  });
271
280
  const opener = (0, TonClientOpener_1.tonClientOpener)(tonClient, logger);
272
- openers.push({ opener, retries: maxRetries, retryDelay });
281
+ openers.push({
282
+ opener,
283
+ retries: maxRetries,
284
+ retryDelay,
285
+ maxRetryDelay: Consts_1.DEFAULT_RETRY_MAX_DELAY_MS,
286
+ retryBackoffMultiplier: Consts_1.DEFAULT_RETRY_BACKOFF_MULTIPLIER,
287
+ });
273
288
  if (networkType !== Struct_1.Network.DEV) {
274
289
  try {
275
290
  const opener = await (0, TonClientOpener_1.orbsOpener)(networkType, logger);
276
- openers.push({ opener: opener, retries: maxRetries, retryDelay });
291
+ openers.push({
292
+ opener: opener,
293
+ retries: maxRetries,
294
+ retryDelay,
295
+ maxRetryDelay: Consts_1.DEFAULT_RETRY_MAX_DELAY_MS,
296
+ retryBackoffMultiplier: Consts_1.DEFAULT_RETRY_BACKOFF_MULTIPLIER,
297
+ });
277
298
  }
278
299
  catch {
279
300
  // skip opener in case of failure
280
301
  }
281
302
  try {
282
303
  const opener4 = await (0, TonClient4Opener_1.orbsOpener4)(networkType, Consts_1.DEFAULT_HTTP_CLIENT_TIMEOUT_MS, logger);
283
- openers.push({ opener: opener4, retries: maxRetries, retryDelay });
304
+ openers.push({
305
+ opener: opener4,
306
+ retries: maxRetries,
307
+ retryDelay,
308
+ maxRetryDelay: Consts_1.DEFAULT_RETRY_MAX_DELAY_MS,
309
+ retryBackoffMultiplier: Consts_1.DEFAULT_RETRY_BACKOFF_MULTIPLIER,
310
+ });
284
311
  }
285
312
  catch {
286
313
  // skip opener in case of failure
@@ -0,0 +1,34 @@
1
+ import { IHttpClient, IToncenterV3Indexer } from '../interfaces';
2
+ import { ToncenterV3IndexedTransaction, ToncenterV3TraversalParams } from '../structs/Struct';
3
+ /**
4
+ * Thin Toncenter v3 indexer client for resolving indexed TON transaction context by hash and
5
+ * traversing a linked chain of TON transactions until it finds the sequencer-collected event transaction on CCL.
6
+ */
7
+ export declare class ToncenterV3Indexer implements IToncenterV3Indexer {
8
+ readonly endpoint: string;
9
+ private readonly httpClient;
10
+ constructor(endpoint: string, httpClient?: IHttpClient);
11
+ /**
12
+ * Queries Toncenter v3 indexed `/transactions` endpoint by hash and returns the first match.
13
+ * @param transactionHash TON transaction hash accepted by the indexer.
14
+ * @returns Indexed transaction with owning account context, or null on 404 / empty result.
15
+ */
16
+ getTransactionByHash(transactionHash: string): Promise<ToncenterV3IndexedTransaction | null>;
17
+ /**
18
+ * Queries Toncenter v3 indexed `/adjacentTransactions` endpoint by hash.
19
+ * @param transactionHash TON transaction hash accepted by the indexer.
20
+ * @returns Adjacent indexed transactions, or an empty array on 404 / empty result.
21
+ */
22
+ getAdjacentTransactions(transactionHash: string): Promise<ToncenterV3IndexedTransaction[]>;
23
+ /**
24
+ * Traverses the linked chain of TON transactions in both directions starting from any TON transaction hash
25
+ * from that linked transaction chain, and returns the transaction on crossChainLayer that the sequencer would collect
26
+ * as a TVM event.
27
+ * @param transactionHash Any TON transaction hash from the target linked chain of TON transactions.
28
+ * @param crossChainLayerAddress crossChainLayer address whose sequencer-collected event transaction should be found in that linked chain of TON transactions.
29
+ * @param params Optional traversal settings. Defaults match the SDK traversal defaults.
30
+ * @returns Indexed crossChainLayer transaction that matches the sequencer collector rules, or null if not found.
31
+ */
32
+ findCollectibleCrossChainLayerTransaction(transactionHash: string, crossChainLayerAddress: string, params?: ToncenterV3TraversalParams): Promise<ToncenterV3IndexedTransaction | null>;
33
+ private isCollectibleEventTransactionOnAccount;
34
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToncenterV3Indexer = void 0;
4
+ const ton_1 = require("@ton/ton");
5
+ const errors_1 = require("../errors");
6
+ const AxiosHttpClient_1 = require("../sdk/AxiosHttpClient");
7
+ const Consts_1 = require("../sdk/Consts");
8
+ const Utils_1 = require("../sdk/Utils");
9
+ /**
10
+ * Thin Toncenter v3 indexer client for resolving indexed TON transaction context by hash and
11
+ * traversing a linked chain of TON transactions until it finds the sequencer-collected event transaction on CCL.
12
+ */
13
+ class ToncenterV3Indexer {
14
+ constructor(endpoint, httpClient = new AxiosHttpClient_1.AxiosHttpClient()) {
15
+ this.endpoint = endpoint;
16
+ this.httpClient = httpClient;
17
+ }
18
+ /**
19
+ * Queries Toncenter v3 indexed `/transactions` endpoint by hash and returns the first match.
20
+ * @param transactionHash TON transaction hash accepted by the indexer.
21
+ * @returns Indexed transaction with owning account context, or null on 404 / empty result.
22
+ */
23
+ async getTransactionByHash(transactionHash) {
24
+ const endpoint = this.endpoint.endsWith('/') ? `${this.endpoint}transactions` : `${this.endpoint}/transactions`;
25
+ const requestLabel = `GET ${endpoint}`;
26
+ try {
27
+ const response = await this.httpClient.get(endpoint, {
28
+ params: {
29
+ hash: transactionHash,
30
+ limit: 1,
31
+ },
32
+ transformResponse: [Utils_1.toCamelCaseTransformer],
33
+ });
34
+ return response.data.transactions?.[0] ?? null;
35
+ }
36
+ catch (error) {
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ if (error?.response?.status === 404) {
39
+ return null;
40
+ }
41
+ throw (0, errors_1.operationFetchError)(`request ${requestLabel} failed to resolve TON indexed transaction`, error);
42
+ }
43
+ }
44
+ /**
45
+ * Queries Toncenter v3 indexed `/adjacentTransactions` endpoint by hash.
46
+ * @param transactionHash TON transaction hash accepted by the indexer.
47
+ * @returns Adjacent indexed transactions, or an empty array on 404 / empty result.
48
+ */
49
+ async getAdjacentTransactions(transactionHash) {
50
+ const endpoint = this.endpoint.endsWith('/') ? `${this.endpoint}adjacentTransactions` : `${this.endpoint}/adjacentTransactions`;
51
+ const requestLabel = `GET ${endpoint}`;
52
+ try {
53
+ const response = await this.httpClient.get(endpoint, {
54
+ params: {
55
+ hash: transactionHash,
56
+ },
57
+ transformResponse: [Utils_1.toCamelCaseTransformer],
58
+ });
59
+ return response.data.transactions ?? [];
60
+ }
61
+ catch (error) {
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
+ if (error?.response?.status === 404) {
64
+ return [];
65
+ }
66
+ throw (0, errors_1.operationFetchError)(`request ${requestLabel} failed to resolve adjacent TON indexed transactions`, error);
67
+ }
68
+ }
69
+ /**
70
+ * Traverses the linked chain of TON transactions in both directions starting from any TON transaction hash
71
+ * from that linked transaction chain, and returns the transaction on crossChainLayer that the sequencer would collect
72
+ * as a TVM event.
73
+ * @param transactionHash Any TON transaction hash from the target linked chain of TON transactions.
74
+ * @param crossChainLayerAddress crossChainLayer address whose sequencer-collected event transaction should be found in that linked chain of TON transactions.
75
+ * @param params Optional traversal settings. Defaults match the SDK traversal defaults.
76
+ * @returns Indexed crossChainLayer transaction that matches the sequencer collector rules, or null if not found.
77
+ */
78
+ async findCollectibleCrossChainLayerTransaction(transactionHash, crossChainLayerAddress, params) {
79
+ const { maxDepth = Consts_1.DEFAULT_FIND_TX_MAX_DEPTH, maxScannedTransactions = Consts_1.DEFAULT_MAX_SCANNED_TRANSACTIONS, } = params ?? {};
80
+ const crossChainLayer = ton_1.Address.parse(crossChainLayerAddress);
81
+ const rootTransaction = await this.getTransactionByHash(transactionHash);
82
+ if (!rootTransaction) {
83
+ return null;
84
+ }
85
+ if (this.isCollectibleEventTransactionOnAccount(rootTransaction, crossChainLayer)) {
86
+ return rootTransaction;
87
+ }
88
+ const queue = [{ hash: rootTransaction.hash, depth: 0 }];
89
+ const visitedHashes = new Set([(0, Utils_1.normalizeHashToHex)(rootTransaction.hash)]);
90
+ let scannedTransactions = 0;
91
+ while (queue.length > 0) {
92
+ const { hash: currentHash, depth } = queue.shift();
93
+ if (depth >= maxDepth || scannedTransactions >= maxScannedTransactions) {
94
+ continue;
95
+ }
96
+ const adjacentTransactions = await this.getAdjacentTransactions(currentHash);
97
+ for (const transaction of adjacentTransactions) {
98
+ const normalizedHash = (0, Utils_1.normalizeHashToHex)(transaction.hash);
99
+ if (visitedHashes.has(normalizedHash)) {
100
+ continue;
101
+ }
102
+ visitedHashes.add(normalizedHash);
103
+ scannedTransactions += 1;
104
+ if (this.isCollectibleEventTransactionOnAccount(transaction, crossChainLayer)) {
105
+ return transaction;
106
+ }
107
+ if (scannedTransactions < maxScannedTransactions) {
108
+ queue.push({ hash: transaction.hash, depth: depth + 1 });
109
+ }
110
+ }
111
+ }
112
+ return null;
113
+ }
114
+ isCollectibleEventTransactionOnAccount(transaction, account) {
115
+ if (!ton_1.Address.parse(transaction.account).equals(account)) {
116
+ return false;
117
+ }
118
+ return transaction.outMsgs.some((message) => {
119
+ return message.destination == null;
120
+ });
121
+ }
122
+ }
123
+ exports.ToncenterV3Indexer = ToncenterV3Indexer;
@@ -3,5 +3,6 @@ export * from './LiteClientOpener';
3
3
  export * from './OpenerUtils';
4
4
  export * from './RetryableContractOpener';
5
5
  export * from './SandboxOpener';
6
+ export * from './ToncenterV3Indexer';
6
7
  export * from './TonClient4Opener';
7
8
  export * from './TonClientOpener';
@@ -19,5 +19,6 @@ __exportStar(require("./LiteClientOpener"), exports);
19
19
  __exportStar(require("./OpenerUtils"), exports);
20
20
  __exportStar(require("./RetryableContractOpener"), exports);
21
21
  __exportStar(require("./SandboxOpener"), exports);
22
+ __exportStar(require("./ToncenterV3Indexer"), exports);
22
23
  __exportStar(require("./TonClient4Opener"), exports);
23
24
  __exportStar(require("./TonClientOpener"), exports);
@@ -131,7 +131,7 @@ class FT {
131
131
  else {
132
132
  const resolvedEvmAddress = (0, ethers_1.isAddress)(address)
133
133
  ? address
134
- : cachedEvmAddress ?? (await jettonMinter.getEVMTokenAddress());
134
+ : (cachedEvmAddress ?? (await jettonMinter.getEVMTokenAddress()));
135
135
  finalEvmAddress = resolvedEvmAddress;
136
136
  decimals = await this.getTACDecimals(configuration, resolvedEvmAddress);
137
137
  }
@@ -1,2 +1,2 @@
1
1
  export { AddressError, BitError, ContractError, EVMCallError, FetchError, FormatError, KeyError, MetadataError, SettingError, TokenError, TransactionError, WalletError, } from './errors';
2
- export { allEndpointsFailedError, blockGasLimitFetchError, emptyArrayError, emptyContractError, emptySettingError, estimatedGasExceedsBlockGasLimitError, evmAddressError, executedInTONStageFailedError, gasPriceFetchError, indexRequiredError, insufficientBalanceError, insufficientFeeParamsError, invalidMethodNameError, missingDecimals, missingFeeParamsError, missingGasLimitError, missingJettonDataError, missingTvmExecutorFeeError, notMultiplyOf8Error, operationFetchError, operationIdRequiredForFinalizationError, prefixError, profilingFetchError, simulationFetchError, statusFetchError, tvmAddressError, txFinalizationError, unknownTokenTypeError, unknownWalletError, unsupportedFormatError, unsupportedKeyError, zeroRawAmountError, } from './instances';
2
+ export { allEndpointsFailedError, blockGasLimitFetchError, emptyArrayError, emptyContractError, emptySettingError, estimatedGasExceedsBlockGasLimitError, evmAddressError, externalInMessageRequiredError, executedInTONStageFailedError, gasPriceFetchError, indexRequiredError, insufficientBalanceError, insufficientFeeParamsError, invalidTonExternalMessageBocError, invalidMethodNameError, missingDecimals, missingFeeParamsError, missingGasLimitError, missingJettonDataError, missingTvmExecutorFeeError, notMultiplyOf8Error, operationFetchError, operationIdRequiredForFinalizationError, prefixError, profilingFetchError, simulationFetchError, statusFetchError, tvmAddressError, txFinalizationError, unknownTokenTypeError, unknownWalletError, unsupportedFormatError, unsupportedKeyError, zeroRawAmountError, } from './instances';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zeroRawAmountError = exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.txFinalizationError = exports.tvmAddressError = exports.statusFetchError = exports.simulationFetchError = exports.profilingFetchError = exports.prefixError = exports.operationIdRequiredForFinalizationError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.missingTvmExecutorFeeError = exports.missingJettonDataError = exports.missingGasLimitError = exports.missingFeeParamsError = exports.missingDecimals = exports.invalidMethodNameError = exports.insufficientFeeParamsError = exports.insufficientBalanceError = exports.indexRequiredError = exports.gasPriceFetchError = exports.executedInTONStageFailedError = exports.evmAddressError = exports.estimatedGasExceedsBlockGasLimitError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.blockGasLimitFetchError = exports.allEndpointsFailedError = exports.WalletError = exports.TransactionError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
3
+ exports.zeroRawAmountError = exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.txFinalizationError = exports.tvmAddressError = exports.statusFetchError = exports.simulationFetchError = exports.profilingFetchError = exports.prefixError = exports.operationIdRequiredForFinalizationError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.missingTvmExecutorFeeError = exports.missingJettonDataError = exports.missingGasLimitError = exports.missingFeeParamsError = exports.missingDecimals = exports.invalidMethodNameError = exports.invalidTonExternalMessageBocError = exports.insufficientFeeParamsError = exports.insufficientBalanceError = exports.indexRequiredError = exports.gasPriceFetchError = exports.executedInTONStageFailedError = exports.externalInMessageRequiredError = exports.evmAddressError = exports.estimatedGasExceedsBlockGasLimitError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.blockGasLimitFetchError = exports.allEndpointsFailedError = exports.WalletError = exports.TransactionError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
4
4
  var errors_1 = require("./errors");
5
5
  Object.defineProperty(exports, "AddressError", { enumerable: true, get: function () { return errors_1.AddressError; } });
6
6
  Object.defineProperty(exports, "BitError", { enumerable: true, get: function () { return errors_1.BitError; } });
@@ -22,11 +22,13 @@ Object.defineProperty(exports, "emptyContractError", { enumerable: true, get: fu
22
22
  Object.defineProperty(exports, "emptySettingError", { enumerable: true, get: function () { return instances_1.emptySettingError; } });
23
23
  Object.defineProperty(exports, "estimatedGasExceedsBlockGasLimitError", { enumerable: true, get: function () { return instances_1.estimatedGasExceedsBlockGasLimitError; } });
24
24
  Object.defineProperty(exports, "evmAddressError", { enumerable: true, get: function () { return instances_1.evmAddressError; } });
25
+ Object.defineProperty(exports, "externalInMessageRequiredError", { enumerable: true, get: function () { return instances_1.externalInMessageRequiredError; } });
25
26
  Object.defineProperty(exports, "executedInTONStageFailedError", { enumerable: true, get: function () { return instances_1.executedInTONStageFailedError; } });
26
27
  Object.defineProperty(exports, "gasPriceFetchError", { enumerable: true, get: function () { return instances_1.gasPriceFetchError; } });
27
28
  Object.defineProperty(exports, "indexRequiredError", { enumerable: true, get: function () { return instances_1.indexRequiredError; } });
28
29
  Object.defineProperty(exports, "insufficientBalanceError", { enumerable: true, get: function () { return instances_1.insufficientBalanceError; } });
29
30
  Object.defineProperty(exports, "insufficientFeeParamsError", { enumerable: true, get: function () { return instances_1.insufficientFeeParamsError; } });
31
+ Object.defineProperty(exports, "invalidTonExternalMessageBocError", { enumerable: true, get: function () { return instances_1.invalidTonExternalMessageBocError; } });
30
32
  Object.defineProperty(exports, "invalidMethodNameError", { enumerable: true, get: function () { return instances_1.invalidMethodNameError; } });
31
33
  Object.defineProperty(exports, "missingDecimals", { enumerable: true, get: function () { return instances_1.missingDecimals; } });
32
34
  Object.defineProperty(exports, "missingFeeParamsError", { enumerable: true, get: function () { return instances_1.missingFeeParamsError; } });
@@ -41,3 +41,5 @@ export declare const operationIdRequiredForFinalizationError: TransactionError;
41
41
  export declare const executedInTONStageFailedError: TransactionError;
42
42
  export declare const blockGasLimitFetchError: (msg: string, inner?: unknown) => FetchError;
43
43
  export declare const estimatedGasExceedsBlockGasLimitError: (txName: string, estimatedGas: bigint, blockGasLimit: bigint) => TransactionError;
44
+ export declare const invalidTonExternalMessageBocError: (reason?: string) => FormatError;
45
+ export declare const externalInMessageRequiredError: (actualType: string) => FormatError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimatedGasExceedsBlockGasLimitError = exports.blockGasLimitFetchError = exports.executedInTONStageFailedError = exports.operationIdRequiredForFinalizationError = exports.insufficientFeeParamsError = exports.txFinalizationError = exports.gasPriceFetchError = exports.unknownAssetOriginError = 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;
3
+ exports.externalInMessageRequiredError = exports.invalidTonExternalMessageBocError = exports.estimatedGasExceedsBlockGasLimitError = exports.blockGasLimitFetchError = exports.executedInTONStageFailedError = exports.operationIdRequiredForFinalizationError = exports.insufficientFeeParamsError = exports.txFinalizationError = exports.gasPriceFetchError = exports.unknownAssetOriginError = 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);
@@ -127,3 +127,7 @@ const blockGasLimitFetchError = (msg, inner) => new errors_1.FetchError(`Failed
127
127
  exports.blockGasLimitFetchError = blockGasLimitFetchError;
128
128
  const estimatedGasExceedsBlockGasLimitError = (txName, estimatedGas, blockGasLimit) => new errors_1.TransactionError(`Estimated gas for ${txName} (${estimatedGas}) exceeds current TAC block gas limit (${blockGasLimit})`, 140);
129
129
  exports.estimatedGasExceedsBlockGasLimitError = estimatedGasExceedsBlockGasLimitError;
130
+ const invalidTonExternalMessageBocError = (reason) => new errors_1.FormatError(`Invalid external TON message BOC${reason ? `: ${reason}` : ''}`, 141);
131
+ exports.invalidTonExternalMessageBocError = invalidTonExternalMessageBocError;
132
+ const externalInMessageRequiredError = (actualType) => new errors_1.FormatError(`Expected external-in TON message, got ${actualType}`, 142);
133
+ exports.externalInMessageRequiredError = externalInMessageRequiredError;
@@ -16,7 +16,7 @@ export interface ContractOpener {
16
16
  */
17
17
  getContractState(address: Address): Promise<ContractState>;
18
18
  /**
19
- * Closes any underlying connections if supported by the implementation.
19
+ * Closes TON lite client connections. Use only with LiteClientOpener.
20
20
  */
21
21
  closeConnections?: () => unknown;
22
22
  /**
@@ -1,13 +1,17 @@
1
1
  import { ConvertCurrencyParams, ConvertedCurrencyResult, ExecutionStagesByOperationId, ExecutionStagesV2ByOperationId, GetTVMExecutorFeeParams, OperationIdsByShardsKey, OperationType, OperationTypeV2Info, StatusInfosByOperationId, SuggestedTVMExecutorFee, TACSimulationParams, TACSimulationResult, TransactionLinker } from '../structs/Struct';
2
2
  export interface ILiteSequencerClient {
3
+ /** Base URL of the lite sequencer endpoint used by this client. */
4
+ readonly endpoint: string;
3
5
  /** Retrieves the operation type by id. */
4
6
  getOperationType(operationId: string): Promise<OperationType>;
5
7
  /** Retrieves the v2 operation route/finalization state by id. */
6
8
  getOperationTypeV2(operationId: string): Promise<OperationTypeV2Info>;
7
9
  /** Resolves operation id by a transaction linker. */
8
10
  getOperationId(transactionLinker: TransactionLinker): Promise<string>;
9
- /** Resolves operation id by the originating transaction hash. */
11
+ /** Resolves operation id by the originating transaction hash (from ccl event in TON and TAC). */
10
12
  getOperationIdByTransactionHash(transactionHash: string): Promise<string>;
13
+ /** Resolves operation id by the originating transaction hash (from ccl event in TON). */
14
+ getOperationIdByTonTransactionHash(transactionHash: string): Promise<string>;
11
15
  /**
12
16
  * Resolves operation ids for multiple shard keys.
13
17
  * @param shardsKeys Shard keys to query.
@@ -24,6 +24,12 @@ export interface IOperationTracker {
24
24
  * @param waitOptions Optional waiting settings. Pass `null` to disable retries and use a single attempt.
25
25
  */
26
26
  getOperationIdByTransactionHash(transactionHash: string, waitOptions?: WaitOptions<string> | null): Promise<string>;
27
+ /**
28
+ * Resolves an operation id by a TON transaction hash, optionally waiting until available.
29
+ * @param transactionHash Exact TON crossChainLayer transaction hash.
30
+ * @param waitOptions Optional waiting settings. Pass `null` to disable retries and use a single attempt.
31
+ */
32
+ getOperationIdByTonTransactionHash(transactionHash: string, waitOptions?: WaitOptions<string> | null): Promise<string>;
27
33
  /**
28
34
  * Resolves operation ids by shard keys for a particular caller, with optional batching and waiting.
29
35
  * @param shardsKeys List of shard keys.
@@ -1,5 +1,5 @@
1
1
  import { Wallet } from 'ethers';
2
- import { BridgeTokensToTONOptions, TACCrossChainTransactionResult } from '../structs/Struct';
2
+ import { CrossChainTransactionToTONOptions, TACCrossChainTransactionResult } from '../structs/Struct';
3
3
  import { Asset } from './Asset';
4
4
  export interface ITACTransactionManager {
5
5
  /**
@@ -8,14 +8,15 @@ export interface ITACTransactionManager {
8
8
  * performs production-oriented TAC prechecks: requires EIP-1559 fee data from the TAC provider,
9
9
  * optionally validates balances / ownership of non-native TAC assets, uses provider gas estimates as-is,
10
10
  * validates those estimates against the latest TAC block gas limit,
11
- * computes the worst-case upfront TAC balance requirement, and then submits approvals plus the bridge message.
11
+ * first estimates approval gas and checks TAC balance for approvals, submits approvals,
12
+ * then estimates the bridge message and checks the remaining TAC balance before sending it.
12
13
  * @param signer Ethers Wallet used to sign EVM transaction.
13
14
  * @param tonTarget Recipient TVM address on TON.
14
15
  * @param assets Optional list of TAC assets to include. Native TAC should be passed here as a TAC asset.
15
16
  * @param options Optional bridge configuration object.
16
17
  * @returns TAC transaction hash and optional operationId.
17
18
  */
18
- sendCrossChainTransactionToTON(signer: Wallet, tonTarget: string, assets?: Asset[], options?: BridgeTokensToTONOptions): Promise<TACCrossChainTransactionResult>;
19
+ sendCrossChainTransactionToTON(signer: Wallet, tonTarget: string, assets?: Asset[], options?: CrossChainTransactionToTONOptions): Promise<TACCrossChainTransactionResult>;
19
20
  /**
20
21
  * Bridges native EVM value and optional assets to TON chain via executor.
21
22
  * This is a low-level send-only method: it approves assets, sends the TAC -> TON message and