@typus/typus-sdk 0.1.3 → 0.1.4

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.
Files changed (67) hide show
  1. package/lib/constants.d.ts +9 -9
  2. package/lib/constants.js +15 -11
  3. package/lib/scripts/coveredCall/{getCoveredCallDepositTx.d.ts → getDeliveryTx.d.ts} +0 -0
  4. package/lib/scripts/coveredCall/{getCoveredCallUnsubscribeTx.js → getDeliveryTx.js} +6 -6
  5. package/lib/scripts/{getDepositTx.d.ts → coveredCall/getDepositTx.d.ts} +0 -0
  6. package/lib/scripts/{getDepositTx.js → coveredCall/getDepositTx.js} +7 -8
  7. package/lib/scripts/coveredCall/{getCoveredCallUnsubscribeTx.d.ts → getNewAuctionTx.d.ts} +0 -0
  8. package/lib/scripts/{getNewSharkFinVaultTx.js → coveredCall/getNewAuctionTx.js} +13 -11
  9. package/lib/scripts/{getNewSharkFinVaultTx.d.ts → coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts} +0 -0
  10. package/lib/scripts/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +65 -0
  11. package/lib/scripts/coveredCall/getNewBidTx.d.ts +1 -0
  12. package/lib/scripts/coveredCall/getNewBidTx.js +59 -0
  13. package/lib/scripts/coveredCall/getNewCoveredCallVaultTx.js +4 -2
  14. package/lib/scripts/coveredCall/getRemoveBidTx.d.ts +1 -0
  15. package/lib/scripts/coveredCall/getRemoveBidTx.js +56 -0
  16. package/lib/scripts/coveredCall/getSubscribeTx.d.ts +1 -0
  17. package/lib/scripts/coveredCall/getSubscribeTx.js +55 -0
  18. package/lib/scripts/coveredCall/getUnsubscribeTx.d.ts +1 -0
  19. package/lib/scripts/coveredCall/getUnsubscribeTx.js +55 -0
  20. package/lib/scripts/coveredCall/getWithdrawTx.d.ts +1 -0
  21. package/lib/scripts/coveredCall/{getCoveredCallDepositTx.js → getWithdrawTx.js} +6 -7
  22. package/lib/scripts/getNewOracleTx.js +3 -3
  23. package/lib/scripts/getUpdateOracleTx.js +1 -1
  24. package/lib/test/testCrypto.d.ts +1 -0
  25. package/lib/test/testCrypto.js +54 -0
  26. package/lib/test/testDeposit.js +16 -43
  27. package/lib/test/testDepositV2.d.ts +0 -1
  28. package/lib/test/testDepositV2.js +61 -168
  29. package/lib/test/testMint.js +70 -30
  30. package/lib/test/testNewVault.d.ts +1 -0
  31. package/lib/test/testNewVault.js +171 -0
  32. package/lib/test/testOracle.js +4 -3
  33. package/lib/test/testSubscribeEvent.d.ts +1 -0
  34. package/lib/test/testSubscribeEvent.js +97 -0
  35. package/lib/test/testUnsubscribe.d.ts +1 -0
  36. package/lib/test/testUnsubscribe.js +86 -0
  37. package/lib/utils/auction/sealedAuction.d.ts +33 -0
  38. package/lib/utils/auction/sealedAuction.js +64 -0
  39. package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -0
  40. package/lib/utils/coveredCall/{getCoveredCallDepositTx.js → getDeliveryTx.js} +5 -10
  41. package/lib/utils/{getDepositTx.d.ts → coveredCall/getDepositTx.d.ts} +0 -0
  42. package/lib/utils/{getDepositTx.js → coveredCall/getDepositTx.js} +3 -3
  43. package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -0
  44. package/lib/utils/{getNewSharkFinVaultTx.js → coveredCall/getNewAuctionTx.js} +15 -13
  45. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -0
  46. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +69 -0
  47. package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -0
  48. package/lib/utils/coveredCall/getNewBidTx.js +62 -0
  49. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
  50. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +3 -2
  51. package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -0
  52. package/lib/utils/coveredCall/getRemoveBidTx.js +60 -0
  53. package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -0
  54. package/lib/utils/coveredCall/getSubscribeTx.js +59 -0
  55. package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -0
  56. package/lib/utils/coveredCall/{getCoveredCallUnsubscribeTx.js → getUnsubscribeTx.js} +3 -3
  57. package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -0
  58. package/lib/utils/coveredCall/getWithdrawTx.js +61 -0
  59. package/lib/utils/getNewOracleTx.d.ts +1 -1
  60. package/lib/utils/getNewOracleTx.js +2 -2
  61. package/lib/utils/getSubVault.js +1 -1
  62. package/lib/utils/getTypeArgumentFromToken.d.ts +1 -0
  63. package/lib/utils/getTypeArgumentFromToken.js +67 -0
  64. package/package.json +6 -2
  65. package/lib/utils/coveredCall/getCoveredCallDepositTx.d.ts +0 -1
  66. package/lib/utils/coveredCall/getCoveredCallUnsubscribeTx.d.ts +0 -1
  67. package/lib/utils/getNewSharkFinVaultTx.d.ts +0 -1
