@typus/typus-sdk 1.0.26 → 1.0.27
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
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { Connection } from "@mysten/sui.js";
|
|
2
|
-
export declare const TOKEN_PACKAGE: string;
|
|
3
|
-
export declare const TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
4
|
-
export declare const ORACLE_PACKAGE: string;
|
|
5
|
-
export declare const TIME_ORACLE = "0x6";
|
|
6
2
|
export declare const CLOCK = "0x6";
|
|
7
3
|
export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
8
|
-
export declare const BTC_ORACLE: string;
|
|
9
|
-
export declare const ETH_ORACLE: string;
|
|
10
|
-
export declare const SUI_ORACLE: string;
|
|
11
|
-
export declare const APT_ORACLE: string;
|
|
12
|
-
export declare const DOGE_ORACLE: string;
|
|
13
|
-
export declare const PORTFOLIO_PACKAGE: string;
|
|
14
|
-
export declare const REGISTRY: string;
|
|
15
|
-
export declare const MODULE = "single_collateral";
|
|
16
|
-
export declare const SINGLE_COLLATERAL_DEPOSIT_VAULT_REGISTRY: string;
|
|
17
|
-
export declare const SINGLE_COLLATERAL_BID_VAULT_REGISTRY: string;
|
|
18
|
-
export declare const TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
19
4
|
export declare const PRICE_DECIMAL = 8;
|
|
20
5
|
export declare const TOKEN_DECIMAL = 9;
|
|
21
6
|
export declare const DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
package/lib/constants.js
CHANGED
|
@@ -3,35 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PERFORMANCE_FEE_SUB_VAULT_TAG = exports.PREMIUM_SUB_VAULT_TAG = exports.BIDDER_SUB_VAULT_TAG = exports.WARMUP_SUB_VAULT_TAG = exports.INACTIVE_SUB_VAULT_TAG = exports.DEACTIVATING_SUB_VAULT_TAG = exports.ACTIVE_SUB_VAULT_TAG = exports.testnetConnection = exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TOKEN_DECIMAL = exports.PRICE_DECIMAL = exports.
|
|
6
|
+
exports.PERFORMANCE_FEE_SUB_VAULT_TAG = exports.PREMIUM_SUB_VAULT_TAG = exports.BIDDER_SUB_VAULT_TAG = exports.WARMUP_SUB_VAULT_TAG = exports.INACTIVE_SUB_VAULT_TAG = exports.DEACTIVATING_SUB_VAULT_TAG = exports.ACTIVE_SUB_VAULT_TAG = exports.testnetConnection = exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.TOKEN_DECIMAL = exports.PRICE_DECIMAL = exports.SENDER = exports.CLOCK = void 0;
|
|
7
7
|
var sui_js_1 = require("@mysten/sui.js");
|
|
8
|
-
var config_json_1 = __importDefault(require("./config.json"));
|
|
9
8
|
var path_1 = __importDefault(require("path"));
|
|
10
9
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
11
10
|
// import .env file if exists
|
|
12
11
|
dotenv_1.default.config({ path: path_1.default.resolve(__dirname, ".env") });
|
|
13
|
-
//publish from sui-dev-token
|
|
14
|
-
exports.TOKEN_PACKAGE = config_json_1.default.TOKEN_PACKAGE;
|
|
15
|
-
exports.TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
16
|
-
//publish from typus-oracle
|
|
17
|
-
exports.ORACLE_PACKAGE = config_json_1.default.ORACLE_PACKAGE;
|
|
18
|
-
exports.TIME_ORACLE = "0x6";
|
|
19
12
|
exports.CLOCK = "0x6";
|
|
20
13
|
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
21
|
-
exports.BTC_ORACLE = config_json_1.default.BTC_ORACLE;
|
|
22
|
-
exports.ETH_ORACLE = config_json_1.default.ETH_ORACLE;
|
|
23
|
-
exports.SUI_ORACLE = config_json_1.default.SUI_ORACLE;
|
|
24
|
-
exports.APT_ORACLE = config_json_1.default.APT_ORACLE;
|
|
25
|
-
exports.DOGE_ORACLE = config_json_1.default.DOGE_ORACLE;
|
|
26
|
-
//publish from typus-dov/cover_call
|
|
27
|
-
exports.PORTFOLIO_PACKAGE = config_json_1.default.PORTFOLIO_PACKAGE;
|
|
28
|
-
exports.REGISTRY = config_json_1.default.SINGLE_COLLATERAL_REGISTRY;
|
|
29
|
-
// export const MANAGER_CAP = config.MANAGER_CAP;
|
|
30
|
-
exports.MODULE = "single_collateral";
|
|
31
|
-
exports.SINGLE_COLLATERAL_DEPOSIT_VAULT_REGISTRY = config_json_1.default.SINGLE_COLLATERAL_DEPOSIT_VAULT_REGISTRY;
|
|
32
|
-
exports.SINGLE_COLLATERAL_BID_VAULT_REGISTRY = config_json_1.default.SINGLE_COLLATERAL_BID_VAULT_REGISTRY;
|
|
33
|
-
//publish from typus-dov/typus-dov
|
|
34
|
-
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
35
14
|
exports.PRICE_DECIMAL = 8;
|
|
36
15
|
exports.TOKEN_DECIMAL = 9;
|
|
37
16
|
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { JsonRpcProvider } from "@mysten/sui.js";
|
|
2
2
|
import { DepositVaultUserShare, BidVaultUserShare } from "../../typus-framework/vault";
|
|
3
|
+
export declare const CLOCK = "0x6";
|
|
4
|
+
export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
3
5
|
export interface UserShare {
|
|
4
6
|
index: string;
|
|
5
7
|
depositVaultUserShare: DepositVaultUserShare;
|
|
@@ -36,10 +36,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getMaxLossPerUnit = exports.getAuctionMaxSize = void 0;
|
|
39
|
+
exports.getMaxLossPerUnit = exports.getAuctionMaxSize = exports.SENDER = exports.CLOCK = void 0;
|
|
40
40
|
var sui_js_1 = require("@mysten/sui.js");
|
|
41
41
|
var tools_1 = require("../../tools");
|
|
42
|
-
|
|
42
|
+
exports.CLOCK = "0x6";
|
|
43
|
+
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
43
44
|
function getAuctionMaxSize(provider, packageId, typeArguments, registry, index, priceOracle) {
|
|
44
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
46
|
var transactionBlock, target, transactionBlockArguments, bytes;
|
|
@@ -52,14 +53,14 @@ function getAuctionMaxSize(provider, packageId, typeArguments, registry, index,
|
|
|
52
53
|
transactionBlock.pure(registry),
|
|
53
54
|
transactionBlock.pure(index),
|
|
54
55
|
transactionBlock.pure(priceOracle),
|
|
55
|
-
transactionBlock.pure(
|
|
56
|
+
transactionBlock.pure(exports.CLOCK),
|
|
56
57
|
];
|
|
57
58
|
transactionBlock.moveCall({
|
|
58
59
|
target: target,
|
|
59
60
|
typeArguments: typeArguments,
|
|
60
61
|
arguments: transactionBlockArguments,
|
|
61
62
|
});
|
|
62
|
-
return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender:
|
|
63
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: exports.SENDER })];
|
|
63
64
|
case 1:
|
|
64
65
|
bytes = (_a.sent()).results[0].returnValues[0][0];
|
|
65
66
|
return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
|
|
@@ -80,14 +81,14 @@ function getMaxLossPerUnit(provider, packageId, typeArguments, registry, index,
|
|
|
80
81
|
transactionBlock.pure(registry),
|
|
81
82
|
transactionBlock.pure(index),
|
|
82
83
|
transactionBlock.pure(priceOracle),
|
|
83
|
-
transactionBlock.pure(
|
|
84
|
+
transactionBlock.pure(exports.CLOCK),
|
|
84
85
|
];
|
|
85
86
|
transactionBlock.moveCall({
|
|
86
87
|
target: target,
|
|
87
88
|
typeArguments: typeArguments,
|
|
88
89
|
arguments: transactionBlockArguments,
|
|
89
90
|
});
|
|
90
|
-
return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender:
|
|
91
|
+
return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: exports.SENDER })];
|
|
91
92
|
case 1:
|
|
92
93
|
bytes = (_a.sent()).results[0].returnValues[0][0];
|
|
93
94
|
return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
|
package/package.json
CHANGED
package/lib/config.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"VERSION": "1.1.5",
|
|
3
|
-
"DB_NAME": "testnet_0_32_0",
|
|
4
|
-
"RPC_ENDPOINT": "https://fullnode.testnet.sui.io:443",
|
|
5
|
-
"PORTFOLIO_PACKAGE": "0x8e3be3caa0bc8c461e78252e360407d44962db2afd67fd38fd98bab9d327baf1",
|
|
6
|
-
"SINGLE_COLLATERAL_MANAGER_CAP": "0xa4189b00966beb3659484c510304569202520db67c783bd728aefa776a8ab017",
|
|
7
|
-
"SINGLE_COLLATERAL_REGISTRY": "0x0aea6911732b61a0fa89cbbb16c713844d5e7682d6c01f957f938dd1e17c5760",
|
|
8
|
-
"SINGLE_COLLATERAL_DEPOSIT_VAULT_REGISTRY": "0xda81da4f3679cff5d146278434c3fa907f547f44fc31bd5e362cb3c84e00f1c8",
|
|
9
|
-
"SINGLE_COLLATERAL_BID_VAULT_REGISTRY": "0x3ce8665b0c374c4c7d71ec11a9e71c5c64eaf8684c24f0077ba05d16e32d58b4",
|
|
10
|
-
"MULTIPLE_COLLATERAL_MANAGER_CAP": "0x007696a2e387c3fc08fbe6e3fd9670aaf7d5ad1f1280df7a7a8cd988a6f47b9d",
|
|
11
|
-
"MULTIPLE_COLLATERAL_REGISTRY": "0x756f490c57433c0712d736e8fa12623e9e42eb7a41e50678a85b9fcf800c3640",
|
|
12
|
-
"MULTIPLE_COLLATERAL_TOKEN_DEPOSIT_VAULT_REGISTRY": "0x613e0de7f61ff00147f1649fa852e599348702abc89937fb718ad3f202909365",
|
|
13
|
-
"MULTIPLE_COLLATERAL_USD_DEPOSIT_VAULT_REGISTRY": "0x981560caf7feccb3279adb3cf78706f27d8f3b4ebfd9029ea66e034b527f048e",
|
|
14
|
-
"MULTIPLE_COLLATERAL_BID_VAULT_REGISTRY": "0xdaddcf7b4007b324fa411862b48b30d1b07e6c360ec8b05b79ba84129313c6bc",
|
|
15
|
-
"TOKEN_PACKAGE": "0xd175cff04f1d49574efb6f138bc3b9b7313915a57b5ca04141fb1cb4f66984b2",
|
|
16
|
-
"BTC_TOKEN_REGISTRY": "0x15b4c8c7a3fb5aa84fd1bfa4f419dbe065c5628cbfacdc812926c1c004444a54",
|
|
17
|
-
"ETH_TOKEN_REGISTRY": "0x823ad0a5c8de5a6bef7bb1112b623765b8d178c5708d6360be49da572226f5c2",
|
|
18
|
-
"SUI_TOKEN_REGISTRY": "0xf979fdd672a8c3578563087295a9a878b52c33cfb57077a1cb827829aa52d3cc",
|
|
19
|
-
"USDC_TOKEN_REGISTRY": "0xbf453a89a9aa37fdd377e2e014f2777003a1594a289738ca63fccf8429729d81",
|
|
20
|
-
"APT_TOKEN_REGISTRY": "0x2bbca3fe6829d84ef8bf74fb5420924384d5368f0de5cc1ba2159eaeffab028c",
|
|
21
|
-
"DOGE_TOKEN_REGISTRY": "0xefb88c143d453005d862fddda58c05c9749110dfa0ae6277b8e96a70e12b8166",
|
|
22
|
-
"ORACLE_PACKAGE": "0x4144cc4bf374646f45927ca82482ab99920b78477bce572d10b7e49d746108c9",
|
|
23
|
-
"BTC_ORACLE": "0x7517f836e6ad37b168c31efafd7c708045cb4d4de6975e4ea6033e79574d0244",
|
|
24
|
-
"BTC_ORACLE_KEY": "0xe8e24e5590fd3b5f6021742a6188514e35f9e2cc6fa0d6938268955460ef14af",
|
|
25
|
-
"ETH_ORACLE": "0x1749868f767680bbe409dbabb94094bc691f09d1e55958ad4dc1a718b701465f",
|
|
26
|
-
"ETH_ORACLE_KEY": "0x6ec01fa9fe697ed56f1d27bada9d96e4b3da1f3e99abe18db0b7265350c6ca74",
|
|
27
|
-
"SUI_ORACLE": "0x579b4006caca220b703c2e919f5b8fa26a600a349a42624577d49e8802506456",
|
|
28
|
-
"SUI_ORACLE_KEY": "0xa06bb17223a82ca842735e249d99b658567196a72ad85a3a6a9ab115a36fa89b",
|
|
29
|
-
"APT_ORACLE": "0x5de8d72df3fe762a2d5d0a51ce1bd6d0c1b2975c4e7414a4a2eb5c410035c66e",
|
|
30
|
-
"APT_ORACLE_KEY": "0xf3e598e304e444f9827d20a0918969dc824314102c143ee67f25f1c80d54d988",
|
|
31
|
-
"DOGE_ORACLE": "0xe43157e6cf9d4090245c7710e1a015cded9c376e25742b590ee9c06989826972",
|
|
32
|
-
"DOGE_ORACLE_KEY": "0x7df1df5bbe3b5086a7318fceea6bee603d03b917574fff894fd6408f5956d1fb"
|
|
33
|
-
}
|