@typus/typus-sdk 0.6.3 → 1.0.1

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 (218) hide show
  1. package/lib/config.json +17 -20
  2. package/lib/constants.d.ts +8 -6
  3. package/lib/constants.js +9 -7
  4. package/lib/scripts/sui.js +1 -2
  5. package/lib/test/authorized/testAuthorizedNewPortfolioVault.js +82 -0
  6. package/lib/test/{testClaim.js → authorized/testAuthorizedUpdateUpcomingVaultConfig.js} +19 -30
  7. package/lib/test/authorized/testAuthorizedUpdateWarmupVaultConfig.js +68 -0
  8. package/lib/test/getBidData.js +1 -1
  9. package/lib/test/getVaultData.js +2 -2
  10. package/lib/test/getWhiteListFromRegistry.js +2 -2
  11. package/lib/test/helper/getAuctionMaxSize.js +76 -0
  12. package/lib/test/helper/getUserStatus.js +75 -0
  13. package/lib/test/testMint.js +1 -1
  14. package/lib/test/testSubscribeEvent.js +1 -1
  15. package/lib/test/{testWithdraw.js → user/testClaim.js} +14 -17
  16. package/lib/test/{getMakersShares.js → user/testCompound.js} +21 -7
  17. package/lib/test/{testUnsubscribe.js → user/testDeposit.js} +28 -37
  18. package/lib/test/{getUsersShares.js → user/testHarvest.js} +21 -7
  19. package/lib/test/user/testNewBid.js +77 -0
  20. package/lib/test/user/testUnsubscribe.d.ts +1 -0
  21. package/lib/test/user/testUnsubscribe.js +69 -0
  22. package/lib/test/user/testWithdraw.d.ts +1 -0
  23. package/lib/test/{testDeposit.js → user/testWithdraw.js} +15 -19
  24. package/lib/utils/auction/getBid.js +0 -1
  25. package/lib/utils/fetchData.d.ts +72 -61
  26. package/lib/utils/fetchData.js +27 -198
  27. package/lib/utils/getTypeArgumentFromToken.js +0 -1
  28. package/lib/utils/getVaultData.d.ts +2 -2
  29. package/lib/utils/getVaultData.js +123 -162
  30. package/lib/utils/getWhiteListFromRegistry.js +0 -1
  31. package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.d.ts +1 -1
  32. package/lib/utils/portfolio/authorized/getAuthorizedAddPortfolioVaultAuthorizedUserTx.js +2 -2
  33. package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.d.ts +4 -3
  34. package/lib/utils/portfolio/authorized/getAuthorizedNewPortfolioVaultTx.js +5 -3
  35. package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.d.ts +1 -1
  36. package/lib/utils/portfolio/authorized/getAuthorizedRemovePortfolioVaultAuthorizedUserTx.js +2 -2
  37. package/lib/utils/portfolio/authorized/getAuthorizedUpdateUpcomingVaultConfigTx.d.ts +4 -0
  38. package/lib/utils/portfolio/authorized/{getAuthorizedUpdateNextVaultConfigTx.js → getAuthorizedUpdateUpcomingVaultConfigTx.js} +5 -5
  39. package/lib/utils/portfolio/authorized/getAuthorizedUpdateWarmupVaultConfigTx.d.ts +1 -0
  40. package/lib/utils/portfolio/{manager/getUpdateVaultConfigTx.js → authorized/getAuthorizedUpdateWarmupVaultConfigTx.js} +4 -5
  41. package/lib/utils/portfolio/helper/getAuctionMaxSize.d.ts +8 -0
  42. package/lib/utils/portfolio/{manager/getLastEvolutionTx.js → helper/getAuctionMaxSize.js} +11 -7
  43. package/lib/utils/portfolio/helper/getUserStatus.d.ts +29 -0
  44. package/lib/utils/portfolio/{authorized/getAuthorizedEvolutionTx.js → helper/getUserStatus.js} +50 -9
  45. package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.d.ts +8 -1
  46. package/lib/utils/portfolio/manager/getAddAuthorizedUserTx.js +9 -2
  47. package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.d.ts +6 -0
  48. package/lib/utils/portfolio/manager/getAddPortfolioVaultAuthorizedUserTx.js +6 -0
  49. package/lib/utils/portfolio/manager/getEvolutionTx.d.ts +15 -1
  50. package/lib/utils/portfolio/manager/getEvolutionTx.js +14 -0
  51. package/lib/utils/portfolio/manager/getNewManagerTx.d.ts +8 -1
  52. package/lib/utils/portfolio/manager/getNewManagerTx.js +9 -2
  53. package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.d.ts +5 -5
  54. package/lib/utils/portfolio/manager/getNewPortfolioVaultTx.js +5 -5
  55. package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.d.ts +7 -0
  56. package/lib/utils/portfolio/manager/getRemoveAuthorizedUserTx.js +7 -0
  57. package/lib/utils/portfolio/manager/getRemoveManagerTx.d.ts +5 -0
  58. package/lib/utils/portfolio/manager/getRemoveManagerTx.js +5 -0
  59. package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.d.ts +7 -1
  60. package/lib/utils/portfolio/manager/getRemovePortfolioVaultAuthorizedUserTx.js +7 -1
  61. package/lib/utils/portfolio/user/getClaimAndHarvestTx.d.ts +9 -1
  62. package/lib/utils/portfolio/user/getClaimAndHarvestTx.js +11 -3
  63. package/lib/utils/portfolio/user/getClaimTx.d.ts +9 -1
  64. package/lib/utils/portfolio/user/getClaimTx.js +8 -0
  65. package/lib/utils/portfolio/user/getCompoundTx.d.ts +9 -0
  66. package/lib/utils/portfolio/{authorized/getAuthorizedLastEvolutionTx.js → user/getCompoundTx.js} +12 -6
  67. package/lib/utils/portfolio/user/getDepositTx.d.ts +10 -0
  68. package/lib/utils/portfolio/user/getDepositTx.js +10 -0
  69. package/lib/utils/portfolio/user/getHarvestTx.d.ts +9 -1
  70. package/lib/utils/portfolio/user/getHarvestTx.js +8 -0
  71. package/lib/utils/portfolio/user/getNewBidTx.d.ts +13 -1
  72. package/lib/utils/portfolio/user/getNewBidTx.js +12 -0
  73. package/lib/utils/portfolio/user/getUnsubscribeTx.d.ts +10 -1
  74. package/lib/utils/portfolio/user/getUnsubscribeTx.js +9 -0
  75. package/lib/utils/portfolio/user/getWithdrawTx.d.ts +10 -1
  76. package/lib/utils/portfolio/user/getWithdrawTx.js +9 -0
  77. package/package.json +2 -2
  78. package/lib/test/eventListener.d.ts +0 -5
  79. package/lib/test/eventListener.js +0 -397
  80. package/lib/test/testDepositV2.d.ts +0 -0
  81. package/lib/test/testDepositV2.js +0 -64
  82. package/lib/test/testNewAuction.js +0 -94
  83. package/lib/test/testNewVault.js +0 -153
  84. package/lib/test/testOracle.js +0 -94
  85. package/lib/test/testSettle.js +0 -590
  86. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +0 -1
  87. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +0 -56
  88. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  89. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +0 -56
  90. package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +0 -1
  91. package/lib/utils/authorized/getAuthorizedDeliveryTx.js +0 -56
  92. package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
  93. package/lib/utils/authorized/getAuthorizedEvolutionTx.js +0 -56
  94. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
  95. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +0 -56
  96. package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +0 -1
  97. package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +0 -56
  98. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +0 -1
  99. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +0 -76
  100. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +0 -1
  101. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +0 -56
  102. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  103. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +0 -56
  104. package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +0 -1
  105. package/lib/utils/authorized/getAuthorizedSettleTx.js +0 -56
  106. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +0 -1
  107. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +0 -56
  108. package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -1
  109. package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +0 -65
  110. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
  111. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
  112. package/lib/utils/coveredCall/createPriceOracle.d.ts +0 -1
  113. package/lib/utils/coveredCall/createPriceOracle.js +0 -93
  114. package/lib/utils/coveredCall/createTimeOracle.d.ts +0 -1
  115. package/lib/utils/coveredCall/createTimeOracle.js +0 -92
  116. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  117. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +0 -61
  118. package/lib/utils/coveredCall/getClaimAllTx.d.ts +0 -1
  119. package/lib/utils/coveredCall/getClaimAllTx.js +0 -59
  120. package/lib/utils/coveredCall/getClaimTx.d.ts +0 -1
  121. package/lib/utils/coveredCall/getClaimTx.js +0 -59
  122. package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +0 -1
  123. package/lib/utils/coveredCall/getCloseAuctionTx.js +0 -61
  124. package/lib/utils/coveredCall/getCloseVaultTx.d.ts +0 -1
  125. package/lib/utils/coveredCall/getCloseVaultTx.js +0 -60
  126. package/lib/utils/coveredCall/getDeliveryTx.d.ts +0 -1
  127. package/lib/utils/coveredCall/getDeliveryTx.js +0 -61
  128. package/lib/utils/coveredCall/getDepositTx.d.ts +0 -1
  129. package/lib/utils/coveredCall/getDepositTx.js +0 -65
  130. package/lib/utils/coveredCall/getEvolutionTx.d.ts +0 -1
  131. package/lib/utils/coveredCall/getEvolutionTx.js +0 -64
  132. package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +0 -1
  133. package/lib/utils/coveredCall/getLastEvolutionTx.js +0 -63
  134. package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +0 -1
  135. package/lib/utils/coveredCall/getMakerClaimAllTx.js +0 -59
  136. package/lib/utils/coveredCall/getMakerClaimTx.d.ts +0 -1
  137. package/lib/utils/coveredCall/getMakerClaimTx.js +0 -59
  138. package/lib/utils/coveredCall/getNewAuctionTx.d.ts +0 -1
  139. package/lib/utils/coveredCall/getNewAuctionTx.js +0 -66
  140. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +0 -1
  141. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +0 -64
  142. package/lib/utils/coveredCall/getNewBidTx.d.ts +0 -1
  143. package/lib/utils/coveredCall/getNewBidTx.js +0 -62
  144. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +0 -1
  145. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +0 -77
  146. package/lib/utils/coveredCall/getNewManagerTx.d.ts +0 -1
  147. package/lib/utils/coveredCall/getNewManagerTx.js +0 -59
  148. package/lib/utils/coveredCall/getRefundTx.d.ts +0 -1
  149. package/lib/utils/coveredCall/getRefundTx.js +0 -59
  150. package/lib/utils/coveredCall/getRemoveBidTx.d.ts +0 -1
  151. package/lib/utils/coveredCall/getRemoveBidTx.js +0 -60
  152. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +0 -1
  153. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +0 -61
  154. package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +0 -1
  155. package/lib/utils/coveredCall/getRemoveManagerTx.js +0 -58
  156. package/lib/utils/coveredCall/getRollOverTx.d.ts +0 -1
  157. package/lib/utils/coveredCall/getRollOverTx.js +0 -60
  158. package/lib/utils/coveredCall/getSettleTx.d.ts +0 -1
  159. package/lib/utils/coveredCall/getSettleTx.js +0 -62
  160. package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +0 -1
  161. package/lib/utils/coveredCall/getSettleWithRollOverTx.js +0 -62
  162. package/lib/utils/coveredCall/getSubscribeTx.d.ts +0 -1
  163. package/lib/utils/coveredCall/getSubscribeTx.js +0 -60
  164. package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +0 -1
  165. package/lib/utils/coveredCall/getUnsubscribeTx.js +0 -63
  166. package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +0 -1
  167. package/lib/utils/coveredCall/getUpdateCapacityTx.js +0 -61
  168. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +0 -1
  169. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +0 -66
  170. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +0 -1
  171. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +0 -62
  172. package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +0 -1
  173. package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +0 -65
  174. package/lib/utils/coveredCall/getWithdrawTx.d.ts +0 -1
  175. package/lib/utils/coveredCall/getWithdrawTx.js +0 -60
  176. package/lib/utils/fetchPortfolioData.d.ts +0 -93
  177. package/lib/utils/fetchPortfolioData.js +0 -205
  178. package/lib/utils/getCreateTokenRegistryTx.d.ts +0 -1
  179. package/lib/utils/getCreateTokenRegistryTx.js +0 -59
  180. package/lib/utils/getMakersShares.d.ts +0 -8
  181. package/lib/utils/getMakersShares.js +0 -145
  182. package/lib/utils/getNewOracleTx.d.ts +0 -1
  183. package/lib/utils/getNewOracleTx.js +0 -59
  184. package/lib/utils/getNewTimeOracleTx.d.ts +0 -1
  185. package/lib/utils/getNewTimeOracleTx.js +0 -56
  186. package/lib/utils/getUpdateOracleTx.d.ts +0 -1
  187. package/lib/utils/getUpdateOracleTx.js +0 -64
  188. package/lib/utils/getUpdateTimeOracleTx.d.ts +0 -1
  189. package/lib/utils/getUpdateTimeOracleTx.js +0 -60
  190. package/lib/utils/getUsersShares.d.ts +0 -9
  191. package/lib/utils/getUsersShares.js +0 -148
  192. package/lib/utils/getVaultIndexInRegistry.d.ts +0 -1
  193. package/lib/utils/getVaultIndexInRegistry.js +0 -61
  194. package/lib/utils/isObjAvailable.d.ts +0 -0
  195. package/lib/utils/isObjAvailable.js +0 -14
  196. package/lib/utils/loadUsersDepositData.d.ts +0 -8
  197. package/lib/utils/loadUsersDepositData.js +0 -160
  198. package/lib/utils/portfolio/authorized/getAuthorizedEvolutionTx.d.ts +0 -1
  199. package/lib/utils/portfolio/authorized/getAuthorizedLastEvolutionTx.d.ts +0 -1
  200. package/lib/utils/portfolio/authorized/getAuthorizedUpdateNextVaultConfigTx.d.ts +0 -4
  201. package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +0 -1
  202. package/lib/utils/portfolio/authorized/getAuthorizedUpdateVaultConfigTx.js +0 -64
  203. package/lib/utils/portfolio/manager/getLastEvolutionTx.d.ts +0 -1
  204. package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.d.ts +0 -4
  205. package/lib/utils/portfolio/manager/getUpdateNextVaultConfigTx.js +0 -71
  206. package/lib/utils/portfolio/manager/getUpdateVaultConfigTx.d.ts +0 -1
  207. package/lib/utils/portfolio/user/getCompoundPremiumTx.d.ts +0 -1
  208. package/lib/utils/portfolio/user/getCompoundPremiumTx.js +0 -60
  209. /package/lib/test/{getMakersShares.d.ts → authorized/testAuthorizedNewPortfolioVault.d.ts} +0 -0
  210. /package/lib/test/{getUsersShares.d.ts → authorized/testAuthorizedUpdateUpcomingVaultConfig.d.ts} +0 -0
  211. /package/lib/test/{testClaim.d.ts → authorized/testAuthorizedUpdateWarmupVaultConfig.d.ts} +0 -0
  212. /package/lib/test/{testDeposit.d.ts → helper/getAuctionMaxSize.d.ts} +0 -0
  213. /package/lib/test/{testNewAuction.d.ts → helper/getUserStatus.d.ts} +0 -0
  214. /package/lib/test/{testNewVault.d.ts → user/testClaim.d.ts} +0 -0
  215. /package/lib/test/{testOracle.d.ts → user/testCompound.d.ts} +0 -0
  216. /package/lib/test/{testSettle.d.ts → user/testDeposit.d.ts} +0 -0
  217. /package/lib/test/{testUnsubscribe.d.ts → user/testHarvest.d.ts} +0 -0
  218. /package/lib/test/{testWithdraw.d.ts → user/testNewBid.d.ts} +0 -0
