@tonappchain/sdk 0.5.3 → 0.5.5
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 +13 -13
- package/dist/sdk/OperationTracker.js +17 -6
- package/dist/sdk/StartTracking.js +1 -3
- package/dist/wrappers/JettonWallet.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# TAC
|
|
1
|
+
# TAC SDK
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tonappchain/sdk)
|
|
4
4
|
|
|
@@ -982,12 +982,12 @@ Provides detailed information about any notes or errors encountered during opera
|
|
|
982
982
|
|
|
983
983
|
```typescript
|
|
984
984
|
export enum StageName {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
985
|
+
COLLECTED_IN_TAC = 'collectedInTAC',
|
|
986
|
+
INCLUDED_IN_TAC_CONSENSUS = 'includedInTACConsensus',
|
|
987
|
+
EXECUTED_IN_TAC = 'executedInTAC',
|
|
988
|
+
COLLECTED_IN_TON = 'collectedInTON',
|
|
989
|
+
INCLUDED_IN_TON_CONSENSUS = 'includedInTONConsensus',
|
|
990
|
+
EXECUTED_IN_TON = 'executedInTON',
|
|
991
991
|
}
|
|
992
992
|
```
|
|
993
993
|
|
|
@@ -1082,12 +1082,12 @@ export type ExecutionStages = {
|
|
|
1082
1082
|
|
|
1083
1083
|
Represents the profiling data for all execution stages within an operation.
|
|
1084
1084
|
- **`operationType`**.
|
|
1085
|
-
- **`
|
|
1086
|
-
- **`
|
|
1087
|
-
- **`
|
|
1088
|
-
- **`
|
|
1089
|
-
- **`
|
|
1090
|
-
- **`
|
|
1085
|
+
- **`collectedInTAC`**.
|
|
1086
|
+
- **`includedInTACConsensus`**.
|
|
1087
|
+
- **`executedInTAC`**.
|
|
1088
|
+
- **`collectedInTON`**.
|
|
1089
|
+
- **`includedInTONConsensus`**.
|
|
1090
|
+
- **`executedInTON`**.
|
|
1091
1091
|
|
|
1092
1092
|
|
|
1093
1093
|
### `ExecutionStagesByOperationId`
|
|
@@ -35,21 +35,32 @@ class OperationTracker {
|
|
|
35
35
|
throw errors_1.operationFetchError;
|
|
36
36
|
}
|
|
37
37
|
async getOperationId(transactionLinker) {
|
|
38
|
+
const requestBody = {
|
|
39
|
+
shardsKey: transactionLinker.shardsKey,
|
|
40
|
+
caller: transactionLinker.caller,
|
|
41
|
+
shardCount: transactionLinker.shardCount,
|
|
42
|
+
timestamp: transactionLinker.timestamp,
|
|
43
|
+
};
|
|
44
|
+
let operationId = undefined;
|
|
38
45
|
for (const endpoint of this.customLiteSequencerEndpoints) {
|
|
39
46
|
try {
|
|
40
|
-
const requestBody = {
|
|
41
|
-
shardsKey: transactionLinker.shardsKey,
|
|
42
|
-
caller: transactionLinker.caller,
|
|
43
|
-
shardCount: transactionLinker.shardCount,
|
|
44
|
-
timestamp: transactionLinker.timestamp,
|
|
45
|
-
};
|
|
46
47
|
const response = await axios_1.default.post(`${endpoint}/ton/operation-id`, requestBody);
|
|
47
48
|
return response.data.response || '';
|
|
48
49
|
}
|
|
49
50
|
catch (error) {
|
|
51
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
52
|
+
if (error.response?.status === 404) {
|
|
53
|
+
console.warn(`404 Not Found: ${endpoint}/ton/operation-id`);
|
|
54
|
+
operationId = '';
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
50
58
|
console.error(`Failed to get OperationId with ${endpoint}:`, error);
|
|
51
59
|
}
|
|
52
60
|
}
|
|
61
|
+
if (operationId !== undefined) {
|
|
62
|
+
return operationId;
|
|
63
|
+
}
|
|
53
64
|
throw errors_1.operationFetchError;
|
|
54
65
|
}
|
|
55
66
|
async getOperationIdsByShardsKeys(shardsKeys, caller) {
|
|
@@ -35,9 +35,7 @@ async function startTracking(transactionLinker, network, options) {
|
|
|
35
35
|
try {
|
|
36
36
|
operationId = await tracker.getOperationId(transactionLinker);
|
|
37
37
|
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
console.log('get operationId error');
|
|
40
|
-
}
|
|
38
|
+
catch (err) { }
|
|
41
39
|
}
|
|
42
40
|
else {
|
|
43
41
|
console.log('request operationType');
|
|
@@ -61,7 +61,7 @@ class JettonWallet {
|
|
|
61
61
|
.storeAddress(ton_1.Address.parse(to))
|
|
62
62
|
.storeAddress(responseAddress ? ton_1.Address.parse(responseAddress) : null)
|
|
63
63
|
.storeMaybeRef(null)
|
|
64
|
-
.storeCoins(forwardTonAmount || 0n)
|
|
64
|
+
.storeCoins((forwardTonAmount || 0n) + (crossChainTonAmount || 0n))
|
|
65
65
|
.storeCoins(crossChainTonAmount ?? 0n)
|
|
66
66
|
.storeMaybeRef(crossChainPayload)
|
|
67
67
|
.endCell();
|