@typus/typus-sdk 1.2.68 → 1.2.69

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 (40) hide show
  1. package/lib/config.json +14 -14
  2. package/lib/utils/airdrop/authority-entry.d.ts +22 -0
  3. package/lib/utils/airdrop/authority-entry.js +138 -0
  4. package/lib/utils/airdrop/user-entry.d.ts +10 -0
  5. package/lib/utils/airdrop/user-entry.js +21 -0
  6. package/lib/utils/airdrop/view-functions.d.ts +10 -0
  7. package/lib/utils/airdrop/view-functions.js +72 -0
  8. package/lib/utils/leaderboard/authority-entry.d.ts +22 -0
  9. package/lib/utils/leaderboard/authority-entry.js +91 -0
  10. package/lib/utils/leaderboard/view-function.d.ts +21 -0
  11. package/lib/utils/leaderboard/view-function.js +92 -0
  12. package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +4 -0
  13. package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +5 -1
  14. package/lib/utils/typus-dov-single-v2/user-entry.d.ts +4 -0
  15. package/lib/utils/typus-dov-single-v2/user-entry.js +10 -2
  16. package/lib/utils/user/view-functions.d.ts +9 -0
  17. package/lib/utils/user/view-functions.js +71 -0
  18. package/package.json +1 -1
  19. package/lib/utils/typus-dov-double/authorized-entry.d.ts +0 -102
  20. package/lib/utils/typus-dov-double/authorized-entry.js +0 -295
  21. package/lib/utils/typus-dov-double/manager-entry.d.ts +0 -219
  22. package/lib/utils/typus-dov-double/manager-entry.js +0 -584
  23. package/lib/utils/typus-dov-double/portfolio-vault.d.ts +0 -68
  24. package/lib/utils/typus-dov-double/portfolio-vault.js +0 -303
  25. package/lib/utils/typus-dov-double/user-entry.d.ts +0 -93
  26. package/lib/utils/typus-dov-double/user-entry.js +0 -280
  27. package/lib/utils/typus-dov-double/view-function.d.ts +0 -11
  28. package/lib/utils/typus-dov-double/view-function.js +0 -213
  29. package/lib/utils/typus-dov-single/db-data.d.ts +0 -19
  30. package/lib/utils/typus-dov-single/db-data.js +0 -226
  31. package/lib/utils/typus-dov-single/portfolio-vault.d.ts +0 -63
  32. package/lib/utils/typus-dov-single/portfolio-vault.js +0 -284
  33. package/lib/utils/typus-dov-single/registry.d.ts +0 -14
  34. package/lib/utils/typus-dov-single/registry.js +0 -126
  35. package/lib/utils/typus-dov-single/user-entry.d.ts +0 -103
  36. package/lib/utils/typus-dov-single/user-entry.js +0 -388
  37. package/lib/utils/typus-dov-single/user-history.d.ts +0 -17
  38. package/lib/utils/typus-dov-single/user-history.js +0 -146
  39. package/lib/utils/typus-dov-single/view-function.d.ts +0 -50
  40. package/lib/utils/typus-dov-single/view-function.js +0 -444
