@tonappchain/sdk 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -47,17 +47,17 @@ To track an operation, you first need to obtain its `operationId`. The `operatio
47
47
 
48
48
  After obtaining the `operationId`, you can check the operation’s status by using `OperationTracker.getOperationStatus(operationId: string)`. The following statuses may be returned:
49
49
 
50
- 1. **EVMMerkleMessageCollected:** The validator has collected all events for a single sharded message. For simple transfers (e.g., a token swap), this status indicates that the message is fully gathered.
51
- 2. **EVMMerkleRootSet:** The EVM message has been added to the Merkle tree, and subsequent roots will reflect this addition.
52
- 3. **EVMMerkleMessageExecuted:** The collected message has been executed on the EVM side.
53
- 4. **TVMMerkleMessageCollected:** After execution on EVM, a return message event is generated, which will then be executed on the TVM side.
54
- 5. **TVMMerkleRootSet:** The TVM message has been added to the Merkle tree, updating future roots accordingly.
55
- 6. **TVMMerkleMessageExecuted:** The TVM Merkle message has been successfully executed on the TVM CrossChainLayer.
50
+ 1. **COLLECTED_IN_TAC:** The sequencer has collected all events for a single sharded message. For simple transfers (e.g., a token swap), this status indicates that the message is fully gathered.
51
+ 2. **INCLUDED_IN_TAC_CONSENSUS:** The EVM message has been added to the Merkle tree, and subsequent roots will reflect this addition.
52
+ 3. **EXECUTED_IN_TAC:** The collected message has been executed on the EVM side.
53
+ 4. **COLLECTED_IN_TON:** After execution on EVM, a return message event is generated, which will then be executed on the TVM side.
54
+ 5. **INCLUDED_IN_TON_CONSENSUS:** The TVM message has been added to the Merkle tree, updating future roots accordingly.
55
+ 6. **EXECUTED_IN_TON:** The TVM Merkle message has been successfully executed on the TVM CrossChainLayer.
56
56
 
57
57
  If an issue occurs, the error message will also be included in response.
58
58
 
59
59
  ### Terminal State
60
- - **TVMMerkleMessageExecuted**: Indicates that the operation has completed its full cycle from TVM to EVM and back.
60
+ - **EXECUTED_IN_TON**: Indicates that the operation has completed its full cycle from TVM to EVM and back.
61
61
 
62
62
  ---
63
63
 
@@ -81,7 +81,7 @@ import { TacSdk } from '@tonappchain/sdk';
81
81
  import { Network } from '@tonappchain/sdk';
82
82
 
83
83
  const sdkParams: SDKParams = {
84
- network: Network.Testnet
84
+ network: Network.TESTNET
85
85
  // you can also customize TAC and TON params here
86
86
  };
87
87
  const tacSdk = await TacSdk.create(sdkParams);
@@ -97,7 +97,7 @@ import { TacSdk, Network, liteClientOpener } from '@tonappchain/sdk';
97
97
  const liteClientServers = [<liteClientServer1>, <liteClientServer1>, ...];
98
98
 
99
99
  const sdkParams: SDKParams = {
100
- network: Network.Testnet,
100
+ network: Network.TESTNET,
101
101
  TONParams: {
102
102
  contractOpener: await liteClientOpener({ liteservers : liteClientServers }),
103
103
  },
@@ -114,15 +114,15 @@ tacSdk.closeConnections();
114
114
 
115
115
  Optionally, you can provide @ton/ton TonClient (public endpoints will be used by default):
116
116
 
117
- - **Mainnet**: https://toncenter.com/api/v2/jsonRPC
118
- - **Testnet**: https://testnet.toncenter.com/api/v2/jsonRPC
117
+ - **MAINNET**: https://toncenter.com/api/v2/jsonRPC
118
+ - **TESTNET**: https://testnet.toncenter.com/api/v2/jsonRPC
119
119
 
120
120
  ```typescript
121
121
  import { TacSdk, Network } from '@tonappchain/sdk';
122
122
  import { TonClient } from '@ton/ton';
123
123
 
