@typus/typus-sdk 1.0.26 → 1.0.28

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 (66) hide show
  1. package/lib/constants.d.ts +0 -15
  2. package/lib/constants.js +1 -29
  3. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/authorized-entry.js +7 -7
  4. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/manager-entry.js +18 -18
  5. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/portfolio-vault.d.ts +2 -2
  6. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/portfolio-vault.js +2 -2
  7. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/user-entry.js +9 -9
  8. package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/view-function.d.ts +4 -2
  9. package/lib/utils/{portfolio/multiple-collateral/user-share.js → typus-dov-double/view-function.js} +50 -3
  10. package/lib/utils/{portfolio/single-collateral → typus-dov-single}/portfolio-vault.d.ts +2 -2
  11. package/lib/utils/{portfolio/single-collateral → typus-dov-single}/portfolio-vault.js +2 -2
  12. package/lib/utils/{portfolio/single-collateral → typus-dov-single}/user-entry.js +8 -8
  13. package/lib/utils/{portfolio/single-collateral → typus-dov-single}/view-function.d.ts +2 -1
  14. package/lib/utils/{portfolio/single-collateral/user-share.js → typus-dov-single/view-function.js} +60 -3
  15. package/package.json +2 -2
  16. package/lib/config.json +0 -33
  17. package/lib/utils/portfolio/multiple-collateral/user-share.d.ts +0 -9
  18. package/lib/utils/portfolio/multiple-collateral/view-function.js +0 -88
  19. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +0 -5
  20. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +0 -61
  21. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedDeliveryTx.d.ts +0 -2
  22. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedDeliveryTx.js +0 -63
  23. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +0 -39
  24. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedNewPortfolioVaultTx.js +0 -118
  25. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +0 -5
  26. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +0 -61
  27. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateCapacityTx.d.ts +0 -2
  28. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateCapacityTx.js +0 -58
  29. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +0 -5
  30. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.js +0 -72
  31. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +0 -2
  32. package/lib/utils/portfolio/single-collateral/authorized/getAuthorizedUpdateWarmupVaultConfigTx.js +0 -66
  33. package/lib/utils/portfolio/single-collateral/manager/getAddAuthorizedUserTx.d.ts +0 -9
  34. package/lib/utils/portfolio/single-collateral/manager/getAddAuthorizedUserTx.js +0 -65
  35. package/lib/utils/portfolio/single-collateral/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +0 -11
  36. package/lib/utils/portfolio/single-collateral/manager/getAddPortfolioVaultAuthorizedUserTx.js +0 -67
  37. package/lib/utils/portfolio/single-collateral/manager/getCloseAuctionTx.d.ts +0 -2
  38. package/lib/utils/portfolio/single-collateral/manager/getCloseAuctionTx.js +0 -64
  39. package/lib/utils/portfolio/single-collateral/manager/getCloseVaultTx.d.ts +0 -2
  40. package/lib/utils/portfolio/single-collateral/manager/getCloseVaultTx.js +0 -58
  41. package/lib/utils/portfolio/single-collateral/manager/getDeliveryTx.d.ts +0 -2
  42. package/lib/utils/portfolio/single-collateral/manager/getDeliveryTx.js +0 -64
  43. package/lib/utils/portfolio/single-collateral/manager/getEvolutionTx.d.ts +0 -16
  44. package/lib/utils/portfolio/single-collateral/manager/getEvolutionTx.js +0 -80
  45. package/lib/utils/portfolio/single-collateral/manager/getNewManagerTx.d.ts +0 -9
  46. package/lib/utils/portfolio/single-collateral/manager/getNewManagerTx.js +0 -65
  47. package/lib/utils/portfolio/single-collateral/manager/getNewPortfolioVaultTx.d.ts +0 -39
  48. package/lib/utils/portfolio/single-collateral/manager/getNewPortfolioVaultTx.js +0 -118
  49. package/lib/utils/portfolio/single-collateral/manager/getRemoveAuthorizedUserTx.d.ts +0 -9
  50. package/lib/utils/portfolio/single-collateral/manager/getRemoveAuthorizedUserTx.js +0 -65
  51. package/lib/utils/portfolio/single-collateral/manager/getRemoveManagerTx.d.ts +0 -7
  52. package/lib/utils/portfolio/single-collateral/manager/getRemoveManagerTx.js +0 -63
  53. package/lib/utils/portfolio/single-collateral/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +0 -11
  54. package/lib/utils/portfolio/single-collateral/manager/getRemovePortfolioVaultAuthorizedUserTx.js +0 -67
  55. package/lib/utils/portfolio/single-collateral/manager/getUpdateCapacityTx.d.ts +0 -2
  56. package/lib/utils/portfolio/single-collateral/manager/getUpdateCapacityTx.js +0 -58
  57. package/lib/utils/portfolio/single-collateral/user-share.d.ts +0 -8
  58. package/lib/utils/portfolio/single-collateral/view-function.js +0 -98
  59. /package/lib/utils/{portfolio/leader-board.d.ts → leader-board.d.ts} +0 -0
  60. /package/lib/utils/{portfolio/leader-board.js → leader-board.js} +0 -0
  61. /package/lib/utils/{portfolio/mint.d.ts → mint.d.ts} +0 -0
  62. /package/lib/utils/{portfolio/mint.js → mint.js} +0 -0
  63. /package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/authorized-entry.d.ts +0 -0
  64. /package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/manager-entry.d.ts +0 -0
  65. /package/lib/utils/{portfolio/multiple-collateral → typus-dov-double}/user-entry.d.ts +0 -0
  66. /package/lib/utils/{portfolio/single-collateral → typus-dov-single}/user-entry.d.ts +0 -0