@@ -1,280 +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.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundUsdTx = exports.getCompoundTokenTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
40
- var transactions_1 = require("@mysten/sui.js/transactions");
41
- /**
42
- public(friend) entry fun deposit<O_TOKEN, U_TOKEN, B_TOKEN>(
43
- registry: &mut Registry,
44
- index: u64,
45
- token_coins: vector<Coin<O_TOKEN>>,
46
- usd_coins: vector<Coin<U_TOKEN>>,
47
- token_amount: u64,
48
- ctx: &mut TxContext
49
- )
50
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
51
- */
52
- function getDepositTx(gasBudget, packageId, typeArguments, registry, index, o_coins, u_coins, amount) {
53
- return __awaiter(this, void 0, void 0, function () {
54
- var tx;
55
- return __generator(this, function (_a) {
56
- tx = new transactions_1.TransactionBlock();
57
- tx.moveCall({
58
- target: "".concat(packageId, "::typus_dov_double::deposit"),
59
- typeArguments: typeArguments,
60
- arguments: [
61
- tx.pure(registry),
62
- tx.pure(index),
63
- tx.makeMoveVec({ objects: o_coins.map(function (id) { return tx.object(id); }) }),
64
- tx.makeMoveVec({ objects: u_coins.map(function (id) { return tx.object(id); }) }),
65
- tx.pure(amount),
66
- ],
67
- });
68
- tx.setGasBudget(gasBudget);
69
- return [2 /*return*/, tx];
70
- });
71
- });
72
- }
73
- exports.getDepositTx = getDepositTx;
74
- /**
75
- public(friend) entry fun withdraw<O_TOKEN, U_TOKEN, B_TOKEN>(
76
- registry: &mut Registry,
77
- index: u64,
78
- share: Option<u64>,
79
- ctx: &mut TxContext
80
- )
81
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
82
- */
83
- function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, share) {
84
- return __awaiter(this, void 0, void 0, function () {
85
- var tx;
86
- return __generator(this, function (_a) {
87
- tx = new transactions_1.TransactionBlock();
88
- tx.moveCall({
89
- target: "".concat(packageId, "::typus_dov_double::withdraw"),
90
- typeArguments: typeArguments,
91
- arguments: [tx.pure(registry), tx.pure(index), tx.pure(share ? [share] : [])],
92
- });
93
- tx.setGasBudget(gasBudget);
94
- return [2 /*return*/, tx];
95
- });
96
- });
97
- }
98
- exports.getWithdrawTx = getWithdrawTx;
99
- /**
100
- public(friend) entry fun claim<O_TOKEN, U_TOKEN>(
101
- registry: &mut Registry,
102
- index: u64,
103
- ctx: &mut TxContext
104
- )
105
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
106
- */
107
- function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
108
- return __awaiter(this, void 0, void 0, function () {
109
- var tx;
110
- return __generator(this, function (_a) {
111
- tx = new transactions_1.TransactionBlock();
112
- tx.moveCall({
113
- target: "".concat(packageId, "::typus_dov_double::claim"),
114
- typeArguments: typeArguments,
115
- arguments: [tx.pure(registry), tx.pure(index)],
116
- });
117
- tx.setGasBudget(gasBudget);
118
- return [2 /*return*/, tx];
119
- });
120
- });
121
- }
122
- exports.getClaimTx = getClaimTx;
123
- /**
124
- public(friend) entry fun harvest<TOKEN>(
125
- registry: &mut Registry,
126
- index: u64,
127
- ctx: &mut TxContext
128
- )
129
- @param typeArguments [Bid Vault Token]
130
- */
131
- function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
132
- return __awaiter(this, void 0, void 0, function () {
133
- var tx;
134
- return __generator(this, function (_a) {
135
- tx = new transactions_1.TransactionBlock();
136
- tx.moveCall({
137
- target: "".concat(packageId, "::typus_dov_double::harvest"),
138
- typeArguments: typeArguments,
139
- arguments: [tx.pure(registry), tx.pure(index)],
140
- });
141
- tx.setGasBudget(gasBudget);
142
- return [2 /*return*/, tx];
143
- });
144
- });
145
- }
146
- exports.getHarvestTx = getHarvestTx;
147
- /**
148
- public(friend) entry fun claim_and_harvest<O_TOKEN, U_TOKEN, B_TOKEN>(
149
- registry: &mut Registry,
150
- index: u64,
151
- ctx: &mut TxContext
152
- )
153
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
154
- */
155
- function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
156
- return __awaiter(this, void 0, void 0, function () {
157
- var tx;
158
- return __generator(this, function (_a) {
159
- tx = new transactions_1.TransactionBlock();
160
- tx.moveCall({
161
- target: "".concat(packageId, "::typus_dov_double::claim_and_harvest"),
162
- typeArguments: typeArguments,
163
- arguments: [tx.pure(registry), tx.pure(index)],
164
- });
165
- tx.setGasBudget(gasBudget);
166
- return [2 /*return*/, tx];
167
- });
168
- });
169
- }
170
- exports.getClaimAndHarvestTx = getClaimAndHarvestTx;
171
- /**
172
- public(friend) entry fun compound_token<TOKEN, U_TOKEN>(
173
- registry: &mut Registry,
174
- index: u64,
175
- usd_coins: vector<Coin<U_TOKEN>>,
176
- ctx: &mut TxContext,
177
- )
178
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
179
- */
180
- function getCompoundTokenTx(gasBudget, packageId, typeArguments, registry, index, u_coins) {
181
- return __awaiter(this, void 0, void 0, function () {
182
- var tx;
183
- return __generator(this, function (_a) {
184
- tx = new transactions_1.TransactionBlock();
185
- tx.moveCall({
186
- target: "".concat(packageId, "::typus_dov_double::compound_token"),
187
- typeArguments: typeArguments,
188
- arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: u_coins.map(function (id) { return tx.object(id); }) })],
189
- });
190
- tx.setGasBudget(gasBudget);
191
- return [2 /*return*/, tx];
192
- });
193
- });
194
- }
195
- exports.getCompoundTokenTx = getCompoundTokenTx;
196
- /**
197
- public(friend) entry fun compound_usd<O_TOKEN, TOKEN>(
198
- registry: &mut Registry,
199
- index: u64,
200
- token_coins: vector<Coin<O_TOKEN>>,
201
- ctx: &mut TxContext,
202
- )
203
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
204
- */
205
- function getCompoundUsdTx(gasBudget, packageId, typeArguments, registry, index, o_coins) {
206
- return __awaiter(this, void 0, void 0, function () {
207
- var tx;
208
- return __generator(this, function (_a) {
209
- tx = new transactions_1.TransactionBlock();
210
- tx.moveCall({
211
- target: "".concat(packageId, "::typus_dov_double::compound_usd"),
212
- typeArguments: typeArguments,
213
- arguments: [tx.pure(registry), tx.pure(index), tx.makeMoveVec({ objects: o_coins.map(function (id) { return tx.object(id); }) })],
214
- });
215
- tx.setGasBudget(gasBudget);
216
- return [2 /*return*/, tx];
217
- });
218
- });
219
- }
220
- exports.getCompoundUsdTx = getCompoundUsdTx;
221
- /**
222
- public(friend) entry fun unsubscribe<O_TOKEN, U_TOKEN>(
223
- registry: &mut Registry,
224
- index: u64,
225
- share: Option<u64>,
226
- ctx: &mut TxContext
227
- )
228
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token]
229
- */
230
- function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index, share) {
231
- return __awaiter(this, void 0, void 0, function () {
232
- var tx;
233
- return __generator(this, function (_a) {
234
- tx = new transactions_1.TransactionBlock();
235
- tx.moveCall({
236
- target: "".concat(packageId, "::typus_dov_double::unsubscribe"),
237
- typeArguments: typeArguments,
238
- arguments: [tx.pure(registry), tx.pure(index), tx.pure(share ? [share] : [])],
239
- });
240
- tx.setGasBudget(gasBudget);
241
- return [2 /*return*/, tx];
242
- });
243
- });
244
- }
245
- exports.getUnsubscribeTx = getUnsubscribeTx;
246
- /**
247
- public(friend) entry fun new_bid<O_TOKEN, U_TOKEN, B_TOKEN>(
248
- registry: &mut Registry,
249
- index: u64,
250
- price_oracle: &Oracle<O_TOKEN>,
251
- clock: &Clock,
252
- coins: vector<Coin<B_TOKEN>>,
253
- size: u64,
254
- ctx: &mut TxContext,
255
- )
256
- @param typeArguments [Token Deposit Vault Token, Usd Deposit Vault Token, Bid Vault Token]
257
- */
258
- function getNewBidTx(gasBudget, packageId, typeArguments, registry, index, priceOracle, b_coins, size) {
259
- return __awaiter(this, void 0, void 0, function () {
260
- var tx;
261
- return __generator(this, function (_a) {
262
- tx = new transactions_1.TransactionBlock();
263
- tx.moveCall({
264
- target: "".concat(packageId, "::typus_dov_double::new_bid"),
265
- typeArguments: typeArguments,
266
- arguments: [
267
- tx.pure(registry),
268
- tx.pure(index),
269
- tx.pure(priceOracle),
270
- tx.pure("0x6"),
271
- tx.makeMoveVec({ objects: b_coins.map(function (id) { return tx.object(id); }) }),
272
- tx.pure(size),
273
- ],
274
- });
275
- tx.setGasBudget(gasBudget);
276
- return [2 /*return*/, tx];
277
- });
278
- });
279
- }
280
- exports.getNewBidTx = getNewBidTx;
@@ -1,11 +0,0 @@
1
- import { SuiClient } from "@mysten/sui.js/client";
2
- import { DepositVaultUserShare, BidVaultUserShare } from "../typus-framework/vault";
3
- export interface UserShare {
4
- index: string;
5
- tokenDepositVaultUserShare: DepositVaultUserShare;
6
- usdDepositVaultUserShare: DepositVaultUserShare;
7
- bidVaultUserShare: BidVaultUserShare;
8
- }
9
- export declare function getUserShares(provider: SuiClient, packageId: string, registry: string, indexes: string[], user: string): Promise<Map<string, UserShare>>;
10
- export declare function getAuctionMaxSize(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, index: string): Promise<BigInt>;
11
- export declare function getMaxLossPerUnit(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, index: string): Promise<BigInt>;
@@ -1,213 +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 __read = (this && this.__read) || function (o, n) {
39
- var m = typeof Symbol === "function" && o[Symbol.iterator];
40
- if (!m) return o;
41
- var i = m.call(o), r, ar = [], e;
42
- try {
43
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
- }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
49
- }
50
- finally { if (e) throw e.error; }
51
- }
52
- return ar;
53
- };
54
- Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getMaxLossPerUnit = exports.getAuctionMaxSize = exports.getUserShares = void 0;
56
- var transactions_1 = require("@mysten/sui.js/transactions");
57
- var tools_1 = require("../tools");
58
- var constants_1 = require("../../constants");
59
- function getUserShares(provider, packageId, registry, indexes, user) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- var transactionBlock, target, transactionBlockArguments, bytes, result, user_share_bytes, index, tag, position, share;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0:
65
- transactionBlock = new transactions_1.TransactionBlock();
66
- target = "".concat(packageId, "::typus_dov_double::get_user_shares");
67
- transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes), transactionBlock.pure(user)];
68
- transactionBlock.moveCall({
69
- target: target,
70
- arguments: transactionBlockArguments,
71
- });
72
- return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: user })];
73
- case 1:
74
- bytes = (_a.sent()).results[0].returnValues[0][0];
75
- result = Array.from(new Map()).reduce(function (map, _a) {
76
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
77
- map[key] = value;
78
- return map;
79
- }, {});
80
- while (bytes.length > 50) {
81
- user_share_bytes = bytes.splice(bytes.length - 50, 50);
82
- index = (0, tools_1.U64FromBytes)(user_share_bytes.splice(0, 8).reverse()).toString();
83
- tag = (0, tools_1.U64FromBytes)(user_share_bytes.splice(0, 1).reverse()).toString();
84
- user_share_bytes.splice(0, 32);
85
- position = (0, tools_1.U64FromBytes)(user_share_bytes.splice(0, 1).reverse()).toString();
86
- share = (0, tools_1.U64FromBytes)(user_share_bytes.splice(0, 8).reverse());
87
- if (result[index] == undefined) {
88
- result[index] = {
89
- index: index,
90
- tokenDepositVaultUserShare: {
91
- activeSubVaultUserShare: BigInt(0),
92
- deactivatingSubVaultUserShare: BigInt(0),
93
- inactiveSubVaultUserShare: BigInt(0),
94
- warmupSubVaultUserShare: BigInt(0),
95
- },
96
- usdDepositVaultUserShare: {
97
- activeSubVaultUserShare: BigInt(0),
98
- deactivatingSubVaultUserShare: BigInt(0),
99
- inactiveSubVaultUserShare: BigInt(0),
100
- warmupSubVaultUserShare: BigInt(0),
101
- },
102
- bidVaultUserShare: {
103
- bidderSubVaultUserShare: BigInt(0),
104
- premiumSubVaultUserShare: BigInt(0),
105
- performanceFeeSubVaultUserShare: BigInt(0),
106
- },
107
- };
108
- }
109
- result[index].index = index;
110
- switch (tag) {
111
- case "0": {
112
- if (position == "0") {
113
- result[index].tokenDepositVaultUserShare.activeSubVaultUserShare = share;
114
- }
115
- else {
116
- result[index].usdDepositVaultUserShare.activeSubVaultUserShare = share;
117
- }
118
- break;
119
- }
120
- case "1": {
121
- if (position == "0") {
122
- result[index].tokenDepositVaultUserShare.deactivatingSubVaultUserShare = share;
123
- }
124
- else {
125
- result[index].usdDepositVaultUserShare.deactivatingSubVaultUserShare = share;
126
- }
127
- break;
128
- }
129
- case "2": {
130
- if (position == "0") {
131
- result[index].tokenDepositVaultUserShare.inactiveSubVaultUserShare = share;
132
- }
133
- else {
134
- result[index].usdDepositVaultUserShare.inactiveSubVaultUserShare = share;
135
- }
136
- break;
137
- }
138
- case "3": {
139
- if (position == "0") {
140
- result[index].tokenDepositVaultUserShare.warmupSubVaultUserShare = share;
141
- }
142
- else {
143
- result[index].usdDepositVaultUserShare.warmupSubVaultUserShare = share;
144
- }
145
- break;
146
- }
147
- case "4": {
148
- result[index].bidVaultUserShare.bidderSubVaultUserShare = share;
149
- break;
150
- }
151
- case "5": {
152
- result[index].bidVaultUserShare.premiumSubVaultUserShare = share;
153
- break;
154
- }
155
- case "6": {
156
- result[index].bidVaultUserShare.performanceFeeSubVaultUserShare = share;
157
- break;
158
- }
159
- }
160
- }
161
- // @ts-ignore
162
- return [2 /*return*/, result];
163
- }
164
- });
165
- });
166
- }
167
- exports.getUserShares = getUserShares;
168
- function getAuctionMaxSize(provider, packageId, typeArguments, registry, index) {
169
- return __awaiter(this, void 0, void 0, function () {
170
- var transactionBlock, target, transactionBlockArguments, bytes;
171
- return __generator(this, function (_a) {
172
- switch (_a.label) {
173
- case 0:
174
- transactionBlock = new transactions_1.TransactionBlock();
175
- target = "".concat(packageId, "::typus_dov_double::get_auction_max_size");
176
- transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
177
- transactionBlock.moveCall({
178
- target: target,
179
- typeArguments: typeArguments,
180
- arguments: transactionBlockArguments,
181
- });
182
- return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
183
- case 1:
184
- bytes = (_a.sent()).results[0].returnValues[0][0];
185
- return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
186
- }
187
- });
188
- });
189
- }
190
- exports.getAuctionMaxSize = getAuctionMaxSize;
191
- function getMaxLossPerUnit(provider, packageId, typeArguments, registry, index) {
192
- return __awaiter(this, void 0, void 0, function () {
193
- var transactionBlock, target, transactionBlockArguments, bytes;
194
- return __generator(this, function (_a) {
195
- switch (_a.label) {
196
- case 0:
197
- transactionBlock = new transactions_1.TransactionBlock();
198
- target = "".concat(packageId, "::typus_dov_double::get_max_loss_per_unit");
199
- transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
200
- transactionBlock.moveCall({
201
- target: target,
202
- typeArguments: typeArguments,
203
- arguments: transactionBlockArguments,
204
- });
205
- return [4 /*yield*/, provider.devInspectTransactionBlock({ transactionBlock: transactionBlock, sender: constants_1.SENDER })];
206
- case 1:
207
- bytes = (_a.sent()).results[0].returnValues[0][0];
208
- return [2 /*return*/, (0, tools_1.U64FromBytes)(bytes.reverse())];
209
- }
210
- });
211
- });
212
- }
213
- exports.getMaxLossPerUnit = getMaxLossPerUnit;
@@ -1,19 +0,0 @@
1
- import { PortfolioVault } from "./portfolio-vault";
2
- export declare function getDb(database: string, functionNames: string[], vaultIndex: string | undefined, startTsMs: string, limit: number, endTsMs?: string | undefined): Promise<any>;
3
- export declare function getShowMap(database: string, portfolioVaults: Map<string, PortfolioVault>, vaultIndex?: string | undefined, startTsMs?: string, limit?: number): Promise<Map<string, Map<string, Show>>>;
4
- interface Show {
5
- ProjectedAPY: number;
6
- ActivationDate: Date;
7
- SettlementTime: Date;
8
- StrikePrice: number[] | undefined;
9
- SettlePrice: number;
10
- Return: number;
11
- Filled: number;
12
- PaidToDepositors: number;
13
- PaidToBidders: number;
14
- EarnedByDepositors: number;
15
- NewAuctionTx: string | undefined;
16
- DeliveryTx: string | undefined;
17
- SettleTx: string | undefined;
18
- }
19
- export {};