124
124
  const sdk = await TacSdk.create({
125
- network: Network.Testnet,
125
+ network: Network.TESTNET,
126
126
  delay: 1,
127
127
  TONParams: {
128
128
  contractOpener: new TonClient({
@@ -159,6 +159,7 @@ The `sendCrossChainTransaction` method is the core functionality of the `TacSdk`
159
159
  - **`evmTargetAddress`**: Target address on the EVM network.
160
160
  - **`methodName`** *(optional)*: Method name to execute on the target contract. Either method name `MethodName` or signature `MethodName(bytes,bytes)` must be specified (strictly (bytes,bytes)).
161
161
  - **`encodedParameters`** *(optional)*: Encoded parameters for the EVM method. You need to specify all arguments except the first one (TACHeader bytes). The TACHeader logic will be specified below
162
+ - **`forceSend`** *(optional)*: Parameter indicates that the transaction should be sent even if simulation returned an error. Default `false`
162
163
 
163
164
  - **`sender`**: A `SenderAbstraction` object, such as:
164
165
  - **`TonConnectSender`**: For TonConnect integration.
@@ -384,7 +385,7 @@ This function provides a more detailed view of a user's Jetton balance, includin
384
385
  - **`AddressError`**: invalid token address provided.
385
386
 
386
387
 
387
- ### Function: `simulateEVMMessage`
388
+ ### Function: `simulateTACMessage`
388
389
 
389
390
  This function will simulate the EVM message on the TAC side.
390
391
 
@@ -394,21 +395,21 @@ The ability to simulate the EVM message is crucial for testing and debugging cro
394
395
 
395
396
  #### **Parameters**
396
397
 
397
- - **`evmCallParams`**: An object defining the EVM-specific logic:
398
+ - **`tacCallParams`**: An object defining the EVM-specific logic:
398
399
  - **`target`**: Target address on the EVM network.
399
400
  - **`methodName`**: Method name to execute on the target contract. Either method name `MethodName` or signature `MethodName(bytes,bytes)` must be specified (strictly (bytes,bytes)).
400
401
  - **`arguments`**: Encoded parameters for the EVM method.
401
402
  - **`extraData`**: Unstrusted Extra Data provided by executor.
402
403
  - **`feeAssetAddress`**: TVM Fee Asset Address, empty string for native TON.
403
404
  - **`shardedId`**: Sharded ID.
404
- - **`tvmAssets`**: An array of objects, each specifying the Assets details:
405
+ - **`tonAssets`**: An array of objects, each specifying the Assets details:
405
406
  - **`tokenAddress`**: Address of the Asset.
406
407
  - **`amount`**: Amount of Assets to be transferred.
407
- - **`tvmCaller`**: TVM Caller wallet address.
408
+ - **`tonCaller`**: TVM Caller wallet address.
408
409
 
409
410
  #### **Returns**
410
411
 
411
- - **`Promise<EVMSimulationResults>`**:
412
+ - **`Promise<TACSimulationResults>`**:
412
413
  - A promise that resolves to detailed information about the execution of the given message, including:
413
414
  - **`estimatedGas`**: The estimated gas required for the message.
414
415
  - **`estimatedJettonFeeAmount`**: The estimated fee amount in Jettons.
@@ -464,7 +465,7 @@ The `RawSender` class allows direct interaction with the blockchain using a raw
464
465
  ```typescript
465
466
  const walletVersion = 'v4';
466
467
  const mnemonic = process.env.TVM_MNEMONICS || ''; // 24 words mnemonic
467
- const network = Network.Testnet; // or Network.Mainnet
468
+ const network = Network.TESTNET; // or Network.MAINNET
468
469
  const sender = await SenderFactory.getSender({
469
470
  version: walletVersion,
470
471
  mnemonic,
@@ -475,13 +476,13 @@ const sender = await SenderFactory.getSender({
475
476
  - **Supported wallet versions**:
476
477
  ```
477
478
  export type WalletVersion =
478
- | "v2r1"
479
- | "v2r2"
480
- | "v3r1"
481
- | "v3r2"
482
- | "v4"
483
- | "v5r1"
484
- | "highloadV3";
479
+ | "V2R1"
480
+ | "V2R2"
481
+ | "V3R1"
482
+ | "V3R2"
483
+ | "V4"
484
+ | "V5R1"
485
+ | "HIGHLOAD_V3";
485
486
  ```
486
487
 
487
488
  - **Possible exceptions**:
@@ -509,7 +510,7 @@ To use the `OperationTracker` class, initialize it with the required parameters
509
510
  import { OperationTracker, Network } from '@tonappchain/sdk';
510
511
 
511
512
  const tracker = new OperationTracker(
512
- network: Network.Testnet,
513
+ network: Network.TESTNET,
513
514
  // customLiteSequencerEndpoints: ["custom.com"]
514
515
  );
515
516
  ```
@@ -533,7 +534,7 @@ Use the `getOperationId(transactionLinker)` method with the `transactionLinker`
533
534
  #### **Usage**:
534
535
  ```typescript
535
536
  const tracker = new OperationTracker(
536
- network: Network.Testnet
537
+ network: Network.TESTNET
537
538
  );
538
539
  const operationId = await tracker.getOperationId(transactionLinker);
539
540
  console.log('Operation ID:', operationId);
@@ -550,29 +551,35 @@ Retrieves the current status of an operation using its `operationId`.
550
551
  #### **Parameters**:
551
552
  - `operationId`: The identifier obtained from `getOperationId`.
552
553
 
553
- #### **Returns**:
554
- - **`Promise<StatusInfo>`**:
555
- - A structure representing the operation's status, including:
556
- - `status`:
557
- - `EVMMerkleMessageCollected`: Validator has collected all events for a single sharded message.
558
- - `EVMMerkleRootSet`: The EVM message has been added to the Merkle tree.
559
- - `EVMMerkleMessageExecuted`: The collected message has been executed on the EVM side.
560
- - `TVMMerkleMessageCollected`: After EVM execution, a return message event is generated for TVM execution.
561
- - `TVMMerkleRootSet`: The TVM message has been added to the Merkle tree.
562
- - `TVMMerkleMessageExecuted`: The operation is fully executed across TVM and EVM.
563
- - `errorMessage`: The error message if the operation failed.
564
- - `operationId`: The identifier of the operation.
565
- (error requests will be processed in future version)
554
+ #### **Returns**:
555
+ - **`Promise<StatusInfo>`**:
556
+ A structure representing the operation's status, including:
557
+ - **`stage`** A value of type `StageName` (enum) which can be one of:
558
+ - `StageName.COLLECTED_IN_TAC` ('COLLECTED_IN_TAC')
559
+ - `StageName.INCLUDED_IN_TAC_CONSENSUS` ('INCLUDED_IN_TAC_CONSENSUS')
560
+ - `StageName.EXECUTED_IN_TAC` ('EXECUTED_IN_TAC')
561
+ - `StageName.COLLECTED_IN_TON` ('COLLECTED_IN_TON')
562
+ - `StageName.INCLUDED_IN_TON_CONSENSUS` ('INCLUDED_IN_TON_CONSENSUS')
563
+ - `StageName.EXECUTED_IN_TON` ('EXECUTED_IN_TON')
564
+ - **`success`** (`boolean`): Indicates if the stage completed successfully.
565
+ - **`timestamp`** (`number`): UNIX timestamp of the stage’s completion.
566
+ - **`transactions`**: An array of `TransactionData` objects or null. Each transaction contains:
567
+ - **`hash`**: A string with the transaction hash.
568
+ - **`blockchainType`**: A `BlockchainType` indicating the blockchain (`TAC`, `TON`).
569
+ - **`note`**: An object of type `NoteInfo` or null containing error/debug information:
570
+ - **`content`**: A string with additional details.
571
+ - **`errorName`**: A string representing the error name.
572
+ - **`internalMsg`**: A string with an internal message.
573
+ - **`internalBytesError`**: A string with internal error details in bytes.
574
+
575
+
566
576
  #### **Usage**:
567
577
  ```typescript
568
578
  const tracker = new OperationTracker(
569
- network: Network.Testnet
579
+ network: Network.TESTNET
570
580
  );
571
- const { status, errorMessage } = await tracker.getOperationStatus(operationId);
572
- if (errorMessage) {
573
- console.log('Error:', status);
574
- }
575
- console.log('Operation Status:', status);
581
+ const status = await tracker.getOperationStatus(operationId);
582
+ console.log('Stage:', status.stage)
576
583
  ```
577
584
 
578
585
  ---
@@ -581,21 +588,20 @@ Retrieves the current status of an operation using its `operationId`.
581
588
 
582
589
  Use the `getSimplifiedOperationStatus(transactionLinker)` method for an easy-to-interpret status.
583
590
 
584
- #### Method: `getSimplifiedOperationStatus(transactionLinker: TransactionLinker, isBridgeOperation: boolean = false): Promise<SimplifiedStatuses>`
591
+ #### Method: `getSimplifiedOperationStatus(transactionLinker: TransactionLinker): Promise<SimplifiedStatuses>`
585
592
 
586
593
  Fetches a simplified operation status using the `transactionLinker`.
587
594
 
588
595
  #### **Parameters**:
589
596
  - `transactionLinker`: A `TransactionLinker` object returned from `sendCrossChainTransaction` function.
590
- - `isBridgeOperation` *(optional)*: If your operation should only execute on EVM side without returning to TVM set `isBridgeOperation` to **true**. TAC protocol can just bridge the assets.
591
597
 
592
598
  #### **Returns**:
593
599
  - **`Promise<SimplifiedStatuses>`**:
594
600
  - A simplified status from the `SimplifiedStatuses` enum:
595
- - **`Pending`**: The operation is still in progress.
596
- - **`Successful`**: The operation has successfully completed.
597
- - **`OperationIdNotFound`**: The operation ID could not be found.
598
- - **`Failed`**: The operation failed.
601
+ - **`PENDING`**: The operation is still in progress.
602
+ - **`SUCCESSFUL`**: The operation has successfully completed.
603
+ - **`OPERATION_ID_NOT_FOUND`**: The operation ID could not be found.
604
+ - **`FAILED`**: The operation failed.
599
605
 
600
606
  #### **Usage**
601
607
  Here operationId will be always requested(not optimal).
@@ -605,8 +611,24 @@ const simplifiedStatus = await tracker.getSimpifiedOperationStatus(transactionLi
605
611
  console.log('Simplified Status:', simplifiedStatus);
606
612
  ```
607
613
 
608
- ---
609
614
  ### Other functions
615
+ #### **Method: `getOperationType(operationId: string): Promise<OperationType>`**
616
+
617
+ Retrieves the current type of operation using its `operationId`.
618
+
619
+ #### **Parameters**:
620
+ - `operationId`: The identifier obtained from `getOperationType`.
621
+
622
+ #### **Returns**:
623
+ - **`Promise<OperationType>`**:
624
+ - A type from the `operationType` enum:
625
+ - **`PENDING`**: The operation is still in progress.
626
+ - **`TON_TAC_TON`**: The operation has successfully completed in TON-TAC-TON.
627
+ - **`ROLLBACK`**: The operation failed and there was an asset rollback.
628
+ - **`TON_TAC`**: The operation has successfully completed in TON-TAC.
629
+ - **`TAC_TON`**: The operation has successfully completed in TAC-TON.
630
+ - **`UNKNOWN`**: unknown operation type.
631
+
610
632
 
611
633
  #### Method: `getOperationIdsByShardsKeys(shardsKeys: string[], caller: string): Promise<OperationIdsByShardsKey>`
612
634
 
@@ -666,17 +688,22 @@ Fetches the current status information for multiple operations based on their op
666
688
 
667
689
  Track the execution of crosschain operation with `startTracking` method
668
690
 
669
- #### Method: `async startTracking(transactionLinker: TransactionLinker, network: network, isBridgeOperation: boolean = false, customLiteSequencerEndpoints?: string[]): Promise<void>`
691
+ #### Method: `async function startTracking(transactionLinker: TransactionLinker, network: Network, customLiteSequencerEndpoints?: string[], delay: number = 10, maxIterationCount = MAX_ITERATION_COUNT, returnValue: boolean = false): Promise<void | { profilingData: ExecutionStages; tableData: ExecutionStagesTableData[]; }>`
670
692
 
671
693
  #### **Parameters**:
672
694
  - `transactionLinker`: A `TransactionLinker` object returned from `sendCrossChainTransaction` function.
673
695
  - `network`: TON network (`Network` type).
674
- - `isBridgeOperation` *(optional)*: If your operation should only execute on EVM side without returning to TVM set `isBridgeOperation` to **true**. TAC protocol can just bridge the assets.
675
696
  - `customLiteSequencerEndpoints` *(optional)*: specify custom lite sequencer API URL for sending requests there.
697
+ - `delay` *(optional)*: specify custom delay after requests there.
698
+ - `maxIterationCount` *(optional)*: specify custom max iteration count there.
699
+ - `returnValue` *(optional)*: specify whether to return the data to you after tracking. When `false` will write to the console. Default is `false`
676
700
 
677
701
  #### **Returns**:
678
- - void:
679
- - Will stop requesting status once the final status of crosschain operation has been reached.
702
+ - Will stop requesting status once the final status of crosschain operation has been reached.
703
+ - if returnValue is `false` return `Promise<void>`
704
+ - if `true` return `Promise<TrackingOperationResult>` with value:
705
+ - **`profilingData`**: `ExecutionStages` - execution stages profiling data;
706
+ - **`tableData`**: `ExecutionStagesTableData[]` - execution stages profiling data in table format;
680
707
 
681
708
  #### **Possible exceptions**
682
709
 
@@ -685,7 +712,7 @@ Track the execution of crosschain operation with `startTracking` method
685
712
  #### **Usage**
686
713
  Here operationId will be always requested(not optimal).
687
714
  ```typescript
688
- await startTracking(transactionLinker, network.Testnet);
715
+ await startTracking(transactionLinker, network.TESTNET);
689
716
  ```
690
717
 
691
718
  ---
@@ -696,13 +723,13 @@ await startTracking(transactionLinker, network.Testnet);
696
723
  Represents TON network type you want to use.
697
724
  ```typescript
698
725
  export enum Network {
699
- Testnet = 'testnet',
700
- Mainnet = 'mainnet'
726
+ TESTNET = 'TESTNET',
727
+ MAINNET = 'MAINNET'
701
728
  }
702
729
  ```
703
730
 
704
- - **`Testnet`**: Represents the testnet TON network.
705
- - **`Mainnet`**: Represents the mainnet TON network.
731
+ - **`TESTNET`**: Represents the testnet TON network.
732
+ - **`MAINNET`**: Represents the mainnet TON network.
706
733
 
707
734
 
708
735
  ### `SDKParams (Type)`
@@ -770,7 +797,7 @@ Represents a proxy message to a TAC.
770
797
  - **`evmTargetAddress`**: Target address on the EVM network.
771
798
  - **`methodName`** *(optional)*: Method name to be called on the target contract. Either method name `MethodName` or signature `MethodName(bytes,bytes)` must be specified (strictly (bytes,bytes)).
772
799
  - **`encodedParameters`** *(optional)*: Parameters for the method, encoded as a string.
773
- - **`gasLimit`** *(optional)*: `gasLimit` is a parameter that will be passed on the TAC side. The executor must allocate at least gasLimit gas for executing the transaction on the TAC side. If this parameter is not specified, it will be calculated using the `simulateEVMMessage` method(prefered).
800
+ - **`gasLimit`** *(optional)*: `gasLimit` is a parameter that will be passed on the TAC side. The executor must allocate at least gasLimit gas for executing the transaction on the TAC side. If this parameter is not specified, it will be calculated using the `simulateTACMessage` method(prefered).
774
801
 
775
802
  This structure defines the logic you want to execute on the TAC side. This message is sent along with all the sharded messages related to the jetton bridging, enabling the TAC to process the intended logic on the TAC side during the crosschain transaction.
776
803
 
@@ -842,17 +869,17 @@ This structure is designed to help track the entire execution path of a operatio
842
869
  ### `SimplifiedStatuses (Enum)`
843
870
  ```typescript
844
871
  export enum SimplifiedStatuses {
845
- Pending,
846
- Failed,
847
- Successful,
848
- OperationIdNotFound,
872
+ PENDING = 'PENDING',
873
+ FAILED = 'FAILED',
874
+ SUCCESSFUL = 'SUCCESSFUL',
875
+ OPERATION_ID_NOT_FOUND = 'OPERATION_ID_NOT_FOUND',
849
876
  }
850
877
  ```
851
878
  Represents the simplified operation statuses.
852
- - **`Pending`**: The operation in progress.
853
- - **`Failed`**: The operation has failed.
854
- - **`Successful`**: The operation was executed successfully.
855
- - **`OperationIdNotFound`**: The operation ID was not found.
879
+ - **`PENDING`**: The operation in progress.
880
+ - **`FAILED`**: The operation has failed.
881
+ - **`SUCCESSFUL`**: The operation was executed successfully.
882
+ - **`OPERATION_ID_NOT_FOUND`**: The operation ID was not found.
856
883
 
857
884
 
858
885
  ### `ContractOpener (Interface)`
@@ -871,11 +898,11 @@ export interface ContractOpener {
871
898
  ```
872
899
 
873
900
 
874
- ### `EVMSimulationRequest`
901
+ ### `TACSimulationRequest`
875
902
 
876
903
  ```typescript
877
- export type EVMSimulationRequest = {
878
- evmCallParams: {
904
+ export type TACSimulationRequest = {
905
+ tacCallParams: {
879
906
  arguments: string;
880
907
  methodName: string;
881
908
  target: string;
@@ -883,27 +910,39 @@ export type EVMSimulationRequest = {
883
910
  extraData: string;
884
911
  feeAssetAddress: string;
885
912
  shardsKey: number;
886
- tvmAssets: {
913
+ tonAssets: {
887
914
  amount: string;
888
915
  tokenAddress: string;
889
916
  }[];
890
- tvmCaller: string;
917
+ tonCaller: string;
891
918
  };
892
919
  ```
893
920
 
894
- Represents a request to simulate an EVM message.
921
+ Represents a request to simulate an TAC message.
895
922
 
896
- - **`evmCallParams`**: An object containing parameters for the EVM call.
897
- - **`arguments`**: Encoded arguments for the EVM method.
898
- - **`methodName`**: Name of the method to be called on the target EVM contract.
899
- - **`target`**: The target address on the EVM network.
900
- - **`extraData`**: Additional non-root data to be included in EVM call.
923
+ - **`tacCallParams`**: An object containing parameters for the TAC call.
924
+ - **`arguments`**: Encoded arguments for the TAC method.
925
+ - **`methodName`**: Name of the method to be called on the target TAC contract.
926
+ - **`target`**: The target address on the TAC network.
927
+ - **`extraData`**: Additional non-root data to be included in TAC call.
901
928
  - **`feeAssetAddress`**: Address of the asset used to cover fees; empty string if using native TON.
902
929
  - **`shardsKey`**: Key identifying shards for the operation.
903
- - **`tvmAssets`**: An array of assets involved in the transaction.
930
+ - **`tonAssets`**: An array of assets involved in the transaction.
904
931
  - **`amount`**: Amount of the asset to be transferred.
905
932
  - **`tokenAddress`**: Address of the token.
906
- - **`tvmCaller`**: Address of the caller in the TVM.
933
+ - **`tonCaller`**: Address of the caller in the TON.
934
+
935
+
936
+ ### `BlockchainType`
937
+
938
+ ```typescript
939
+ export enum BlockchainType {
940
+ TAC = 'TAC',
941
+ TON = 'TON',
942
+ }
943
+ ```
944
+
945
+ Represents blockchain type.
907
946
 
908
947
 
909
948
  ### `TransactionData`
@@ -911,21 +950,23 @@ Represents a request to simulate an EVM message.
911
950
  ```typescript
912
951
  export type TransactionData = {
913
952
  hash: string;
953
+ blockchainType: BlockchainType;
914
954
  };
915
955
  ```
916
956
 
917
957
  Represents transaction details.
918
958
  - **`hash`**: The hash of the transaction.
959
+ - **`blockchainType`**: The type of the blockchain (`TON` or `TAC`).
919
960
 
920
961
 
921
962
  ### `NoteInfo`
922
963
 
923
964
  ```typescript
924
965
  export type NoteInfo = {
925
- content: string;
926
- errorName: string;
927
- internalMsg: string;
928
- internalBytesError: string;
966
+ content: string;
967
+ errorName: string;
968
+ internalMsg: string;
969
+ internalBytesError: string;
929
970
  };
930
971
  ```
931
972
 
@@ -937,14 +978,30 @@ Provides detailed information about any notes or errors encountered during opera
937
978
  - **`internalBytesError`**: Detailed bytes error information.
938
979
 
939
980
 
981
+ ### `StageName`
982
+
983
+ ```typescript
984
+ export enum StageName {
985
+ COLLECTED_IN_TAC = 'COLLECTED_IN_TAC',
986
+ INCLUDED_IN_TAC_CONSENSUS = 'INCLUDED_IN_TAC_CONSENSUS',
987
+ EXECUTED_IN_TAC = 'EXECUTED_IN_TAC',
988
+ COLLECTED_IN_TON = 'COLLECTED_IN_TON',
989
+ INCLUDED_IN_TON_CONSENSUS = 'INCLUDED_IN_TON_CONSENSUS',
990
+ EXECUTED_IN_TON = 'EXECUTED_IN_TON',
991
+ }
992
+ ```
993
+
994
+ Represents stage in TAC protocol.
995
+
996
+
940
997
  ### `StageData`
941
998
 
942
999
  ```typescript
943
1000
  export type StageData = {
944
- success: boolean;
945
- timestamp: number;
946
- transactions: TransactionData[] | null;
947
- note: NoteInfo | null;
1001
+ success: boolean;
1002
+ timestamp: number;
1003
+ transactions: TransactionData[] | null;
1004
+ note: NoteInfo | null;
948
1005
  };
949
1006
  ```
950
1007
 
@@ -962,23 +1019,47 @@ Represents data for a specific stage of operation execution.
962
1019
 
963
1020
  ```typescript
964
1021
  export type StatusInfo = StageData & {
965
- stage: string;
1022
+ stage: StageName;
966
1023
  };
967
1024
  ```
968
1025
 
969
1026
  Combines `StageData` with an additional stage identifier.
970
1027
 
971
- - **`stage`**: Name of the current stage.
972
-
1028
+ - **`stage`**: Current stage in `StageName` enum.
973
1029
  - **Other Properties from `StageData`**
974
1030
 
1031
+ ### `OperationType`
1032
+
1033
+ ```typescript
1034
+ export enum OperationType {
1035
+ PENDING = "PENDING",
1036
+ TON_TAC_TON = "TON-TAC-TON",
1037
+ ROLLBACK = "ROLLBACK",
1038
+ TON_TAC = "TON-TAC",
1039
+ TAC_TON = "TAC-TON",
1040
+ UNKNOWN = "UNKNOWN",
1041
+ }
1042
+ ```
1043
+
1044
+ Provides information about transaction.
1045
+
1046
+ - **`PENDING`**: The transaction is still processing and has not yet reached a final state.
1047
+ - **`TON_TAC_TON`**:
1048
+ The transaction succeeded fully:
1049
+ - Executed on **TAC** (successfully interacted with dapp)
1050
+ - Processed a `roundTrip` message (e.g., a cross-chain callback - bridging back received assets).
1051
+ - **`ROLLBACK`**: The transaction failed on TAC, and funds were rolled back to their original on TON (e.g., tokens returned to the sender).
1052
+ - **`TON_TAC`**: The transaction was fully executed on TAC. (successfully interacted with dapp or assets were bridged)
1053
+ - **`TAC_TON`**: The cross-chain bridge operation from TAC to TON has completed successfully (e.g., tokens bridged to TON).
1054
+ - **`UNKNOWN`**: The status could not be determined (e.g., due to network errors, invalid operation ID, or outdated data).
1055
+
975
1056
 
976
1057
  ### `ProfilingStageData`
977
1058
 
978
1059
  ```typescript
979
1060
  export type ProfilingStageData = {
980
- exists: boolean;
981
- stageData: StageData | null;
1061
+ exists: boolean;
1062
+ stageData: StageData | null;
982
1063
  };
983
1064
 
984
1065
  ```
@@ -986,7 +1067,6 @@ export type ProfilingStageData = {
986
1067
  Provides profiling information for a specific stage.
987
1068
 
988
1069
  - **`exists`**: Indicates whether profiling data exists for the stage.
989
-
990
1070
  - **`stageData`** *(optional)*: Detailed data of the stage. `null` if none.
991
1071
 
992
1072
 
@@ -994,21 +1074,37 @@ Provides profiling information for a specific stage.
994
1074
 
995
1075
  ```typescript
996
1076
  export type ExecutionStages = {
997
- evmMerkleMsgCollected: ProfilingStageData;
998
- evmMerkleRootSet: ProfilingStageData;
999
- evmMerkleMsgExecuted: ProfilingStageData;
1000
- tvmMerkleMsgCollected: ProfilingStageData;
1001
- tvmMerkleMsgExecuted: ProfilingStageData;
1002
- };
1077
+ operationType: OperationType;
1078
+ } & Record<StageName, ProfilingStageData>;
1079
+
1003
1080
  ```
1004
1081
 
1005
1082
  Represents the profiling data for all execution stages within an operation.
1083
+ - **`operationType`**.
1084
+ - **`COLLECTED_IN_TAC`**.
1085
+ - **`INCLUDED_IN_TAC_CONSENSUS`**.
1086
+ - **`EXECUTED_IN_TAC`**.
1087
+ - **`COLLECTED_IN_TON`**.
1088
+ - **`INCLUDED_IN_TON_CONSENSUS`**.
1089
+ - **`EXECUTED_IN_TON`**.
1090
+
1091
+ ### `ExecutionStagesTableData`
1006
1092
 
1007
- - **`evmMerkleMsgCollected`**: Profiling data for the EVM Merkle message collection stage.
1008
- - **`evmMerkleRootSet`**: Profiling data for setting the EVM Merkle root.
1009
- - **`evmMerkleMsgExecuted`**: Profiling data for executing the EVM Merkle message.
1010
- - **`tvmMerkleMsgCollected`**: Profiling data for the TVM Merkle message collection stage.
1011
- - **`tvmMerkleMsgExecuted`**: Profiling data for executing the TVM Merkle message.
1093
+ ```typescript
1094
+ export type ExecutionStagesTableData = {
1095
+ stage: string;
1096
+ exists: string;
1097
+ success: string;
1098
+ timestamp: string;
1099
+ transactions: string;
1100
+ noteContent: string;
1101
+ errorName: string;
1102
+ internalMsg: string;
1103
+ bytesError: string;
1104
+ };
1105
+ ```
1106
+
1107
+ Represents the profiling data for all execution stages in table format.
1012
1108
 
1013
1109
 
1014
1110
  ### `ExecutionStagesByOperationId`
@@ -1064,47 +1160,47 @@ Provides extended information about a user's Jetton balance.
1064
1160
  - **`decimals`** *(optional)*: The number of decimals for the Jetton token. Present only if `exists` is `true`.
1065
1161
 
1066
1162
 
1067
- ### `EVMSimulationResults`
1163
+ ### `TACSimulationResults`
1068
1164
 
1069
1165
  ```typescript
1070
- export type EVMSimulationResults = {
1071
- estimatedGas: bigint;
1072
- estimatedJettonFeeAmount: string;
1073
- feeParams: {
1074
- currentBaseFee: string;
1075
- isEip1559: boolean;
1076
- suggestedGasPrice: string;
1077
- suggestedGasTip: string;
1078
- };
1079
- message: string;
1080
- outMessages:
1081
- | {
1082
- callerAddress: string;
1083
- operationId: string;
1084
- payload: string;
1085
- queryId: number;
1086
- targetAddress: string;
1087
- tokensBurned: {
1088
- amount: string;
1089
- tokenAddress: string;
1090
- }[];
1091
- tokensLocked: {
1092
- amount: string;
1093
- tokenAddress: string;
1094
- }[];
1095
- }[]
1096
- | null;
1097
- simulationError: string;
1098
- simulationStatus: boolean;
1099
- debugInfo: {
1100
- from: string;
1101
- to: string;
1102
- callData: string;
1103
- blockNumber: number;
1104
- };
1166
+ export type TACSimulationResults = {
1167
+ estimatedGas: bigint;
1168
+ estimatedJettonFeeAmount: string;
1169
+ feeParams: {
1170
+ currentBaseFee: string;
1171
+ isEip1559: boolean;
1172
+ suggestedGasPrice: string;
1173
+ suggestedGasTip: string;
1174
+ };
1175
+ message: string;
1176
+ outMessages:
1177
+ | {
1178
+ callerAddress: string;
1179
+ operationId: string;
1180
+ payload: string;
1181
+ queryId: number;
1182
+ targetAddress: string;
1183
+ tokensBurned: {
1184
+ amount: string;
1185
+ tokenAddress: string;
1186
+ }[];
1187
+ tokensLocked: {
1188
+ amount: string;
1189
+ tokenAddress: string;
1190
+ }[];
1191
+ }[]
1192
+ | null;
1193
+ simulationError: string;
1194
+ simulationStatus: boolean;
1195
+ debugInfo: {
1196
+ from: string;
1197
+ to: string;
1198
+ callData: string;
1199
+ blockNumber: number;
1200
+ };
1105
1201
  };
1106
1202
  ```
1107
- Provides EVM simulation results.
1203
+ Provides TAC simulation results.
1108
1204
 
1109
1205
  - **`estimatedGas`**: The estimated gas required for the message.
1110
1206
  - **`estimatedJettonFeeAmount`**: The estimated fee amount in Jettons.
@@ -1172,7 +1268,7 @@ const assets: AssetBridgingData[] = [
1172
1268
  ];
1173
1269
 
1174
1270
  const sdkParams: SDKParams = {
1175
- network: Network.Testnet
1271
+ network: Network.TESTNET
1176
1272
  };
1177
1273
  const tacSdk = await TacSdk.create(sdkParams);
1178
1274