@typus/typus-sdk 0.2.7 → 0.2.9
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/lib/constants.d.ts +2 -0
- package/lib/constants.js +3 -1
- package/lib/utils/getVaultData.js +2 -2
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare const USER_SHARE_TABLE = "0xd1ea22029f899265c9588c0e19d0366e6bb60
|
|
|
10
10
|
export declare const MAKER_SHARE_TABLE = "0xf4db8e77a8763e1ac2d3038f53456410e2175989";
|
|
11
11
|
export declare const DOV_PACKAGE = "0xaf114c36e5329271f84a0d2cb1310d0efa6c6bb9";
|
|
12
12
|
export declare const TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
13
|
+
export declare const PRICE_DECIMAL = 8;
|
|
14
|
+
export declare const TOKEN_DECIMAL = 9;
|
|
13
15
|
export declare const DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
14
16
|
export declare const FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
15
17
|
export declare const TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.TEST_MNEMONIC = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TEST_MINT_TOKEN = exports.DOV_PACKAGE = exports.MAKER_SHARE_TABLE = exports.USER_SHARE_TABLE = exports.COVERED_CALL_MANAGER = exports.COVERED_CALL_REGISTRY = exports.COVERED_CALL_PACKAGE = exports.ORACLE_PACKAGE = exports.TOKEN_REGISTRY_SUI = exports.TOKEN_REGISTRY_ETH = exports.TOKEN_REGISTRY_BTC = exports.TOKEN_PACKAGE = void 0;
|
|
3
|
+
exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.TEST_MNEMONIC = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TOKEN_DECIMAL = exports.PRICE_DECIMAL = exports.TEST_MINT_TOKEN = exports.DOV_PACKAGE = exports.MAKER_SHARE_TABLE = exports.USER_SHARE_TABLE = exports.COVERED_CALL_MANAGER = exports.COVERED_CALL_REGISTRY = exports.COVERED_CALL_PACKAGE = exports.ORACLE_PACKAGE = exports.TOKEN_REGISTRY_SUI = exports.TOKEN_REGISTRY_ETH = exports.TOKEN_REGISTRY_BTC = exports.TOKEN_PACKAGE = void 0;
|
|
4
4
|
//publish from sui-dev-token
|
|
5
5
|
exports.TOKEN_PACKAGE = "0x2c9a10117599e2d3232495a525b10f679691c9ae";
|
|
6
6
|
exports.TOKEN_REGISTRY_BTC = "0xe0dc19dfc9023f2e86462aa37dc8fae290b4e2bb"; //fake btc registry
|
|
@@ -17,6 +17,8 @@ exports.MAKER_SHARE_TABLE = "0xf4db8e77a8763e1ac2d3038f53456410e2175989";
|
|
|
17
17
|
//publish from typus-dov/typus-dov
|
|
18
18
|
exports.DOV_PACKAGE = "0xaf114c36e5329271f84a0d2cb1310d0efa6c6bb9";
|
|
19
19
|
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
20
|
+
exports.PRICE_DECIMAL = 8;
|
|
21
|
+
exports.TOKEN_DECIMAL = 9;
|
|
20
22
|
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
21
23
|
exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
22
24
|
exports.TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
|
@@ -119,7 +119,7 @@ function getVaultDataFromRegistry(registry) {
|
|
|
119
119
|
var payoffConfigRes = {
|
|
120
120
|
exposureRatio: Number(payoffConfig.exposure_ratio),
|
|
121
121
|
premiumRoi: Number(payoffConfig.premium_roi),
|
|
122
|
-
strike: Number(payoffConfig.strike),
|
|
122
|
+
strike: Number(payoffConfig.strike) / (Math.pow(10, constants_1.PRICE_DECIMAL)),
|
|
123
123
|
};
|
|
124
124
|
var configRes = {
|
|
125
125
|
period: config.period,
|
|
@@ -127,7 +127,7 @@ function getVaultDataFromRegistry(registry) {
|
|
|
127
127
|
expirationTsMs: config.expiration_ts_ms,
|
|
128
128
|
tokenDecimal: config.token_decimal,
|
|
129
129
|
shareDecimal: config.share_decimal,
|
|
130
|
-
capacity: config.capacity,
|
|
130
|
+
capacity: Number(config.capacity) / (Math.pow(10, constants_1.TOKEN_DECIMAL)),
|
|
131
131
|
vaultConfig: vaultConfigRes,
|
|
132
132
|
nextVaultConfig: nextVaultConfigRes,
|
|
133
133
|
payoffConfig: payoffConfigRes,
|