@clonegod/ttd-sui-common 1.0.14 → 1.0.16
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/constants/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUI_TOKEN_ADDRESS = void 0;
|
|
4
|
+
var SUI_TOKEN_ADDRESS;
|
|
5
|
+
(function (SUI_TOKEN_ADDRESS) {
|
|
6
|
+
SUI_TOKEN_ADDRESS["SHORT"] = "0x2::sui::SUI";
|
|
7
|
+
SUI_TOKEN_ADDRESS["LONG"] = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
8
|
+
})(SUI_TOKEN_ADDRESS || (exports.SUI_TOKEN_ADDRESS = SUI_TOKEN_ADDRESS = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeSuiTokenAddress: (address: string, useLongAddress?: boolean) => string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeSuiTokenAddress = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const normalizeSuiTokenAddress = (address, useLongAddress = true) => {
|
|
6
|
+
if (useLongAddress) {
|
|
7
|
+
if (address === constants_1.SUI_TOKEN_ADDRESS.SHORT) {
|
|
8
|
+
return constants_1.SUI_TOKEN_ADDRESS.LONG;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
if (address === constants_1.SUI_TOKEN_ADDRESS.LONG) {
|
|
13
|
+
return constants_1.SUI_TOKEN_ADDRESS.SHORT;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return address;
|
|
17
|
+
};
|
|
18
|
+
exports.normalizeSuiTokenAddress = normalizeSuiTokenAddress;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./decode"), exports);
|
|
18
18
|
__exportStar(require("./checkpoint"), exports);
|
|
19
|
+
__exportStar(require("./format"), exports);
|