@typus/typus-sdk 0.2.8 → 0.3.0
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/coveredCall/getClaimAllTx.d.ts +1 -1
- package/lib/utils/coveredCall/getClaimTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -1
- package/lib/utils/coveredCall/getDepositTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -1
- package/lib/utils/coveredCall/getRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +1 -1
- package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -1
- package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +1 -1
- package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimAllTx(packageId: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getClaimAllTx(packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getClaimTx(packageId: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getClaimTx(packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDeliveryTx(packageId: string, managerCap: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getDeliveryTx(packageId: string, managerCap: string, registry: string, typeArgument: string, index: string, size: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDepositTx(packageId: string, registry: string, typeArgument: string, vaultIndex:
|
|
1
|
+
export declare function getDepositTx(packageId: string, registry: string, typeArgument: string, vaultIndex: string, isRolling: Boolean, coin: string, amount: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index:
|
|
1
|
+
export declare function getNewAuctionTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewBidTx(packageId: string, registry: string, typeArgument: string, vaultIndex:
|
|
1
|
+
export declare function getNewBidTx(packageId: string, registry: string, typeArgument: string, vaultIndex: string, size: string, coin: string, time: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, timeOracle: string, period:
|
|
1
|
+
export declare function getNewCoveredCallVaultTx(packageId: string, registry: string, typeArgument: string, managerCap: string, timeOracle: string, period: string, activationTsMs: string, expirationTsMs: string, tokenDecimal: string, shareDecimal: string, capacity: string, strikeOtmPct: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, prevBalance: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRemoveBidTx(packageId: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getRemoveBidTx(packageId: string, registry: string, typeArgument: string, index: string, bidIndex: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRollOverTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index:
|
|
1
|
+
export declare function getRollOverTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSettleTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index:
|
|
1
|
+
export declare function getSettleTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSettleWithRollOverTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index:
|
|
1
|
+
export declare function getSettleWithRollOverTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getSubscribeTx(packageId: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getSubscribeTx(packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUnsubscribeTx(packageId: string, registry: string, typeArgument: string, index:
|
|
1
|
+
export declare function getUnsubscribeTx(packageId: string, registry: string, typeArgument: string, index: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getUpdatePayoffConfigTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index:
|
|
1
|
+
export declare function getUpdatePayoffConfigTx(packageId: string, registry: string, typeArgument: string, managerCap: string, index: string, price: string, roi: string, exposureRatio: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getWithdrawTx(packageId: string, registry: string, typeArgument: string, vaultIndex:
|
|
1
|
+
export declare function getWithdrawTx(packageId: string, registry: string, typeArgument: string, vaultIndex: string, isRolling: Boolean, amount: string): Promise<any>;
|
|
@@ -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,
|