@@ -1,13 +1,13 @@
1
- export declare const TOKEN_PACKAGE = "0xe879e96fb90a8559127091f1176a2d10bb67c6ff";
2
- export declare const TOKEN_REGISTRY = "0x5dce92f67eeda471369b734deac0d540b751cea6";
3
- export declare const SHARKFIN_PACKAGE = "0x3085e089d748e09ae2a5859531ec3bc34b1e13b4";
4
- export declare const SHARKFIN_REGISTRY = "0xd27515bcf75daba9cff1da5b93bd4f08c781cea2";
5
- export declare const DOV_PACKAGE = "0x6fbe0bd487e9ca263f682f8d192750ef4ecce73d";
6
- export declare const COVERED_CALL_PACKAGE = "0x1543511bdce9ea3c401c4939126cea518adee965";
7
- export declare const COVERED_CALL_REGISTRY = "0xb02452d0bbef3cbdc7840ea5bad27bcdd4031675";
8
- export declare const COVERED_CALL_MANAGER = "0x8517b2dbaae56eeb84352e4869b289459c68965b";
1
+ export declare const TOKEN_PACKAGE = "0xd73d20a3ca73054ef56af95754698af0f587f90d";
2
+ export declare const TOKEN_REGISTRY = "0x882541280791e5c2a2eb386d1f36be220461d471";
3
+ export declare const ORACLE_PACKAGE = "0xe85eabdada216e470344b2e70cdc8155a4007a2a";
4
+ export declare const COVERED_CALL_PACKAGE = "0xc33f18cc20a5c17c41ef9e054e1b37f60d804d9c";
5
+ export declare const COVERED_CALL_REGISTRY = "0x6c17473d6b1252db26278ec5818ef3bfdca75c89";
6
+ export declare const COVERED_CALL_MANAGER = "0xe004885ef67c7af37b96f8313738bb758d51b6d3";
7
+ export declare const DOV_PACKAGE = "0x461c7f49f322c3b12523f51c8b8f00d6e0eda243";
9
8
  export declare const DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
10
- export declare const TEST_MNEMONIC = "tackle wheat jungle viable memory dwarf swift fold purpose cattle impose horn";
9
+ export declare const FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
10
+ export declare const TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
11
11
  export declare const TOKEN_NAME: string[];
