@typus/typus-sdk 0.6.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/lib/config.json +17 -20
  2. package/lib/constants.d.ts +9 -7
  3. package/lib/constants.js +10 -8
  4. package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
  5. package/lib/test/{testClaim.js → authorized/testAuthorizedUpdateUpcomingVaultConfig.js} +19 -30
  6. package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +68 -0
  7. package/lib/test/getVaultData.js +1 -1
  8. package/lib/test/getWhiteListFromRegistry.js +1 -1
  9. package/lib/test/helper/getAuctionMaxSize.js +76 -0
  10. package/lib/test/helper/getUserStatus.js +75 -0
  11. package/lib/test/{testWithdraw.js → user/testClaim.js} +14 -17
  12. package/lib/test/{getMakersShares.js → user/testCompound.js} +20 -6
  13. package/lib/test/{testUnsubscribe.js → user/testDeposit.js} +28 -37
  14. package/lib/test/{getUsersShares.js → user/testHarvest.js} +20 -6
  15. package/lib/test/user/testNewBid.js +77 -0
  16. package/lib/test/user/testUnsubscribe.d.ts +1 -0
  17. package/lib/test/user/testUnsubscribe.js +69 -0
  18. package/lib/test/user/testWithdraw.d.ts +1 -0
  19. package/lib/test/{testDeposit.js → user/testWithdraw.js} +15 -19
  20. package/lib/utils/fetchData.d.ts +72 -61
  21. package/lib/utils/fetchData.js +26 -197
  22. package/lib/utils/getVaultData.d.ts +2 -2
  23. package/lib/utils/getVaultData.js +123 -161
  24. package/lib/utils/getWhiteListFromRegistry.js +0 -1
  25. package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +1 -1
  26. package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +2 -2
  27. package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +4 -3
  28. package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +5 -3
  29. package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +1 -1
  30. package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +2 -2
  31. package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
  32. package/lib/utils/portfolio/authorized/{getAuthorizedUpdateNextVaultConfigTx.js → getAuthorizedUpdateUpcomingVaultConfigTx.js} +5 -5
  33. package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
  34. package/lib/utils/portfolio/{manager/getUpdateVaultConfigTx.js → authorized/getAuthorizedUpdateWarmupVaultConfigTx.js} +4 -5
  35. package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
  36. package/lib/utils/portfolio/{manager/getLastEvolutionTx.js → helper/getAuctionMaxSize.js} +11 -7
  37. package/lib/utils/portfolio/helper/getUserStatus.d.ts +29 -0
  38. package/lib/utils/portfolio/{authorized/getAuthorizedEvolutionTx.js → helper/getUserStatus.js} +50 -9
  39. package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -1
  40. package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +9 -2
  41. package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +6 -0
  42. package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +6 -0
  43. package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +15 -1
  44. package/lib/utils/portfolio/manager/getEvolutionTx.js +14 -0
  45. package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -1
  46. package/lib/utils/portfolio/manager/getNewManagerTx.js +9 -2
  47. package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +5 -5
  48. package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +5 -5
  49. package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +7 -0
  50. package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +7 -0
  51. package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +5 -0
  52. package/lib/utils/portfolio/manager/getRemoveManagerTx.js +5 -0
  53. package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +7 -1
  54. package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +7 -1
  55. package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +9 -1
  56. package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +11 -3
  57. package/lib/utils/portfolio/user/getClaimTx.d.ts +9 -1
  58. package/lib/utils/portfolio/user/getClaimTx.js +8 -0
  59. package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
  60. package/lib/utils/portfolio/{authorized/getAuthorizedLastEvolutionTx.js → user/getCompoundTx.js} +12 -6
  61. package/lib/utils/portfolio/user/getDepositTx.d.ts +10 -0
  62. package/lib/utils/portfolio/user/getDepositTx.js +10 -0
  63. package/lib/utils/portfolio/user/getHarvestTx.d.ts +9 -1
  64. package/lib/utils/portfolio/user/getHarvestTx.js +8 -0
  65. package/lib/utils/portfolio/user/getNewBidTx.d.ts +13 -1
  66. package/lib/utils/portfolio/user/getNewBidTx.js +12 -0
  67. package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -1
  68. package/lib/utils/portfolio/user/getUnsubscribeTx.js +9 -0
  69. package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -1
  70. package/lib/utils/portfolio/user/getWithdrawTx.js +9 -0
  71. package/package.json +1 -1
  72. package/lib/test/eventListener.d.ts +0 -5
  73. package/lib/test/eventListener.js +0 -397
  74. package/lib/test/testDepositV2.d.ts +0 -0
  75. package/lib/test/testDepositV2.js +0 -64
  76. package/lib/test/testNewAuction.js +0 -94
  77. package/lib/test/testNewVault.js +0 -153
  78. package/lib/test/testOracle.js +0 -94
  79. package/lib/test/testSettle.js +0 -590
  80. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +0 -1
  81. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +0 -56
  82. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  83. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +0 -56
  84. package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +0 -1
  85. package/lib/utils/authorized/getAuthorizedDeliveryTx.js +0 -56
  86. package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
  87. package/lib/utils/authorized/getAuthorizedEvolutionTx.js +0 -56
  88. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
  89. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +0 -56
  90. package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +0 -1
  91. package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +0 -56
  92. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +0 -1
  93. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +0 -76
  94. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +0 -1
  95. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +0 -56
  96. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  97. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +0 -56
  98. package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +0 -1
  99. package/lib/utils/authorized/getAuthorizedSettleTx.js +0 -56
  100. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +0 -1
  101. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +0 -56
  102. package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -1
  103. package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +0 -65
  104. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
  105. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
  106. package/lib/utils/coveredCall/createPriceOracle.d.ts +0 -1
  107. package/lib/utils/coveredCall/createPriceOracle.js +0 -93
  108. package/lib/utils/coveredCall/createTimeOracle.d.ts +0 -1
  109. package/lib/utils/coveredCall/createTimeOracle.js +0 -92
  110. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  111. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +0 -61
  112. package/lib/utils/coveredCall/getClaimAllTx.d.ts +0 -1
  113. package/lib/utils/coveredCall/getClaimAllTx.js +0 -59
  114. package/lib/utils/coveredCall/getClaimTx.d.ts +0 -1
  115. package/lib/utils/coveredCall/getClaimTx.js +0 -59
  116. package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +0 -1
  117. package/lib/utils/coveredCall/getCloseAuctionTx.js +0 -61
  118. package/lib/utils/coveredCall/getCloseVaultTx.d.ts +0 -1
  119. package/lib/utils/coveredCall/getCloseVaultTx.js +0 -60
  120. package/lib/utils/coveredCall/getDeliveryTx.d.ts +0 -1
  121. package/lib/utils/coveredCall/getDeliveryTx.js +0 -61
  122. package/lib/utils/coveredCall/getDepositTx.d.ts +0 -1
  123. package/lib/utils/coveredCall/getDepositTx.js +0 -65
  124. package/lib/utils/coveredCall/getEvolutionTx.d.ts +0 -1
  125. package/lib/utils/coveredCall/getEvolutionTx.js +0 -64
  126. package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +0 -1
  127. package/lib/utils/coveredCall/getLastEvolutionTx.js +0 -63
  128. package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +0 -1
  129. package/lib/utils/coveredCall/getMakerClaimAllTx.js +0 -59
  130. package/lib/utils/coveredCall/getMakerClaimTx.d.ts +0 -1
  131. package/lib/utils/coveredCall/getMakerClaimTx.js +0 -59
  132. package/lib/utils/coveredCall/getNewAuctionTx.d.ts +0 -1
  133. package/lib/utils/coveredCall/getNewAuctionTx.js +0 -66
  134. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +0 -1
  135. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +0 -64
  136. package/lib/utils/coveredCall/getNewBidTx.d.ts +0 -1
  137. package/lib/utils/coveredCall/getNewBidTx.js +0 -62
  138. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +0 -1
  139. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +0 -77
  140. package/lib/utils/coveredCall/getNewManagerTx.d.ts +0 -1
  141. package/lib/utils/coveredCall/getNewManagerTx.js +0 -59
  142. package/lib/utils/coveredCall/getRefundTx.d.ts +0 -1
  143. package/lib/utils/coveredCall/getRefundTx.js +0 -59
  144. package/lib/utils/coveredCall/getRemoveBidTx.d.ts +0 -1
  145. package/lib/utils/coveredCall/getRemoveBidTx.js +0 -60
  146. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  147. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +0 -61
  148. package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +0 -1
  149. package/lib/utils/coveredCall/getRemoveManagerTx.js +0 -58
  150. package/lib/utils/coveredCall/getRollOverTx.d.ts +0 -1
  151. package/lib/utils/coveredCall/getRollOverTx.js +0 -60
  152. package/lib/utils/coveredCall/getSettleTx.d.ts +0 -1
  153. package/lib/utils/coveredCall/getSettleTx.js +0 -62
  154. package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +0 -1
  155. package/lib/utils/coveredCall/getSettleWithRollOverTx.js +0 -62
  156. package/lib/utils/coveredCall/getSubscribeTx.d.ts +0 -1
  157. package/lib/utils/coveredCall/getSubscribeTx.js +0 -60
  158. package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +0 -1
  159. package/lib/utils/coveredCall/getUnsubscribeTx.js +0 -63
  160. package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +0 -1
  161. package/lib/utils/coveredCall/getUpdateCapacityTx.js +0 -61
  162. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +0 -1
  163. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +0 -66
  164. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +0 -1
  165. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +0 -62
  166. package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +0 -1
  167. package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +0 -65
  168. package/lib/utils/coveredCall/getWithdrawTx.d.ts +0 -1
  169. package/lib/utils/coveredCall/getWithdrawTx.js +0 -60
  170. package/lib/utils/fetchPortfolioData.d.ts +0 -93
  171. package/lib/utils/fetchPortfolioData.js +0 -205
  172. package/lib/utils/getCreateTokenRegistryTx.d.ts +0 -1
  173. package/lib/utils/getCreateTokenRegistryTx.js +0 -59
  174. package/lib/utils/getMakersShares.d.ts +0 -8
  175. package/lib/utils/getMakersShares.js +0 -145
  176. package/lib/utils/getNewOracleTx.d.ts +0 -1
  177. package/lib/utils/getNewOracleTx.js +0 -59
  178. package/lib/utils/getNewTimeOracleTx.d.ts +0 -1
  179. package/lib/utils/getNewTimeOracleTx.js +0 -56
  180. package/lib/utils/getUpdateOracleTx.d.ts +0 -1
  181. package/lib/utils/getUpdateOracleTx.js +0 -64
  182. package/lib/utils/getUpdateTimeOracleTx.d.ts +0 -1
  183. package/lib/utils/getUpdateTimeOracleTx.js +0 -60
  184. package/lib/utils/getUsersShares.d.ts +0 -9
  185. package/lib/utils/getUsersShares.js +0 -148
  186. package/lib/utils/getVaultIndexInRegistry.d.ts +0 -1
  187. package/lib/utils/getVaultIndexInRegistry.js +0 -61
  188. package/lib/utils/isObjAvailable.d.ts +0 -0
  189. package/lib/utils/isObjAvailable.js +0 -14
  190. package/lib/utils/loadUsersDepositData.d.ts +0 -8
  191. package/lib/utils/loadUsersDepositData.js +0 -160
  192. package/lib/utils/portfolio/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
  193. package/lib/utils/portfolio/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
  194. package/lib/utils/portfolio/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -4
  195. package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
  196. package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
  197. package/lib/utils/portfolio/manager/getLastEvolutionTx.d.ts +0 -1
  198. package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.d.ts +0 -4
  199. package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.js +0 -71
  200. package/lib/utils/portfolio/manager/getUpdateVaultConfigTx.d.ts +0 -1
  201. package/lib/utils/portfolio/user/getCompoundPremiumTx.d.ts +0 -1
  202. package/lib/utils/portfolio/user/getCompoundPremiumTx.js +0 -60
  203. /package/lib/test/{getMakersShares.d.ts → authorized/testAuthorizedNewPortfolioVault.d.ts} +0 -0
  204. /package/lib/test/{getUsersShares.d.ts → authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts} +0 -0
  205. /package/lib/test/{testClaim.d.ts → authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts} +0 -0
  206. /package/lib/test/{testDeposit.d.ts → helper/getAuctionMaxSize.d.ts} +0 -0
  207. /package/lib/test/{testNewAuction.d.ts → helper/getUserStatus.d.ts} +0 -0
  208. /package/lib/test/{testNewVault.d.ts → user/testClaim.d.ts} +0 -0
  209. /package/lib/test/{testOracle.d.ts → user/testCompound.d.ts} +0 -0
  210. /package/lib/test/{testSettle.d.ts → user/testDeposit.d.ts} +0 -0
  211. /package/lib/test/{testUnsubscribe.d.ts → user/testHarvest.d.ts} +0 -0
  212. /package/lib/test/{testWithdraw.d.ts → user/testNewBid.d.ts} +0 -0
