@typus/typus-sdk 1.0.2 → 1.0.3
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/config.json +20 -0
- package/lib/constants.d.ts +26 -0
- package/lib/constants.js +37 -0
- package/lib/scripts/getSubVault.d.ts +0 -0
- package/lib/scripts/getSubVault.js +6 -0
- package/lib/scripts/sui.d.ts +1 -0
- package/lib/scripts/sui.js +174 -0
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
- package/lib/test/authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedUpdateUpcomingVaultConfig.js +71 -0
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts +1 -0
- package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +68 -0
- package/lib/test/getBidData.d.ts +1 -0
- package/lib/test/getBidData.js +55 -0
- package/lib/test/getVaultData.d.ts +1 -0
- package/lib/test/getVaultData.js +55 -0
- package/lib/test/getWhiteListFromRegistry.d.ts +1 -0
- package/lib/test/getWhiteListFromRegistry.js +55 -0
- package/lib/test/helper/getAuctionMaxSize.d.ts +1 -0
- package/lib/test/helper/getAuctionMaxSize.js +76 -0
- package/lib/test/helper/getUserStatus.d.ts +1 -0
- package/lib/test/helper/getUserStatus.js +83 -0
- package/lib/test/testCrypto.d.ts +1 -0
- package/lib/test/testCrypto.js +54 -0
- package/lib/test/testMint.d.ts +1 -0
- package/lib/test/testMint.js +137 -0
- package/lib/test/testSubscribeEvent.d.ts +1 -0
- package/lib/test/testSubscribeEvent.js +97 -0
- package/lib/test/user/testClaim.d.ts +1 -0
- package/lib/test/user/testClaim.js +68 -0
- package/lib/test/user/testCompound.d.ts +1 -0
- package/lib/test/user/testCompound.js +68 -0
- package/lib/test/user/testDeposit.d.ts +1 -0
- package/lib/test/user/testDeposit.js +79 -0
- package/lib/test/user/testHarvest.d.ts +1 -0
- package/lib/test/user/testHarvest.js +68 -0
- package/lib/test/user/testNewBid.d.ts +1 -0
- package/lib/test/user/testNewBid.js +77 -0
- package/lib/test/user/testUnsubscribe.d.ts +1 -0
- package/lib/test/user/testUnsubscribe.js +69 -0
- package/lib/test/user/testWithdraw.d.ts +1 -0
- package/lib/test/user/testWithdraw.js +70 -0
- package/lib/utils/auction/getBid.d.ts +3 -0
- package/lib/utils/auction/getBid.js +77 -0
- package/lib/utils/auction/sealedAuction.d.ts +33 -0
- package/lib/utils/auction/sealedAuction.js +64 -0
- package/lib/utils/fetchData.d.ts +96 -0
- package/lib/utils/fetchData.js +34 -0
- package/lib/utils/getMintTx.d.ts +1 -0
- package/lib/utils/getMintTx.js +62 -0
- package/lib/utils/getTypeArgumentFromToken.d.ts +2 -0
- package/lib/utils/getTypeArgumentFromToken.js +68 -0
- package/lib/utils/getVaultData.d.ts +5 -0
- package/lib/utils/getVaultData.js +242 -0
- package/lib/utils/getWhiteListFromRegistry.d.ts +2 -0
- package/lib/utils/getWhiteListFromRegistry.js +70 -0
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +63 -0
- package/lib/utils/portfolio/authorized/getAuthorizedDeliveryTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedDeliveryTx.js +61 -0
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +116 -0
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +63 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateCapacityTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateCapacityTx.js +60 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.js +70 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
- package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.js +64 -0
- package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
- package/lib/utils/portfolio/helper/getAuctionMaxSize.js +66 -0
- package/lib/utils/portfolio/helper/getUserStatus.d.ts +29 -0
- package/lib/utils/portfolio/helper/getUserStatus.js +102 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -0
- package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +67 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +10 -0
- package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +70 -0
- package/lib/utils/portfolio/manager/getCloseAuctionTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getCloseAuctionTx.js +62 -0
- package/lib/utils/portfolio/manager/getCloseVaultTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getCloseVaultTx.js +60 -0
- package/lib/utils/portfolio/manager/getDeliveryTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getDeliveryTx.js +62 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +15 -0
- package/lib/utils/portfolio/manager/getEvolutionTx.js +78 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -0
- package/lib/utils/portfolio/manager/getNewManagerTx.js +66 -0
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +38 -0
- package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +116 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +8 -0
- package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +67 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +6 -0
- package/lib/utils/portfolio/manager/getRemoveManagerTx.js +63 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +10 -0
- package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +70 -0
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.d.ts +1 -0
- package/lib/utils/portfolio/manager/getUpdateCapacityTx.js +61 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +67 -0
- package/lib/utils/portfolio/user/getClaimTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getClaimTx.js +67 -0
- package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getCompoundTx.js +67 -0
- package/lib/utils/portfolio/user/getDepositTx.d.ts +11 -0
- package/lib/utils/portfolio/user/getDepositTx.js +71 -0
- package/lib/utils/portfolio/user/getHarvestTx.d.ts +9 -0
- package/lib/utils/portfolio/user/getHarvestTx.js +67 -0
- package/lib/utils/portfolio/user/getNewBidTx.d.ts +13 -0
- package/lib/utils/portfolio/user/getNewBidTx.js +75 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getUnsubscribeTx.js +69 -0
- package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -0
- package/lib/utils/portfolio/user/getWithdrawTx.js +69 -0
- package/package.json +1 -1
package/lib/config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"RPC_ENDPOINT": "https://fullnode.devnet.sui.io:443",
|
|
3
|
+
"PORTFOLIO_PACKAGE": "0xec173aa0db809acf12578133c8fb69b6eb062072",
|
|
4
|
+
"REGISTRY": "0x02354de3b28ac37b3cc88cb4702d3f7e33dcc475",
|
|
5
|
+
"MANAGER_CAP": "0x8c27432f2f82e4fd165c1db12e321933e0cc1f5c",
|
|
6
|
+
"TOKEN_PACKAGE": "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec",
|
|
7
|
+
"ORACLE_PACKAGE": "0xaf8a13019dbcda931baab67c4f13bf4adc7ebb14",
|
|
8
|
+
"TIME_ORACLE": "0xf09375b1a06e06897f79e61cdfef7baabf1a2da5",
|
|
9
|
+
"TIME_ORACLE_KEY": "0x4844842eabe4ab7f42a9e38c8be052122d1d3477",
|
|
10
|
+
"BTC_ORACLE": "0x2291059bfea5061676bf990ac26823f69cbd1523",
|
|
11
|
+
"BTC_ORACLE_KEY": "0x2bdbc4ed776c48b4cdfec6439d9eeca12947f4b5",
|
|
12
|
+
"ETH_ORACLE": "0x2867941517e1334cf5fb0eb1dd635e8d2cf39167",
|
|
13
|
+
"ETH_ORACLE_KEY": "0x662f2242f4a1ee3df299c4f459921ac72d657ae0",
|
|
14
|
+
"SUI_ORACLE": "0xcb19a040109e3f606c65d37c2b9118fdb1bd606e",
|
|
15
|
+
"SUI_ORACLE_KEY": "0x09818d7a532697c5d1a6867c818f8116a7a1f0e9",
|
|
16
|
+
"APT_ORACLE": "0xa17cb9fe11c57c7dbfff59910da90ac63fad8938",
|
|
17
|
+
"APT_ORACLE_KEY": "0x6d2ed8259baf387b8c5d2b8f1e15fdaf188ca4a0",
|
|
18
|
+
"DOGE_ORACLE": "0x48ab076f16e2bc3fdfb9be44990976dadcc30128",
|
|
19
|
+
"DOGE_ORACLE_KEY": "0x7942367add64cd9196ce283741acb01578fa249a"
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const TOKEN_PACKAGE: string;
|
|
2
|
+
export declare const TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
3
|
+
export declare const ORACLE_PACKAGE: string;
|
|
4
|
+
export declare const TIME_ORACLE: string;
|
|
5
|
+
export declare const BTC_ORACLE: string;
|
|
6
|
+
export declare const ETH_ORACLE: string;
|
|
7
|
+
export declare const SUI_ORACLE: string;
|
|
8
|
+
export declare const APT_ORACLE: string;
|
|
9
|
+
export declare const DOGE_ORACLE: string;
|
|
10
|
+
export declare const PORTFOLIO_PACKAGE: string;
|
|
11
|
+
export declare const REGISTRY: string;
|
|
12
|
+
export declare const MANAGER_CAP: string;
|
|
13
|
+
export declare const TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
14
|
+
export declare const PRICE_DECIMAL = 8;
|
|
15
|
+
export declare const TOKEN_DECIMAL = 9;
|
|
16
|
+
export declare const DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
17
|
+
export declare const FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
18
|
+
export declare const TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
|
19
|
+
export declare const TOKEN_NAME: string[];
|
|
20
|
+
export declare const TOKEN_NAME_TO_MODULE: {
|
|
21
|
+
BTC: string;
|
|
22
|
+
ETH: string;
|
|
23
|
+
SUI: string;
|
|
24
|
+
USDC: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const TESTNET_RPC_ENDPOINT = "https://fullnode.testnet.sui.io:443";
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TESTNET_RPC_ENDPOINT = 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.MANAGER_CAP = exports.REGISTRY = exports.PORTFOLIO_PACKAGE = exports.DOGE_ORACLE = exports.APT_ORACLE = exports.SUI_ORACLE = exports.ETH_ORACLE = exports.BTC_ORACLE = exports.TIME_ORACLE = exports.ORACLE_PACKAGE = exports.TOKEN_REGISTRY_SUI = exports.TOKEN_PACKAGE = void 0;
|
|
7
|
+
var config_json_1 = __importDefault(require("./config.json"));
|
|
8
|
+
//publish from sui-dev-token
|
|
9
|
+
exports.TOKEN_PACKAGE = config_json_1.default.TOKEN_PACKAGE;
|
|
10
|
+
exports.TOKEN_REGISTRY_SUI = "0x3b87b3f0403f527d28fd1301074a12446f43817a";
|
|
11
|
+
//publish from typus-oracle
|
|
12
|
+
exports.ORACLE_PACKAGE = config_json_1.default.ORACLE_PACKAGE;
|
|
13
|
+
exports.TIME_ORACLE = config_json_1.default.TIME_ORACLE;
|
|
14
|
+
exports.BTC_ORACLE = config_json_1.default.BTC_ORACLE;
|
|
15
|
+
exports.ETH_ORACLE = config_json_1.default.ETH_ORACLE;
|
|
16
|
+
exports.SUI_ORACLE = config_json_1.default.SUI_ORACLE;
|
|
17
|
+
exports.APT_ORACLE = config_json_1.default.APT_ORACLE;
|
|
18
|
+
exports.DOGE_ORACLE = config_json_1.default.DOGE_ORACLE;
|
|
19
|
+
//publish from typus-dov/cover_call
|
|
20
|
+
exports.PORTFOLIO_PACKAGE = config_json_1.default.PORTFOLIO_PACKAGE;
|
|
21
|
+
exports.REGISTRY = config_json_1.default.REGISTRY;
|
|
22
|
+
exports.MANAGER_CAP = config_json_1.default.MANAGER_CAP;
|
|
23
|
+
//publish from typus-dov/typus-dov
|
|
24
|
+
exports.TEST_MINT_TOKEN = "0x672612858fcb5c6abf944638253142820c251753";
|
|
25
|
+
exports.PRICE_DECIMAL = 8;
|
|
26
|
+
exports.TOKEN_DECIMAL = 9;
|
|
27
|
+
exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
|
|
28
|
+
exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
|
|
29
|
+
exports.TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
|
|
30
|
+
exports.TOKEN_NAME = ["BTC", "ETH", "SUI", "USDC", "USDT", "APT", "DOGE"];
|
|
31
|
+
exports.TOKEN_NAME_TO_MODULE = {
|
|
32
|
+
"BTC": "btc",
|
|
33
|
+
"ETH": "eth",
|
|
34
|
+
"SUI": "sui",
|
|
35
|
+
"USDC": "usdc",
|
|
36
|
+
};
|
|
37
|
+
exports.TESTNET_RPC_ENDPOINT = "https://fullnode.testnet.sui.io:443";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
7
|
+
var fs_1 = __importDefault(require("fs"));
|
|
8
|
+
var execSync = require('child_process').execSync;
|
|
9
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
10
|
+
var owner = "0xd28103a499003bed0b1b9ee52988ecdd2db82224";
|
|
11
|
+
var obj1 = "0x7e9e58daeb94bbd0450bb9ee9f00e219a1f2b734"; //obj owned by owner
|
|
12
|
+
var obj2 = "0x74aa838eb6627c8e74b0645484abb463e6fd6669"; //obj owned by owner
|
|
13
|
+
var obj1Digest = "tclmc0L6hewmfWxQAxSl9eUe14C82+hzE4OblKgY38U=";
|
|
14
|
+
var obj2Digest = "tclmc0L6hewmfWxQAxSl9eUe14C82+hzE4OblKgY38U=";
|
|
15
|
+
var receiver = "0x15ca0895f29101085cb26e00ede89420741b3140";
|
|
16
|
+
var tx1 = "GRiBgktRqgJ4MSoRhCfSm/+1R/Zh9jy4UncoQeFAu5I=";
|
|
17
|
+
// export PRIVATEKEY=~/.sui/sui_config/sui.keystore
|
|
18
|
+
var secretKeysPath = process.env.PRIVATEKEY;
|
|
19
|
+
var subVault = "0xd3b2d3ee74afe2b5af0f810b3368955f068188e8";
|
|
20
|
+
var TEST_MNEMONIC = "tackle wheat jungle viable memory dwarf swift fold purpose cattle impose horn";
|
|
21
|
+
var VALID_SECRET_KEY = "Itk7iNFs91kXKdqVqmLrBKJItNIoSyWAOh+ZC2qaSihpxiAxNYwKPjwfresk9CSbKCmwNwvXfPQoeLL4rVa4OQ=="; //'mdqVWeFekT7pqy5T49+tV12jO0m+ESW7ki4zSU9JiCgbL0kJbj5dvQ/PqcDAzZLZqzshVEs01d1KZdmLh4uZIg==';
|
|
22
|
+
// let secretKeys = (readJsonFile<any>(secretKeysPath as string))
|
|
23
|
+
// let sender = secretKeys[0]
|
|
24
|
+
// let keypair = Ed25519Keypair.fromSecretKey(fromB64(sender))// Error: Wrong secretKey size. Expected 64 bytes, got 65.
|
|
25
|
+
// let keypair = Ed25519Keypair.fromSecretKey(fromB64(VALID_SECRET_KEY))
|
|
26
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(TEST_MNEMONIC);
|
|
27
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
28
|
+
function readJsonFile(filePath) {
|
|
29
|
+
return JSON.parse(fs_1.default.readFileSync(filePath, "utf-8"));
|
|
30
|
+
}
|
|
31
|
+
// //Success
|
|
32
|
+
// (async () => {
|
|
33
|
+
// console.log("test for getObjectsOwnedByAddress()")
|
|
34
|
+
// const objects = await provider.getObjectsOwnedByAddress(
|
|
35
|
+
// owner
|
|
36
|
+
// )
|
|
37
|
+
// console.log(objects)
|
|
38
|
+
// })();
|
|
39
|
+
// //Success
|
|
40
|
+
// (async () => {
|
|
41
|
+
// console.log("test for getObject() and getObjectBatch()")
|
|
42
|
+
// const txn = await provider.getObject(
|
|
43
|
+
// obj1
|
|
44
|
+
// );
|
|
45
|
+
// console.log(txn)
|
|
46
|
+
// // You can also fetch multiple objects in one batch request
|
|
47
|
+
// const txns = await provider.getObjectBatch([
|
|
48
|
+
// obj1,
|
|
49
|
+
// obj2,
|
|
50
|
+
// ]);
|
|
51
|
+
// console.log(txns)
|
|
52
|
+
// })();
|
|
53
|
+
// // Fail
|
|
54
|
+
// (async () => {
|
|
55
|
+
// console.log("test for getTransactionWithEffects() and getTransactionWithEffectsBatch()")
|
|
56
|
+
// const txn = await provider.getTransactionWithEffects(
|
|
57
|
+
// obj1Digest
|
|
58
|
+
// );
|
|
59
|
+
// console.log(txn)
|
|
60
|
+
// You can also fetch multiple transactions in one batch request
|
|
61
|
+
// const txns = await provider.getTransactionWithEffectsBatch([
|
|
62
|
+
// obj1Digest,
|
|
63
|
+
// obj2Digest,
|
|
64
|
+
// ]);
|
|
65
|
+
// console.log(txns)
|
|
66
|
+
// })();
|
|
67
|
+
// //Fail (without correct signer)
|
|
68
|
+
// (async () => {
|
|
69
|
+
// console.log("test for transferObject()")
|
|
70
|
+
// const transferTxn = await signer.transferObject({
|
|
71
|
+
// objectId: obj1,
|
|
72
|
+
// gasBudget: gasBudget,
|
|
73
|
+
// recipient: receiver,
|
|
74
|
+
// });
|
|
75
|
+
// console.log('transferTxn', transferTxn);
|
|
76
|
+
// })();
|
|
77
|
+
// //Fail (without correct signer)
|
|
78
|
+
// (async () => {
|
|
79
|
+
// console.log("test for executeMoveCall()")
|
|
80
|
+
// const moveCallTxn = await signer.executeMoveCall({
|
|
81
|
+
// packageObjectId: '0x2',
|
|
82
|
+
// module: 'devnet_nft',
|
|
83
|
+
// function: 'mint',
|
|
84
|
+
// typeArguments: [],
|
|
85
|
+
// arguments: [
|
|
86
|
+
// 'Example NFT',
|
|
87
|
+
// 'An NFT created by the wallet Command Line Tool',
|
|
88
|
+
// 'ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty',
|
|
89
|
+
// ],
|
|
90
|
+
// gasBudget: gasBudget,
|
|
91
|
+
// });
|
|
92
|
+
// console.log('moveCallTxn', moveCallTxn);
|
|
93
|
+
// })();
|
|
94
|
+
// //Fail( Error subscribing to event)
|
|
95
|
+
// (async () => {
|
|
96
|
+
// console.log("test for subscribeEvent()")
|
|
97
|
+
// // calls RPC method 'sui_subscribeEvent' with params:
|
|
98
|
+
// // [ { SenderAddress: '0xbff6ccc8707aa517b4f1b95750a2a8c666012df3' } ]
|
|
99
|
+
// const subscriptionId = await provider.subscribeEvent(
|
|
100
|
+
// { SenderAddress: '0xbff6ccc8707aa517b4f1b95750a2a8c666012df3' },
|
|
101
|
+
// (event: SuiEventEnvelope) => {
|
|
102
|
+
// console.log(event)
|
|
103
|
+
// // handle subscription notification message here. This function is called once per subscription message.
|
|
104
|
+
// }
|
|
105
|
+
// );
|
|
106
|
+
// // later, to unsubscribe
|
|
107
|
+
// // calls RPC method 'sui_unsubscribeEvent' with params: [ subscriptionId ]
|
|
108
|
+
// const subFoundAndRemoved = await provider.unsubscribeEvent(subscriptionId);
|
|
109
|
+
// })();
|
|
110
|
+
// //Fail (without correct signer)
|
|
111
|
+
//refer: https://docs.sui.io/build/json-rpc
|
|
112
|
+
// (async () => {
|
|
113
|
+
// console.log("test for publish()")
|
|
114
|
+
// const compiledModules = JSON.parse(
|
|
115
|
+
// execSync(
|
|
116
|
+
// `${cliPath} move build --dump-bytecode-as-base64 --path ${packagePath}`,
|
|
117
|
+
// { encoding: 'utf-8' }
|
|
118
|
+
// )
|
|
119
|
+
// );
|
|
120
|
+
// const modulesInBytes = compiledModules.map((m) =>
|
|
121
|
+
// Array.from(new Base64DataBuffer(m).getData())
|
|
122
|
+
// );
|
|
123
|
+
// const publishTxn = await signer.publish({
|
|
124
|
+
// compiledModules: modulesInBytes,
|
|
125
|
+
// gasBudget: gasBudget,
|
|
126
|
+
// });
|
|
127
|
+
// console.log('publishTxn', publishTxn);
|
|
128
|
+
// })();
|
|
129
|
+
// //Success
|
|
130
|
+
// (async () => {
|
|
131
|
+
// console.log("test for getTransactions()") // return digest
|
|
132
|
+
// let txs = await provider.getTransactionsForObject(
|
|
133
|
+
// obj1
|
|
134
|
+
// )
|
|
135
|
+
// console.log(txs)
|
|
136
|
+
// let tx = await provider.getTransactionWithEffects(
|
|
137
|
+
// txs[0]
|
|
138
|
+
// )
|
|
139
|
+
// console.log(tx)
|
|
140
|
+
// })();
|
|
141
|
+
// //Success
|
|
142
|
+
// (async () => {
|
|
143
|
+
// console.log("test for getEvents()")//input type: EventQuery
|
|
144
|
+
// const senderEvents = await provider.getEvents(
|
|
145
|
+
// { "Transaction": tx1 },
|
|
146
|
+
// null,
|
|
147
|
+
// null,
|
|
148
|
+
// );
|
|
149
|
+
// for (let e of senderEvents.data) {
|
|
150
|
+
// console.log(e.event)
|
|
151
|
+
// }
|
|
152
|
+
// })();
|
|
153
|
+
// let packageId = "0xfbbdd33ab4c02e7a315e2477931bae4cbdf46381";
|
|
154
|
+
// let registry = "0x0a9d87a1b6c00415708d2f1c62784b52f797213c";
|
|
155
|
+
// let coin = "0x84e5c5702bfbb00a830fb43e720a3a412cc2a8db";
|
|
156
|
+
// console.log("test for deposit()")
|
|
157
|
+
// await deposit(packageId, registry, coin)
|
|
158
|
+
// async function deposit(packageId: string, registry: string, coin: string) {
|
|
159
|
+
// let txn = {
|
|
160
|
+
// packageObjectId: packageId,
|
|
161
|
+
// module: 'shark_fin',
|
|
162
|
+
// function: 'deposit',
|
|
163
|
+
// typeArguments: ["0x2::sui::SUI"],
|
|
164
|
+
// arguments: [
|
|
165
|
+
// registry,
|
|
166
|
+
// 0,
|
|
167
|
+
// true,
|
|
168
|
+
// coin
|
|
169
|
+
// ],
|
|
170
|
+
// gasBudget: gasBudget,
|
|
171
|
+
// }
|
|
172
|
+
// const moveCallTxn = await signer.executeMoveCall(txn);
|
|
173
|
+
// console.log('moveCallTxn', moveCallTxn);
|
|
174
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var getAuthorizedNewPortfolioVaultTx_1 = require("../../utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx");
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
43
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
44
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
45
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var typeArguments, optionType, period, activationTsMs, expirationTsMs, dTokenDecimal, bTokenDecimal, oTokenDecimal, capacity, strikePct, weight, isBuyer, strikeIncrement, lotSize, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage, hasNext, gasBudget, claimTx, res;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
typeArguments = ["0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC"];
|
|
51
|
+
optionType = "0";
|
|
52
|
+
period = "0";
|
|
53
|
+
activationTsMs = "1678694400000";
|
|
54
|
+
expirationTsMs = "1678780800000";
|
|
55
|
+
dTokenDecimal = "9";
|
|
56
|
+
bTokenDecimal = "9";
|
|
57
|
+
oTokenDecimal = "9";
|
|
58
|
+
capacity = "1000000000000";
|
|
59
|
+
strikePct = ["10254"];
|
|
60
|
+
weight = ["1"];
|
|
61
|
+
isBuyer = [false];
|
|
62
|
+
strikeIncrement = "20000000000";
|
|
63
|
+
lotSize = "100000";
|
|
64
|
+
decaySpeed = "1";
|
|
65
|
+
initialPrice = "12176899";
|
|
66
|
+
finalPrice = "1791643";
|
|
67
|
+
auctionDurationInMs = "3600000";
|
|
68
|
+
whitelist = [];
|
|
69
|
+
leverage = "100";
|
|
70
|
+
hasNext = true;
|
|
71
|
+
gasBudget = 100000;
|
|
72
|
+
return [4 /*yield*/, (0, getAuthorizedNewPortfolioVaultTx_1.getAuthorizedNewPortfolioVaultTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, constants_1.TIME_ORACLE, optionType, period, activationTsMs, expirationTsMs, dTokenDecimal, bTokenDecimal, oTokenDecimal, capacity, strikePct, weight, isBuyer, strikeIncrement, lotSize, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage, hasNext)];
|
|
73
|
+
case 1:
|
|
74
|
+
claimTx = _a.sent();
|
|
75
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
76
|
+
case 2:
|
|
77
|
+
res = _a.sent();
|
|
78
|
+
console.log(res);
|
|
79
|
+
return [2 /*return*/];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var getAuthorizedUpdateUpcomingVaultConfigTx_1 = require("../../utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx");
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
43
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
44
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
45
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var typeArguments, index, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, strikePct, weight, isBuyer, gasBudget, claimTx, res;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
typeArguments = ["0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC"];
|
|
51
|
+
index = "0";
|
|
52
|
+
strikeIncrement = "20000000000";
|
|
53
|
+
decaySpeed = "1";
|
|
54
|
+
initialPrice = "12176899";
|
|
55
|
+
finalPrice = "1791643";
|
|
56
|
+
auctionDurationInMs = "1800000";
|
|
57
|
+
strikePct = ["10254"];
|
|
58
|
+
weight = ["1"];
|
|
59
|
+
isBuyer = [false];
|
|
60
|
+
gasBudget = 100000;
|
|
61
|
+
return [4 /*yield*/, (0, getAuthorizedUpdateUpcomingVaultConfigTx_1.getAuthorizedUpdateUpcomingVaultConfigTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, constants_1.REGISTRY, typeArguments, index, strikePct, weight, isBuyer, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs)];
|
|
62
|
+
case 1:
|
|
63
|
+
claimTx = _a.sent();
|
|
64
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
65
|
+
case 2:
|
|
66
|
+
res = _a.sent();
|
|
67
|
+
console.log(res);
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var constants_1 = require("../../constants");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var getAuthorizedUpdateWarmupVaultConfigTx_1 = require("../../utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx");
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
43
|
+
var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
|
|
44
|
+
var signer = new sui_js_1.RawSigner(keypair, provider);
|
|
45
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var typeArguments, index, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, gasBudget, claimTx, res;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
typeArguments = ["0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC", "0x8ccdddc0e8d9287953375ae83cda731d7c75e0ec::btc::BTC"];
|
|
51
|
+
index = "0";
|
|
52
|
+
strikeIncrement = "20000000000";
|
|
53
|
+
decaySpeed = "1";
|
|
54
|
+
initialPrice = "12176899";
|
|
55
|
+
finalPrice = "1791643";
|
|
56
|
+
auctionDurationInMs = "1800000";
|
|
57
|
+
gasBudget = 100000;
|
|
58
|
+
return [4 /*yield*/, (0, getAuthorizedUpdateWarmupVaultConfigTx_1.getAuthorizedUpdateWarmupVaultConfigTx)(gasBudget, constants_1.PORTFOLIO_PACKAGE, typeArguments, constants_1.REGISTRY, index, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs)];
|
|
59
|
+
case 1:
|
|
60
|
+
claimTx = _a.sent();
|
|
61
|
+
return [4 /*yield*/, signer.executeMoveCall(claimTx)];
|
|
62
|
+
case 2:
|
|
63
|
+
res = _a.sent();
|
|
64
|
+
console.log(res);
|
|
65
|
+
return [2 /*return*/];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var getBid_1 = require("../utils/auction/getBid");
|
|
40
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
41
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
42
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
43
|
+
var vault, bid;
|
|
44
|
+
return __generator(this, function (_a) {
|
|
45
|
+
switch (_a.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
vault = "0x1e5807f118c2fc7e0f74eeb439b34f448532a900";
|
|
48
|
+
return [4 /*yield*/, (0, getBid_1.getBid)(vault, provider)];
|
|
49
|
+
case 1:
|
|
50
|
+
bid = _a.sent();
|
|
51
|
+
console.log(bid);
|
|
52
|
+
return [2 /*return*/];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var constants_1 = require("../constants");
|
|
40
|
+
var getVaultData_1 = require("../utils/getVaultData");
|
|
41
|
+
var sui_js_1 = require("@mysten/sui.js");
|
|
42
|
+
var provider = new sui_js_1.JsonRpcProvider(sui_js_1.devnetConnection); //for read only operations
|
|
43
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var res;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0: return [4 /*yield*/, (0, getVaultData_1.getVaultDataFromRegistry)(constants_1.REGISTRY, provider)];
|
|
48
|
+
case 1:
|
|
49
|
+
res = _a.sent();
|
|
50
|
+
console.log("vault: ");
|
|
51
|
+
console.log(res);
|
|
52
|
+
return [2 /*return*/];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}); })();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|