@typus/typus-sdk 0.5.5 → 0.5.6

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 (126) hide show
  1. package/lib/scripts/sui.js +4 -4
  2. package/lib/test/eventListener.js +1 -1
  3. package/lib/test/getBidData.js +1 -1
  4. package/lib/test/getMakersShares.js +1 -1
  5. package/lib/test/getUsersShares.js +1 -1
  6. package/lib/test/getVaultData.js +1 -1
  7. package/lib/test/testClaim.js +5 -4
  8. package/lib/test/testCrypto.js +1 -1
  9. package/lib/test/testDeposit.js +4 -3
  10. package/lib/test/testDepositV2.js +4 -2
  11. package/lib/test/testMint.js +4 -3
  12. package/lib/test/testNewAuction.js +4 -3
  13. package/lib/test/testNewVault.js +4 -3
  14. package/lib/test/testOracle.js +5 -4
  15. package/lib/test/testSettle.js +11 -10
  16. package/lib/test/testSubscribeEvent.js +1 -1
  17. package/lib/test/testUnsubscribe.js +4 -3
  18. package/lib/test/testWithdraw.js +4 -3
  19. package/lib/utils/auction/getBid.js +1 -1
  20. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.d.ts +1 -1
  21. package/lib/utils/authorized/getAuthorizedAddAuthorizedUserTx.js +3 -3
  22. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
  23. package/lib/utils/authorized/getAuthorizedAddCoveredCallVaultAuthorizedUserTx.js +3 -3
  24. package/lib/utils/authorized/getAuthorizedDeliveryTx.d.ts +1 -1
  25. package/lib/utils/authorized/getAuthorizedDeliveryTx.js +3 -3
  26. package/lib/utils/authorized/getAuthorizedEvolutionTx.d.ts +1 -1
  27. package/lib/utils/authorized/getAuthorizedEvolutionTx.js +3 -3
  28. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.d.ts +1 -1
  29. package/lib/utils/authorized/getAuthorizedLastEvolutionTx.js +3 -3
  30. package/lib/utils/authorized/getAuthorizedNewAuctionTx.d.ts +1 -1
  31. package/lib/utils/authorized/getAuthorizedNewAuctionTx.js +3 -3
  32. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.d.ts +1 -1
  33. package/lib/utils/authorized/getAuthorizedNewCoveredCallVaultTx.js +3 -3
  34. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.d.ts +1 -1
  35. package/lib/utils/authorized/getAuthorizedRemoveAuthorizedUserTx.js +3 -3
  36. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
  37. package/lib/utils/authorized/getAuthorizedRemoveCoveredCallVaultAuthorizedUserTx.js +3 -3
  38. package/lib/utils/authorized/getAuthorizedSettleTx.d.ts +1 -1
  39. package/lib/utils/authorized/getAuthorizedSettleTx.js +3 -3
  40. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.d.ts +1 -1
  41. package/lib/utils/authorized/getAuthorizedUpdateCapacityTx.js +3 -3
  42. package/lib/utils/authorized/getAuthorizedUpdateNextVaultConfigTx.js +1 -1
  43. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.d.ts +1 -1
  44. package/lib/utils/authorized/getAuthorizedUpdateVaultConfigTx.js +3 -3
  45. package/lib/utils/coveredCall/createPriceOracle.js +4 -3
  46. package/lib/utils/coveredCall/createTimeOracle.js +4 -3
  47. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
  48. package/lib/utils/coveredCall/getAddCoveredCallVaultAuthorizedUserTx.js +3 -3
  49. package/lib/utils/coveredCall/getClaimAllTx.d.ts +1 -1
  50. package/lib/utils/coveredCall/getClaimAllTx.js +3 -3
  51. package/lib/utils/coveredCall/getClaimTx.d.ts +1 -1
  52. package/lib/utils/coveredCall/getClaimTx.js +3 -3
  53. package/lib/utils/coveredCall/getCloseAuctionTx.d.ts +1 -1
  54. package/lib/utils/coveredCall/getCloseAuctionTx.js +3 -3
  55. package/lib/utils/coveredCall/getCloseVaultTx.d.ts +1 -1
  56. package/lib/utils/coveredCall/getCloseVaultTx.js +3 -3
  57. package/lib/utils/coveredCall/getDeliveryTx.d.ts +1 -1
  58. package/lib/utils/coveredCall/getDeliveryTx.js +3 -3
  59. package/lib/utils/coveredCall/getDepositTx.d.ts +1 -1
  60. package/lib/utils/coveredCall/getDepositTx.js +3 -3
  61. package/lib/utils/coveredCall/getEvolutionTx.d.ts +1 -1
  62. package/lib/utils/coveredCall/getEvolutionTx.js +3 -3
  63. package/lib/utils/coveredCall/getLastEvolutionTx.d.ts +1 -1
  64. package/lib/utils/coveredCall/getLastEvolutionTx.js +3 -3
  65. package/lib/utils/coveredCall/getMakerClaimAllTx.d.ts +1 -1
  66. package/lib/utils/coveredCall/getMakerClaimAllTx.js +3 -3
  67. package/lib/utils/coveredCall/getMakerClaimTx.d.ts +1 -1
  68. package/lib/utils/coveredCall/getMakerClaimTx.js +3 -3
  69. package/lib/utils/coveredCall/getNewAuctionTx.d.ts +1 -1
  70. package/lib/utils/coveredCall/getNewAuctionTx.js +3 -3
  71. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.d.ts +1 -1
  72. package/lib/utils/coveredCall/getNewAuctionWithNextCoveredCallVaultTx.js +3 -3
  73. package/lib/utils/coveredCall/getNewBidTx.d.ts +1 -1
  74. package/lib/utils/coveredCall/getNewBidTx.js +3 -3
  75. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.d.ts +1 -1
  76. package/lib/utils/coveredCall/getNewCoveredCallVaultTx.js +3 -3
  77. package/lib/utils/coveredCall/getNewManagerTx.d.ts +1 -1
  78. package/lib/utils/coveredCall/getNewManagerTx.js +3 -3
  79. package/lib/utils/coveredCall/getRefundTx.d.ts +1 -1
  80. package/lib/utils/coveredCall/getRefundTx.js +3 -3
  81. package/lib/utils/coveredCall/getRemoveBidTx.d.ts +1 -1
  82. package/lib/utils/coveredCall/getRemoveBidTx.js +3 -3
  83. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.d.ts +1 -1
  84. package/lib/utils/coveredCall/getRemoveCoveredCallVaultAuthorizedUserTx.js +3 -3
  85. package/lib/utils/coveredCall/getRemoveManagerTx.d.ts +1 -1
  86. package/lib/utils/coveredCall/getRemoveManagerTx.js +3 -3
  87. package/lib/utils/coveredCall/getRollOverTx.d.ts +1 -1
  88. package/lib/utils/coveredCall/getRollOverTx.js +3 -3
  89. package/lib/utils/coveredCall/getSettleTx.d.ts +1 -1
  90. package/lib/utils/coveredCall/getSettleTx.js +3 -3
  91. package/lib/utils/coveredCall/getSettleWithRollOverTx.d.ts +1 -1
  92. package/lib/utils/coveredCall/getSettleWithRollOverTx.js +3 -3
  93. package/lib/utils/coveredCall/getSubscribeTx.d.ts +1 -1
  94. package/lib/utils/coveredCall/getSubscribeTx.js +3 -3
  95. package/lib/utils/coveredCall/getUnsubscribeTx.d.ts +1 -1
  96. package/lib/utils/coveredCall/getUnsubscribeTx.js +3 -3
  97. package/lib/utils/coveredCall/getUpdateCapacityTx.d.ts +1 -1
  98. package/lib/utils/coveredCall/getUpdateCapacityTx.js +3 -3
  99. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.d.ts +1 -1
  100. package/lib/utils/coveredCall/getUpdateNextVaultConfigTx.js +3 -3
  101. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.d.ts +1 -1
  102. package/lib/utils/coveredCall/getUpdatePayoffConfigTx.js +3 -3
  103. package/lib/utils/coveredCall/getUpdateVaultConfigTx.d.ts +1 -1
  104. package/lib/utils/coveredCall/getUpdateVaultConfigTx.js +3 -3
  105. package/lib/utils/coveredCall/getWithdrawTx.d.ts +1 -1
  106. package/lib/utils/coveredCall/getWithdrawTx.js +3 -3
  107. package/lib/utils/fetchData.js +1 -1
  108. package/lib/utils/getCreateTokenRegistryTx.d.ts +1 -1
  109. package/lib/utils/getCreateTokenRegistryTx.js +3 -3
  110. package/lib/utils/getMakersShares.js +1 -1
  111. package/lib/utils/getMintTx.d.ts +1 -1
  112. package/lib/utils/getMintTx.js +3 -3
  113. package/lib/utils/getNewOracleTx.d.ts +1 -1
  114. package/lib/utils/getNewOracleTx.js +3 -3
  115. package/lib/utils/getNewTimeOracleTx.d.ts +1 -1
  116. package/lib/utils/getNewTimeOracleTx.js +3 -3
  117. package/lib/utils/getTypeArgumentFromToken.js +1 -1
  118. package/lib/utils/getUpdateOracleTx.d.ts +1 -1
  119. package/lib/utils/getUpdateOracleTx.js +3 -3
  120. package/lib/utils/getUpdateTimeOracleTx.d.ts +1 -1
  121. package/lib/utils/getUpdateTimeOracleTx.js +3 -3
  122. package/lib/utils/getUsersShares.js +1 -1
  123. package/lib/utils/getVaultData.js +1 -1
  124. package/lib/utils/getVaultIndexInRegistry.js +1 -1
  125. package/lib/utils/loadUsersDepositData.js +28 -31
  126. package/package.json +2 -2