12
12
  export declare const TOKEN_NAME_TO_MODULE: {
13
13
  BTC: string;
package/lib/constants.js CHANGED
@@ -1,19 +1,23 @@
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.DEFAULT_TYPE_ARGUMENT = exports.COVERED_CALL_MANAGER = exports.COVERED_CALL_REGISTRY = exports.COVERED_CALL_PACKAGE = exports.DOV_PACKAGE = exports.SHARKFIN_REGISTRY = exports.SHARKFIN_PACKAGE = exports.TOKEN_REGISTRY = exports.TOKEN_PACKAGE = void 0;
4
- exports.TOKEN_PACKAGE = "0xe879e96fb90a8559127091f1176a2d10bb67c6ff";
5
- exports.TOKEN_REGISTRY = "0x5dce92f67eeda471369b734deac0d540b751cea6"; //fake btc registry
6
- exports.SHARKFIN_PACKAGE = "0x3085e089d748e09ae2a5859531ec3bc34b1e13b4";
7
- exports.SHARKFIN_REGISTRY = "0xd27515bcf75daba9cff1da5b93bd4f08c781cea2";
8
- exports.DOV_PACKAGE = "0x6fbe0bd487e9ca263f682f8d192750ef4ecce73d";
9
- exports.COVERED_CALL_PACKAGE = "0x1543511bdce9ea3c401c4939126cea518adee965";
10
- exports.COVERED_CALL_REGISTRY = "0xb02452d0bbef3cbdc7840ea5bad27bcdd4031675";
11
- exports.COVERED_CALL_MANAGER = "0x8517b2dbaae56eeb84352e4869b289459c68965b";
3
+ exports.TOKEN_NAME_TO_MODULE = exports.TOKEN_NAME = exports.TEST_MNEMONIC = exports.FAKE_TOKEN_TYPE_ARGUMENT = exports.DEFAULT_TYPE_ARGUMENT = exports.DOV_PACKAGE = exports.COVERED_CALL_MANAGER = exports.COVERED_CALL_REGISTRY = exports.COVERED_CALL_PACKAGE = exports.ORACLE_PACKAGE = exports.TOKEN_REGISTRY = exports.TOKEN_PACKAGE = void 0;
4
+ //publish from sui-dev-token
5
+ exports.TOKEN_PACKAGE = "0xd73d20a3ca73054ef56af95754698af0f587f90d";
6
+ exports.TOKEN_REGISTRY = "0x882541280791e5c2a2eb386d1f36be220461d471"; //fake btc registry
7
+ //publish from typus-oracle
8
+ exports.ORACLE_PACKAGE = "0xe85eabdada216e470344b2e70cdc8155a4007a2a";
9
+ //publish from typus-dov/cover_call
10
+ exports.COVERED_CALL_PACKAGE = "0xc33f18cc20a5c17c41ef9e054e1b37f60d804d9c";
11
+ exports.COVERED_CALL_REGISTRY = "0x6c17473d6b1252db26278ec5818ef3bfdca75c89";
12
+ exports.COVERED_CALL_MANAGER = "0xe004885ef67c7af37b96f8313738bb758d51b6d3";
13
+ //publish from typus-dov/typus-dov
14
+ exports.DOV_PACKAGE = "0x461c7f49f322c3b12523f51c8b8f00d6e0eda243";
12
15
  exports.DEFAULT_TYPE_ARGUMENT = "0x2::sui::SUI";
13
- exports.TEST_MNEMONIC = "tackle wheat jungle viable memory dwarf swift fold purpose cattle impose horn";
16
+ exports.FAKE_TOKEN_TYPE_ARGUMENT = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
17
+ exports.TEST_MNEMONIC = "plug grain matter asthma aware critic can lottery blouse uncover sauce speak";
14
18
  exports.TOKEN_NAME = ["BTC", "ETH", "SUI", "USDC", "USDT"];
15
19
  exports.TOKEN_NAME_TO_MODULE = {
16
- "BTC": "token_btc",
20
+ "BTC": "btc",
17
21
  "ETH": "token_eth",
18
22
  "SUI": "token_sui",
19
23
  "USDC": "token_usdc",
@@ -36,19 +36,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var getCoveredCallUnsubscribeTx_1 = require("../../utils/coveredCall/getCoveredCallUnsubscribeTx");
39
+ var getDeliveryTx_1 = require("../../utils/coveredCall/getDeliveryTx");
40
40
  var constants_1 = require("../../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var index, coveredCallUnsubscribeTx;
42
+ var index, deliveryTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
- console.log("test for getCoveredCallUnsubscribeTx()");
46
+ console.log("test for getSubscribeTx()");
47
47
  index = 0;
48
- return [4 /*yield*/, (0, getCoveredCallUnsubscribeTx_1.getCoveredCallUnsubscribeTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
48
+ return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
49
49
  case 1:
50
- coveredCallUnsubscribeTx = _a.sent();
51
- console.log(coveredCallUnsubscribeTx);
50
+ deliveryTx = _a.sent();
51
+ console.log(deliveryTx);
52
52
  return [2 /*return*/];
53
53
  }
54
54
  });
@@ -36,20 +36,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var getDepositTx_1 = require("../utils/getDepositTx");
40
- var constants_1 = require("../constants");
39
+ var getDepositTx_1 = require("../../utils/coveredCall/getDepositTx");
40
+ var constants_1 = require("../../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var isRolling, typeArgument, vaultIndex, coin, amount, depositTx;
42
+ var index, rolling, coin, amount, depositTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
46
  console.log("test for getDepositTx()");
47
- isRolling = true;
48
- typeArgument = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
49
- vaultIndex = 1;
50
- coin = "0x51537ac6fdbe920db8319e3fa41b764d721cc46e";
47
+ index = 0;
48
+ rolling = true;
49
+ coin = "";
51
50
  amount = 9999;
52
- return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.SHARKFIN_PACKAGE, constants_1.SHARKFIN_REGISTRY, typeArgument, vaultIndex, isRolling, coin, amount)];
51
+ return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.FAKE_TOKEN_TYPE_ARGUMENT, index, rolling, coin, amount)];
53
52
  case 1:
54
53
  depositTx = _a.sent();
55
54
  console.log(depositTx);
@@ -36,23 +36,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var getNewSharkFinVaultTx_1 = require("../utils/getNewSharkFinVaultTx");
40
- var constants_1 = require("../constants");
39
+ var getNewAuctionTx_1 = require("../../utils/coveredCall/getNewAuctionTx");
40
+ var constants_1 = require("../../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice, newSharkFinVaultTx;
42
+ var typeArgument, vaultIndex, start, end, decay, initialPrice, finalPrice, newAuctionTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
- console.log("test for getNewSharkFinVaultTx()");
46
+ console.log("test for getNewAuctionTx()");
47
47
  typeArgument = "0x27b3674c685046f66cad1d5496d2967894fa5329::token::USDC";
48
- expiration = 1671344789;
49
- bullish = true;
50
- lowBarrierPrice = 1;
51
- highBarrierPrice = 10;
52
- return [4 /*yield*/, (0, getNewSharkFinVaultTx_1.getNewSharkFinVaultTx)(constants_1.SHARKFIN_PACKAGE, constants_1.SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice)];
48
+ vaultIndex = 1;
49
+ start = 1;
50
+ end = 100;
51
+ decay = 0;
52
+ initialPrice = 1;
53
+ finalPrice = 100;
54
+ return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex, start, end, decay, initialPrice, finalPrice)];
53
55
  case 1:
54
- newSharkFinVaultTx = _a.sent();
55
- console.log(newSharkFinVaultTx);
56
+ newAuctionTx = _a.sent();
57
+ console.log(newAuctionTx);
56
58
  return [2 /*return*/];
57
59
  }
58
60
  });
