@tonappchain/sdk 0.7.2-scaled-ui-support-2 → 0.7.2
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 +130 -17
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.d.ts +2 -0
- package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.js +3 -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/endpoints.d.ts +1 -1
- package/dist/artifacts/mainnet/ton/endpoints.js +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/CrossChainLayer.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/Executor.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/JettonMinter.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/JettonProxy.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/JettonWallet.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/NFTItem.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/build/NFTProxy.compiled.json +1 -1
- package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.d.ts +1 -13
- package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.js +7 -45
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.d.ts +2 -2
- package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.js +2 -2
- 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/endpoints.d.ts +1 -1
- package/dist/artifacts/testnet/ton/endpoints.js +1 -1
- package/dist/artifacts/testnet/ton/internal/build/CrossChainLayer.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/Executor.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/JettonProxy.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/JettonWallet.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/NFTItem.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/NFTProxy.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/build/Settings.compiled.json +1 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.d.ts +53 -6
- package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.js +130 -17
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.d.ts +2 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.js +3 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.d.ts +9 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.js +10 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.d.ts +7 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.js +9 -2
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.d.ts +9 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.js +9 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.d.ts +7 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.js +7 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.d.ts +7 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.js +8 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/Settings.d.ts +1 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/Settings.js +1 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/CrossChainLayerPayload.d.ts +10 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/CrossChainLayerPayload.js +24 -0
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.d.ts +2 -1
- package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.js +9 -1
- package/dist/src/adapters/BaseContractOpener.d.ts +76 -0
- package/dist/src/adapters/BaseContractOpener.js +440 -0
- package/dist/src/adapters/LiteClientOpener.d.ts +38 -0
- package/dist/src/adapters/LiteClientOpener.js +141 -0
- package/dist/src/adapters/OpenerUtils.d.ts +3 -0
- package/dist/src/adapters/OpenerUtils.js +40 -0
- package/dist/src/adapters/RetryableContractOpener.d.ts +40 -0
- package/dist/src/adapters/RetryableContractOpener.js +290 -0
- package/dist/src/adapters/SandboxOpener.d.ts +15 -0
- package/dist/src/adapters/SandboxOpener.js +35 -0
- package/dist/src/adapters/TonClient4Opener.d.ts +24 -0
- package/dist/src/adapters/TonClient4Opener.js +95 -0
- package/dist/src/adapters/TonClientOpener.d.ts +19 -0
- package/dist/src/adapters/TonClientOpener.js +82 -0
- package/dist/src/adapters/index.d.ts +7 -2
- package/dist/src/adapters/index.js +7 -2
- package/dist/src/assets/AssetCache.d.ts +8 -8
- package/dist/src/assets/AssetCache.js +3 -0
- package/dist/src/assets/AssetFactory.js +8 -2
- package/dist/src/assets/FT.d.ts +2 -3
- package/dist/src/assets/FT.js +4 -7
- package/dist/src/assets/NFT.d.ts +1 -1
- package/dist/src/assets/NFT.js +1 -1
- package/dist/src/assets/TON.d.ts +3 -2
- package/dist/src/assets/TON.js +2 -1
- package/dist/src/errors/errors.d.ts +12 -1
- package/dist/src/errors/errors.js +66 -2
- package/dist/src/errors/index.d.ts +2 -2
- package/dist/src/errors/index.js +4 -1
- package/dist/src/errors/instances.d.ts +7 -2
- package/dist/src/errors/instances.js +67 -2
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +6 -4
- package/dist/src/interfaces/Asset.d.ts +4 -9
- package/dist/src/interfaces/ContractOpener.d.ts +76 -2
- package/dist/src/interfaces/IOperationTracker.d.ts +22 -22
- package/dist/src/interfaces/ISimulator.d.ts +9 -1
- package/dist/src/interfaces/ITONTransactionManager.d.ts +20 -1
- package/dist/src/interfaces/ITacExplorerClient.d.ts +8 -0
- package/dist/src/interfaces/ITacExplorerClient.js +2 -0
- package/dist/src/interfaces/ITacSDK.d.ts +25 -1
- package/dist/src/interfaces/ITxFinalizer.d.ts +4 -0
- package/dist/src/interfaces/ITxFinalizer.js +2 -0
- package/dist/src/interfaces/WalletInstanse.d.ts +4 -8
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/sdk/Configuration.d.ts +5 -3
- package/dist/src/sdk/Configuration.js +54 -7
- package/dist/src/sdk/Consts.d.ts +18 -1
- package/dist/src/sdk/Consts.js +21 -2
- package/dist/src/sdk/Fees.d.ts +21 -0
- package/dist/src/sdk/Fees.js +201 -0
- package/dist/src/sdk/LiteSequencerClient.d.ts +1 -0
- package/dist/src/sdk/LiteSequencerClient.js +39 -17
- package/dist/src/sdk/OperationTracker.d.ts +11 -11
- package/dist/src/sdk/OperationTracker.js +46 -94
- package/dist/src/sdk/Simulator.d.ts +10 -2
- package/dist/src/sdk/Simulator.js +102 -0
- package/dist/src/sdk/StartTracking.d.ts +12 -7
- package/dist/src/sdk/StartTracking.js +75 -49
- package/dist/src/sdk/TONTransactionManager.d.ts +5 -4
- package/dist/src/sdk/TONTransactionManager.js +63 -8
- package/dist/src/sdk/TacExplorerClient.d.ts +8 -0
- package/dist/src/sdk/TacExplorerClient.js +22 -0
- package/dist/src/sdk/TacSdk.d.ts +8 -2
- package/dist/src/sdk/TacSdk.js +27 -4
- package/dist/src/sdk/TxFinalizer.d.ts +4 -3
- package/dist/src/sdk/TxFinalizer.js +41 -41
- package/dist/src/sdk/Utils.d.ts +20 -1
- package/dist/src/sdk/Utils.js +158 -10
- package/dist/src/sender/BatchSender.js +19 -0
- package/dist/src/sender/MockSender.d.ts +2 -0
- package/dist/src/sender/MockSender.js +13 -0
- package/dist/src/sender/RawSender.js +34 -1
- package/dist/src/sender/SenderFactory.js +1 -1
- package/dist/src/sender/TonConnectSender.js +2 -0
- package/dist/src/sender/index.d.ts +1 -0
- package/dist/src/sender/index.js +1 -0
- package/dist/src/structs/InternalStruct.d.ts +98 -4
- package/dist/src/structs/Struct.d.ts +183 -7
- package/dist/src/structs/Struct.js +4 -3
- package/dist/src/wrappers/HighloadWalletV3.d.ts +5 -3
- package/dist/src/wrappers/HighloadWalletV3.js +14 -3
- package/package.json +121 -117
- package/dist/src/adapters/contractOpener.d.ts +0 -20
- package/dist/src/adapters/contractOpener.js +0 -126
- package/dist/src/adapters/retryableContractOpener.d.ts +0 -24
- package/dist/src/adapters/retryableContractOpener.js +0 -111
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SandboxContract } from '@ton/sandbox';
|
|
2
|
-
import { OpenedContract } from '@ton/ton';
|
|
2
|
+
import { Cell, OpenedContract } from '@ton/ton';
|
|
3
3
|
import { AbstractProvider } from 'ethers';
|
|
4
4
|
import { JettonMinter, JettonMinterData } from '../../artifacts/tonTypes';
|
|
5
5
|
import type { FT, NFT } from '../assets';
|
|
6
6
|
import type { Asset, ContractOpener, ILogger } from '../interfaces';
|
|
7
|
+
import { SendResult } from './InternalStruct';
|
|
7
8
|
export type ContractState = {
|
|
8
9
|
balance: bigint;
|
|
9
10
|
state: 'active' | 'uninitialized' | 'frozen';
|
|
@@ -81,6 +82,11 @@ export type SDKParams = {
|
|
|
81
82
|
* URLs of lite sequencers
|
|
82
83
|
*/
|
|
83
84
|
customLiteSequencerEndpoints?: string[];
|
|
85
|
+
/**
|
|
86
|
+
* Whether SDK logger should be passed to TON contract opener(s).
|
|
87
|
+
* Default: true
|
|
88
|
+
*/
|
|
89
|
+
passLoggerToOpeners?: boolean;
|
|
84
90
|
};
|
|
85
91
|
export declare enum AssetType {
|
|
86
92
|
NFT = "NFT",
|
|
@@ -103,14 +109,13 @@ export type EvmProxyMsg = {
|
|
|
103
109
|
methodName?: string;
|
|
104
110
|
encodedParameters?: string;
|
|
105
111
|
gasLimit?: bigint;
|
|
106
|
-
[key: string]: unknown;
|
|
107
112
|
};
|
|
108
113
|
export type TransactionLinker = {
|
|
109
114
|
caller: string;
|
|
110
115
|
shardCount: number;
|
|
111
116
|
shardsKey: string;
|
|
112
117
|
timestamp: number;
|
|
113
|
-
sendTransactionResult?:
|
|
118
|
+
sendTransactionResult?: SendResult;
|
|
114
119
|
};
|
|
115
120
|
export type TransactionLinkerWithOperationId = TransactionLinker & {
|
|
116
121
|
operationId?: string;
|
|
@@ -279,9 +284,21 @@ export type FeeParams = {
|
|
|
279
284
|
protocolFee: bigint;
|
|
280
285
|
evmExecutorFee: bigint;
|
|
281
286
|
tvmExecutorFee: bigint;
|
|
287
|
+
evmEstimatedGas?: bigint;
|
|
282
288
|
};
|
|
289
|
+
export type evmDataBuilder = (transactionLinker: TransactionLinker, evmProxyMsg: EvmProxyMsg, validExecutors: ValidExecutors) => Cell;
|
|
283
290
|
export type CrossChainTransactionOptions = {
|
|
284
291
|
allowSimulationError?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* If true, ensures TON transaction execution is validated before waiting for operation id.
|
|
294
|
+
* @default true
|
|
295
|
+
*/
|
|
296
|
+
ensureTxExecuted?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* If true, validates explicitly provided fee params against suggested values.
|
|
299
|
+
* @default true
|
|
300
|
+
*/
|
|
301
|
+
shouldValidateFees?: boolean;
|
|
285
302
|
isRoundTrip?: boolean;
|
|
286
303
|
protocolFee?: bigint;
|
|
287
304
|
evmValidExecutors?: string[];
|
|
@@ -293,8 +310,9 @@ export type CrossChainTransactionOptions = {
|
|
|
293
310
|
validateAssetsBalance?: boolean;
|
|
294
311
|
waitOperationId?: boolean;
|
|
295
312
|
waitOptions?: WaitOptions<string>;
|
|
313
|
+
evmDataBuilder?: evmDataBuilder;
|
|
296
314
|
};
|
|
297
|
-
export type BatchCrossChainTransactionOptions = Omit<CrossChainTransactionOptions, 'waitOperationId' | 'waitOptions'>;
|
|
315
|
+
export type BatchCrossChainTransactionOptions = Omit<CrossChainTransactionOptions, 'waitOperationId' | 'waitOptions' | 'ensureTxExecuted'>;
|
|
298
316
|
export type CrossChainTransactionsOptions = {
|
|
299
317
|
waitOperationIds?: boolean;
|
|
300
318
|
waitOptions?: WaitOptions<OperationIdsByShardsKey>;
|
|
@@ -335,17 +353,17 @@ export type BatchCrossChainTxWithAssetLike = Omit<BatchCrossChainTx, 'assets'> &
|
|
|
335
353
|
export interface WaitOptions<T = unknown, TContext = unknown> {
|
|
336
354
|
/**
|
|
337
355
|
* Timeout in milliseconds
|
|
338
|
-
* @default
|
|
356
|
+
* @default 30000 (5 minutes)
|
|
339
357
|
*/
|
|
340
358
|
timeout?: number;
|
|
341
359
|
/**
|
|
342
360
|
* Maximum number of attempts
|
|
343
|
-
* @default
|
|
361
|
+
* @default 10
|
|
344
362
|
*/
|
|
345
363
|
maxAttempts?: number;
|
|
346
364
|
/**
|
|
347
365
|
* Delay between attempts in milliseconds
|
|
348
|
-
* @default
|
|
366
|
+
* @default 1000 (1 seconds)
|
|
349
367
|
*/
|
|
350
368
|
delay?: number;
|
|
351
369
|
/**
|
|
@@ -367,6 +385,11 @@ export interface WaitOptions<T = unknown, TContext = unknown> {
|
|
|
367
385
|
* Receives both the result and optional context with additional parameters
|
|
368
386
|
*/
|
|
369
387
|
onSuccess?: (result: T, context?: TContext) => Promise<void> | void;
|
|
388
|
+
/**
|
|
389
|
+
* Include underlying error stack trace in FetchError (innerStack)
|
|
390
|
+
* @default false
|
|
391
|
+
*/
|
|
392
|
+
includeErrorTrace?: boolean;
|
|
370
393
|
}
|
|
371
394
|
export declare const defaultWaitOptions: WaitOptions;
|
|
372
395
|
export declare enum Origin {
|
|
@@ -418,3 +441,156 @@ export type FTOriginAndData = {
|
|
|
418
441
|
evmAddress?: string;
|
|
419
442
|
jettonData?: JettonMinterData;
|
|
420
443
|
};
|
|
444
|
+
export type CrossChainPayloadResult = {
|
|
445
|
+
body: Cell;
|
|
446
|
+
destinationAddress: string;
|
|
447
|
+
tonAmount: bigint;
|
|
448
|
+
tonNetworkFee: bigint;
|
|
449
|
+
tacEstimatedGas?: bigint;
|
|
450
|
+
transactionLinker: TransactionLinker;
|
|
451
|
+
};
|
|
452
|
+
export type GeneratePayloadParams = {
|
|
453
|
+
excessReceiver: string;
|
|
454
|
+
evmData: Cell;
|
|
455
|
+
crossChainTonAmount?: bigint;
|
|
456
|
+
forwardFeeTonAmount?: bigint;
|
|
457
|
+
feeParams?: FeeParams;
|
|
458
|
+
};
|
|
459
|
+
export type TacGasPrice = {
|
|
460
|
+
average: number;
|
|
461
|
+
fast: number;
|
|
462
|
+
slow: number;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Parameters for tracking and validating transaction trees
|
|
466
|
+
*/
|
|
467
|
+
export type TrackTransactionTreeParams = {
|
|
468
|
+
/**
|
|
469
|
+
* Maximum number of transactions to fetch per pagination request
|
|
470
|
+
* @default 100
|
|
471
|
+
*/
|
|
472
|
+
limit?: number;
|
|
473
|
+
/**
|
|
474
|
+
* Maximum depth to traverse in the transaction tree, inclusive (prevents infinite loops)
|
|
475
|
+
* @default 10
|
|
476
|
+
*/
|
|
477
|
+
maxDepth?: number;
|
|
478
|
+
/**
|
|
479
|
+
* Maximum number of transactions to scan while searching by hash in account history.
|
|
480
|
+
* Prevents excessive full-history scans on high-activity accounts.
|
|
481
|
+
* @default 100
|
|
482
|
+
*/
|
|
483
|
+
maxScannedTransactions?: number;
|
|
484
|
+
/**
|
|
485
|
+
* List of operation codes (opcodes) to skip for extra checks.
|
|
486
|
+
* Core phase validation is still applied.
|
|
487
|
+
* @default [ 0xd53276db ] // Excess
|
|
488
|
+
*/
|
|
489
|
+
ignoreOpcodeList?: number[];
|
|
490
|
+
/**
|
|
491
|
+
* Direction to search the transaction tree:
|
|
492
|
+
* - 'forward': only search children (outgoing messages)
|
|
493
|
+
* - 'backward': only search parents (incoming messages)
|
|
494
|
+
* - 'both': search in both directions (default)
|
|
495
|
+
* @default 'both'
|
|
496
|
+
*/
|
|
497
|
+
direction?: 'forward' | 'backward' | 'both';
|
|
498
|
+
/**
|
|
499
|
+
* Retry transaction lookup when `not_found` error occurs.
|
|
500
|
+
* Useful when transaction indexing has delays or when transactions appear gradually.
|
|
501
|
+
* @default true
|
|
502
|
+
*/
|
|
503
|
+
retryOnNotFound?: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Delay in milliseconds between retry attempts for transaction lookup
|
|
506
|
+
* @default 5000
|
|
507
|
+
*/
|
|
508
|
+
retryDelayMs?: number;
|
|
509
|
+
/**
|
|
510
|
+
* Number of retry attempts for transaction lookup
|
|
511
|
+
* @default 10
|
|
512
|
+
*/
|
|
513
|
+
retries?: number;
|
|
514
|
+
};
|
|
515
|
+
/**
|
|
516
|
+
* Details about a transaction validation error
|
|
517
|
+
*/
|
|
518
|
+
export type TransactionValidationError = {
|
|
519
|
+
/**
|
|
520
|
+
* Base64-encoded hash of the failed transaction (or the searched hash if not found)
|
|
521
|
+
*/
|
|
522
|
+
txHash: string;
|
|
523
|
+
/**
|
|
524
|
+
* Exit code from the compute phase, or 'N/A' if compute phase is missing
|
|
525
|
+
*/
|
|
526
|
+
exitCode: number | 'N/A';
|
|
527
|
+
/**
|
|
528
|
+
* Result code from the action phase, or 'N/A' if action phase is missing
|
|
529
|
+
*/
|
|
530
|
+
resultCode: number | 'N/A';
|
|
531
|
+
/**
|
|
532
|
+
* Reason for validation failure:
|
|
533
|
+
* - 'aborted': default: transaction was aborted
|
|
534
|
+
* - 'compute_phase_missing': compute phase is missing
|
|
535
|
+
* - 'compute_phase_failed': compute phase failed (exitCode !== 0)
|
|
536
|
+
* - 'action_phase_failed': action phase failed (resultCode !== 0)
|
|
537
|
+
* - 'not_found': transaction or message hash not found during traversal
|
|
538
|
+
*/
|
|
539
|
+
reason: 'aborted' | 'compute_phase_missing' | 'compute_phase_failed' | 'action_phase_failed' | 'not_found';
|
|
540
|
+
/**
|
|
541
|
+
* Address where the lookup was performed (for reason: 'not_found')
|
|
542
|
+
*/
|
|
543
|
+
address?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Hash type used in lookup (for reason: 'not_found')
|
|
546
|
+
*/
|
|
547
|
+
hashType?: 'unknown' | 'in' | 'out';
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* Result of transaction tree tracking and validation
|
|
551
|
+
*/
|
|
552
|
+
export type TrackTransactionTreeResult = {
|
|
553
|
+
/**
|
|
554
|
+
* Whether all transactions in the tree passed validation
|
|
555
|
+
*/
|
|
556
|
+
success: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Count of unique transactions checked during traversal
|
|
559
|
+
*/
|
|
560
|
+
checkedCount?: number;
|
|
561
|
+
/**
|
|
562
|
+
* Details about the first validation error encountered (if any)
|
|
563
|
+
*/
|
|
564
|
+
error?: TransactionValidationError;
|
|
565
|
+
};
|
|
566
|
+
export type GetTransactionsOptions = {
|
|
567
|
+
/** Maximum number of transactions to retrieve */
|
|
568
|
+
limit?: number;
|
|
569
|
+
/** Logical time of the transaction to start from */
|
|
570
|
+
lt?: string;
|
|
571
|
+
/** Hash of the transaction to start from */
|
|
572
|
+
hash?: string;
|
|
573
|
+
/** Logical time of the transaction to end at */
|
|
574
|
+
to_lt?: string;
|
|
575
|
+
/** Whether to include the starting transaction in the results */
|
|
576
|
+
inclusive?: boolean;
|
|
577
|
+
/** Whether to search in archival nodes for historical data */
|
|
578
|
+
archival?: boolean;
|
|
579
|
+
/** Request timeout in milliseconds */
|
|
580
|
+
timeoutMs?: number;
|
|
581
|
+
/** Delay between retry attempts in milliseconds */
|
|
582
|
+
retryDelayMs?: number;
|
|
583
|
+
/** Number of retry attempts */
|
|
584
|
+
retries?: number;
|
|
585
|
+
/** Internal scan guard: maximum transactions to inspect while traversing history */
|
|
586
|
+
maxScannedTransactions?: number;
|
|
587
|
+
};
|
|
588
|
+
export type AddressInformation = {
|
|
589
|
+
/** Information about the last transaction of the address */
|
|
590
|
+
lastTransaction: {
|
|
591
|
+
/** Logical time of the last transaction */
|
|
592
|
+
lt: string;
|
|
593
|
+
/** Hash of the last transaction */
|
|
594
|
+
hash: string;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Origin = exports.defaultWaitOptions = exports.TokenSymbol = exports.StageName = exports.NFTAddressType = exports.AssetType = exports.OperationType = exports.CurrencyType = exports.BlockchainType = exports.Network = exports.SimplifiedStatuses = void 0;
|
|
4
|
+
const Consts_1 = require("../sdk/Consts");
|
|
4
5
|
var SimplifiedStatuses;
|
|
5
6
|
(function (SimplifiedStatuses) {
|
|
6
7
|
SimplifiedStatuses["PENDING"] = "PENDING";
|
|
@@ -58,9 +59,9 @@ var TokenSymbol;
|
|
|
58
59
|
TokenSymbol["TON_SYMBOL"] = "TON";
|
|
59
60
|
})(TokenSymbol || (exports.TokenSymbol = TokenSymbol = {}));
|
|
60
61
|
exports.defaultWaitOptions = {
|
|
61
|
-
timeout:
|
|
62
|
-
maxAttempts:
|
|
63
|
-
delay:
|
|
62
|
+
timeout: Consts_1.DEFAULT_WAIT_TIMEOUT_MS,
|
|
63
|
+
maxAttempts: Consts_1.DEFAULT_WAIT_MAX_ATTEMPTS,
|
|
64
|
+
delay: Consts_1.DEFAULT_WAIT_DELAY_MS,
|
|
64
65
|
};
|
|
65
66
|
var Origin;
|
|
66
67
|
(function (Origin) {
|
|
@@ -25,6 +25,8 @@ export declare class HighloadWalletV3 implements WalletInstanse {
|
|
|
25
25
|
data: Cell;
|
|
26
26
|
} | undefined);
|
|
27
27
|
getSeqno(): Promise<number>;
|
|
28
|
+
send(provider: ContractProvider, msg: Cell): Promise<void>;
|
|
29
|
+
createTransfer(): Cell;
|
|
28
30
|
sendTransfer(provider: ContractProvider, args: {
|
|
29
31
|
seqno?: number;
|
|
30
32
|
secretKey: Buffer;
|
|
@@ -33,7 +35,7 @@ export declare class HighloadWalletV3 implements WalletInstanse {
|
|
|
33
35
|
timeout?: number;
|
|
34
36
|
subwalletId?: number;
|
|
35
37
|
createdAt?: number;
|
|
36
|
-
}): Promise<
|
|
38
|
+
}): Promise<string>;
|
|
37
39
|
static create(config: HighloadWalletV3Config, code?: Cell, workchain?: number): HighloadWalletV3;
|
|
38
40
|
static generateCreatedAt(): number;
|
|
39
41
|
sendExternalMessage(provider: ContractProvider, secretKey: Buffer, opts: {
|
|
@@ -43,8 +45,8 @@ export declare class HighloadWalletV3 implements WalletInstanse {
|
|
|
43
45
|
createdAt: number;
|
|
44
46
|
subwalletId: number;
|
|
45
47
|
timeout: number;
|
|
46
|
-
}): Promise<
|
|
47
|
-
sendBatch(provider: ContractProvider, secretKey: Buffer, messages: OutActionSendMsg[], subwallet: number, timeout: number, createdAt?: number, value?: bigint): Promise<
|
|
48
|
+
}): Promise<string>;
|
|
49
|
+
sendBatch(provider: ContractProvider, secretKey: Buffer, messages: OutActionSendMsg[], subwallet: number, timeout: number, createdAt?: number, value?: bigint): Promise<string>;
|
|
48
50
|
getQueryIdFromCreatedAt(createdAt: number): HighloadQueryId;
|
|
49
51
|
getExternalMessage(messages: MessageRelaxed[], sendMode: SendMode, value: bigint, queryId: HighloadQueryId): MessageRelaxed;
|
|
50
52
|
static createInternalTransferBody(opts: {
|
|
@@ -30,9 +30,15 @@ class HighloadWalletV3 {
|
|
|
30
30
|
async getSeqno() {
|
|
31
31
|
return 0; // will not be used
|
|
32
32
|
}
|
|
33
|
+
async send(provider, msg) {
|
|
34
|
+
await provider.external(msg);
|
|
35
|
+
}
|
|
36
|
+
createTransfer() {
|
|
37
|
+
throw new Error('Not implemented. Use sendTransfer instead - it returns the BOC as a string');
|
|
38
|
+
}
|
|
33
39
|
async sendTransfer(provider, args) {
|
|
34
40
|
if (!args.messages.length) {
|
|
35
|
-
return;
|
|
41
|
+
return '';
|
|
36
42
|
}
|
|
37
43
|
const state = await provider.getState();
|
|
38
44
|
const isActive = state.state.type === 'active';
|
|
@@ -43,7 +49,7 @@ class HighloadWalletV3 {
|
|
|
43
49
|
mode: args.sendMode,
|
|
44
50
|
outMsg: msg,
|
|
45
51
|
}));
|
|
46
|
-
await this.sendBatch(provider, args.secretKey, actions, subwalletId, timeout, args.createdAt);
|
|
52
|
+
return await this.sendBatch(provider, args.secretKey, actions, subwalletId, timeout, args.createdAt);
|
|
47
53
|
}
|
|
48
54
|
static create(config, code = HIGHLOAD_V3_CODE, workchain = 0) {
|
|
49
55
|
const data = highloadWalletV3ConfigToCell(config);
|
|
@@ -72,7 +78,12 @@ class HighloadWalletV3 {
|
|
|
72
78
|
.storeUint(opts.createdAt, exports.TIMESTAMP_SIZE)
|
|
73
79
|
.storeUint(opts.timeout, exports.TIMEOUT_SIZE)
|
|
74
80
|
.endCell();
|
|
75
|
-
|
|
81
|
+
const externalMessage = (0, ton_1.beginCell)()
|
|
82
|
+
.storeBuffer((0, ton_crypto_1.sign)(messageInner.hash(), secretKey))
|
|
83
|
+
.storeRef(messageInner)
|
|
84
|
+
.endCell();
|
|
85
|
+
await provider.external(externalMessage);
|
|
86
|
+
return externalMessage.toBoc().toString('base64');
|
|
76
87
|
}
|
|
77
88
|
async sendBatch(provider, secretKey, messages, subwallet, timeout, createdAt, value = 0n) {
|
|
78
89
|
if (createdAt == undefined) {
|
package/package.json
CHANGED
|
@@ -1,117 +1,121 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonappchain/sdk",
|
|
3
|
+
"version": "0.7.2",
|
|
4
|
+
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
|
+
"author": "TAC. <developers@tac>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/src/index.js",
|
|
8
|
+
"types": "dist/src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"node": {
|
|
12
|
+
"types": "./dist/src/index.d.ts",
|
|
13
|
+
"require": "./dist/src/index.js",
|
|
14
|
+
"import": "./dist/src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"browser": {
|
|
17
|
+
"types": "./dist/src/index.d.ts",
|
|
18
|
+
"import": "./dist/src/index.js"
|
|
19
|
+
},
|
|
20
|
+
"types": "./dist/src/index.d.ts",
|
|
21
|
+
"require": "./dist/src/index.js",
|
|
22
|
+
"import": "./dist/src/index.js",
|
|
23
|
+
"default": "./dist/src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
"./dist": null,
|
|
27
|
+
"./dist/*": null,
|
|
28
|
+
"./src": null,
|
|
29
|
+
"./src/*": null,
|
|
30
|
+
"./artifacts": {
|
|
31
|
+
"types": "./dist/artifacts/index.d.ts",
|
|
32
|
+
"import": "./dist/artifacts/index.js",
|
|
33
|
+
"require": "./dist/artifacts/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./artifacts/types/ton": {
|
|
36
|
+
"types": "./dist/artifacts/tonTypes.d.ts",
|
|
37
|
+
"import": "./dist/artifacts/tonTypes.js",
|
|
38
|
+
"require": "./dist/artifacts/tonTypes.js"
|
|
39
|
+
},
|
|
40
|
+
"./artifacts/types/tac": {
|
|
41
|
+
"types": "./dist/artifacts/tacTypes.d.ts",
|
|
42
|
+
"import": "./dist/artifacts/tacTypes.js",
|
|
43
|
+
"require": "./dist/artifacts/tacTypes.js"
|
|
44
|
+
},
|
|
45
|
+
"./artifacts/*": null,
|
|
46
|
+
"./*": null
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"litebuild": "rm -rf dist && tsc --declaration",
|
|
53
|
+
"build": "bash build.sh",
|
|
54
|
+
"build:artifacts:tac:dev": "cd artifacts/dev/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
55
|
+
"build:artifacts:ton:dev": "cd artifacts/dev/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
56
|
+
"build:artifacts:tac:testnet": "cd artifacts/testnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
57
|
+
"build:artifacts:ton:testnet": "cd artifacts/testnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
58
|
+
"build:artifacts:tac:mainnet": "cd artifacts/mainnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
59
|
+
"build:artifacts:ton:mainnet": "cd artifacts/mainnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
60
|
+
"build:artifacts:ton:all": "npm run build:artifacts:ton:dev && npm run build:artifacts:ton:testnet && npm run build:artifacts:ton:mainnet",
|
|
61
|
+
"build:artifacts:tac:all": "npm run build:artifacts:tac:dev && npm run build:artifacts:tac:testnet && npm run build:artifacts:tac:mainnet",
|
|
62
|
+
"build:artifacts": "npm run build:artifacts:ton:all && npm run build:artifacts:tac:all",
|
|
63
|
+
"test": "jest --verbose --runInBand",
|
|
64
|
+
"release": "npm run build && npx release-it",
|
|
65
|
+
"lint": "eslint .",
|
|
66
|
+
"lint:fix": "eslint . --fix",
|
|
67
|
+
"prettier": "prettier --ignore-path .gitignore --write \"./src/**/*.+(js|ts|json)\""
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@aws-crypto/sha256-js": "^5.2.0",
|
|
71
|
+
"@orbs-network/ton-access": "^2.3.3",
|
|
72
|
+
"@tonappchain/ton-lite-client": "3.0.6",
|
|
73
|
+
"bn.js": "^5.2.3",
|
|
74
|
+
"cli-table3": "^0.6.5",
|
|
75
|
+
"dotenv": "^16.4.7"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@ton/ton": ">=15",
|
|
79
|
+
"@tonconnect/ui": ">=2",
|
|
80
|
+
"ethers": ">=6",
|
|
81
|
+
"ton-crypto": ">=3"
|
|
82
|
+
},
|
|
83
|
+
"keywords": [],
|
|
84
|
+
"description": "",
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@eslint/js": "^9.21.0",
|
|
87
|
+
"@jest/globals": "^29.7.0",
|
|
88
|
+
"@release-it/keep-a-changelog": "^7.0.0",
|
|
89
|
+
"@ton/sandbox": "^0.27.1",
|
|
90
|
+
"@ton/test-utils": "^0.5.0",
|
|
91
|
+
"@ton/ton": "16.2.2",
|
|
92
|
+
"@tonconnect/ui": "^2.0.11",
|
|
93
|
+
"@types/bn.js": "^5.1.6",
|
|
94
|
+
"@types/jest": "^29.5.14",
|
|
95
|
+
"eslint": "^9.26.0",
|
|
96
|
+
"eslint-config-prettier": "^10.0.2",
|
|
97
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
98
|
+
"ethers": "^6.13.5",
|
|
99
|
+
"jest": "^29.7.0",
|
|
100
|
+
"prettier": "^3.5.3",
|
|
101
|
+
"ton-crypto": "3.2.0",
|
|
102
|
+
"ts-jest": "^29.2.6",
|
|
103
|
+
"ts-node": "^10.9.2",
|
|
104
|
+
"typescript": "^5.7.3",
|
|
105
|
+
"typescript-eslint": "^8.17.0"
|
|
106
|
+
},
|
|
107
|
+
"publishConfig": {
|
|
108
|
+
"access": "public",
|
|
109
|
+
"registry": "https://registry.npmjs.org/"
|
|
110
|
+
},
|
|
111
|
+
"release-it": {
|
|
112
|
+
"plugins": {
|
|
113
|
+
"@release-it/keep-a-changelog": {
|
|
114
|
+
"filename": "CHANGELOG.md"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"npm": {
|
|
118
|
+
"publish": false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Blockchain } from '@ton/sandbox';
|
|
2
|
-
import { ContractOpener } from '../interfaces';
|
|
3
|
-
import { Network } from '../structs/Struct';
|
|
4
|
-
type LiteServer = {
|
|
5
|
-
ip: number;
|
|
6
|
-
port: number;
|
|
7
|
-
id: {
|
|
8
|
-
'@type': string;
|
|
9
|
-
key: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare function liteClientOpener(options: {
|
|
13
|
-
liteservers: LiteServer[];
|
|
14
|
-
} | {
|
|
15
|
-
network: Network;
|
|
16
|
-
}): Promise<ContractOpener>;
|
|
17
|
-
export declare function sandboxOpener(blockchain: Blockchain): ContractOpener;
|
|
18
|
-
export declare function orbsOpener(network: Network): Promise<ContractOpener>;
|
|
19
|
-
export declare function orbsOpener4(network: Network, timeout?: number): Promise<ContractOpener>;
|
|
20
|
-
export {};
|