@@ -1,205 +1,34 @@
1
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
- var __values = (this && this.__values) || function(o) {
39
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
- if (m) return m.call(o);
41
- if (o && typeof o.length === "number") return {
42
- next: function () {
43
- if (o && i >= o.length) o = void 0;
44
- return { value: o && o[i++], done: !o };
45
- }
46
- };
47
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
- };
49
2
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.getUserDataFromLinkedListNode = exports.getLinkedListNodesFromTable = exports.getTableUnderSubVault = exports.getSubVaultsFromTable = exports.getTableFromCoveredCallVault = exports.getCoveredCallVaultsFromRegistry = void 0;
3
+ exports.parseSubVault = exports.parsePayoffConfig = exports.parseVaultConfig = void 0;
51
4
  var sui_js_1 = require("@mysten/sui.js");
52
5
  var provider = new sui_js_1.JsonRpcProvider(sui_js_1.Network.DEVNET); //for read only operations
53
6
  var decode = function (str) { return Buffer.from(str, 'base64').toString('binary'); };
54
- //new version: getVaultDataFromRegistry()
55
- function getCoveredCallVaultsFromRegistry(registry) {
56
- return __awaiter(this, void 0, void 0, function () {
57
- var coveredCallVaults;
58
- return __generator(this, function (_a) {
59
- switch (_a.label) {
60
- case 0:
61
- console.log("registry: " + registry);
62
- return [4 /*yield*/, provider.getDynamicFields(registry)];
63
- case 1:
64
- coveredCallVaults = (_a.sent()).data;
65
- console.log("under the registry, there are " + coveredCallVaults.length + " covered call vaults");
66
- return [2 /*return*/, coveredCallVaults];
67
- }
68
- });
69
- });
70
- }
71
- exports.getCoveredCallVaultsFromRegistry = getCoveredCallVaultsFromRegistry;
72
- function getTableFromCoveredCallVault(coveredCallVault) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var tmp, tableUnderCoveredCallVault;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- console.log("coveredCallVault: " + coveredCallVault);
79
- return [4 /*yield*/, provider.getObject(coveredCallVault)];
80
- case 1:
81
- tmp = _a.sent();
82
- if (tmp.status != "Exists") {
83
- console.log("obj not exists");
84
- return [2 /*return*/];
85
- }
86
- tableUnderCoveredCallVault = tmp.details.data.fields.value.fields.vault.fields.sub_vaults.fields.id.id;
87
- console.log("table : " + tableUnderCoveredCallVault);
88
- return [2 /*return*/, tableUnderCoveredCallVault];
89
- }
90
- });
91
- });
92
- }
93
- exports.getTableFromCoveredCallVault = getTableFromCoveredCallVault;
94
- function getSubVaultsFromTable(tableUnderCoveredCallVault) {
95
- return __awaiter(this, void 0, void 0, function () {
96
- var subVaults, result, subVaults_1, subVaults_1_1, subVault, txn, name_1, e_1_1;
97
- var e_1, _a;
98
- return __generator(this, function (_b) {
99
- switch (_b.label) {
100
- case 0: return [4 /*yield*/, provider.getDynamicFields(tableUnderCoveredCallVault)];
101
- case 1:
102
- subVaults = (_b.sent()).data;
103
- console.log("there are " + subVaults.length + " sub vault under table, representing rolling, regular and maker");
104
- result = {};
105
- _b.label = 2;
106
- case 2:
107
- _b.trys.push([2, 7, 8, 9]);
108
- subVaults_1 = __values(subVaults), subVaults_1_1 = subVaults_1.next();
109
- _b.label = 3;
110
- case 3:
111
- if (!!subVaults_1_1.done) return [3 /*break*/, 6];
112
- subVault = subVaults_1_1.value;
113
- return [4 /*yield*/, provider.getObject(subVault.objectId)];
114
- case 4:
115
- txn = _b.sent();
116
- if (txn.status != "Exists") {
117
- console.log("obj not exists");
118
- return [2 /*return*/, {}];
119
- }
120
- name_1 = decode(txn.details.data.fields.name) //rolling / regular / maker
121
- ;
122
- //@ts-ignore
123
- result[name_1] = txn.details.data.fields.id.id;
124
- _b.label = 5;
125
- case 5:
126
- subVaults_1_1 = subVaults_1.next();
127
- return [3 /*break*/, 3];
128
- case 6: return [3 /*break*/, 9];
129
- case 7:
130
- e_1_1 = _b.sent();
131
- e_1 = { error: e_1_1 };
132
- return [3 /*break*/, 9];
133
- case 8:
134
- try {
135
- if (subVaults_1_1 && !subVaults_1_1.done && (_a = subVaults_1.return)) _a.call(subVaults_1);
136
- }
137
- finally { if (e_1) throw e_1.error; }
138
- return [7 /*endfinally*/];
139
- case 9:
140
- console.log("sub vaults:");
141
- console.log(result);
142
- return [2 /*return*/, result];
143
- }
144
- });
145
- });
146
- }
147
- exports.getSubVaultsFromTable = getSubVaultsFromTable;
148
- function getTableUnderSubVault(subVault) {
149
- return __awaiter(this, void 0, void 0, function () {
150
- var tmp, table;
151
- return __generator(this, function (_a) {
152
- switch (_a.label) {
153
- case 0:
154
- console.log("sub vault: " + subVault);
155
- return [4 /*yield*/, provider.getObject(subVault)];
156
- case 1:
157
- tmp = _a.sent();
158
- if (tmp.status != "Exists") {
159
- console.log("obj not exists");
160
- return [2 /*return*/, ""];
161
- }
162
- table = tmp.details.data.fields.value.fields.user_shares.fields.nodes.fields.id.id;
163
- console.log("table under sub vault: ", table);
164
- return [2 /*return*/, table];
165
- }
166
- });
167
- });
7
+ function parseVaultConfig(vaultConfigF) {
8
+ var payoffConfigs = vaultConfigF.payoff_configs.map(function (x) { return parsePayoffConfig(x); });
9
+ return {
10
+ payoffConfigs: payoffConfigs,
11
+ strikeIncrement: vaultConfigF.strike_increment,
12
+ decaySpeed: vaultConfigF.decay_speed,
13
+ initialPrice: vaultConfigF.initial_price,
14
+ finalPrice: vaultConfigF.final_price,
15
+ auctionDurationInMs: vaultConfigF.auction_duration_in_ms,
16
+ };
168
17
  }
169
- exports.getTableUnderSubVault = getTableUnderSubVault;
170
- function getLinkedListNodesFromTable(table) {
171
- return __awaiter(this, void 0, void 0, function () {
172
- var linkedListNodes;
173
- return __generator(this, function (_a) {
174
- switch (_a.label) {
175
- case 0: return [4 /*yield*/, provider.getDynamicFields(table)];
176
- case 1:
177
- linkedListNodes = (_a.sent()).data;
178
- console.log("there are " + linkedListNodes.length + " linked list nodes in table");
179
- return [2 /*return*/, linkedListNodes];
180
- }
181
- });
182
- });
18
+ exports.parseVaultConfig = parseVaultConfig;
19
+ function parsePayoffConfig(payoffConfigF) {
20
+ return {
21
+ strikePct: payoffConfigF.strike_pct,
22
+ weight: payoffConfigF.weight,
23
+ isBuyer: payoffConfigF.is_buyer,
24
+ strike: payoffConfigF.strike,
25
+ };
183
26
  }
184
- exports.getLinkedListNodesFromTable = getLinkedListNodesFromTable;
185
- function getUserDataFromLinkedListNode(linkedListNode) {
186
- return __awaiter(this, void 0, void 0, function () {
187
- var tmp, usersData;
188
- return __generator(this, function (_a) {
189
- switch (_a.label) {
190
- case 0: return [4 /*yield*/, provider.getObject(linkedListNode)];
191
- case 1:
192
- tmp = _a.sent();
193
- if (tmp.status != "Exists") {
194
- console.log("obj not exists");
195
- return [2 /*return*/];
196
- }
197
- usersData = tmp.details.data.fields;
198
- console.log("users data from linked list node:");
199
- console.log(usersData);
200
- return [2 /*return*/, usersData];
201
- }
202
- });
203
- });
27
+ exports.parsePayoffConfig = parsePayoffConfig;
28
+ function parseSubVault(subVaultF) {
29
+ return {
30
+ balance: subVaultF.balance,
31
+ shareSupply: subVaultF.share_supply,
32
+ };
204
33
  }
205
- exports.getUserDataFromLinkedListNode = getUserDataFromLinkedListNode;
34
+ exports.parseSubVault = parseSubVault;
@@ -1,5 +1,5 @@
1
1
  import { JsonRpcProvider } from '@mysten/sui.js';
2
- import { CoveredCallVault, Auction } from "../utils/fetchData";
3
- export declare function getVaultDataFromRegistry(registry: string, provider: JsonRpcProvider): Promise<CoveredCallVault[]>;
2
+ import { PortfolioVault, Auction } from "./fetchData";
3
+ export declare function getVaultDataFromRegistry(registry: string, provider: JsonRpcProvider): Promise<PortfolioVault[]>;
4
4
  export declare function getVaultBidPrice(auction: Auction): Promise<number>;
5
5
  export declare function getNodesKeyFromLinkedList(linkedList: string, provider: JsonRpcProvider): Promise<string[]>;
@@ -48,17 +48,15 @@ var __values = (this && this.__values) || function(o) {
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.getNodesKeyFromLinkedList = exports.getVaultBidPrice = exports.getVaultDataFromRegistry = void 0;
51
- var constants_1 = require("../constants");
51
+ var fetchData_1 = require("./fetchData");
52
52
  // const provider = new JsonRpcProvider(TESTNET_RPC_ENDPOINT);//for read only operations
53
53
  function getVaultDataFromRegistry(registry, provider) {
54
54
  return __awaiter(this, void 0, void 0, function () {
55
- var coveredCallVaults, coveredCallVaultsId, objsInfo, vaults, _loop_1, objsInfo_1, objsInfo_1_1, objInfo, e_1_1;
55
+ var coveredCallVaults, coveredCallVaultsId, objsInfo, vaults, objsInfo_1, objsInfo_1_1, objInfo, vaultId, type, typeArgs, assets, deliveryInfo, fields, infoF, info, config, configRes, depositVaultF, depositVault, bidVaultF, bidVault, auctionRes, vaultBidPrice, auction, priceConfig, priceConfigRes, tvl, authority, res, e_1_1;
56
56
  var e_1, _a;
57
57
  return __generator(this, function (_b) {
58
58
  switch (_b.label) {
59
- case 0:
60
- console.log("registry: " + registry);
61
- return [4 /*yield*/, provider.getDynamicFields(registry)];
59
+ case 0: return [4 /*yield*/, provider.getDynamicFields(registry)];
62
60
  case 1:
63
61
  coveredCallVaults = (_b.sent()).data;
64
62
  coveredCallVaultsId = coveredCallVaults.map(function (e) { return e.objectId; });
@@ -66,178 +64,142 @@ function getVaultDataFromRegistry(registry, provider) {
66
64
  case 2:
67
65
  objsInfo = _b.sent();
68
66
  vaults = [];
69
- _loop_1 = function (objInfo) {
70
- var vaultId, vaultIdx, type, asset, config, vault, prev, vaultConfig, vaultConfigRes, nextVaultConfig, nextVaultConfigRes, payoffConfig, payoffConfigRes, configRes, maker, regular, rolling, vaultRes, auctionRes, vaultBidPrice, auction, priceConfig, priceConfigRes, next, totalBidSize, deliveryInfo, owner, tvl, authority, res;
71
- return __generator(this, function (_c) {
72
- switch (_c.label) {
73
- case 0:
74
- if (objInfo.status != "Exists") {
75
- console.log("obj not exist");
76
- return [2 /*return*/, "continue"];
77
- }
78
- vaultId = objInfo.details.data.fields.id.id;
79
- vaultIdx = objInfo.details.data.fields.name;
80
- type = objInfo.details.data.fields.value.type;
81
- asset = constants_1.TOKEN_NAME.find(function (e) { return type.includes(e); });
82
- if (!asset) {
83
- console.log("can't find token");
84
- asset = "";
85
- }
86
- config = objInfo.details.data.fields.value.fields.config.fields;
87
- vault = objInfo.details.data.fields.value.fields.vault.fields;
88
- prev = objInfo.details.data.fields.value.fields.prev;
89
- prev = (prev != null) ? prev : null;
90
- vaultConfig = config.vault_config.fields;
91
- vaultConfigRes = {
92
- strikeOtmPct: vaultConfig.strike_otm_pct,
93
- strikeIncrement: vaultConfig.strike_increment,
94
- decaySpeed: vaultConfig.decay_speed,
95
- initialPrice: vaultConfig.initial_price,
96
- finalPrice: vaultConfig.final_price,
97
- auctionDurationInMs: vaultConfig.auction_duration_in_ms,
98
- };
99
- nextVaultConfig = config.next_vault_config.fields;
100
- nextVaultConfigRes = {
101
- strikeOtmPct: nextVaultConfig.strike_otm_pct,
102
- strikeIncrement: nextVaultConfig.strike_increment,
103
- decaySpeed: nextVaultConfig.decay_speed,
104
- initialPrice: nextVaultConfig.initial_price,
105
- finalPrice: nextVaultConfig.final_price,
106
- auctionDurationInMs: nextVaultConfig.auction_duration_in_ms,
107
- };
108
- payoffConfig = config.payoff_config.fields;
109
- payoffConfigRes = {
110
- exposureRatio: (payoffConfig.exposure_ratio),
111
- premiumRoi: (payoffConfig.premium_roi),
112
- strike: ((payoffConfig.strike) / (Math.pow(10, constants_1.PRICE_DECIMAL))).toString(),
113
- };
114
- configRes = {
115
- period: config.period,
116
- activationTsMs: config.activation_ts_ms,
117
- expirationTsMs: config.expiration_ts_ms,
118
- tokenDecimal: config.token_decimal,
119
- shareDecimal: config.share_decimal,
120
- capacity: (Number(config.capacity) / (Math.pow(10, constants_1.TOKEN_DECIMAL))).toString(),
121
- leverage: config.leverage,
122
- vaultConfig: vaultConfigRes,
123
- nextVaultConfig: nextVaultConfigRes,
124
- payoffConfig: payoffConfigRes,
125
- };
126
- maker = {
127
- balance: (vault.maker_sub_vault.fields.balance),
128
- shareSupply: (vault.maker_sub_vault.fields.share_supply),
129
- };
130
- regular = {
131
- balance: (vault.regular_sub_vault.fields.balance),
132
- shareSupply: (vault.regular_sub_vault.fields.share_supply),
133
- };
134
- rolling = {
135
- balance: (vault.rolling_sub_vault.fields.balance),
136
- shareSupply: (vault.rolling_sub_vault.fields.share_supply),
137
- };
138
- vaultRes = {
139
- ableToDeposit: vault.able_to_deposit,
140
- ableToWithdraw: vault.able_to_withdraw,
141
- makerSubVault: maker,
142
- regularSubVault: regular,
143
- rollingSubVault: rolling,
144
- };
145
- auctionRes = void 0;
146
- vaultBidPrice = void 0;
147
- if (!objInfo.details.data.fields.value.fields.auction) return [3 /*break*/, 2];
148
- auction = objInfo.details.data.fields.value.fields.auction.fields;
149
- priceConfig = auction.price_config.fields;
150
- priceConfigRes = {
151
- decaySpeed: (priceConfig.decay_speed),
152
- initialPrice: (priceConfig.initial_price),
153
- finalPrice: (priceConfig.final_price),
154
- };
155
- auctionRes = {
156
- startTsMs: (auction.start_ts_ms),
157
- endTsMs: (auction.end_ts_ms),
158
- priceConfig: priceConfigRes,
159
- index: (auction.index),
160
- };
161
- return [4 /*yield*/, getVaultBidPrice(auctionRes)
162
- // console.log("get auction in " + vaultId)
163
- ];
164
- case 1:
165
- vaultBidPrice = _c.sent();
166
- return [3 /*break*/, 3];
167
- case 2:
168
- // console.log("No auction " + vaultId)
169
- auctionRes = {};
170
- vaultBidPrice = 0;
171
- _c.label = 3;
172
- case 3:
173
- next = objInfo.details.data.fields.value.fields.next;
174
- totalBidSize = objInfo.details.data.fields.value.fields.total_bid_size;
175
- deliveryInfo = void 0;
176
- //@ts-ignore
177
- if (objInfo.details.data.fields.value.fields.delivery_info) {
178
- deliveryInfo = {
179
- //@ts-ignore
180
- deliveryPrice: objInfo.details.data.fields.value.fields.delivery_info.fields.delivery_price,
181
- //@ts-ignore
182
- deliverySize: objInfo.details.data.fields.value.fields.delivery_info.fields.delivery_size,
183
- };
184
- }
185
- else {
186
- deliveryInfo = {};
187
- }
188
- owner = objInfo.details.data.fields.value.fields.owner;
189
- tvl = Number(vault.regular_sub_vault.fields.balance) + Number(vault.rolling_sub_vault.fields.balance);
190
- return [4 /*yield*/, getNodesKeyFromLinkedList(objInfo.details.data.fields.value.fields.authority, provider)];
191
- case 4:
192
- authority = _c.sent();
193
- res = {
194
- vaultId: vaultId,
195
- vaultIdx: vaultIdx.toString(),
196
- asset: asset,
197
- config: configRes,
198
- vault: vaultRes,
199
- auction: auctionRes,
200
- prev: (prev) ? prev.toString() : null,
201
- next: next,
202
- totalBidSize: totalBidSize,
203
- deliveryInfo: deliveryInfo,
204
- owner: owner,
205
- authority: authority,
206
- tvl: tvl.toString(),
207
- vaultBidPrice: vaultBidPrice.toString(),
208
- };
209
- vaults.push(res);
210
- return [2 /*return*/];
211
- }
212
- });
213
- };
214
67
  _b.label = 3;
215
68
  case 3:
216
- _b.trys.push([3, 8, 9, 10]);
69
+ _b.trys.push([3, 11, 12, 13]);
217
70
  objsInfo_1 = __values(objsInfo), objsInfo_1_1 = objsInfo_1.next();
218
71
  _b.label = 4;
219
72
  case 4:
220
- if (!!objsInfo_1_1.done) return [3 /*break*/, 7];
73
+ if (!!objsInfo_1_1.done) return [3 /*break*/, 10];
221
74
  objInfo = objsInfo_1_1.value;
222
- return [5 /*yield**/, _loop_1(objInfo)];
75
+ if (objInfo.status != "Exists") {
76
+ console.log("obj not exist");
77
+ return [3 /*break*/, 9];
78
+ }
79
+ vaultId = objInfo.details.data.fields.id.id;
80
+ type = objInfo.details.data.fields.value.type;
81
+ type = type.split("<")[1];
82
+ type = type.split(">")[0];
83
+ typeArgs = type.split(", ");
84
+ assets = typeArgs.map(function (x) { return x.split("::")[2]; });
85
+ deliveryInfo = void 0;
86
+ //@ts-ignore
87
+ if (objInfo.details.data.fields.value.fields.delivery_info) {
88
+ fields = objInfo.details.data.fields.value.fields.delivery_info.fields;
89
+ deliveryInfo = {
90
+ round: fields.round,
91
+ price: fields.price,
92
+ size: fields.size,
93
+ premium: fields.premium,
94
+ tsMs: fields.ts_ms,
95
+ };
96
+ }
97
+ else {
98
+ deliveryInfo = {};
99
+ }
100
+ infoF = objInfo.details.data.fields.value.fields.info.fields;
101
+ info = {
102
+ index: infoF.index,
103
+ creator: infoF.creator,
104
+ createTsMs: infoF.create_ts_ms,
105
+ round: infoF.round,
106
+ deliveryInfo: deliveryInfo
107
+ };
108
+ config = objInfo.details.data.fields.value.fields.config.fields;
109
+ configRes = {
110
+ optionType: config.option_type,
111
+ period: config.period,
112
+ activationTsMs: config.activation_ts_ms,
113
+ expirationTsMs: config.expiration_ts_ms,
114
+ dTokenDecimal: config.d_token_decimal,
115
+ bTokenDecimal: config.b_token_decimal,
116
+ oTokenDecimal: config.o_token_decimal,
117
+ lotSize: config.lot_size,
118
+ capacity: (Number(config.capacity) / (Math.pow(10, config.d_token_decimal))).toString(),
119
+ leverage: config.leverage,
120
+ hasNext: config.has_next,
121
+ activeVaultConfig: (0, fetchData_1.parseVaultConfig)(config.active_vault_config.fields),
122
+ warmupVaultConfig: (0, fetchData_1.parseVaultConfig)(config.warmup_vault_config.fields),
123
+ upcomingVaultConfig: (0, fetchData_1.parseVaultConfig)(config.upcoming_vault_config.fields),
124
+ };
125
+ depositVaultF = objInfo.details.data.fields.value.fields.deposit_vault.fields;
126
+ depositVault = {
127
+ activeSubVault: (0, fetchData_1.parseSubVault)(depositVaultF.active_sub_vault.fields),
128
+ deactivatingSubVault: (0, fetchData_1.parseSubVault)(depositVaultF.deactivating_sub_vault.fields),
129
+ inactiveSubVault: (0, fetchData_1.parseSubVault)(depositVaultF.inactive_sub_vault.fields),
130
+ warmupSubVault: (0, fetchData_1.parseSubVault)(depositVaultF.warmup_sub_vault.fields),
131
+ hasNext: depositVaultF.has_next
132
+ };
133
+ bidVaultF = objInfo.details.data.fields.value.fields.bid_vault.fields;
134
+ bidVault = {
135
+ bidderSubVault: (0, fetchData_1.parseSubVault)(bidVaultF.bidder_sub_vault.fields),
136
+ premiumSubVault: (0, fetchData_1.parseSubVault)(bidVaultF.premium_sub_vault.fields),
137
+ performanceFeeSubVault: (0, fetchData_1.parseSubVault)(bidVaultF.performance_fee_sub_vault.fields),
138
+ };
139
+ auctionRes = void 0;
140
+ vaultBidPrice = void 0;
141
+ if (!objInfo.details.data.fields.value.fields.auction) return [3 /*break*/, 6];
142
+ auction = objInfo.details.data.fields.value.fields.auction.fields;
143
+ priceConfig = auction.price_config.fields;
144
+ priceConfigRes = {
145
+ decaySpeed: (priceConfig.decay_speed),
146
+ initialPrice: (priceConfig.initial_price),
147
+ finalPrice: (priceConfig.final_price),
148
+ };
149
+ auctionRes = {
150
+ startTsMs: (auction.start_ts_ms),
151
+ endTsMs: (auction.end_ts_ms),
152
+ priceConfig: priceConfigRes,
153
+ index: (auction.index),
154
+ totalBidSize: auction.total_bid_size,
155
+ ableToRemoveBid: auction.able_to_remove_bid,
156
+ };
157
+ return [4 /*yield*/, getVaultBidPrice(auctionRes)
158
+ // console.log("get auction in " + vaultId)
159
+ ];
223
160
  case 5:
224
- _b.sent();
225
- _b.label = 6;
161
+ vaultBidPrice = _b.sent();
162
+ return [3 /*break*/, 7];
226
163
  case 6:
164
+ // console.log("No auction " + vaultId)
165
+ auctionRes = {};
166
+ vaultBidPrice = 0;
167
+ _b.label = 7;
168
+ case 7:
169
+ tvl = Number(depositVault.activeSubVault.balance) + Number(depositVault.warmupSubVault.balance);
170
+ return [4 /*yield*/, getNodesKeyFromLinkedList(objInfo.details.data.fields.value.fields.authority, provider)];
171
+ case 8:
172
+ authority = _b.sent();
173
+ res = {
174
+ vaultId: vaultId,
175
+ typeArgs: typeArgs,
176
+ assets: assets,
177
+ info: info,
178
+ config: configRes,
179
+ depositVault: depositVault,
180
+ bidVault: bidVault,
181
+ auction: auctionRes,
182
+ authority: authority,
183
+ tvl: tvl.toString(),
184
+ vaultBidPrice: vaultBidPrice.toString(),
185
+ };
186
+ vaults.push(res);
187
+ _b.label = 9;
188
+ case 9:
227
189
  objsInfo_1_1 = objsInfo_1.next();
228
190
  return [3 /*break*/, 4];
229
- case 7: return [3 /*break*/, 10];
230
- case 8:
191
+ case 10: return [3 /*break*/, 13];
192
+ case 11:
231
193
  e_1_1 = _b.sent();
232
194
  e_1 = { error: e_1_1 };
233
- return [3 /*break*/, 10];
234
- case 9:
195
+ return [3 /*break*/, 13];
196
+ case 12:
235
197
  try {
236
198
  if (objsInfo_1_1 && !objsInfo_1_1.done && (_a = objsInfo_1.return)) _a.call(objsInfo_1);
237
199
  }
238
200
  finally { if (e_1) throw e_1.error; }
239
201
  return [7 /*endfinally*/];
240
- case 10: return [2 /*return*/, vaults];
202
+ case 13: return [2 /*return*/, vaults];
241
203
  }
242
204
  });
243
205
  });
@@ -253,7 +215,7 @@ function getVaultBidPrice(auction) {
253
215
  decaySpeed = Number(auction.priceConfig.decaySpeed);
254
216
  start = Number(auction.startTsMs);
255
217
  end = Number(auction.endTsMs);
256
- /// decayed_price =
218
+ /// decayed_price =
257
219
  /// initial_price -
258
220
  /// (initial_price - final_price) *
259
221
  /// (1 - remaining_time / auction_duration) ^ decay_speed
@@ -37,7 +37,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getWhiteListFromRegistry = void 0;
40
- // const provider = new JsonRpcProvider(TESTNET_RPC_ENDPOINT);//for read only operations
41
40
  function getWhiteListFromRegistry(registry, provider) {
42
41
  return __awaiter(this, void 0, void 0, function () {
43
42
  var whiteLists, tmp, whiteListsTable, whiteListsNodes, whiteListsTableId, tmp2;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
3
3
  */
4
- export declare function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, address: string): Promise<any>;
4
+ export declare function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, addresses: string[]): Promise<any>;
@@ -40,7 +40,7 @@ exports.getAuthorizedAddPortfolioVaultAuthorizedUserTx = void 0;
40
40
  /**
41
41
  * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
42
42
  */
43
- function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, address) {
43
+ function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArguments, index, addresses) {
44
44
  return __awaiter(this, void 0, void 0, function () {
45
45
  var tx;
46
46
  return __generator(this, function (_a) {
@@ -52,7 +52,7 @@ function getAuthorizedAddPortfolioVaultAuthorizedUserTx(gasBudget, packageId, re
52
52
  arguments: [
53
53
  registry,
54
54
  index,
55
- address,
55
+ addresses,
56
56
  ],
57
57
  gasBudget: gasBudget,
58
58
  };
@@ -19,6 +19,7 @@
19
19
  final_price: u64,
20
20
  auction_duration_in_ms: u64,
21
21
  leverage: u64,
22
+ has_next: bool,
22
23
  whitelist: vector<address>,
23
24
  * @param typeArguments [D_TOKEN, B_TOKEN, O_TOKEN]
24
25
  */
@@ -30,8 +31,8 @@ dTokenDecimal: string, // u64
30
31
  bTokenDecimal: string, // u64
31
32
  oTokenDecimal: string, // u64
32
33
  capacity: string, // u64
33
- strikeOtmPct: string[], // vector<u64>
34
+ strikePct: string[], // vector<u64>
34
35
  weight: string[], // vector<u64>
35
- isBuyer: string[], // vector<bool>
36
+ isBuyer: boolean[], // vector<bool>
36
37
  strikeIncrement: string, // u64
37
- lotSize: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string): Promise<any>;
38
+ lotSize: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string, whitelist: string[], leverage: string, hasNext: boolean): Promise<any>;