@typus/typus-sdk 1.1.39 → 1.1.40
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.
- package/lib/constants.d.ts +2 -2
- package/lib/constants.js +3 -4
- package/lib/utils/mint.d.ts +1 -1
- package/lib/utils/mint.js +2 -2
- package/lib/utils/nft-staking/authorized-entry.d.ts +1 -1
- package/lib/utils/nft-staking/authorized-entry.js +4 -4
- package/lib/utils/nft-staking/fetch.d.ts +2 -2
- package/lib/utils/nft-staking/user-entry.d.ts +4 -2
- package/lib/utils/nft-staking/user-entry.js +37 -27
- package/lib/utils/tails-exp-dice/fetch.d.ts +4 -4
- package/lib/utils/tails-exp-dice/user-entry.d.ts +1 -1
- package/lib/utils/tails-exp-dice/user-entry.js +4 -4
- package/lib/utils/token.js +2 -2
- package/lib/utils/typus-dov-double/authorized-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/authorized-entry.js +8 -8
- package/lib/utils/typus-dov-double/manager-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/manager-entry.js +19 -19
- package/lib/utils/typus-dov-double/portfolio-vault.d.ts +2 -2
- package/lib/utils/typus-dov-double/portfolio-vault.js +6 -2
- package/lib/utils/typus-dov-double/user-entry.d.ts +1 -1
- package/lib/utils/typus-dov-double/user-entry.js +10 -10
- package/lib/utils/typus-dov-double/view-function.d.ts +4 -4
- package/lib/utils/typus-dov-double/view-function.js +4 -4
- package/lib/utils/typus-dov-single/portfolio-vault.d.ts +3 -3
- package/lib/utils/typus-dov-single/registry.d.ts +3 -3
- package/lib/utils/typus-dov-single/user-entry.d.ts +1 -1
- package/lib/utils/typus-dov-single/user-entry.js +12 -12
- package/lib/utils/typus-dov-single/user-history.d.ts +2 -2
- package/lib/utils/typus-dov-single/view-function.d.ts +8 -8
- package/lib/utils/typus-dov-single/view-function.js +8 -8
- package/lib/utils/typus-dov-single-v2/authorized-entry.d.ts +1 -1
- package/lib/utils/typus-dov-single-v2/authorized-entry.js +3 -3
- package/lib/utils/typus-dov-single-v2/leaderboard.d.ts +4 -16
- package/lib/utils/typus-dov-single-v2/leaderboard.js +12 -0
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +14 -1
- package/lib/utils/typus-dov-single-v2/user-entry.js +67 -12
- package/lib/utils/typus-dov-single-v2/user-history.d.ts +2 -2
- package/lib/utils/typus-dov-single-v2/view-function.d.ts +7 -7
- package/lib/utils/typus-dov-single-v2/view-function.js +7 -7
- package/lib/utils/typus-framework/dutch.d.ts +2 -2
- package/lib/utils/typus-nft/fetch.d.ts +6 -6
- package/lib/utils/typus-nft/fetch.js +8 -4
- package/lib/utils/typus-nft/user-entry.d.ts +1 -1
- package/lib/utils/typus-nft/user-entry.js +3 -3
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
import { DepositVault, BidVault } from "../typus-framework/vault";
|
|
3
3
|
import { Auction } from "../typus-framework/dutch";
|
|
4
4
|
export interface PortfolioVault {
|
|
@@ -65,4 +65,4 @@ export interface PayoffConfig {
|
|
|
65
65
|
isBuyer: boolean;
|
|
66
66
|
strike?: string;
|
|
67
67
|
}
|
|
68
|
-
export declare function getPortfolioVaults(provider:
|
|
68
|
+
export declare function getPortfolioVaults(provider: SuiClient, registry: string, token_deposit_vault_registry: string, usd_deposit_vault_registry: string, bid_vault_registry: string, index?: string): Promise<Map<string, PortfolioVault>>;
|
|
@@ -185,7 +185,9 @@ function getPortfolioVaults(provider, registry, token_deposit_vault_registry, us
|
|
|
185
185
|
},
|
|
186
186
|
upcomingVaultConfig: {
|
|
187
187
|
// @ts-ignore
|
|
188
|
-
callPayoffConfigs:
|
|
188
|
+
callPayoffConfigs:
|
|
189
|
+
// @ts-ignore
|
|
190
|
+
portfolioVault.data.content.fields.config.fields.upcoming_vault_config.fields.call_payoff_configs.map(function (x) {
|
|
189
191
|
return ({
|
|
190
192
|
strikePct: x.fields.strike_pct,
|
|
191
193
|
weight: x.fields.weight,
|
|
@@ -211,7 +213,9 @@ function getPortfolioVaults(provider, registry, token_deposit_vault_registry, us
|
|
|
211
213
|
// @ts-ignore
|
|
212
214
|
finalPrice: portfolioVault.data.content.fields.config.fields.upcoming_vault_config.fields.final_price,
|
|
213
215
|
// @ts-ignore
|
|
214
|
-
auctionDurationInMs:
|
|
216
|
+
auctionDurationInMs:
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
portfolioVault.data.content.fields.config.fields.upcoming_vault_config.fields.auction_duration_in_ms,
|
|
215
219
|
},
|
|
216
220
|
};
|
|
217
221
|
// @ts-ignore
|
|
@@ -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.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundUsdTx = exports.getCompoundTokenTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
40
|
-
var
|
|
40
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
41
41
|
/**
|
|
42
42
|
public(friend) entry fun deposit<O_TOKEN, U_TOKEN, B_TOKEN>(
|
|
43
43
|
registry: &mut Registry,
|
|
@@ -53,7 +53,7 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, o_co
|
|
|
53
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
54
|
var tx;
|
|
55
55
|
return __generator(this, function (_a) {
|
|
56
|
-
tx = new
|
|
56
|
+
tx = new transactions_1.TransactionBlock();
|
|
57
57
|
tx.moveCall({
|
|
58
58
|
target: "".concat(packageId, "::typus_dov_double::deposit"),
|
|
59
59
|
typeArguments: typeArguments,
|
|
@@ -84,7 +84,7 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, sha
|
|
|
84
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
85
|
var tx;
|
|
86
86
|
return __generator(this, function (_a) {
|
|
87
|
-
tx = new
|
|
87
|
+
tx = new transactions_1.TransactionBlock();
|
|
88
88
|
tx.moveCall({
|
|
89
89
|
target: "".concat(packageId, "::typus_dov_double::withdraw"),
|
|
90
90
|
typeArguments: typeArguments,
|
|
@@ -108,7 +108,7 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
108
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
109
109
|
var tx;
|
|
110
110
|
return __generator(this, function (_a) {
|
|
111
|
-
tx = new
|
|
111
|
+
tx = new transactions_1.TransactionBlock();
|
|
112
112
|
tx.moveCall({
|
|
113
113
|
target: "".concat(packageId, "::typus_dov_double::claim"),
|
|
114
114
|
typeArguments: typeArguments,
|
|
@@ -132,7 +132,7 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
132
132
|
return __awaiter(this, void 0, void 0, function () {
|
|
133
133
|
var tx;
|
|
134
134
|
return __generator(this, function (_a) {
|
|
135
|
-
tx = new
|
|
135
|
+
tx = new transactions_1.TransactionBlock();
|
|
136
136
|
tx.moveCall({
|
|
137
137
|
target: "".concat(packageId, "::typus_dov_double::harvest"),
|
|
138
138
|
typeArguments: typeArguments,
|
|
@@ -156,7 +156,7 @@ function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, ind
|
|
|
156
156
|
return __awaiter(this, void 0, void 0, function () {
|
|
157
157
|
var tx;
|
|
158
158
|
return __generator(this, function (_a) {
|
|
159
|
-
tx = new
|
|
159
|
+
tx = new transactions_1.TransactionBlock();
|
|
160
160
|
tx.moveCall({
|
|
161
161
|
target: "".concat(packageId, "::typus_dov_double::claim_and_harvest"),
|
|
162
162
|
typeArguments: typeArguments,
|
|
@@ -181,7 +181,7 @@ function getCompoundTokenTx(gasBudget, packageId, typeArguments, registry, index
|
|
|
181
181
|
return __awaiter(this, void 0, void 0, function () {
|
|
182
182
|
var tx;
|
|
183
183
|
return __generator(this, function (_a) {
|
|
184
|
-
tx = new
|
|
184
|
+
tx = new transactions_1.TransactionBlock();
|
|
185
185
|
tx.moveCall({
|
|
186
186
|
target: "".concat(packageId, "::typus_dov_double::compound_token"),
|
|
187
187
|
typeArguments: typeArguments,
|
|
@@ -206,7 +206,7 @@ function getCompoundUsdTx(gasBudget, packageId, typeArguments, registry, index,
|
|
|
206
206
|
return __awaiter(this, void 0, void 0, function () {
|
|
207
207
|
var tx;
|
|
208
208
|
return __generator(this, function (_a) {
|
|
209
|
-
tx = new
|
|
209
|
+
tx = new transactions_1.TransactionBlock();
|
|
210
210
|
tx.moveCall({
|
|
211
211
|
target: "".concat(packageId, "::typus_dov_double::compound_usd"),
|
|
212
212
|
typeArguments: typeArguments,
|
|
@@ -231,7 +231,7 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, index,
|
|
|
231
231
|
return __awaiter(this, void 0, void 0, function () {
|
|
232
232
|
var tx;
|
|
233
233
|
return __generator(this, function (_a) {
|
|
234
|
-
tx = new
|
|
234
|
+
tx = new transactions_1.TransactionBlock();
|
|
235
235
|
tx.moveCall({
|
|
236
236
|
target: "".concat(packageId, "::typus_dov_double::unsubscribe"),
|
|
237
237
|
typeArguments: typeArguments,
|
|
@@ -259,7 +259,7 @@ function getNewBidTx(gasBudget, packageId, typeArguments, registry, index, price
|
|
|
259
259
|
return __awaiter(this, void 0, void 0, function () {
|
|
260
260
|
var tx;
|
|
261
261
|
return __generator(this, function (_a) {
|
|
262
|
-
tx = new
|
|
262
|
+
tx = new transactions_1.TransactionBlock();
|
|
263
263
|
tx.moveCall({
|
|
264
264
|
target: "".concat(packageId, "::typus_dov_double::new_bid"),
|
|
265
265
|
typeArguments: typeArguments,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
import { DepositVaultUserShare, BidVaultUserShare } from "../typus-framework/vault";
|
|
3
3
|
export interface UserShare {
|
|
4
4
|
index: string;
|
|
@@ -6,6 +6,6 @@ export interface UserShare {
|
|
|
6
6
|
usdDepositVaultUserShare: DepositVaultUserShare;
|
|
7
7
|
bidVaultUserShare: BidVaultUserShare;
|
|
8
8
|
}
|
|
9
|
-
export declare function getUserShares(provider:
|
|
10
|
-
export declare function getAuctionMaxSize(provider:
|
|
11
|
-
export declare function getMaxLossPerUnit(provider:
|
|
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>;
|
|
@@ -53,7 +53,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getMaxLossPerUnit = exports.getAuctionMaxSize = exports.getUserShares = void 0;
|
|
56
|
-
var
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var tools_1 = require("../tools");
|
|
58
58
|
var constants_1 = require("../../constants");
|
|
59
59
|
function getUserShares(provider, packageId, registry, indexes, user) {
|
|
@@ -62,7 +62,7 @@ function getUserShares(provider, packageId, registry, indexes, user) {
|
|
|
62
62
|
return __generator(this, function (_a) {
|
|
63
63
|
switch (_a.label) {
|
|
64
64
|
case 0:
|
|
65
|
-
transactionBlock = new
|
|
65
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
66
66
|
target = "".concat(packageId, "::typus_dov_double::get_user_shares");
|
|
67
67
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes), transactionBlock.pure(user)];
|
|
68
68
|
transactionBlock.moveCall({
|
|
@@ -171,7 +171,7 @@ function getAuctionMaxSize(provider, packageId, typeArguments, registry, index)
|
|
|
171
171
|
return __generator(this, function (_a) {
|
|
172
172
|
switch (_a.label) {
|
|
173
173
|
case 0:
|
|
174
|
-
transactionBlock = new
|
|
174
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
175
175
|
target = "".concat(packageId, "::typus_dov_double::get_auction_max_size");
|
|
176
176
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
177
177
|
transactionBlock.moveCall({
|
|
@@ -194,7 +194,7 @@ function getMaxLossPerUnit(provider, packageId, typeArguments, registry, index)
|
|
|
194
194
|
return __generator(this, function (_a) {
|
|
195
195
|
switch (_a.label) {
|
|
196
196
|
case 0:
|
|
197
|
-
transactionBlock = new
|
|
197
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
198
198
|
target = "".concat(packageId, "::typus_dov_double::get_max_loss_per_unit");
|
|
199
199
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
200
200
|
transactionBlock.moveCall({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
import { DepositVault, BidVault } from "../typus-framework/vault";
|
|
3
3
|
import { Auction } from "../typus-framework/dutch";
|
|
4
4
|
export interface PortfolioVault {
|
|
@@ -59,5 +59,5 @@ export interface PayoffConfig {
|
|
|
59
59
|
isBuyer: boolean;
|
|
60
60
|
strike?: string;
|
|
61
61
|
}
|
|
62
|
-
export declare function getPortfolioVaults(provider:
|
|
63
|
-
export declare function getPortfolioVaultAuctionDelayTsMs(provider:
|
|
62
|
+
export declare function getPortfolioVaults(provider: SuiClient, registry: string, deposit_vault_registry: string, bid_vault_registry: string, index?: string): Promise<Map<string, PortfolioVault>>;
|
|
63
|
+
export declare function getPortfolioVaultAuctionDelayTsMs(provider: SuiClient, portfolio_vault: PortfolioVault): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export interface Registry {
|
|
3
3
|
version: string;
|
|
4
4
|
numOfVault: string;
|
|
@@ -10,5 +10,5 @@ export interface Registry {
|
|
|
10
10
|
};
|
|
11
11
|
authority: string[];
|
|
12
12
|
}
|
|
13
|
-
export declare function getRegistry(provider:
|
|
14
|
-
export declare function getPackageVersion(provider:
|
|
13
|
+
export declare function getRegistry(provider: SuiClient, registry: string): Promise<Registry>;
|
|
14
|
+
export declare function getPackageVersion(provider: SuiClient, packageId: string): Promise<bigint>;
|
|
@@ -53,7 +53,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getNewBidTx = exports.getUnsubscribeTx = exports.getCompoundTx = exports.getClaimAndHarvestTx = exports.getHarvestTx = exports.getBatchClaimHarvestWithdrawTx = exports.getBatchClaimHarvestTx = exports.getBatchClaimTx = exports.getClaimTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
|
-
var
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
59
59
|
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
@@ -70,7 +70,7 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, additional_
|
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
71
|
var tx, _a, coin;
|
|
72
72
|
return __generator(this, function (_b) {
|
|
73
|
-
tx = new
|
|
73
|
+
tx = new transactions_1.TransactionBlock();
|
|
74
74
|
if (!usingSponsoredGasCoin &&
|
|
75
75
|
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
76
76
|
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -119,7 +119,7 @@ function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, sha
|
|
|
119
119
|
return __awaiter(this, void 0, void 0, function () {
|
|
120
120
|
var tx;
|
|
121
121
|
return __generator(this, function (_a) {
|
|
122
|
-
tx = new
|
|
122
|
+
tx = new transactions_1.TransactionBlock();
|
|
123
123
|
tx.moveCall({
|
|
124
124
|
target: "".concat(packageId, "::typus_dov_single::withdraw"),
|
|
125
125
|
typeArguments: typeArguments,
|
|
@@ -143,7 +143,7 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, additional_co
|
|
|
143
143
|
return __awaiter(this, void 0, void 0, function () {
|
|
144
144
|
var tx;
|
|
145
145
|
return __generator(this, function (_a) {
|
|
146
|
-
tx = new
|
|
146
|
+
tx = new transactions_1.TransactionBlock();
|
|
147
147
|
tx.moveCall({
|
|
148
148
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
149
149
|
typeArguments: typeArguments,
|
|
@@ -159,7 +159,7 @@ function getBatchClaimTx(gasBudget, packageId, registry, additional_config_regis
|
|
|
159
159
|
return __awaiter(this, void 0, void 0, function () {
|
|
160
160
|
var tx;
|
|
161
161
|
return __generator(this, function (_a) {
|
|
162
|
-
tx = new
|
|
162
|
+
tx = new transactions_1.TransactionBlock();
|
|
163
163
|
requests.forEach(function (request) {
|
|
164
164
|
tx.moveCall({
|
|
165
165
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
@@ -177,7 +177,7 @@ function getBatchClaimHarvestTx(gasBudget, packageId, registry, additional_confi
|
|
|
177
177
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
178
|
var tx;
|
|
179
179
|
return __generator(this, function (_a) {
|
|
180
|
-
tx = new
|
|
180
|
+
tx = new transactions_1.TransactionBlock();
|
|
181
181
|
claimRequests.forEach(function (request) {
|
|
182
182
|
tx.moveCall({
|
|
183
183
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
@@ -203,7 +203,7 @@ function getBatchClaimHarvestWithdrawTx(gasBudget, packageId, registry, addition
|
|
|
203
203
|
return __awaiter(this, void 0, void 0, function () {
|
|
204
204
|
var tx;
|
|
205
205
|
return __generator(this, function (_a) {
|
|
206
|
-
tx = new
|
|
206
|
+
tx = new transactions_1.TransactionBlock();
|
|
207
207
|
claimRequests.forEach(function (request) {
|
|
208
208
|
tx.moveCall({
|
|
209
209
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
@@ -243,7 +243,7 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, additional_
|
|
|
243
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
244
|
var tx;
|
|
245
245
|
return __generator(this, function (_a) {
|
|
246
|
-
tx = new
|
|
246
|
+
tx = new transactions_1.TransactionBlock();
|
|
247
247
|
tx.moveCall({
|
|
248
248
|
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
249
249
|
typeArguments: typeArguments,
|
|
@@ -267,7 +267,7 @@ function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, add
|
|
|
267
267
|
return __awaiter(this, void 0, void 0, function () {
|
|
268
268
|
var tx;
|
|
269
269
|
return __generator(this, function (_a) {
|
|
270
|
-
tx = new
|
|
270
|
+
tx = new transactions_1.TransactionBlock();
|
|
271
271
|
tx.moveCall({
|
|
272
272
|
target: "".concat(packageId, "::typus_dov_single::claim_and_harvest"),
|
|
273
273
|
typeArguments: typeArguments,
|
|
@@ -291,7 +291,7 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional
|
|
|
291
291
|
return __awaiter(this, void 0, void 0, function () {
|
|
292
292
|
var tx;
|
|
293
293
|
return __generator(this, function (_a) {
|
|
294
|
-
tx = new
|
|
294
|
+
tx = new transactions_1.TransactionBlock();
|
|
295
295
|
tx.moveCall({
|
|
296
296
|
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
297
297
|
typeArguments: typeArguments,
|
|
@@ -316,7 +316,7 @@ function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, additio
|
|
|
316
316
|
return __awaiter(this, void 0, void 0, function () {
|
|
317
317
|
var tx;
|
|
318
318
|
return __generator(this, function (_a) {
|
|
319
|
-
tx = new
|
|
319
|
+
tx = new transactions_1.TransactionBlock();
|
|
320
320
|
tx.moveCall({
|
|
321
321
|
target: "".concat(packageId, "::typus_dov_single::unsubscribe"),
|
|
322
322
|
typeArguments: typeArguments,
|
|
@@ -346,7 +346,7 @@ usingSponsoredGasCoin) {
|
|
|
346
346
|
return __awaiter(this, void 0, void 0, function () {
|
|
347
347
|
var tx, _a, coin;
|
|
348
348
|
return __generator(this, function (_b) {
|
|
349
|
-
tx = new
|
|
349
|
+
tx = new transactions_1.TransactionBlock();
|
|
350
350
|
if (!usingSponsoredGasCoin &&
|
|
351
351
|
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
352
352
|
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getUserHistory(provider:
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
+
export declare function getUserHistory(provider: SuiClient, originPackage: string, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
3
3
|
interface TxHistory {
|
|
4
4
|
Vault: string;
|
|
5
5
|
Action: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
import { DepositVaultUserShare, BidVaultUserShare } from "../typus-framework/vault";
|
|
3
3
|
export interface UserShare {
|
|
4
4
|
index: string;
|
|
@@ -41,10 +41,10 @@ export interface AdditionalConfig {
|
|
|
41
41
|
depositor_incentive_rate_bp: string;
|
|
42
42
|
current_portfolio_step: string;
|
|
43
43
|
}
|
|
44
|
-
export declare function getUserShares(provider:
|
|
45
|
-
export declare function getAuctionMaxSize(provider:
|
|
46
|
-
export declare function getMaxLossPerUnit(provider:
|
|
47
|
-
export declare function getAuctionTotalBidSize(provider:
|
|
48
|
-
export declare function getAuctionBids(provider:
|
|
49
|
-
export declare function getVaultUserShares(provider:
|
|
50
|
-
export declare function getAdditionalConfigs(provider:
|
|
44
|
+
export declare function getUserShares(provider: SuiClient, packageId: string, registry: string, indexes: string[], user: string): Promise<Map<string, UserShare>>;
|
|
45
|
+
export declare function getAuctionMaxSize(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string): Promise<BigInt>;
|
|
46
|
+
export declare function getMaxLossPerUnit(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string): Promise<BigInt>;
|
|
47
|
+
export declare function getAuctionTotalBidSize(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, index: string): Promise<BigInt>;
|
|
48
|
+
export declare function getAuctionBids(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, index: string): Promise<UserBid[]>;
|
|
49
|
+
export declare function getVaultUserShares(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, index: string): Promise<VaultUserShares>;
|
|
50
|
+
export declare function getAdditionalConfigs(provider: SuiClient, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, indexes: string[]): Promise<[string, Map<string, AdditionalConfig>]>;
|
|
@@ -53,7 +53,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getAdditionalConfigs = exports.getVaultUserShares = exports.getAuctionBids = exports.getAuctionTotalBidSize = exports.getMaxLossPerUnit = exports.getAuctionMaxSize = exports.getUserShares = void 0;
|
|
56
|
-
var
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var bcs_1 = require("@mysten/bcs");
|
|
58
58
|
var tools_1 = require("../tools");
|
|
59
59
|
var constants_1 = require("../../constants");
|
|
@@ -63,7 +63,7 @@ function getUserShares(provider, packageId, registry, indexes, user) {
|
|
|
63
63
|
return __generator(this, function (_a) {
|
|
64
64
|
switch (_a.label) {
|
|
65
65
|
case 0:
|
|
66
|
-
transactionBlock = new
|
|
66
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
67
67
|
target = "".concat(packageId, "::typus_dov_single::get_user_shares");
|
|
68
68
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes), transactionBlock.pure(user)];
|
|
69
69
|
transactionBlock.moveCall({
|
|
@@ -145,7 +145,7 @@ function getAuctionMaxSize(provider, packageId, typeArguments, registry, additio
|
|
|
145
145
|
return __generator(this, function (_a) {
|
|
146
146
|
switch (_a.label) {
|
|
147
147
|
case 0:
|
|
148
|
-
transactionBlock = new
|
|
148
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
149
149
|
target = "".concat(packageId, "::typus_dov_single::get_auction_max_size");
|
|
150
150
|
transactionBlockArguments = [
|
|
151
151
|
transactionBlock.pure(registry),
|
|
@@ -174,7 +174,7 @@ function getMaxLossPerUnit(provider, packageId, typeArguments, registry, additio
|
|
|
174
174
|
return __generator(this, function (_a) {
|
|
175
175
|
switch (_a.label) {
|
|
176
176
|
case 0:
|
|
177
|
-
transactionBlock = new
|
|
177
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
178
178
|
target = "".concat(packageId, "::typus_dov_single::get_max_loss_per_unit");
|
|
179
179
|
transactionBlockArguments = [
|
|
180
180
|
transactionBlock.pure(registry),
|
|
@@ -203,7 +203,7 @@ function getAuctionTotalBidSize(provider, packageId, typeArguments, registry, in
|
|
|
203
203
|
return __generator(this, function (_a) {
|
|
204
204
|
switch (_a.label) {
|
|
205
205
|
case 0:
|
|
206
|
-
transactionBlock = new
|
|
206
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
207
207
|
target = "".concat(packageId, "::typus_dov_single::get_auction_total_bid_size");
|
|
208
208
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
209
209
|
transactionBlock.moveCall({
|
|
@@ -226,7 +226,7 @@ function getAuctionBids(provider, packageId, typeArguments, registry, index) {
|
|
|
226
226
|
return __generator(this, function (_a) {
|
|
227
227
|
switch (_a.label) {
|
|
228
228
|
case 0:
|
|
229
|
-
transactionBlock = new
|
|
229
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
230
230
|
target = "".concat(packageId, "::typus_dov_single::get_auction_bids");
|
|
231
231
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
232
232
|
transactionBlock.moveCall({
|
|
@@ -267,7 +267,7 @@ function getVaultUserShares(provider, packageId, typeArguments, registry, index)
|
|
|
267
267
|
return __generator(this, function (_a) {
|
|
268
268
|
switch (_a.label) {
|
|
269
269
|
case 0:
|
|
270
|
-
transactionBlock = new
|
|
270
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
271
271
|
target = "".concat(packageId, "::typus_dov_single::get_vault_user_shares");
|
|
272
272
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
273
273
|
transactionBlock.moveCall({
|
|
@@ -322,7 +322,7 @@ function getAdditionalConfigs(provider, packageId, typeArguments, registry, addi
|
|
|
322
322
|
return __generator(this, function (_a) {
|
|
323
323
|
switch (_a.label) {
|
|
324
324
|
case 0:
|
|
325
|
-
transactionBlock = new
|
|
325
|
+
transactionBlock = new transactions_1.TransactionBlock();
|
|
326
326
|
target = "".concat(packageId, "::typus_dov_single::get_additional_configs");
|
|
327
327
|
transactionBlockArguments = [
|
|
328
328
|
transactionBlock.pure(registry),
|
|
@@ -53,7 +53,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getUpdateConfigTx = exports.getOtcTx = void 0;
|
|
56
|
-
var
|
|
56
|
+
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
59
59
|
public(friend) entry fun otc<D_TOKEN, B_TOKEN>(
|
|
@@ -76,7 +76,7 @@ function getOtcTx(gasBudget, packageId, typeArguments, registry, index, coins, d
|
|
|
76
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
77
|
var tx, amount, _a, coin;
|
|
78
78
|
return __generator(this, function (_b) {
|
|
79
|
-
tx = new
|
|
79
|
+
tx = new transactions_1.TransactionBlock();
|
|
80
80
|
if (!usingSponsoredGasCoin &&
|
|
81
81
|
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
82
82
|
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
@@ -129,7 +129,7 @@ function getUpdateConfigTx(gasBudget, packageId, registry, requests) {
|
|
|
129
129
|
return __awaiter(this, void 0, void 0, function () {
|
|
130
130
|
var tx;
|
|
131
131
|
return __generator(this, function (_a) {
|
|
132
|
-
tx = new
|
|
132
|
+
tx = new transactions_1.TransactionBlock();
|
|
133
133
|
requests.forEach(function (request) {
|
|
134
134
|
tx.moveCall({
|
|
135
135
|
target: "".concat(packageId, "::tds_authorized_entry::update_config"),
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
2
|
export declare function getDb(startTs: any, endTs: any): Promise<any>;
|
|
3
3
|
export declare function getUsersTvl(startTs: any, endTs: any): Promise<Map<string, number>>;
|
|
4
|
-
export declare function getUsersBidEvents(provider:
|
|
5
|
-
id: {
|
|
6
|
-
txDigest: string;
|
|
7
|
-
eventSeq: string;
|
|
8
|
-
};
|
|
9
|
-
packageId: string;
|
|
10
|
-
transactionModule: string;
|
|
11
|
-
sender: string;
|
|
12
|
-
type: string;
|
|
13
|
-
parsedJson?: Record<string, any> | undefined;
|
|
14
|
-
bcs?: string | undefined;
|
|
15
|
-
timestampMs?: string | undefined;
|
|
16
|
-
}[]>;
|
|
4
|
+
export declare function getUsersBidEvents(provider: SuiClient, originPackage: string, startTs?: number): Promise<import("@mysten/sui.js/client").SuiEvent[]>;
|
|
17
5
|
export declare function sumUsersBidPremium(datas: any, vaultIndexes?: string[], startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
18
|
-
export declare function getSuiNS(provider:
|
|
19
|
-
export declare function getUsersHarvestCompound(provider:
|
|
6
|
+
export declare function getSuiNS(provider: SuiClient, address: string): Promise<string>;
|
|
7
|
+
export declare function getUsersHarvestCompound(provider: SuiClient, originPackage: string, startTs?: number, endTs?: number): Promise<Map<string, number>>;
|
|
@@ -223,17 +223,23 @@ function getUsersHarvestCompound(provider, originPackage, startTs, endTs) {
|
|
|
223
223
|
result.data.forEach(function (data) {
|
|
224
224
|
if (Number(data.timestampMs) / 1000 < endTs) {
|
|
225
225
|
var parsedJson = data.parsedJson;
|
|
226
|
+
// @ts-ignore
|
|
226
227
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
228
|
+
// @ts-ignore
|
|
227
229
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
230
|
+
// @ts-ignore
|
|
228
231
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
229
232
|
if (asset.startsWith("USD")) {
|
|
230
233
|
price = 1;
|
|
231
234
|
}
|
|
232
235
|
var acc = 0;
|
|
236
|
+
// @ts-ignore
|
|
233
237
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
238
|
+
// @ts-ignore
|
|
234
239
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
235
240
|
}
|
|
236
241
|
acc += amount * price;
|
|
242
|
+
// @ts-ignore
|
|
237
243
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
238
244
|
}
|
|
239
245
|
});
|
|
@@ -260,17 +266,23 @@ function getUsersHarvestCompound(provider, originPackage, startTs, endTs) {
|
|
|
260
266
|
result.data.forEach(function (data) {
|
|
261
267
|
if (Number(data.timestampMs) / 1000 < endTs) {
|
|
262
268
|
var parsedJson = data.parsedJson;
|
|
269
|
+
// @ts-ignore
|
|
263
270
|
var amount = Number(parsedJson.amount) / Math.pow(10, Number(parsedJson.decimal));
|
|
271
|
+
// @ts-ignore
|
|
264
272
|
var price = Number(parsedJson.oracle_info.price) / Math.pow(10, Number(parsedJson.oracle_info.decimal));
|
|
273
|
+
// @ts-ignore
|
|
265
274
|
var asset = (0, token_1.typeArgToAsset)("0x" + parsedJson.token.name);
|
|
266
275
|
if (asset.startsWith("USD")) {
|
|
267
276
|
price = 1;
|
|
268
277
|
}
|
|
269
278
|
var acc = 0;
|
|
279
|
+
// @ts-ignore
|
|
270
280
|
if (usersHarvestCompound.has(parsedJson.signer)) {
|
|
281
|
+
// @ts-ignore
|
|
271
282
|
acc = usersHarvestCompound.get(parsedJson.signer);
|
|
272
283
|
}
|
|
273
284
|
acc += amount * price;
|
|
285
|
+
// @ts-ignore
|
|
274
286
|
usersHarvestCompound.set(parsedJson.signer, acc);
|
|
275
287
|
}
|
|
276
288
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionBlock } from "@mysten/sui.js";
|
|
1
|
+
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
2
|
/**
|
|
3
3
|
public(friend) entry fun deposit<D_TOKEN, B_TOKEN>(
|
|
4
4
|
registry: &mut Registry,
|
|
@@ -56,6 +56,19 @@ export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId:
|
|
|
56
56
|
index: string;
|
|
57
57
|
receipts: string[];
|
|
58
58
|
}[]): Promise<TransactionBlock>;
|
|
59
|
+
export declare function getBatchClaimHarvestWithdrawTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, registry: string, claimRequests: {
|
|
60
|
+
typeArguments: string[];
|
|
61
|
+
index: string;
|
|
62
|
+
receipts: string[];
|
|
63
|
+
}[], harvestRequests: {
|
|
64
|
+
typeArguments: string[];
|
|
65
|
+
index: string;
|
|
66
|
+
receipts: string[];
|
|
67
|
+
}[], withdrawRequests: {
|
|
68
|
+
typeArguments: string[];
|
|
69
|
+
index: string;
|
|
70
|
+
receipts: string[];
|
|
71
|
+
}[]): Promise<TransactionBlock>;
|
|
59
72
|
/**
|
|
60
73
|
public(friend) entry fun compound<D_TOKEN, B_TOKEN>(
|
|
61
74
|
registry: &mut Registry,
|