@@ -82,7 +82,7 @@ function readJsonFile(filePath) {
82
82
  // console.log("test for transferObject()")
83
83
  // const transferTxn = await signer.transferObject({
84
84
  // objectId: obj1,
85
- // gasBudget: 100000,
85
+ // gasBudget: gasBudget,
86
86
  // recipient: receiver,
87
87
  // });
88
88
  // console.log('transferTxn', transferTxn);
@@ -100,7 +100,7 @@ function readJsonFile(filePath) {
100
100
  // 'An NFT created by the wallet Command Line Tool',
101
101
  // 'ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty',
102
102
  // ],
103
- // gasBudget: 100000,
103
+ // gasBudget: gasBudget,
104
104
  // });
105
105
  // console.log('moveCallTxn', moveCallTxn);
106
106
  // })();
@@ -135,7 +135,7 @@ function readJsonFile(filePath) {
135
135
  // );
136
136
  // const publishTxn = await signer.publish({
137
137
  // compiledModules: modulesInBytes,
138
- // gasBudget: 100000,
138
+ // gasBudget: gasBudget,
139
139
  // });
140
140
  // console.log('publishTxn', publishTxn);
141
141
  // })();
@@ -180,7 +180,7 @@ function readJsonFile(filePath) {
180
180
  // true,
181
181
  // coin
182
182
  // ],
183
- // gasBudget: 100000,
183
+ // gasBudget: gasBudget,
184
184
  // }
185
185
  // const moveCallTxn = await signer.executeMoveCall(txn);
186
186
  // console.log('moveCallTxn', moveCallTxn);
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -48,7 +48,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
48
48
  after claim,
49
49
  */
50
50
  (function () { return __awaiter(void 0, void 0, void 0, function () {
51
- var claimAmount, isRolling, token, vaultIndex, typeArgument, claimTx, claimAllTx;
51
+ var claimAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, claimTx, claimAllTx;
52
52
  return __generator(this, function (_a) {
53
53
  switch (_a.label) {
54
54
  case 0:
@@ -61,14 +61,15 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
61
61
  case 1:
62
62
  typeArgument = _a.sent();
63
63
  console.log("test for claim, try to claim " + token + " for " + claimAmount + " ...");
64
- return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex[0])];
64
+ gasBudget = "100000";
65
+ return [4 /*yield*/, (0, getClaimTx_1.getClaimTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex[0])];
65
66
  case 2:
66
67
  claimTx = _a.sent();
67
68
  return [4 /*yield*/, signer.executeMoveCall(claimTx)];
68
69
  case 3:
69
70
  _a.sent();
70
71
  console.log("claim successfully");
71
- return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
72
+ return [4 /*yield*/, (0, getClaimAllTx_1.getClaimAllTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex)];
72
73
  case 4:
73
74
  claimAllTx = _a.sent();
74
75
  return [4 /*yield*/, signer.executeMoveCall(claimAllTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -48,7 +48,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
48
48
  and subVault "rolling_sub_vault" will increase
49
49
  */
50
50
  (function () { return __awaiter(void 0, void 0, void 0, function () {
51
- var depositAmount, isRolling, token, vaultIndex, typeArgument, depositTx;
51
+ var depositAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, depositTx;
52
52
  return __generator(this, function (_a) {
53
53
  switch (_a.label) {
54
54
  case 0:
@@ -60,7 +60,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
60
60
  case 1:
61
61
  typeArgument = _a.sent();
62
62
  console.log("test for deposit, try to deposit " + token + " for " + depositAmount + " ...");
63
- return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
63
+ gasBudget = "100000";
64
+ return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
64
65
  case 2:
65
66
  depositTx = _a.sent();
66
67
  return [4 /*yield*/, signer.executeMoveCall(depositTx)];
@@ -32,7 +32,8 @@
32
32
  // })
33
33
  // it('Create new vault in registry', async () => {
34
34
  // try {
35
- // let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
35
+ // let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
36
+ // gasBudget: string, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
36
37
  // let moveCallTxn = await signer.executeMoveCall(newSharkFinVaultTx);
37
38
  // console.log(moveCallTxn)
38
39
  // assert.ok("Create new vault in registry successfully");
@@ -46,7 +47,8 @@
46
47
  // //@ts-ignore
47
48
  // let numOfVaultBeforeCreateVault = registry.details.data.fields.num_of_vault
48
49
  // // console.log("numOfVaultBeforeCreateVault: " + numOfVaultBeforeCreateVault)
49
- // let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
50
+ // let newSharkFinVaultTx: any = await getNewSharkFinVaultTx(
51
+ // gasBudget: string, SHARKFIN_PACKAGE, SHARKFIN_REGISTRY, typeArgument, expiration, bullish, lowBarrierPrice, highBarrierPrice);
50
52
  // await signer.executeMoveCall(newSharkFinVaultTx);
51
53
  // registry = await provider.getObject(SHARKFIN_REGISTRY)
52
54
  // //@ts-ignore
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -44,7 +44,7 @@ var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
44
44
  var signer = new sui_js_1.RawSigner(keypair, provider);
45
45
  var mintAmount = 1000500000;
46
46
  (function () { return __awaiter(void 0, void 0, void 0, function () {
47
- var tokenRegistry, moduleName, mintTx, moveCallTxn;
47
+ var tokenRegistry, moduleName, gasBudget, mintTx, moveCallTxn;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
50
50
  case 0:
@@ -52,7 +52,8 @@ var mintAmount = 1000500000;
52
52
  return [4 /*yield*/, prepareData(tokenRegistry)];
53
53
  case 1:
54
54
  moduleName = _a.sent();
55
- return [4 /*yield*/, (0, getMintTx_1.getMintTx)(constants_1.TOKEN_PACKAGE, tokenRegistry, moduleName, mintAmount)];
55
+ gasBudget = "100000";
56
+ return [4 /*yield*/, (0, getMintTx_1.getMintTx)(gasBudget, constants_1.TOKEN_PACKAGE, tokenRegistry, moduleName, mintAmount)];
56
57
  case 2:
57
58
  mintTx = _a.sent();
58
59
  return [4 /*yield*/, signer.executeMoveCall(mintTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -62,7 +62,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
62
62
  var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
63
63
  var signer = new sui_js_1.RawSigner(keypair, provider);
64
64
  (function () { return __awaiter(void 0, void 0, void 0, function () {
65
- var token, typeArgument, vaultIndex, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, activationTsMs, expirationTsMs, newAuctionTx, a;
65
+ var token, typeArgument, vaultIndex, _a, priceOracle, priceOracleManager, _b, timeOracle, timeOracleManager, activationTsMs, expirationTsMs, gasBudget, newAuctionTx, a;
66
66
  return __generator(this, function (_c) {
67
67
  switch (_c.label) {
68
68
  case 0:
@@ -80,7 +80,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
80
80
  _b = __read.apply(void 0, [_c.sent(), 2]), timeOracle = _b[0], timeOracleManager = _b[1];
81
81
  activationTsMs = 1671992000000;
82
82
  expirationTsMs = 1;
83
- return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
83
+ gasBudget = "100000";
84
+ return [4 /*yield*/, (0, getNewAuctionTx_1.getNewAuctionTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
84
85
  case 4:
85
86
  newAuctionTx = _c.sent();
86
87
  return [4 /*yield*/, signer.executeMoveCall(newAuctionTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -87,7 +87,7 @@ var auctionDurationInMs = "3600000";
87
87
  var prevBalance = 0;
88
88
  var leverage = "100";
89
89
  (function () { return __awaiter(void 0, void 0, void 0, function () {
90
- var typeArgument, _a, timeOracle, _, newCoveredCallVaultTx, moveCallTxn;
90
+ var typeArgument, _a, timeOracle, _, gasBudget, newCoveredCallVaultTx, moveCallTxn;
91
91
  return __generator(this, function (_b) {
92
92
  switch (_b.label) {
93
93
  case 0: return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)
@@ -99,7 +99,8 @@ var leverage = "100";
99
99
  case 2:
100
100
  _a = __read.apply(void 0, [_b.sent(), 2]), timeOracle = _a[0], _ = _a[1];
101
101
  console.log(typeArgument, timeOracle);
102
- return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs.toString(), tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, [], leverage)];
102
+ gasBudget = "100000";
103
+ return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period, activationTsMs, expirationTsMs.toString(), tokenDecimal, shareDecimal, capacity, strikeOtmPct, strikeIncrement, decaySpeed, initialPrice, finalPrice, auctionDurationInMs, [], leverage)];
103
104
  case 3:
104
105
  newCoveredCallVaultTx = _b.sent();
105
106
  return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -44,7 +44,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
44
44
  var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
45
45
  var signer = new sui_js_1.RawSigner(keypair, provider);
46
46
  (function () { return __awaiter(void 0, void 0, void 0, function () {
47
- var price, unix, decimal, newOracleTx, moveCallTxn, digest, txn, newOracle, managerCap, updateOracleTx, newOracleObj;
47
+ var price, unix, decimal, gasBudget, newOracleTx, moveCallTxn, digest, txn, newOracle, managerCap, updateOracleTx, newOracleObj;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
50
50
  case 0:
@@ -52,7 +52,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
52
52
  unix = 5678;
53
53
  decimal = 8;
54
54
  console.log("create new oracle...");
55
- return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, decimal)];
55
+ gasBudget = "100000";
56
+ return [4 /*yield*/, (0, getNewOracleTx_1.getNewOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, decimal)];
56
57
  case 1:
57
58
  newOracleTx = _a.sent();
58
59
  return [4 /*yield*/, signer.executeMoveCall(newOracleTx)];
@@ -71,7 +72,7 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
71
72
  managerCap = txn.effects.created[0].reference.objectId;
72
73
  }
73
74
  console.log("update oracle...");
74
- return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, newOracle, managerCap, price, unix)];
75
+ return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, constants_1.DEFAULT_TYPE_ARGUMENT, newOracle, managerCap, price, unix)];
75
76
  case 4:
76
77
  updateOracleTx = _a.sent();
77
78
  return [4 /*yield*/, signer.executeMoveCall(updateOracleTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -87,6 +87,7 @@ var strike = 2000;
87
87
  var isRolling = true;
88
88
  var expirationTsMs1 = 1000000;
89
89
  var expirationTsMs2 = 2000000;
90
+ var gasBudget = "100000";
90
91
  // let priceOracle = '0x636b4e02991f13720571d0cbbc8b83d80cd14729';
91
92
  // let priceOracleManager = '0xd958057a227cdfd2080f4aeda7a16d6fe7135bcc';
92
93
  // let timeOracle = '0x2b06a0f8109e394258c288b1d90c8c5a9c3832db';
@@ -243,7 +244,7 @@ function updatePriceOracle(priceOracle, priceOracleManager, typeArgument, price,
243
244
  switch (_a.label) {
244
245
  case 0:
245
246
  _a.trys.push([0, 3, , 4]);
246
- return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(constants_1.ORACLE_PACKAGE, typeArgument, priceOracle, priceOracleManager, price, ts)];
247
+ return [4 /*yield*/, (0, getUpdateOracleTx_1.getUpdateOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, typeArgument, priceOracle, priceOracleManager, price, ts)];
247
248
  case 1:
248
249
  updateOracleTx = _a.sent();
249
250
  return [4 /*yield*/, signer.executeMoveCall(updateOracleTx)];
@@ -276,7 +277,7 @@ function updateTimeOracle(timeOracle, managerCap, ts) {
276
277
  switch (_a.label) {
277
278
  case 0:
278
279
  _a.trys.push([0, 3, , 4]);
279
- return [4 /*yield*/, (0, getUpdateTimeOracleTx_1.getUpdateTimeOracleTx)(constants_1.ORACLE_PACKAGE, timeOracle, managerCap, ts)];
280
+ return [4 /*yield*/, (0, getUpdateTimeOracleTx_1.getUpdateTimeOracleTx)(gasBudget, constants_1.ORACLE_PACKAGE, timeOracle, managerCap, ts)];
280
281
  case 1:
281
282
  updateTimeOracleTx = _a.sent();
282
283
  return [4 /*yield*/, signer.executeMoveCall(updateTimeOracleTx)];
@@ -309,7 +310,7 @@ function createNewVault(packageId, registry, typeArgument, managerCap, timeOracl
309
310
  switch (_a.label) {
310
311
  case 0:
311
312
  _a.trys.push([0, 4, , 5]);
312
- return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period.toString(), activationTsMs.toString(), expirationTsMs.toString(), tokenDecimal.toString(), shareDecimal.toString(), capacity.toString(), strikeOtmPct.toString(), strikeIncrement.toString(), decaySpeed.toString(), initialPrice.toString(), finalPrice.toString(), auctionDurationInMs.toString(), [], leverage.toString())];
313
+ return [4 /*yield*/, (0, getNewCoveredCallVaultTx_1.getNewCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, timeOracle, period.toString(), activationTsMs.toString(), expirationTsMs.toString(), tokenDecimal.toString(), shareDecimal.toString(), capacity.toString(), strikeOtmPct.toString(), strikeIncrement.toString(), decaySpeed.toString(), initialPrice.toString(), finalPrice.toString(), auctionDurationInMs.toString(), [], leverage.toString())];
313
314
  case 1:
314
315
  newCoveredCallVaultTx = _a.sent();
315
316
  return [4 /*yield*/, signer.executeMoveCall(newCoveredCallVaultTx)];
@@ -401,7 +402,7 @@ function depositToVault(typeArgument, vaultIndex, depositAmount) {
401
402
  switch (_a.label) {
402
403
  case 0:
403
404
  _a.trys.push([0, 3, , 4]);
404
- return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), token, depositAmount.toString())];
405
+ return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), token, depositAmount.toString())];
405
406
  case 1:
406
407
  depositTx = _a.sent();
407
408
  return [4 /*yield*/, signer.executeMoveCall(depositTx)];
@@ -434,7 +435,7 @@ function createNewAuctionWithNextCoveredCallVault(typeArgument, vaultIndex, pric
434
435
  switch (_a.label) {
435
436
  case 0:
436
437
  _a.trys.push([0, 3, , 4]);
437
- return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
438
+ return [4 /*yield*/, (0, getNewAuctionWithNextCoveredCallVaultTx_1.getNewAuctionWithNextCoveredCallVaultTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, priceOracle, timeOracle, activationTsMs, expirationTsMs)];
438
439
  case 1:
439
440
  txn = _a.sent();
440
441
  return [4 /*yield*/, signer.executeMoveCall(txn)];
@@ -466,7 +467,7 @@ function newBid(typeArgument, vaultIndex, size, token, timeOracle) {
466
467
  switch (_a.label) {
467
468
  case 0:
468
469
  _a.trys.push([0, 3, , 4]);
469
- return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), size.toString(), token, timeOracle)];
470
+ return [4 /*yield*/, (0, getNewBidTx_1.getNewBidTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), size.toString(), token, timeOracle)];
470
471
  case 1:
471
472
  newBidTx = _a.sent();
472
473
  return [4 /*yield*/, signer.executeMoveCall(newBidTx)];
@@ -498,7 +499,7 @@ function delivery(typeArgument, vaultIndex, sellSize, timeOracle) {
498
499
  switch (_a.label) {
499
500
  case 0:
500
501
  _a.trys.push([0, 3, , 4]);
501
- return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), timeOracle)];
502
+ return [4 /*yield*/, (0, getDeliveryTx_1.getDeliveryTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_MANAGER, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), timeOracle)];
502
503
  case 1:
503
504
  deliveryTx = _a.sent();
504
505
  return [4 /*yield*/, signer.executeMoveCall(deliveryTx)];
@@ -531,7 +532,7 @@ function updatePayoffConfig(typeArgument, vaultIndex, price, premiumRoi, exposur
531
532
  switch (_a.label) {
532
533
  case 0:
533
534
  _a.trys.push([0, 3, , 4]);
534
- return [4 /*yield*/, (0, getUpdatePayoffConfigTx_1.getUpdatePayoffConfigTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), premiumRoi.toString(), exposureRatio.toString())];
535
+ return [4 /*yield*/, (0, getUpdatePayoffConfigTx_1.getUpdatePayoffConfigTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), premiumRoi.toString(), exposureRatio.toString())];
535
536
  case 1:
536
537
  updatePayoffConfigTx = _a.sent();
537
538
  return [4 /*yield*/, signer.executeMoveCall(updatePayoffConfigTx)];
@@ -564,7 +565,7 @@ function settle(typeArgument, vaultIndex, priceOracle, timeOracle) {
564
565
  switch (_a.label) {
565
566
  case 0:
566
567
  _a.trys.push([0, 3, , 4]);
567
- return [4 /*yield*/, (0, getSettleTx_1.getSettleTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
568
+ return [4 /*yield*/, (0, getSettleTx_1.getSettleTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, constants_1.COVERED_CALL_MANAGER, vaultIndex.toString(), priceOracle, timeOracle)];
568
569
  case 1:
569
570
  settleTx = _a.sent();
570
571
  return [4 /*yield*/, signer.executeMoveCall(settleTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -44,6 +44,7 @@ var getUnsubscribeTx_1 = require("../utils/coveredCall/getUnsubscribeTx");
44
44
  var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); //for read only operations
45
45
  var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
46
46
  var signer = new sui_js_1.RawSigner(keypair, provider);
47
+ var gasBudget = "100000";
47
48
  /*
48
49
  after unsubscribe, the subvault (is deposited) "balance" in fields will be 0,
49
50
  and a regular linked list node will be created if not exist, and the value increase.
@@ -67,14 +68,14 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
67
68
  return [4 /*yield*/, (0, getTypeArgumentFromToken_1.getTypeArgumentFromToken)(token, provider)];
68
69
  case 1:
69
70
  typeArgument = _a.sent();
70
- return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
71
+ return [4 /*yield*/, (0, getDepositTx_1.getDepositTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, token, depositAmount)];
71
72
  case 2:
72
73
  depositTx = _a.sent();
73
74
  return [4 /*yield*/, signer.executeMoveCall(depositTx)];
74
75
  case 3:
75
76
  _a.sent();
76
77
  console.log("deposit " + depositAmount + " to new vault successfully");
77
- return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, share)];
78
+ return [4 /*yield*/, (0, getUnsubscribeTx_1.getUnsubscribeTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex, share)];
78
79
  case 4:
79
80
  unSubscribedTx = _a.sent();
80
81
  return [4 /*yield*/, signer.executeMoveCall(unSubscribedTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -44,7 +44,7 @@ var provider = new sui_js_1.JsonRpcProvider(constants_1.TESTNET_RPC_ENDPOINT); /
44
44
  var keypair = sui_js_1.Ed25519Keypair.deriveKeypair(constants_1.TEST_MNEMONIC);
45
45
  var signer = new sui_js_1.RawSigner(keypair, provider);
46
46
  (function () { return __awaiter(void 0, void 0, void 0, function () {
47
- var withdrawAmount, isRolling, token, vaultIndex, typeArgument, withdrawTx;
47
+ var withdrawAmount, isRolling, token, vaultIndex, typeArgument, gasBudget, withdrawTx;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
50
50
  case 0:
@@ -57,7 +57,8 @@ var signer = new sui_js_1.RawSigner(keypair, provider);
57
57
  case 1:
58
58
  typeArgument = _a.sent();
59
59
  console.log("test for withdraw, try to withdraw " + token + " for " + withdrawAmount + " ...");
60
- return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), withdrawAmount.toString())];
60
+ gasBudget = "100000";
61
+ return [4 /*yield*/, (0, getWithdrawTx_1.getWithdrawTx)(gasBudget, constants_1.COVERED_CALL_PACKAGE, constants_1.COVERED_CALL_REGISTRY, typeArgument, vaultIndex.toString(), withdrawAmount.toString())];
61
62
  case 2:
62
63
  withdrawTx = _a.sent();
63
64
  return [4 /*yield*/, signer.executeMoveCall(withdrawTx)];
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1 +1 @@
1
- export declare function getAuthorizedAddAuthorizedUserTx(packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
1
+ export declare function getAuthorizedAddAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, managerCap: string, address: string): Promise<any>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getAuthorizedAddAuthorizedUserTx = void 0;
40
- function getAuthorizedAddAuthorizedUserTx(packageId, registry, managerCap, address) {
40
+ function getAuthorizedAddAuthorizedUserTx(gasBudget, packageId, registry, managerCap, address) {
41
41
  return __awaiter(this, void 0, void 0, function () {
42
42
  var tx;
43
43
  return __generator(this, function (_a) {
@@ -47,7 +47,7 @@ function getAuthorizedAddAuthorizedUserTx(packageId, registry, managerCap, addre
47
47
  function: 'add_authorized_user',
48
48
  typeArguments: [],
49
49
  arguments: [managerCap, registry, address],
50
- gasBudget: 100000,
50
+ gasBudget: gasBudget,
51
51
  };
52
52
  return [2 /*return*/, tx];
53
53
  });
@@ -1 +1 @@
1
- export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
1
+ export declare function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, address: string): Promise<any>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getAuthorizedAddCoveredCallVaultAuthorizedUserTx = void 0;
40
- function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId, registry, typeArgument, index, address) {
40
+ function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(gasBudget, packageId, registry, typeArgument, index, address) {
41
41
  return __awaiter(this, void 0, void 0, function () {
42
42
  var tx;
43
43
  return __generator(this, function (_a) {
@@ -47,7 +47,7 @@ function getAuthorizedAddCoveredCallVaultAuthorizedUserTx(packageId, registry, t
47
47
  function: 'authorized_add_covered_call_vault_authorized_user',
48
48
  typeArguments: [typeArgument],
49
49
  arguments: [registry, index, address],
50
- gasBudget: 100000,
50
+ gasBudget: gasBudget,
51
51
  };
52
52
  return [2 /*return*/, tx];
53
53
  });
@@ -1 +1 @@
1
- export declare function getAuthorizedDeliveryTx(packageId: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
1
+ export declare function getAuthorizedDeliveryTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, timeOracle: string): Promise<any>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getAuthorizedDeliveryTx = void 0;
40
- function getAuthorizedDeliveryTx(packageId, registry, typeArgument, index, timeOracle) {
40
+ function getAuthorizedDeliveryTx(gasBudget, packageId, registry, typeArgument, index, timeOracle) {
41
41
  return __awaiter(this, void 0, void 0, function () {
42
42
  var tx;
43
43
  return __generator(this, function (_a) {
@@ -47,7 +47,7 @@ function getAuthorizedDeliveryTx(packageId, registry, typeArgument, index, timeO
47
47
  function: 'authorized_delivery',
48
48
  typeArguments: [typeArgument],
49
49
  arguments: [registry, index, timeOracle],
50
- gasBudget: 100000,
50
+ gasBudget: gasBudget,
51
51
  };
52
52
  return [2 /*return*/, tx];
53
53
  });
@@ -1 +1 @@
1
- export declare function getAuthorizedEvolutionTx(packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;
1
+ export declare function getAuthorizedEvolutionTx(gasBudget: string, packageId: string, registry: string, typeArgument: string, index: string, priceOracle: string, timeOracle: string, activationTsMs: string, expirationTsMs: string): Promise<any>;