@tonappchain/sdk 0.5.3 → 0.5.4
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.
|
@@ -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');
|