@@ -1,60 +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.getUpdateTimeOracleTx = void 0;
40
- function getUpdateTimeOracleTx(gasBudget, packageId, oracle, managerCap, ts) {
41
- return __awaiter(this, void 0, void 0, function () {
42
- var tx;
43
- return __generator(this, function (_a) {
44
- tx = {
45
- packageObjectId: packageId,
46
- module: 'unix_time',
47
- function: 'update',
48
- typeArguments: [],
49
- arguments: [
50
- oracle,
51
- managerCap,
52
- ts
53
- ],
54
- gasBudget: gasBudget,
55
- };
56
- return [2 /*return*/, tx];
57
- });
58
- });
59
- }
60
- exports.getUpdateTimeOracleTx = getUpdateTimeOracleTx;
@@ -1,9 +0,0 @@
1
- import { JsonRpcProvider } from '@mysten/sui.js';
2
- export interface UserShare {
3
- coveredCallVaultIndex: number;
4
- isRolling: boolean;
5
- share: number;
6
- user: string;
7
- depositAmount: string;
8
- }
9
- export declare function getUsersShares(userShareTable: string, registry: string, provider: JsonRpcProvider): Promise<UserShare[]>;
@@ -1,148 +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
- 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
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.getUsersShares = void 0;
54
- var bignumber_js_1 = __importDefault(require("bignumber.js"));
55
- function getSubVaultsData(registry, provider) {
56
- return __awaiter(this, void 0, void 0, function () {
57
- var subVaultsData, coveredCallVaults, coveredCallVaultsId, objsInfo, objsInfo_1, objsInfo_1_1, objInfo, vaultId, vault, subVaultData;
58
- var e_1, _a;
59
- return __generator(this, function (_b) {
60
- switch (_b.label) {
61
- case 0:
62
- subVaultsData = new Map();
63
- return [4 /*yield*/, provider.getDynamicFields(registry)];
64
- case 1:
65
- coveredCallVaults = (_b.sent()).data;
66
- coveredCallVaultsId = coveredCallVaults.map(function (e) { return e.objectId; });
67
- return [4 /*yield*/, provider.getObjectBatch(coveredCallVaultsId)];
68
- case 2:
69
- objsInfo = _b.sent();
70
- try {
71
- for (objsInfo_1 = __values(objsInfo), objsInfo_1_1 = objsInfo_1.next(); !objsInfo_1_1.done; objsInfo_1_1 = objsInfo_1.next()) {
72
- objInfo = objsInfo_1_1.value;
73
- if (objInfo.status != "Exists") {
74
- console.log("obj not exist");
75
- continue;
76
- }
77
- vaultId = Number(objInfo.details.data.fields.name);
78
- vault = objInfo.details.data.fields.value.fields.vault.fields;
79
- subVaultData = {
80
- regularTotalSupply: Number(vault.regular_sub_vault.fields.share_supply),
81
- regularTotalBalance: Number(vault.regular_sub_vault.fields.balance),
82
- isRollingTotalSupply: Number(vault.rolling_sub_vault.fields.share_supply),
83
- isRollingTotalBalance: Number(vault.rolling_sub_vault.fields.balance),
84
- };
85
- subVaultsData.set(vaultId, subVaultData);
86
- }
87
- }
88
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
89
- finally {
90
- try {
91
- if (objsInfo_1_1 && !objsInfo_1_1.done && (_a = objsInfo_1.return)) _a.call(objsInfo_1);
92
- }
93
- finally { if (e_1) throw e_1.error; }
94
- }
95
- return [2 /*return*/, subVaultsData];
96
- }
97
- });
98
- });
99
- }
100
- function getUsersShares(userShareTable, registry, provider) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var subVaultsData, userShareIds, userShares;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4 /*yield*/, getSubVaultsData(registry, provider)]; //vault idx to subvault info
106
- case 1:
107
- subVaultsData = _a.sent() //vault idx to subvault info
108
- ;
109
- return [4 /*yield*/, provider.getDynamicFields(userShareTable)];
110
- case 2:
111
- userShareIds = (_a.sent()).data.map(function (x) { return x.objectId; });
112
- return [4 /*yield*/, provider.getObjectBatch(userShareIds)];
113
- case 3:
114
- userShares = (_a.sent()).map(function (x) {
115
- var _a, _b, _c, _d;
116
- if (x.status != "Exists") {
117
- console.log("obj not exist");
118
- return {};
119
- }
120
- //@ts-ignore
121
- var index = Number(x.details.data.fields.name.fields.index);
122
- //@ts-ignore
123
- var isRolling = Boolean(x.details.data.fields.name.fields.is_rolling);
124
- //@ts-ignore
125
- var share = Number(x.details.data.fields.value);
126
- //user deposit amount = (user share/total share) * total balance
127
- var depositAmount = isRolling ?
128
- (new bignumber_js_1.default(share).div(new bignumber_js_1.default((_a = subVaultsData.get(index)) === null || _a === void 0 ? void 0 : _a.isRollingTotalSupply)).multipliedBy((_b = subVaultsData.get(index)) === null || _b === void 0 ? void 0 : _b.isRollingTotalBalance)) :
129
- (new bignumber_js_1.default(share).div(new bignumber_js_1.default((_c = subVaultsData.get(index)) === null || _c === void 0 ? void 0 : _c.regularTotalSupply)).multipliedBy((_d = subVaultsData.get(index)) === null || _d === void 0 ? void 0 : _d.regularTotalBalance));
130
- var depositAmountRes = depositAmount.toNumber().toFixed(0);
131
- var res = {
132
- coveredCallVaultIndex: index,
133
- //@ts-ignore
134
- isRolling: isRolling,
135
- //@ts-ignore
136
- share: share,
137
- //@ts-ignore
138
- user: x.details.data.fields.name.fields.user,
139
- depositAmount: depositAmountRes,
140
- };
141
- return res;
142
- });
143
- return [2 /*return*/, userShares];
144
- }
145
- });
146
- });
147
- }
148
- exports.getUsersShares = getUsersShares;
@@ -1 +0,0 @@
1
- export declare function getVaultIndexInregistry(registry: string): Promise<number>;
@@ -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.getVaultIndexInregistry = void 0;
40
- var sui_js_1 = require("@mysten/sui.js");
41
- var constants_1 = require("../constants");
42
- var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); //for read only operations
43
- function getVaultIndexInregistry(registry) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- var txn, index;
46
- return __generator(this, function (_a) {
47
- switch (_a.label) {
48
- case 0: return [4 /*yield*/, provider.getObject(registry)];
49
- case 1:
50
- txn = _a.sent();
51
- if (txn.status != "Exists") {
52
- console.log("obj not exists");
53
- return [2 /*return*/, -1];
54
- }
55
- index = txn.details.data.fields.name;
56
- return [2 /*return*/, index];
57
- }
58
- });
59
- });
60
- }
61
- exports.getVaultIndexInregistry = getVaultIndexInregistry;
File without changes
@@ -1,14 +0,0 @@
1
- "use strict";
2
- // import { JsonRpcProvider, Network } from '@mysten/sui.js';
3
- // const provider = new JsonRpcProvider(TESTNET_RPC_ENDPOINT);//for read only operations
4
- // export async function isObjAvailable(obj: string): Promise<Boolean> {
5
- // try {
6
- // let tmp = await provider.getObject(
7
- // obj
8
- // )
9
- // if (tmp.status == "Exists") return true
10
- // else return false
11
- // } catch (e) {
12
- // return false
13
- // }
14
- // }
@@ -1,8 +0,0 @@
1
- export interface UserDepositData {
2
- coveredCallVault: string;
3
- subVault: string;
4
- subVaultType: string;
5
- linkedListNode: string;
6
- balance: number;
7
- }
8
- export declare function loadUsersDepositData(registry: string): Promise<Map<string, UserDepositData[]>>;
@@ -1,160 +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
- 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
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.loadUsersDepositData = void 0;
51
- var fetchData_1 = require("./fetchData");
52
- function loadUsersDepositData(registry) {
53
- return __awaiter(this, void 0, void 0, function () {
54
- var usersDepositData, coveredCallVaults, coveredCallVaults_1, coveredCallVaults_1_1, coveredCallVault, tableUnderCoveredCallVault, subVaults, _a, _b, _c, _i, subVaultType, tableUnderSubVault, linkedListNodes, linkedListNodes_1, linkedListNodes_1_1, linkedListNode, userData, userDepositData, userDepositDatas, e_1_1, e_2_1;
55
- var e_2, _d, e_1, _e;
56
- return __generator(this, function (_f) {
57
- switch (_f.label) {
58
- case 0:
59
- usersDepositData = new Map();
60
- return [4 /*yield*/, (0, fetchData_1.getCoveredCallVaultsFromRegistry)(registry)];
61
- case 1:
62
- coveredCallVaults = _f.sent();
63
- _f.label = 2;
64
- case 2:
65
- _f.trys.push([2, 19, 20, 21]);
66
- coveredCallVaults_1 = __values(coveredCallVaults), coveredCallVaults_1_1 = coveredCallVaults_1.next();
67
- _f.label = 3;
68
- case 3:
69
- if (!!coveredCallVaults_1_1.done) return [3 /*break*/, 18];
70
- coveredCallVault = coveredCallVaults_1_1.value;
71
- return [4 /*yield*/, (0, fetchData_1.getTableFromCoveredCallVault)(coveredCallVault.objectId)
72
- //from table find sub vault
73
- ];
74
- case 4:
75
- tableUnderCoveredCallVault = _f.sent();
76
- return [4 /*yield*/, (0, fetchData_1.getSubVaultsFromTable)(tableUnderCoveredCallVault)
77
- //from sub vault find table
78
- ];
79
- case 5:
80
- subVaults = _f.sent();
81
- _a = subVaults;
82
- _b = [];
83
- for (_c in _a)
84
- _b.push(_c);
85
- _i = 0;
86
- _f.label = 6;
87
- case 6:
88
- if (!(_i < _b.length)) return [3 /*break*/, 17];
89
- _c = _b[_i];
90
- if (!(_c in _a)) return [3 /*break*/, 16];
91
- subVaultType = _c;
92
- return [4 /*yield*/, (0, fetchData_1.getTableUnderSubVault)(subVaults[subVaultType])
93
- //from table find linked list node
94
- ];
95
- case 7:
96
- tableUnderSubVault = _f.sent();
97
- return [4 /*yield*/, (0, fetchData_1.getLinkedListNodesFromTable)(tableUnderSubVault)
98
- //from linkedListNode find user data
99
- ];
100
- case 8:
101
- linkedListNodes = _f.sent();
102
- _f.label = 9;
103
- case 9:
104
- _f.trys.push([9, 14, 15, 16]);
105
- linkedListNodes_1 = (e_1 = void 0, __values(linkedListNodes)), linkedListNodes_1_1 = linkedListNodes_1.next();
106
- _f.label = 10;
107
- case 10:
108
- if (!!linkedListNodes_1_1.done) return [3 /*break*/, 13];
109
- linkedListNode = linkedListNodes_1_1.value;
110
- return [4 /*yield*/, (0, fetchData_1.getUserDataFromLinkedListNode)(linkedListNode.objectId)];
111
- case 11:
112
- userData = _f.sent();
113
- userDepositData = {
114
- coveredCallVault: coveredCallVault.objectId,
115
- subVault: subVaults[subVaultType],
116
- subVaultType: subVaultType,
117
- linkedListNode: linkedListNode.objectId,
118
- balance: (userData.value) ? userData.value.fields.value : 0
119
- };
120
- userDepositDatas = (usersDepositData.get(userData.name) == undefined) ? [] : usersDepositData.get(userData.name);
121
- userDepositDatas.push(userDepositData);
122
- usersDepositData.set(userData.name, userDepositDatas);
123
- _f.label = 12;
124
- case 12:
125
- linkedListNodes_1_1 = linkedListNodes_1.next();
126
- return [3 /*break*/, 10];
127
- case 13: return [3 /*break*/, 16];
128
- case 14:
129
- e_1_1 = _f.sent();
130
- e_1 = { error: e_1_1 };
131
- return [3 /*break*/, 16];
132
- case 15:
133
- try {
134
- if (linkedListNodes_1_1 && !linkedListNodes_1_1.done && (_e = linkedListNodes_1.return)) _e.call(linkedListNodes_1);
135
- }
136
- finally { if (e_1) throw e_1.error; }
137
- return [7 /*endfinally*/];
138
- case 16:
139
- _i++;
140
- return [3 /*break*/, 6];
141
- case 17:
142
- coveredCallVaults_1_1 = coveredCallVaults_1.next();
143
- return [3 /*break*/, 3];
144
- case 18: return [3 /*break*/, 21];
145
- case 19:
146
- e_2_1 = _f.sent();
147
- e_2 = { error: e_2_1 };
148
- return [3 /*break*/, 21];
149
- case 20:
150
- try {
151
- if (coveredCallVaults_1_1 && !coveredCallVaults_1_1.done && (_d = coveredCallVaults_1.return)) _d.call(coveredCallVaults_1);
152
- }
153
- finally { if (e_2) throw e_2.error; }
154
- return [7 /*endfinally*/];
155
- case 21: return [2 /*return*/, usersDepositData];
156
- }
157
- });
158
- });
159
- }
160
- exports.loadUsersDepositData = loadUsersDepositData;
@@ -1 +0,0 @@
1
- export declare function getAuthorizedEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
@@ -1 +0,0 @@
1
- export declare function getAuthorizedLastEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, priceOracle: string, timeOracle: string): Promise<any>;
@@ -1,4 +0,0 @@
1
- export declare function getAuthorizedUpdateNextVaultConfigTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string, strikeOtmPct: string[], // vector<u64>
2
- weight: string[], // vector<u64>
3
- isBuyer: string[], // vector<bool>
4
- strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
@@ -1 +0,0 @@
1
- export declare function getAuthorizedUpdateVaultConfigTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
@@ -1,64 +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.getAuthorizedUpdateVaultConfigTx = void 0;
40
- function getAuthorizedUpdateVaultConfigTx(gasBudget, packageId, typeArguments, registry, index, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs) {
41
- return __awaiter(this, void 0, void 0, function () {
42
- var tx;
43
- return __generator(this, function (_a) {
44
- tx = {
45
- packageObjectId: packageId,
46
- module: 'portfolio',
47
- function: 'authorized_update_vault_config',
48
- typeArguments: typeArguments,
49
- arguments: [
50
- registry,
51
- index,
52
- strikeIncrement,
53
- decaySpeed,
54
- initialPrice,
55
- finalPrice,
56
- auctionDurationInMs,
57
- ],
58
- gasBudget: gasBudget,
59
- };
60
- return [2 /*return*/, tx];
61
- });
62
- });
63
- }
64
- exports.getAuthorizedUpdateVaultConfigTx = getAuthorizedUpdateVaultConfigTx;
@@ -1 +0,0 @@
1
- export declare function getLastEvolutionTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], managerCap: string, index: string, priceOracle: string, timeOracle: string): Promise<any>;
@@ -1,4 +0,0 @@
1
- export declare function getUpdateNextVaultConfigTx(gasBudget: number, packageId: string, managerCap: string, registry: string, typeArguments: string[], index: string, strikeOtmPct: string[], // vector<u64>
2
- weight: string[], // vector<u64>
3
- isBuyer: string[], // vector<bool>
4
- strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
@@ -1,71 +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.getUpdateNextVaultConfigTx = void 0;
40
- function getUpdateNextVaultConfigTx(gasBudget, packageId, managerCap, registry, typeArguments, index, strikeOtmPct, // vector<u64>
41
- weight, // vector<u64>
42
- isBuyer, // vector<bool>
43
- strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- var tx;
46
- return __generator(this, function (_a) {
47
- tx = {
48
- packageObjectId: packageId,
49
- module: 'portfolio',
50
- function: 'update_next_vault_config',
51
- typeArguments: typeArguments,
52
- arguments: [
53
- managerCap,
54
- registry,
55
- index,
56
- strikeOtmPct,
57
- weight,
58
- isBuyer,
59
- strikeIncrement,
60
- decaySpeed,
61
- initialPrice,
62
- finalPrice,
63
- auctionDurationInMs,
64
- ],
65
- gasBudget: gasBudget,
66
- };
67
- return [2 /*return*/, tx];
68
- });
69
- });
70
- }
71
- exports.getUpdateNextVaultConfigTx = getUpdateNextVaultConfigTx;
@@ -1 +0,0 @@
1
- export declare function getUpdateVaultConfigTx(gasBudget: number, packageId: string, managerCap: string, typeArguments: string[], registry: string, index: string, strikeIncrement: string, decaySpeed: string, initialPrice: string, finalPrice: string, auctionDurationInMs: string): Promise<any>;
@@ -1 +0,0 @@
1
- export declare function getCompoundPremiumTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[], index: string): Promise<any>;