@@ -0,0 +1,65 @@
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 (_) 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 getNewAuctionWithNextCoveredCallVaultTx_1 = require("../../utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx");
40
+ var constants_1 = require("../../constants");
41
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
42
+ var index, start, end, decay, initialPrice, finalPrice, expiration, assetName, strikeOtmPct, priceOracle, newAuctionWithNextCoveredCallVaultTx;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0:
46
+ console.log("test for getNewAuctionWithNextCoveredCallVaultTx()");
47
+ index = 1;
48
+ start = 10;
49
+ end = 20;
50
+ decay = 2;
51
+ initialPrice = 5;
52
+ finalPrice = 1;
53
+ expiration = 2000;
54
+ assetName = "BTC";
55
+ strikeOtmPct = 2000;
56
+ priceOracle = "" // new oracle by new_oracle
57
+ ;
58
+ return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, start, end, decay, initialPrice, finalPrice, expiration, assetName, strikeOtmPct, priceOracle)];
59
+ case 1:
60
+ newAuctionWithNextCoveredCallVaultTx = _a.sent();
61
+ console.log(newAuctionWithNextCoveredCallVaultTx);
62
+ return [2 /*return*/];
63
+ }
64
+ });
65
+ }); })();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
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 (_) 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 getNewBidTx_1 = require("../../utils/coveredCall/getNewBidTx");
40
+ var constants_1 = require("../../constants");
41
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
42
+ var index, size, coin, time, newBidTx;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0:
46
+ console.log("test for getNewBidTx()");
47
+ index = 0;
48
+ size = 1;
49
+ coin = "";
50
+ time = "" //publish from typus-oracle->new_time()
51
+ ;
52
+ return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, size, coin, time)];
53
+ case 1:
54
+ newBidTx = _a.sent();
55
+ console.log(newBidTx);
56
+ return [2 /*return*/];
57
+ }
58
+ });
59
+ }); })();
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var getNewCoveredCallVaultTx_1 = require("../../utils/coveredCall/getNewCoveredCallVaultTx");
40
40
  var constants_1 = require("../../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var expiration, assetName, strike, newCoveredCallVaultTx;
42
+ var expiration, assetName, strike, oracle, newCoveredCallVaultTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
@@ -47,7 +47,9 @@ var constants_1 = require("../../constants");
47
47
  expiration = 123;
48
48
  assetName = "sui";
49
49
  strike = 456;
50
- return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, constants_1.COVERED_CALL_MANAGER, expiration, assetName, strike)];
50
+ oracle = "0x7158f68a06bc09123fcba1645f4c56ca866a8e90" //created from "new oracle"
51
+ ;
52
+ return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, constants_1.COVERED_CALL_MANAGER, expiration, assetName, strike, oracle)];
51
53
  case 1:
52
54
  newCoveredCallVaultTx = _a.sent();