@@ -52,9 +52,10 @@ var __read = (this && this.__read) || function (o, n) {
52
52
  return ar;
53
53
  };
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getUserShares = void 0;
55
+ exports.getMaxLossPerUnit = exports.getAuctionMaxSize = exports.getUserShares = void 0;
56
56
  var sui_js_1 = require("@mysten/sui.js");
57
- var tools_1 = require("../../tools");
57
+ var tools_1 = require("../tools");
58
+ var constants_1 = require("../../constants");
58
59
  function getUserShares(provider, packageId, registry, indexes, user) {
59
60
  return __awaiter(this, void 0, void 0, function () {
60
61
  var transactionBlock, target, transactionBlockArguments, bytes, result, user_share_bytes, index, tag, share;
@@ -62,7 +63,7 @@ function getUserShares(provider, packageId, registry, indexes, user) {
62
63
  switch (_a.label) {
63
64
  case 0:
64
65
  transactionBlock = new sui_js_1.TransactionBlock();
65
- target = "".concat(packageId, "::single_collateral::get_user_shares");
66
+ target = "".concat(packageId, "::typus_dov_single::get_user_shares");
66
67
  transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes), transactionBlock.pure(user)];
67
68
  transactionBlock.moveCall({
68
69
  target: target,
@@ -137,3 +138,59 @@ function getUserShares(provider, packageId, registry, indexes, user) {
137
138
  });
138
139
  }
139
140
  exports.getUserShares = getUserShares;
141
+ function getAuctionMaxSize(provider, packageId, typeArguments, registry, index, priceOracle) {
142
+ return __awaiter(this, void 0, void 0, function () {
143
+ var transactionBlock, target, transactionBlockArguments, bytes;
144
+ return __generator(this, function (_a) {
145
+ switch (_a.label) {
146
+ case 0:
147
+ transactionBlock = new sui_js_1.TransactionBlock();
148
+ target = "".concat(packageId, "::typus_dov_single::get_auction_max_size");
149
+ transactionBlockArguments = [
150
+ transactionBlock.pure(registry),
151
+ transactionBlock.pure(index),
152
+ transactionBlock.pure(priceOracle),
153
+ transactionBlock.pure(constants_1.CLOCK),
154
+ ];
155
+ transactionBlock.moveCall({
156
+ target: target,
157
+ typeArguments: typeArguments,
158
+ arguments: transactionBlockArguments,
159
+ });
160
+ return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
161
+ case 1:
162
+ bytes = (_a.sent()).results[0].returnValues[0][0];
163
+ return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
164
+ }
165
+ });
166
+ });
167
+ }
168
+ exports.getAuctionMaxSize = getAuctionMaxSize;
169
+ function getMaxLossPerUnit(provider, packageId, typeArguments, registry, index, priceOracle) {
170
+ return __awaiter(this, void 0, void 0, function () {
171
+ var transactionBlock, target, transactionBlockArguments, bytes;
172
+ return __generator(this, function (_a) {
173
+ switch (_a.label) {
174
+ case 0:
175
+ transactionBlock = new sui_js_1.TransactionBlock();
176
+ target = "".concat(packageId, "::typus_dov_single::get_max_loss_per_unit");
177
+ transactionBlockArguments = [
178
+ transactionBlock.pure(registry),
179
+ transactionBlock.pure(index),
180
+ transactionBlock.pure(priceOracle),
181
+ transactionBlock.pure(constants_1.CLOCK),
182
+ ];
183
+ transactionBlock.moveCall({
184
+ target: target,
185
+ typeArguments: typeArguments,
186
+ arguments: transactionBlockArguments,
187
+ });
188
+ return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
189
+ case 1:
190
+ bytes = (_a.sent()).results[0].returnValues[0][0];
191
+ return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
192
+ }
193
+ });
194
+ });
195
+ }
196
+ exports.getMaxLossPerUnit = getMaxLossPerUnit;
package/package.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.0.26",
5
+ "version": "1.0.28",
6
6
  "dependencies": {
7
- "@mysten/sui.js": "^0.32.1",
7
+ "@mysten/sui.js": "^0.33.0",
8
8
  "@types/node": "^17.0.0",
9
9
  "bignumber.js": "^9.1.1",
10
10
  "bs58": "^4.0.1",
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
- }
@@ -1,9 +0,0 @@
1
- import { JsonRpcProvider } from "@mysten/sui.js";
2
- import { DepositVaultUserShare, BidVaultUserShare } from "../../typus-framework/vault";
3
- export interface UserShare {
4
- index: string;
5
- tokenDepositVaultUserShare: DepositVaultUserShare;
6
- usdDepositVaultUserShare: DepositVaultUserShare;
7
- bidVaultUserShare: BidVaultUserShare;
8
- }
9
- export declare function getUserShares(provider: JsonRpcProvider, packageId: string, registry: string, indexes: string[], user: string): Promise<Map<string, UserShare>>;
@@ -1,88 +0,0 @@
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
- exports.getMaxLossPerUnit = exports.getAuctionMaxSize = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- var tools_1 = require("../../tools");
42
- var constants_1 = require("../../../constants");
43
- function getAuctionMaxSize(provider, packageId, typeArguments, registry, index) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- var transactionBlock, target, transactionBlockArguments, bytes;
46
- return __generator(this, function (_a) {
47
- switch (_a.label) {
48
- case 0:
49
- transactionBlock = new sui_js_1.TransactionBlock();
50
- target = "".concat(packageId, "::multiple_collateral::get_auction_max_size");
51
- transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
52
- transactionBlock.moveCall({
53
- target: target,
54
- typeArguments: typeArguments,
55
- arguments: transactionBlockArguments,
56
- });
57
- return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
58
- case 1:
59
- bytes = (_a.sent()).results[0].returnValues[0][0];
60
- return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
61
- }
62
- });
63
- });
64
- }
65
- exports.getAuctionMaxSize = getAuctionMaxSize;
66
- function getMaxLossPerUnit(provider, packageId, typeArguments, registry, index) {
67
- return __awaiter(this, void 0, void 0, function () {
68
- var transactionBlock, target, transactionBlockArguments, bytes;
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0:
72
- transactionBlock = new sui_js_1.TransactionBlock();
73
- target = "".concat(packageId, "::multiple_collateral::get_max_loss_per_unit");
74
- transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
75
- transactionBlock.moveCall({
76
- target: target,
77
- typeArguments: typeArguments,
78
- arguments: transactionBlockArguments,
79
- });
80
- return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
81
- case 1:
82
- bytes = (_a.sent()).results[0].returnValues[0][0];
83
- return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
84
- }
85
- });
86
- });
87
- }
88
- exports.getMaxLossPerUnit = getMaxLossPerUnit;
@@ -1,5 +0,0 @@
1
- import { TransactionBlock } from "@mysten/sui.js";
2
- /**
3
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
4
- */
5
- export declare function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, users: string[]): Promise<TransactionBlock>;
@@ -1,61 +0,0 @@
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
- exports.getAuthorizedAddPortfolioVaultAuthorizedUserTx = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- /**
42
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
43
- */
44
- function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, users) {
45
- return __awaiter(this, void 0, void 0, function () {
46
- var tx, target, txArguments;
47
- return __generator(this, function (_a) {
48
- tx = new sui_js_1.TransactionBlock();
49
- target = "".concat(packageId, "::").concat(module, "::authorized_add_portfolio_vault_authorized_user");
50
- txArguments = [tx.pure(registry), tx.pure(index), tx.pure(users)];
51
- tx.moveCall({
52
- target: target,
53
- typeArguments: typeArguments,
54
- arguments: txArguments,
55
- });
56
- tx.setGasBudget(gasBudget);
57
- return [2 /*return*/, tx];
58
- });
59
- });
60
- }
61
- exports.getAuthorizedAddPortfolioVaultAuthorizedUserTx = getAuthorizedAddPortfolioVaultAuthorizedUserTx;
@@ -1,2 +0,0 @@
1
- import { TransactionBlock } from "@mysten/sui.js";
2
- export declare function getAuthorizedDeliveryTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string): Promise<TransactionBlock>;
@@ -1,63 +0,0 @@
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
- exports.getAuthorizedDeliveryTx = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- function getAuthorizedDeliveryTx(gasBudget, packageId, registry, typeArguments, index, priceOracle, timeOracle) {
42
- return __awaiter(this, void 0, void 0, function () {
43
- var tx, target, txArguments;
44
- return __generator(this, function (_a) {
45
- tx = new sui_js_1.TransactionBlock();
46
- target = "".concat(packageId, "::").concat(module, "::authorized_delivery");
47
- txArguments = [
48
- tx.pure(registry),
49
- tx.pure(index),
50
- tx.pure(priceOracle),
51
- tx.pure(timeOracle),
52
- ];
53
- tx.moveCall({
54
- target: target,
55
- typeArguments: typeArguments,
56
- arguments: txArguments,
57
- });
58
- tx.setGasBudget(gasBudget);
59
- return [2 /*return*/, tx];
60
- });
61
- });
62
- }
63
- exports.getAuthorizedDeliveryTx = getAuthorizedDeliveryTx;
@@ -1,39 +0,0 @@
1
- import { TransactionBlock } from "@mysten/sui.js";
2
- /**
3
- * registry: & mut Registry,
4
- time_oracle: & Time,
5
- option_type: u64,
6
- period: u8,
7
- activation_ts_ms: u64,
8
- expiration_ts_ms: u64,
9
- d_token_decimal: u64,
10
- b_token_decimal: u64,
11
- o_token_decimal: u64,
12
- capacity: u64,
13
- strike_pct: vector<u64>,
14
- weight: vector<u64>,
15
- is_buyer: vector<bool>,
16
- strike_increment: u64,
17
- lot_size: u64,
18
- decay_speed: u64,
19
- initial_price: u64,
20
- final_price: u64,
21
- auction_duration_in_ms: u64,
22
- leverage: u64,
23
- has_next: bool,
24
- whitelist: vector<address>,
25
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
26
- */
27
- export declare function getAuthorizedNewPortfolioVaultTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], timeOracle: string, optionType: string, // u64
28
- period: string, // u8
29
- activationTsMs: string, // u64
30
- expirationTsMs: string, // u64
31
- dTokenDecimal: string, // u64
32
- bTokenDecimal: string, // u64
33
- oTokenDecimal: string, // u64
34
- capacity: string, // u64
35
- strikePct: string[], // vector<u64>
36
- weight: string[], // vector<u64>
37
- isBuyer: boolean[], // vector<bool>
38
- strikeIncrement: string, // u64
39
- lotSize: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string, hasNext: boolean): Promise<TransactionBlock>;
@@ -1,118 +0,0 @@
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
- exports.getAuthorizedNewPortfolioVaultTx = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- /**
42
- * registry: & mut Registry,
43
- time_oracle: & Time,
44
- option_type: u64,
45
- period: u8,
46
- activation_ts_ms: u64,
47
- expiration_ts_ms: u64,
48
- d_token_decimal: u64,
49
- b_token_decimal: u64,
50
- o_token_decimal: u64,
51
- capacity: u64,
52
- strike_pct: vector<u64>,
53
- weight: vector<u64>,
54
- is_buyer: vector<bool>,
55
- strike_increment: u64,
56
- lot_size: u64,
57
- decay_speed: u64,
58
- initial_price: u64,
59
- final_price: u64,
60
- auction_duration_in_ms: u64,
61
- leverage: u64,
62
- has_next: bool,
63
- whitelist: vector<address>,
64
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
65
- */
66
- function getAuthorizedNewPortfolioVaultTx(gasBudget, packageId, registry, typeArguments, timeOracle, optionType, // u64
67
- period, // u8
68
- activationTsMs, // u64
69
- expirationTsMs, // u64
70
- dTokenDecimal, // u64
71
- bTokenDecimal, // u64
72
- oTokenDecimal, // u64
73
- capacity, // u64
74
- strikePct, // vector<u64>
75
- weight, // vector<u64>
76
- isBuyer, // vector<bool>
77
- strikeIncrement, // u64
78
- lotSize, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, whitelist, leverage, hasNext // bool
79
- ) {
80
- return __awaiter(this, void 0, void 0, function () {
81
- var tx, target, txArguments;
82
- return __generator(this, function (_a) {
83
- tx = new sui_js_1.TransactionBlock();
84
- target = "".concat(packageId, "::").concat(module, "::authorized_new_portfolio_vault");
85
- txArguments = [
86
- tx.pure(registry),
87
- tx.pure(timeOracle),
88
- tx.pure(optionType),
89
- tx.pure(period),
90
- tx.pure(activationTsMs),
91
- tx.pure(expirationTsMs),
92
- tx.pure(dTokenDecimal),
93
- tx.pure(bTokenDecimal),
94
- tx.pure(oTokenDecimal),
95
- tx.pure(capacity),
96
- tx.pure(strikePct),
97
- tx.pure(weight),
98
- tx.pure(isBuyer),
99
- tx.pure(strikeIncrement),
100
- tx.pure(lotSize),
101
- tx.pure(decaySpeed),
102
- tx.pure(initialPrice),
103
- tx.pure(finalPrice),
104
- tx.pure(auctionDurationInMs),
105
- tx.pure(leverage),
106
- tx.pure(whitelist),
107
- ];
108
- tx.moveCall({
109
- target: target,
110
- typeArguments: typeArguments,
111
- arguments: txArguments,
112
- });
113
- tx.setGasBudget(gasBudget);
114
- return [2 /*return*/, tx];
115
- });
116
- });
117
- }
118
- exports.getAuthorizedNewPortfolioVaultTx = getAuthorizedNewPortfolioVaultTx;
@@ -1,5 +0,0 @@
1
- import { TransactionBlock } from "@mysten/sui.js";
2
- /**
3
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
4
- */
5
- export declare function getAuthorizedRemovePortfolioVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, users: string[]): Promise<TransactionBlock>;
@@ -1,61 +0,0 @@
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
- exports.getAuthorizedRemovePortfolioVaultAuthorizedUserTx = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- /**
42
- * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
43
- */
44
- function getAuthorizedRemovePortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, users) {
45
- return __awaiter(this, void 0, void 0, function () {
46
- var tx, target, txArguments;
47
- return __generator(this, function (_a) {
48
- tx = new sui_js_1.TransactionBlock();
49
- target = "".concat(packageId, "::").concat(module, "::authorized_remove_portfolio_vault_authorized_user");
50
- txArguments = [tx.pure(registry), tx.pure(index), tx.pure(users)];
51
- tx.moveCall({
52
- target: target,
53
- typeArguments: typeArguments,
54
- arguments: txArguments,
55
- });
56
- tx.setGasBudget(gasBudget);
57
- return [2 /*return*/, tx];
58
- });
59
- });
60
- }
61
- exports.getAuthorizedRemovePortfolioVaultAuthorizedUserTx = getAuthorizedRemovePortfolioVaultAuthorizedUserTx;
@@ -1,2 +0,0 @@
1
- import { TransactionBlock } from "@mysten/sui.js";
2
- export declare function getAuthorizedUpdateCapacityTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, capacity: string): Promise<TransactionBlock>;