@clonegod/ttd-sui-common 1.0.4 → 1.0.6
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/dist/index.d.ts +5 -0
- package/dist/index.js +21 -1
- package/dist/parsed_swap_transactions_2025-08-30T12-11-48-744Z.json +19215 -0
- package/dist/parsed_swap_transactions_2025-08-30T12-51-39-586Z.json +19309 -0
- package/dist/parsed_swap_transactions_2025-08-30T13-58-34-579Z.json +19005 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +17 -0
- package/dist/swap_transactions_2025-08-30T12-05-49-140Z.json +1384 -0
- package/dist/swap_transactions_2025-08-30T12-05-51-529Z.json +2907 -0
- package/dist/swap_transactions_2025-08-30T12-05-54-042Z.json +13392 -0
- package/dist/swap_transactions_2025-08-30T12-05-56-880Z.json +16210 -0
- package/dist/swap_transactions_2025-08-30T12-05-59-588Z.json +17993 -0
- package/dist/swap_transactions_2025-08-30T12-05-59-597Z.json +17993 -0
- package/dist/test/test_checkpoint_processor.d.ts +1 -0
- package/dist/test/test_checkpoint_processor.js +112 -0
- package/dist/test/test_checkpoint_subscription.d.ts +1 -0
- package/dist/test/test_checkpoint_subscription.js +132 -0
- package/dist/test/test_grpc.js +1 -1
- package/dist/test/test_momentum_events.d.ts +1 -0
- package/dist/test/test_momentum_events.js +113 -0
- package/dist/test/test_single_momentum_event.d.ts +1 -0
- package/dist/test/test_single_momentum_event.js +44 -0
- package/dist/type/index.d.ts +45 -0
- package/dist/type/index.js +2 -0
- package/dist/utils/bcs-parser.d.ts +8 -0
- package/dist/utils/bcs-parser.js +121 -0
- package/dist/utils/checkpoint-processor.d.ts +7 -0
- package/dist/utils/checkpoint-processor.js +123 -0
- package/dist/utils/checkpoint_parse.d.ts +26 -0
- package/dist/utils/checkpoint_parse.js +277 -0
- package/dist/utils/decode.d.ts +2 -0
- package/dist/utils/decode.js +43 -0
- package/dist/utils/dex-parser-manager.d.ts +7 -0
- package/dist/utils/dex-parser-manager.js +138 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +16 -41
- package/package.json +2 -1
package/dist/utils/index.js
CHANGED
|
@@ -1,43 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return obj.map((item) => decodeBytes(item));
|
|
8
|
-
}
|
|
9
|
-
else if (obj && typeof obj === 'object') {
|
|
10
|
-
const result = {};
|
|
11
|
-
for (const key of Object.keys(obj)) {
|
|
12
|
-
const val = obj[key];
|
|
13
|
-
if (Buffer.isBuffer(val) || (Array.isArray(val) && typeof val[0] === 'number')) {
|
|
14
|
-
result[key] = Buffer.from(val).toString('hex');
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
result[key] = decodeBytes(val);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
return obj;
|
|
23
|
-
}
|
|
24
|
-
function parseObjectAmount(objectResponse) {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
try {
|
|
27
|
-
if (!((_b = (_a = objectResponse === null || objectResponse === void 0 ? void 0 : objectResponse.object) === null || _a === void 0 ? void 0 : _a.contents) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const contentsValue = objectResponse.object.contents.value;
|
|
31
|
-
if (contentsValue.length < 80) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const balanceHex = contentsValue.substring(64, 80);
|
|
35
|
-
const balanceBytes = Buffer.from(balanceHex, 'hex');
|
|
36
|
-
const balance = balanceBytes.readBigUInt64LE(0).toString();
|
|
37
|
-
return balance;
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
38
7
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./checkpoint_parse"), exports);
|
|
18
|
+
__exportStar(require("./decode"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clonegod/ttd-sui-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Sui common library",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@clonegod/ttd-core": "2.0.60",
|
|
18
18
|
"@grpc/grpc-js": "^1.9.14",
|
|
19
19
|
"@grpc/proto-loader": "^0.7.10",
|
|
20
|
+
"@mysten/sui": "^1.37.5",
|
|
20
21
|
"axios": "^1.11.00",
|
|
21
22
|
"dotenv": "^16.4.7",
|
|
22
23
|
"google-protobuf": "^4.0.0",
|