53
55
  console.log(newCoveredCallVaultTx);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
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 (_) 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 getRemoveBidTx_1 = require("../../utils/coveredCall/getRemoveBidTx");
40
+ var constants_1 = require("../../constants");
41
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
42
+ var index, bidIndex, removeBidTx;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0:
46
+ console.log("test for getRemoveBidTx()");
47
+ index = 0;
48
+ bidIndex = 1;
49
+ return [4 /*yield*/, (0, getRemoveBidTx_1.getRemoveBidTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, bidIndex)];
50
+ case 1:
51
+ removeBidTx = _a.sent();
52
+ console.log(removeBidTx);
53
+ return [2 /*return*/];
54
+ }
55
+ });
56
+ }); })();
@@ -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 (_) 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 getSubscribeTx_1 = require("../../utils/coveredCall/getSubscribeTx");
40
+ var constants_1 = require("../../constants");
41
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
42
+ var index, subscribeTx;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0:
46
+ console.log("test for getSubscribeTx()");
47
+ index = 0;
48
+ return [4 /*yield*/, (0, getSubscribeTx_1.getSubscribeTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
49
+ case 1:
50
+ subscribeTx = _a.sent();
51
+ console.log(subscribeTx);
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 (_) 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 getUnsubscribeTx_1 = require("../../utils/coveredCall/getUnsubscribeTx");
40
+ var constants_1 = require("../../constants");
41
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
42
+ var index, unsubscribeTx;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0:
46
+ console.log("test for getUnsubscribeTx()");
47
+ index = 0;
48
+ return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index)];
49
+ case 1:
50
+ unsubscribeTx = _a.sent();
51
+ console.log(unsubscribeTx);
52
+ return [2 /*return*/];
53
+ }
54
+ });
55
+ }); })();
@@ -0,0 +1 @@
1
+ export {};
@@ -36,22 +36,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var getCoveredCallDepositTx_1 = require("../../utils/coveredCall/getCoveredCallDepositTx");
39
+ var getWithdrawTx_1 = require("../../utils/coveredCall/getWithdrawTx");
40
40
  var constants_1 = require("../../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var index, rolling, coin, amount, coveredCallDepositTx;
42
+ var index, rolling, amount, withdrawTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
- console.log("test for getCoveredCallDepositTx()");
46
+ console.log("test for getWithdrawTx()");
47
47
  index = 0;
48
48
  rolling = true;
49
- coin = "";
50
49
  amount = 9999;
51
- return [4 /*yield*/, (0, getCoveredCallDepositTx_1.getCoveredCallDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.DEFAULT_TYPE_ARGUMENT, index, rolling, coin, amount)];
50
+ return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, constants_1.FAKE_TOKEN_TYPE_ARGUMENT, index, rolling, amount)];
52
51
  case 1:
53
- coveredCallDepositTx = _a.sent();
54
- console.log(coveredCallDepositTx);
52
+ withdrawTx = _a.sent();
53
+ console.log(withdrawTx);
55
54
  return [2 /*return*/];
56
55
  }
57
56
  });
@@ -39,13 +39,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var getNewOracleTx_1 = require("../utils/getNewOracleTx");
40
40
  var constants_1 = require("../constants");
41
41
  (function () { return __awaiter(void 0, void 0, void 0, function () {
42
- var typeArgument, newOracleTx;
42
+ var decimal, newOracleTx;
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
46
  console.log("test for getNewOracleTx()");
47
- typeArgument = "0x2::sui::SUI";
48
- return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(constants_1.TOKEN_PACKAGE, typeArgument)];
47
+ decimal = 8;
48
+ return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(constants_1.TOKEN_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, decimal)];
49
49
  case 1:
50
50
  newOracleTx = _a.sent();
51
51
  console.log(newOracleTx);
@@ -50,7 +50,7 @@ var constants_1 = require("../constants");
50
50
  ;
51
51
  price = 1234;
52
52
  unix = 5678;
53
- return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.DOV_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, oracle, managerCap, price, unix)];
53
+ return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, oracle, managerCap, price, unix)];
54
54
  case 1:
55
55
  updateOracleTx = _a.sent();
56
56
  console.log(updateOracleTx);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,54 @@
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 (_) 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 sealedAuction_1 = require("../utils/auction/sealedAuction");
40
+ (function () { return __awaiter(void 0, void 0, void 0, function () {
41
+ var price, size, secret, encryptedBid, hash, bid;
42
+ return __generator(this, function (_a) {
43
+ price = BigInt(100);
44
+ size = BigInt(2);
45
+ secret = "my secret";
46
+ encryptedBid = (0, sealedAuction_1.encryptBid)(price, size, secret);
47
+ console.log("encryptedBid: ", encryptedBid);
48
+ hash = (0, sealedAuction_1.getBidHash)(price, size, encryptedBid[0]);
49
+ console.log("hash: ", hash);
50
+ bid = (0, sealedAuction_1.decryptBid)(encryptedBid[1], "my secret");
51
+ console.log("bid: ", bid);
52
+ return [2 /*return*/];
53
+ });
54
+ }); })();