@typus/typus-sdk 1.9.1 → 1.9.2
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/dist/src/auto-bid/view-function.js +1 -1
- package/dist/src/dice/fetch.js +1 -1
- package/dist/src/typus/airdrop/view-function.js +0 -2
- package/dist/src/typus/leaderboard/view-function.js +0 -2
- package/dist/src/typus/tails-staking/view-function.js +0 -4
- package/dist/src/typus-dov-single-v2/function/bidding.d.ts +88 -0
- package/dist/src/typus-dov-single-v2/function/bidding.js +652 -0
- package/dist/src/typus-dov-single-v2/function/index.d.ts +1 -0
- package/dist/src/typus-dov-single-v2/function/index.js +1 -0
- package/dist/src/typus-dov-single-v2/view-function.d.ts +0 -3
- package/dist/src/typus-dov-single-v2/view-function.js +1 -45
- package/dist/src/typus-launch/airdrop/view-function.js +1 -5
- package/dist/src/typus-launch/funding-vault/view-function.js +1 -1
- package/dist/src/typus-launch/improvement-proposal/view-function.js +4 -20
- package/dist/src/typus-launch/ve-typus/view-function.js +1 -5
- package/dist/src/utils/api/price.js +57 -5
- package/dist/src/utils/api/sentio/events.js +4 -4
- package/dist/src/utils/api/sentio/leader-board.js +1 -1
- package/dist/src/utils/api/sentio/reward-generated.js +16 -16
- package/dist/src/utils/api/sentio/vault-history.js +1 -1
- package/package.json +3 -4
- package/dist/src/typus-nft/fetch.d.ts +0 -36
- package/dist/src/typus-nft/fetch.js +0 -269
- package/dist/src/typus-nft/index.d.ts +0 -1
- package/dist/src/typus-nft/index.js +0 -17
|
@@ -200,7 +200,7 @@ function getStrategyPool(config) {
|
|
|
200
200
|
switch (_f.label) {
|
|
201
201
|
case 0:
|
|
202
202
|
provider = config.gRpcClient();
|
|
203
|
-
return [4 /*yield*/, provider.getObject({
|
|
203
|
+
return [4 /*yield*/, provider.getObject({ id: config.registry.dov.autoBid, include: { content: true } })];
|
|
204
204
|
case 1:
|
|
205
205
|
pool = (_e = (_f.sent()).data) === null || _e === void 0 ? void 0 : _e.content.fields;
|
|
206
206
|
vaults = pool.strategies.fields.contents;
|
package/dist/src/dice/fetch.js
CHANGED
|
@@ -228,7 +228,7 @@ function parseHistory(datas, playgrounds) {
|
|
|
228
228
|
// }
|
|
229
229
|
// export async function getProfitSharing(provider: SuiClient, diceProfitSharing: string) {
|
|
230
230
|
// let object = await provider.getObject({
|
|
231
|
-
//
|
|
231
|
+
// id: diceProfitSharing,
|
|
232
232
|
// include: { content: true },
|
|
233
233
|
// });
|
|
234
234
|
// // @ts-ignore
|
|
@@ -60,8 +60,6 @@ function getStakingInfo(config, input) {
|
|
|
60
60
|
});
|
|
61
61
|
return [4 /*yield*/, provider.simulateTransaction({
|
|
62
62
|
transaction: transaction,
|
|
63
|
-
checksEnabled: false,
|
|
64
|
-
include: { commandResults: true },
|
|
65
63
|
})];
|
|
66
64
|
case 1:
|
|
67
65
|
results = (_a.sent()).commandResults;
|
|
@@ -110,8 +108,6 @@ function getLevelCounts(config) {
|
|
|
110
108
|
});
|
|
111
109
|
return [4 /*yield*/, provider.simulateTransaction({
|
|
112
110
|
transaction: transaction,
|
|
113
|
-
checksEnabled: false,
|
|
114
|
-
include: { commandResults: true },
|
|
115
111
|
})];
|
|
116
112
|
case 1:
|
|
117
113
|
results = (_a.sent()).commandResults;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Auction, BidShare, Vault } from "../../../src/typus-dov-single-v2";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import { TypusConfig } from "../../../src/utils";
|
|
4
|
+
export declare const tokenOrder: {
|
|
5
|
+
[key: string]: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const optionTypeOrder: {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const periodOrder: {
|
|
11
|
+
[key: string]: number;
|
|
12
|
+
};
|
|
13
|
+
export type Receipt = {
|
|
14
|
+
id: string;
|
|
15
|
+
index: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
vid: string;
|
|
19
|
+
};
|
|
20
|
+
export type TokenAmount = {
|
|
21
|
+
value: string;
|
|
22
|
+
token: string;
|
|
23
|
+
};
|
|
24
|
+
export type BidVaultInfo = {
|
|
25
|
+
vaultInfo: Vault;
|
|
26
|
+
receipt: Receipt;
|
|
27
|
+
};
|
|
28
|
+
export interface Bid {
|
|
29
|
+
vaultIndex: string;
|
|
30
|
+
expiry: string;
|
|
31
|
+
auctionName: string;
|
|
32
|
+
strikes: string[];
|
|
33
|
+
bidSize: TokenAmount;
|
|
34
|
+
breakEvenPrice: string;
|
|
35
|
+
estPnls: TokenAmount[];
|
|
36
|
+
receiptsId: string[];
|
|
37
|
+
receiptsVid: string[];
|
|
38
|
+
settlePrice: string;
|
|
39
|
+
isAutoBid: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface OrderBy {
|
|
42
|
+
tokenOrder: number;
|
|
43
|
+
optionTypeOrder: number;
|
|
44
|
+
periodOrder: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CoinInfo {
|
|
47
|
+
price: string;
|
|
48
|
+
decimal: string;
|
|
49
|
+
quote: string;
|
|
50
|
+
}
|
|
51
|
+
export declare const IncentiveRateBp = 4;
|
|
52
|
+
export declare const calcIncentiveRate: (incentiveBp: any) => number;
|
|
53
|
+
export declare const calcDeliveryPrice: (bidShare: BidShare, vaultInfo: Vault) => BigNumber;
|
|
54
|
+
export declare const calcBreakEvenPrice: (optionType: string, period: string, strikes: string[], bToken: string, price: string, incentive: number) => number;
|
|
55
|
+
export declare const calcEstPnl: (live: boolean, incentive: number, bidSize: string, optionType: string, assets: string[], strikes: string[], bidShare: BidShare, deliveryPrice: string, oTokenPrice: string) => TokenAmount[];
|
|
56
|
+
export declare const parseStrikes: (period: string, optionType: string, metadata: string) => string[];
|
|
57
|
+
export declare const parseBidReceipt: (vaults: Vault[], bidReceipts: {
|
|
58
|
+
[key: string]: Receipt[];
|
|
59
|
+
}) => {
|
|
60
|
+
sortedBidReceipts: string[];
|
|
61
|
+
bidVaultsInfo: BidVaultInfo[];
|
|
62
|
+
};
|
|
63
|
+
export declare const parseBid: (bidVaultInfo: BidVaultInfo, bidShare: BidShare, auction: Auction | null, oTokenPrice: string, isAutoBid: boolean) => Bid & OrderBy;
|
|
64
|
+
export declare function getUserOwnedObjects(config: TypusConfig, user: string): Promise<import("@mysten/sui/client", { with: { "resolution-mode": "import" } }).SuiClientTypes.Object<{
|
|
65
|
+
content: true;
|
|
66
|
+
}>[]>;
|
|
67
|
+
export declare const getUserBidReceipts: (config: TypusConfig, data: any) => Promise<{
|
|
68
|
+
[key: string]: Receipt[];
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch user's bids info
|
|
72
|
+
*
|
|
73
|
+
* @param provider - Sui Client instance.
|
|
74
|
+
* @param network - network type in lowercase.
|
|
75
|
+
* @param packageAddress - Typus main package address.
|
|
76
|
+
* @param framworkAddress - Typus framwork package address.
|
|
77
|
+
* @param originFramworkAddress - Typus intial framwork package address.
|
|
78
|
+
* @param registryAddress - Typus registry package address.
|
|
79
|
+
* @param strategyPoolAddress - strategy pool package address.
|
|
80
|
+
* @param user - user's wallet address.
|
|
81
|
+
* @param prices - tokens prices (usd pair on Pyth)
|
|
82
|
+
* @return User Bids.
|
|
83
|
+
*/
|
|
84
|
+
export declare function fetchUserBids(config: TypusConfig, user: string, vaultsInfo: {
|
|
85
|
+
[key: string]: Vault;
|
|
86
|
+
}, userReceipts: {
|
|
87
|
+
[key: string]: Receipt[];
|
|
88
|
+
}): Promise<any>;
|