@typus/typus-sdk 1.4.8 → 1.4.10
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/config.json +19 -14
- package/dist/src/dice/api.d.ts +1 -0
- package/dist/src/{tails-exp-dice → dice}/api.js +8 -3
- package/dist/src/{tails-exp-dice → dice}/fetch.d.ts +15 -12
- package/dist/src/{tails-exp-dice → dice}/fetch.js +48 -148
- package/dist/src/{tails-exp-dice → dice}/user-entry.d.ts +4 -4
- package/dist/src/{tails-exp-dice → dice}/user-entry.js +26 -11
- package/dist/src/dice/view-function.d.ts +8 -0
- package/dist/src/{tails-exp-dice → dice}/view-function.js +3 -3
- package/dist/src/{leaderboard → typus/leaderboard}/view-function.js +2 -2
- package/dist/src/{tails-staking → typus/tails-staking}/user-entry.js +1 -1
- package/dist/src/{tails-staking → typus/tails-staking}/view-function.js +2 -2
- package/dist/src/typus-dov-single-v2/{entry/authority-entry.js → authority-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/function/bidding.d.ts +2 -2
- package/dist/src/typus-dov-single-v2/function/bidding.js +21 -23
- package/dist/src/typus-dov-single-v2/function/vault.js +2 -2
- package/dist/src/typus-dov-single-v2/history/user-history.js +43 -43
- package/dist/src/typus-dov-single-v2/history/vault-history.js +11 -11
- package/dist/src/typus-dov-single-v2/index.d.ts +3 -1
- package/dist/src/typus-dov-single-v2/index.js +3 -1
- package/dist/src/typus-dov-single-v2/{entry/mfud-user-entry.js → token-user-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/{entry/user-entry.js → user-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/view-function.js +8 -8
- package/dist/src/typus-nft/fetch.js +1 -0
- package/dist/src/typus-perp/fetch.d.ts +10 -10
- package/dist/src/typus-perp/fetch.js +20 -21
- package/dist/src/typus-perp/readVec.js +6 -6
- package/dist/src/typus-perp/user/order.d.ts +10 -10
- package/dist/src/typus-perp/user/order.js +31 -32
- package/dist/src/typus-perp/user/orderWithBidReceipt.d.ts +6 -6
- package/dist/src/typus-perp/user/orderWithBidReceipt.js +15 -17
- package/dist/src/typus-perp/user/tlp.d.ts +12 -13
- package/dist/src/typus-perp/user/tlp.js +38 -41
- package/dist/src/typus-safu/index.d.ts +3 -0
- package/dist/src/typus-safu/index.js +20 -0
- package/dist/src/typus-safu/user-entry.d.ts +84 -0
- package/dist/src/typus-safu/user-entry.js +158 -0
- package/dist/src/typus-safu/view-function.d.ts +31 -0
- package/dist/src/typus-safu/view-function.js +147 -0
- package/dist/src/utils/api/sentio/reward-generated.js +3 -3
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/pyth/constant.js +1 -1
- package/dist/src/utils/pyth/pythClient.d.ts +1 -1
- package/dist/src/utils/pyth/pythClient.js +1 -1
- package/dist/src/utils/typusConfig.d.ts +93 -0
- package/dist/src/utils/typusConfig.js +21 -0
- package/package.json +4 -1
- package/dist/src/index.d.ts +0 -11
- package/dist/src/index.js +0 -27
- package/dist/src/tails-exp-dice/api.d.ts +0 -1
- package/dist/src/tails-exp-dice/view-function.d.ts +0 -8
- package/dist/src/typus-dov-single-v2/entry/index.d.ts +0 -3
- package/dist/src/typus-dov-single-v2/entry/index.js +0 -19
- /package/dist/src/{tails-exp-dice → dice}/index.d.ts +0 -0
- /package/dist/src/{tails-exp-dice → dice}/index.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/authority-entry.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/authority-entry.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/index.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/index.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/user-entry.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/user-entry.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/view-function.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/view-function.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/authority-entry.d.ts +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/authority-entry.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/index.d.ts +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/index.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/view-function.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/authority-entry.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/authority-entry.js +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/index.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/index.js +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/user-entry.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/view-function.d.ts +0 -0
- /package/dist/src/{user → typus/user}/index.d.ts +0 -0
- /package/dist/src/{user → typus/user}/index.js +0 -0
- /package/dist/src/{user → typus/user}/view-function.d.ts +0 -0
- /package/dist/src/{user → typus/user}/view-function.js +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/authority-entry.d.ts → authority-entry.d.ts} +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/mfud-user-entry.d.ts → token-user-entry.d.ts} +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/user-entry.d.ts → user-entry.d.ts} +0 -0
|
@@ -62,7 +62,7 @@ exports.getExpUpTx = getExpUpTx;
|
|
|
62
62
|
exports.getExpUpWithoutStakingTx = getExpUpWithoutStakingTx;
|
|
63
63
|
exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
|
|
64
64
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
65
|
-
var constants_1 = require("
|
|
65
|
+
var constants_1 = require("../../constants");
|
|
66
66
|
var kiosk_1 = require("@mysten/kiosk");
|
|
67
67
|
/**
|
|
68
68
|
public fun stake_tails(
|
|
@@ -40,7 +40,7 @@ exports.getStakingInfo = getStakingInfo;
|
|
|
40
40
|
exports.getLevelCounts = getLevelCounts;
|
|
41
41
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
42
42
|
var bcs_1 = require("@mysten/bcs");
|
|
43
|
-
var
|
|
43
|
+
var utils_1 = require("../../utils");
|
|
44
44
|
function getStakingInfo(input) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
46
|
var transactionBlock, results, bytes, reader, length;
|
|
@@ -68,7 +68,7 @@ function getStakingInfo(input) {
|
|
|
68
68
|
length = reader.readULEB();
|
|
69
69
|
if (length > 0) {
|
|
70
70
|
return [2 /*return*/, {
|
|
71
|
-
user: (0,
|
|
71
|
+
user: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
72
72
|
tails: reader.readVec(function (reader) {
|
|
73
73
|
return reader.read64();
|
|
74
74
|
}),
|
|
@@ -55,7 +55,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
55
55
|
exports.getOtcTx = getOtcTx;
|
|
56
56
|
exports.getUpdateConfigTx = getUpdateConfigTx;
|
|
57
57
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
58
|
-
var constants_1 = require("
|
|
58
|
+
var constants_1 = require("../constants");
|
|
59
59
|
/**
|
|
60
60
|
public(friend) entry fun otc<D_TOKEN, B_TOKEN>(
|
|
61
61
|
registry: &mut Registry,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Auction, BidShare, Vault } from "../view-function";
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
import { PriceData } from "@pythnetwork/client";
|
|
4
4
|
import { SuiClient } from "@mysten/sui.js/dist/cjs/client";
|
|
5
|
-
import
|
|
5
|
+
import BigNumber from "bignumber.js";
|
|
6
6
|
export declare const ASSET_INFO: {
|
|
7
7
|
BTC: {
|
|
8
8
|
product: PublicKey;
|
|
@@ -87,20 +87,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
87
87
|
};
|
|
88
88
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
89
89
|
exports.fetchUserBids = exports.getUserBidReceipts = exports.parseBid = exports.parseBidReceipt = exports.parseStrikes = exports.calcEstPnl = exports.calcBreakEvenPrice = exports.calcDeliveryPrice = exports.calcIncentiveRate = exports.fetchPrices = exports.parsePythOracleData = exports.IncentiveRateBp = exports.periodOrder = exports.optionTypeOrder = exports.tokenOrder = exports.ASSET_INFO = void 0;
|
|
90
|
-
var
|
|
90
|
+
var vault_1 = require("./vault");
|
|
91
|
+
var view_function_1 = require("../view-function");
|
|
92
|
+
var utils_1 = require("../../utils");
|
|
91
93
|
var web3_js_1 = require("@solana/web3.js");
|
|
92
|
-
var
|
|
94
|
+
var auto_bid_1 = require("../../auto-bid");
|
|
93
95
|
var lodash_1 = require("lodash");
|
|
94
|
-
var
|
|
95
|
-
var view_function_1 = require("../view-function");
|
|
96
|
-
var vault_1 = require("./vault");
|
|
96
|
+
var client_1 = require("@pythnetwork/client");
|
|
97
97
|
var token_1 = require("./token");
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var token_2 = require("../../constants/token");
|
|
101
|
-
var token_3 = require("./token");
|
|
102
|
-
var price_1 = require("../../utils/api/price");
|
|
98
|
+
var constants_1 = require("../../constants");
|
|
99
|
+
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
103
100
|
var config_json_1 = __importDefault(require("../../../config.json"));
|
|
101
|
+
var moment_1 = __importDefault(require("moment"));
|
|
104
102
|
var PriceDecimal = (0, bignumber_js_1.default)(10).pow(8);
|
|
105
103
|
exports.ASSET_INFO = {
|
|
106
104
|
BTC: {
|
|
@@ -241,8 +239,8 @@ var parsePythOracleData = function (data, decimals) {
|
|
|
241
239
|
decimal: decimal,
|
|
242
240
|
quote: "usd",
|
|
243
241
|
};
|
|
244
|
-
if (
|
|
245
|
-
prices[
|
|
242
|
+
if (token_1.WrappedToken[asset]) {
|
|
243
|
+
prices[token_1.WrappedToken[asset].toLowerCase()] = {
|
|
246
244
|
price: (0, bignumber_js_1.default)((_b = coinData.price) !== null && _b !== void 0 ? _b : 0)
|
|
247
245
|
.multipliedBy((0, bignumber_js_1.default)(10).pow(decimal))
|
|
248
246
|
.toString(),
|
|
@@ -283,27 +281,27 @@ var fetchPrices = function (provider, network) { return __awaiter(void 0, void 0
|
|
|
283
281
|
priceData = _c.sent();
|
|
284
282
|
prices = (0, exports.parsePythOracleData)(priceData, oracleDecimal);
|
|
285
283
|
suiusd = (0, bignumber_js_1.default)((_b = (_a = prices["sui"]) === null || _a === void 0 ? void 0 : _a.price) !== null && _b !== void 0 ? _b : 0);
|
|
286
|
-
return [4 /*yield*/, (0,
|
|
284
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIFUD")];
|
|
287
285
|
case 3:
|
|
288
286
|
suifud = _c.sent();
|
|
289
287
|
fudusd = suifud == "0" ? (0, bignumber_js_1.default)(0) : suiusd.div(suifud);
|
|
290
|
-
return [4 /*yield*/, (0,
|
|
288
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIAFSUI")];
|
|
291
289
|
case 4:
|
|
292
290
|
suiafsui = _c.sent();
|
|
293
291
|
afsuiusd = suiafsui == "0" ? (0, bignumber_js_1.default)(0) : suiusd.div(suiafsui);
|
|
294
|
-
return [4 /*yield*/, (0,
|
|
292
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUINAVX")];
|
|
295
293
|
case 5:
|
|
296
294
|
suinavx = _c.sent();
|
|
297
295
|
navxusd = suiusd.div(suinavx);
|
|
298
|
-
return [4 /*yield*/, (0,
|
|
296
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIBUCK")];
|
|
299
297
|
case 6:
|
|
300
298
|
suibuck = _c.sent();
|
|
301
299
|
buckusd = (0, bignumber_js_1.default)(suibuck).lte(0) ? "0" : suiusd.div(suibuck);
|
|
302
|
-
return [4 /*yield*/, (0,
|
|
300
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("USDYUSDC")];
|
|
303
301
|
case 7:
|
|
304
302
|
usdyusdc = _c.sent();
|
|
305
303
|
usdyusdcWithDecimal = (0, bignumber_js_1.default)(usdyusdc).multipliedBy((0, bignumber_js_1.default)(10).pow(8));
|
|
306
|
-
return [4 /*yield*/, (0,
|
|
304
|
+
return [4 /*yield*/, (0, utils_1.getLatestPrice)("SCASUI")];
|
|
307
305
|
case 8:
|
|
308
306
|
scasui = _c.sent();
|
|
309
307
|
scausd = suiusd.eq(0) ? (0, bignumber_js_1.default)(0) : (0, bignumber_js_1.default)(scasui).multipliedBy(suiusd);
|
|
@@ -398,7 +396,7 @@ exports.calcBreakEvenPrice = calcBreakEvenPrice;
|
|
|
398
396
|
var calcEstPnl = function (live, incentive, bidSize, optionType, assets, strikes, bidShare, deliveryPrice, oTokenPrice) {
|
|
399
397
|
var profit = "0";
|
|
400
398
|
var cost = "0";
|
|
401
|
-
var _a = __read((0,
|
|
399
|
+
var _a = __read((0, constants_1.typeArgsToAssets)(assets), 3), dToken = _a[0], bToken = _a[1], oToken = _a[2];
|
|
402
400
|
var dTokenWrappedName = (0, token_1.getTokenName)({ token: dToken, wrapped: true });
|
|
403
401
|
var bTokenWrappedName = (0, token_1.getTokenName)({ token: bToken, wrapped: true });
|
|
404
402
|
var estPnls = [];
|
|
@@ -478,7 +476,7 @@ var parseStrikes = function (period, optionType, metadata) {
|
|
|
478
476
|
strikes = strikes.sort(function (a, b) { return Number(a) - Number(b); });
|
|
479
477
|
break;
|
|
480
478
|
}
|
|
481
|
-
strikes = (0,
|
|
479
|
+
strikes = (0, utils_1.checkNumber)(strikes[0]) ? strikes : [];
|
|
482
480
|
strikes = strikes.sort(function (a, b) { return Number(a) - Number(b); });
|
|
483
481
|
return strikes;
|
|
484
482
|
};
|
|
@@ -531,7 +529,7 @@ var parseBid = function (bidVaultInfo, bidShare, auction, oTokenPrice, isAutoBid
|
|
|
531
529
|
var bidsSize = Number(bidShare.share) / Math.pow(10, Number(oTokenDecimal));
|
|
532
530
|
var expirationDate = (0, moment_1.default)(metadata.split("-")[1], "DDMMMYY").format("yyyy-MM-DD");
|
|
533
531
|
expirationDate = moment_1.default
|
|
534
|
-
.utc(period === "3" ? "".concat(expirationDate, " ").concat((0,
|
|
532
|
+
.utc(period === "3" ? "".concat(expirationDate, " ").concat((0, utils_1.insertAt)(metadata.split("-")[2], ":", 2)) : "".concat(expirationDate, " 08:00"))
|
|
535
533
|
.local()
|
|
536
534
|
.format("DD MMM YY, HH:mm");
|
|
537
535
|
var live = !auction
|
|
@@ -546,7 +544,7 @@ var parseBid = function (bidVaultInfo, bidShare, auction, oTokenPrice, isAutoBid
|
|
|
546
544
|
var breakEvenPriceReference = live ? initialPrice : deliveryPrice;
|
|
547
545
|
var breakEvenPrice = (0, exports.calcBreakEvenPrice)(optionType, period, strikes, bToken, breakEvenPriceReference, incentiveRate);
|
|
548
546
|
var defaultMinBidSize = (0, bignumber_js_1.default)(lotSize).div((0, bignumber_js_1.default)(10).pow(oTokenDecimal));
|
|
549
|
-
var bidSize = bidsSize.toFixed((0,
|
|
547
|
+
var bidSize = bidsSize.toFixed((0, utils_1.countFloating)(defaultMinBidSize.toNumber()));
|
|
550
548
|
var settlePrice = (0, bignumber_js_1.default)((_b = bidShare.bidVault.u64Padding[0]) !== null && _b !== void 0 ? _b : "0").div(PriceDecimal);
|
|
551
549
|
var estPnls = (0, exports.calcEstPnl)(live, incentiveRate, bidSize, optionType, [depositToken, bidToken, settlementBase], strikes, bidShare, deliveryPrice.toString(), oTokenPrice);
|
|
552
550
|
return {
|
|
@@ -682,7 +680,7 @@ var fetchUserBids = function (provider, network, packageAddress, framworkAddress
|
|
|
682
680
|
return [4 /*yield*/, (0, exports.getUserBidReceipts)(provider, network, originFramworkAddress, userAddress)];
|
|
683
681
|
case 2:
|
|
684
682
|
userReceipts = _f.sent();
|
|
685
|
-
return [4 /*yield*/, (0,
|
|
683
|
+
return [4 /*yield*/, (0, auto_bid_1.getUserStrategies)(provider, packageAddress, registryAddress, strategyPoolAddress, userAddress)];
|
|
686
684
|
case 3:
|
|
687
685
|
userStrategies = _f.sent();
|
|
688
686
|
return [4 /*yield*/, (0, view_function_1.getAuctions)(provider, packageAddress, registryAddress, [])];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseAssets = exports.AbbrStrategyName = exports.Period = void 0;
|
|
4
|
-
var
|
|
4
|
+
var constants_1 = require("../../constants");
|
|
5
5
|
exports.Period = {
|
|
6
6
|
0: "daily",
|
|
7
7
|
1: "weekly",
|
|
@@ -18,6 +18,6 @@ exports.AbbrStrategyName = {
|
|
|
18
18
|
};
|
|
19
19
|
var parseAssets = function (info) {
|
|
20
20
|
var dToken = info.depositToken, bToken = info.bidToken, oToken = info.settlementBase;
|
|
21
|
-
return (0,
|
|
21
|
+
return (0, constants_1.typeArgsToAssets)([dToken, bToken, oToken]);
|
|
22
22
|
};
|
|
23
23
|
exports.parseAssets = parseAssets;
|
|
@@ -73,7 +73,7 @@ exports.getFromSentio = getFromSentio;
|
|
|
73
73
|
exports.getNewBidFromSentio = getNewBidFromSentio;
|
|
74
74
|
exports.getExerciseFromSentio = getExerciseFromSentio;
|
|
75
75
|
exports.getDepositorCashFlows = getDepositorCashFlows;
|
|
76
|
-
var
|
|
76
|
+
var constants_1 = require("../../constants");
|
|
77
77
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
78
78
|
function getUserEvents(provider, sender, cursor) {
|
|
79
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -221,8 +221,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
221
221
|
break;
|
|
222
222
|
case "ClaimProfitSharingEvent":
|
|
223
223
|
if (event.parsedJson.profit_asset) {
|
|
224
|
-
token = (0,
|
|
225
|
-
amount = Number(event.parsedJson.log[0]) / Math.pow(10, (0,
|
|
224
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.profit_asset.name);
|
|
225
|
+
amount = Number(event.parsedJson.log[0]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
226
226
|
Action = "Harvest Dice Profit";
|
|
227
227
|
Tails = event.parsedJson.tails.map(function (num) { return "#".concat(num); }).join(" ");
|
|
228
228
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
@@ -292,7 +292,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
292
292
|
case "CompoundEvent":
|
|
293
293
|
case "HarvestEvent":
|
|
294
294
|
i = txHistory.findIndex(function (x) { return x.txDigest == event.id.txDigest && x.Action == "Collect EXP"; });
|
|
295
|
-
token = (0,
|
|
295
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
296
296
|
amount = Number(event.parsedJson.amount) / Math.pow(10, Number(event.parsedJson.decimal));
|
|
297
297
|
Action = action.slice(0, action.length - 5);
|
|
298
298
|
if (Action == "Harvest") {
|
|
@@ -312,17 +312,17 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
312
312
|
case "RaiseFundEvent":
|
|
313
313
|
Index = event.parsedJson.log[0];
|
|
314
314
|
_b = __read(parseVaultInfo(vaults, Index, action, event.parsedJson.log), 6), Period = _b[0], Vault = _b[1], RiskLevel = _b[2], d_token = _b[3], b_token = _b[4], o_token = _b[5];
|
|
315
|
-
token = (0,
|
|
315
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
316
316
|
if (event.parsedJson.log[4] > 0) {
|
|
317
317
|
// deposit
|
|
318
318
|
Action = "Deposit";
|
|
319
|
-
amount = Number(event.parsedJson.log[4]) / Math.pow(10, (0,
|
|
319
|
+
amount = Number(event.parsedJson.log[4]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
320
320
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
321
321
|
}
|
|
322
322
|
else if (event.parsedJson.log[5] > 0) {
|
|
323
323
|
// compound
|
|
324
324
|
Action = "Compound";
|
|
325
|
-
amount = Number(event.parsedJson.log[5]) / Math.pow(10, (0,
|
|
325
|
+
amount = Number(event.parsedJson.log[5]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
326
326
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
327
327
|
}
|
|
328
328
|
break;
|
|
@@ -332,8 +332,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
332
332
|
if (event.parsedJson.log[4] > 0) {
|
|
333
333
|
// withdraw
|
|
334
334
|
Action = "Withdraw";
|
|
335
|
-
token = (0,
|
|
336
|
-
amount = Number(event.parsedJson.log[4]) / Math.pow(10, (0,
|
|
335
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.d_token.name);
|
|
336
|
+
amount = Number(event.parsedJson.log[4]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
337
337
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
338
338
|
txHistory.push({
|
|
339
339
|
Index: Index,
|
|
@@ -351,8 +351,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
351
351
|
if (event.parsedJson.log[5] > 0) {
|
|
352
352
|
// unsubscribe
|
|
353
353
|
Action = "Unsubscribe";
|
|
354
|
-
token = (0,
|
|
355
|
-
amount = Number(event.parsedJson.log[5]) / Math.pow(10, (0,
|
|
354
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.d_token.name);
|
|
355
|
+
amount = Number(event.parsedJson.log[5]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
356
356
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
357
357
|
txHistory.push({
|
|
358
358
|
Index: Index,
|
|
@@ -370,8 +370,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
370
370
|
if (event.parsedJson.log[9] > 0) {
|
|
371
371
|
// claim
|
|
372
372
|
Action = "Claim";
|
|
373
|
-
token = (0,
|
|
374
|
-
amount = Number(event.parsedJson.log[9]) / Math.pow(10, (0,
|
|
373
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.d_token.name);
|
|
374
|
+
amount = Number(event.parsedJson.log[9]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
375
375
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
376
376
|
txHistory.push({
|
|
377
377
|
Index: Index,
|
|
@@ -389,10 +389,10 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
389
389
|
if (event.parsedJson.log[6] > 0 && event.parsedJson.log[10] > 0) {
|
|
390
390
|
// Harvest d token and i token
|
|
391
391
|
Action = "Harvest Reward";
|
|
392
|
-
b_token_name = (0,
|
|
393
|
-
b_token_amount = Number(event.parsedJson.log[6]) / Math.pow(10, (0,
|
|
394
|
-
i_token_name = (0,
|
|
395
|
-
i_token_amount = Number(event.parsedJson.log[10]) / Math.pow(10, (0,
|
|
392
|
+
b_token_name = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.b_token.name);
|
|
393
|
+
b_token_amount = Number(event.parsedJson.log[6]) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token_name));
|
|
394
|
+
i_token_name = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.i_token.name);
|
|
395
|
+
i_token_amount = Number(event.parsedJson.log[10]) / Math.pow(10, (0, constants_1.assetToDecimal)(i_token_name));
|
|
396
396
|
Amount = "".concat((0, bignumber_js_1.default)(b_token_amount).toFixed(), " ").concat(b_token_name, "\n").concat((0, bignumber_js_1.default)(i_token_amount).toFixed(), " ").concat(i_token_name);
|
|
397
397
|
// var amount =
|
|
398
398
|
// Number(event.parsedJson!.log[6]) / 10 ** assetToDecimal(token)!
|
|
@@ -415,8 +415,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
415
415
|
if (event.parsedJson.log[6] > 0) {
|
|
416
416
|
// harvest
|
|
417
417
|
Action = "Harvest Reward";
|
|
418
|
-
token = (0,
|
|
419
|
-
amount = Number(event.parsedJson.log[6]) / Math.pow(10, (0,
|
|
418
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.b_token.name);
|
|
419
|
+
amount = Number(event.parsedJson.log[6]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
420
420
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
421
421
|
txHistory.push({
|
|
422
422
|
Index: Index,
|
|
@@ -434,8 +434,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
434
434
|
if (event.parsedJson.log[10] > 0) {
|
|
435
435
|
// redeem
|
|
436
436
|
Action = "Harvest Reward";
|
|
437
|
-
token = (0,
|
|
438
|
-
amount = Number(event.parsedJson.log[10]) / Math.pow(10, (0,
|
|
437
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.i_token.name);
|
|
438
|
+
amount = Number(event.parsedJson.log[10]) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
439
439
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
440
440
|
txHistory.push({
|
|
441
441
|
Index: Index,
|
|
@@ -454,35 +454,35 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
454
454
|
return [2 /*return*/, txHistory];
|
|
455
455
|
case "NewStrategyEventV2":
|
|
456
456
|
Action = "Create Strategy";
|
|
457
|
-
deposit_amount = Number(event.parsedJson.deposit_amount) / Math.pow(10, (0,
|
|
457
|
+
deposit_amount = Number(event.parsedJson.deposit_amount) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
458
458
|
Amount = "".concat((0, bignumber_js_1.default)(deposit_amount).toFixed(), " ").concat(b_token);
|
|
459
459
|
break;
|
|
460
460
|
case "UpdateStrategyEvent":
|
|
461
461
|
Action = "Update Strategy";
|
|
462
|
-
deposit_amount = Number(event.parsedJson.deposit_amount) / Math.pow(10, (0,
|
|
462
|
+
deposit_amount = Number(event.parsedJson.deposit_amount) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
463
463
|
Amount = "".concat((0, bignumber_js_1.default)(deposit_amount).toFixed(), " ").concat(b_token);
|
|
464
464
|
break;
|
|
465
465
|
case "CloseStrategyEventV2":
|
|
466
466
|
Action = "Close Strategy";
|
|
467
467
|
if (b_token == d_token) {
|
|
468
468
|
balance = (Number(event.parsedJson.u64_padding[0]) + Number(event.parsedJson.u64_padding[1])) /
|
|
469
|
-
Math.pow(10, (0,
|
|
469
|
+
Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
470
470
|
Amount = "".concat((0, bignumber_js_1.default)(balance).toFixed(), " ").concat(b_token);
|
|
471
471
|
}
|
|
472
472
|
else {
|
|
473
|
-
balance = Number(event.parsedJson.u64_padding[0]) / Math.pow(10, (0,
|
|
474
|
-
profit = Number(event.parsedJson.u64_padding[1]) / Math.pow(10, (0,
|
|
473
|
+
balance = Number(event.parsedJson.u64_padding[0]) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
474
|
+
profit = Number(event.parsedJson.u64_padding[1]) / Math.pow(10, (0, constants_1.assetToDecimal)(d_token));
|
|
475
475
|
Amount = "".concat((0, bignumber_js_1.default)(balance).toFixed(), " ").concat(b_token, "\n").concat((0, bignumber_js_1.default)(profit).toFixed(), " ").concat(d_token);
|
|
476
476
|
}
|
|
477
477
|
break;
|
|
478
478
|
case "WithdrawProfitEvent":
|
|
479
479
|
Action = "Harvest Gain";
|
|
480
|
-
profit = Number(event.parsedJson.profit) / Math.pow(10, (0,
|
|
480
|
+
profit = Number(event.parsedJson.profit) / Math.pow(10, (0, constants_1.assetToDecimal)(d_token));
|
|
481
481
|
Amount = "".concat((0, bignumber_js_1.default)(profit).toFixed(), " ").concat(d_token);
|
|
482
482
|
break;
|
|
483
483
|
case "RedeemEvent":
|
|
484
|
-
token = (0,
|
|
485
|
-
amount = Number(event.parsedJson.amount) / Math.pow(10, (0,
|
|
484
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
485
|
+
amount = Number(event.parsedJson.amount) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
486
486
|
Action = "Harvest Reward";
|
|
487
487
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
488
488
|
Index = Index;
|
|
@@ -493,12 +493,12 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
493
493
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(o_token);
|
|
494
494
|
break;
|
|
495
495
|
case "ExerciseEvent":
|
|
496
|
-
token = (0,
|
|
496
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
497
497
|
amount = Number(event.parsedJson.amount) / Math.pow(10, Number(event.parsedJson.decimal));
|
|
498
498
|
Action = "Exercise";
|
|
499
499
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
500
500
|
if (event.parsedJson.u64_padding[0]) {
|
|
501
|
-
size = Number(event.parsedJson.u64_padding[0]) / Math.pow(10, (0,
|
|
501
|
+
size = Number(event.parsedJson.u64_padding[0]) / Math.pow(10, (0, constants_1.assetToDecimal)(o_token));
|
|
502
502
|
Action = "Exercise ".concat(size, " ").concat(o_token);
|
|
503
503
|
}
|
|
504
504
|
if (event.sender != event.parsedJson.signer) {
|
|
@@ -506,8 +506,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
506
506
|
}
|
|
507
507
|
break;
|
|
508
508
|
case "RefundEvent":
|
|
509
|
-
token = (0,
|
|
510
|
-
amount = Number(event.parsedJson.amount) / Math.pow(10, (0,
|
|
509
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
510
|
+
amount = Number(event.parsedJson.amount) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
511
511
|
Action = "Rebate";
|
|
512
512
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
513
513
|
break;
|
|
@@ -519,8 +519,8 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
519
519
|
// Tails = `#${event.parsedJson!.number}`;
|
|
520
520
|
// break;
|
|
521
521
|
case "ClaimProfitSharingEventV2":
|
|
522
|
-
token = (0,
|
|
523
|
-
amount = Number(event.parsedJson.value) / Math.pow(10, (0,
|
|
522
|
+
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
523
|
+
amount = Number(event.parsedJson.value) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
524
524
|
// dice_profit, exp_profit
|
|
525
525
|
// TODO: filter amount != 0
|
|
526
526
|
switch (event.parsedJson.name) {
|
|
@@ -535,10 +535,10 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
535
535
|
Tails = "#".concat(event.parsedJson.number);
|
|
536
536
|
break;
|
|
537
537
|
case "NewBidEvent":
|
|
538
|
-
o_token = (0,
|
|
539
|
-
b_token = (0,
|
|
540
|
-
size = Number(event.parsedJson.size) / Math.pow(10, (0,
|
|
541
|
-
bidder_balance = Number(event.parsedJson.bidder_balance) / Math.pow(10, (0,
|
|
538
|
+
o_token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.o_token.name);
|
|
539
|
+
b_token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.b_token.name);
|
|
540
|
+
size = Number(event.parsedJson.size) / Math.pow(10, (0, constants_1.assetToDecimal)(o_token));
|
|
541
|
+
bidder_balance = Number(event.parsedJson.bidder_balance) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
542
542
|
Action = action.slice(0, action.length - 5) + " ".concat(size, " ").concat(o_token);
|
|
543
543
|
Amount = "".concat((0, bignumber_js_1.default)(bidder_balance).toFixed(), " ").concat(b_token);
|
|
544
544
|
if (event.sender != event.parsedJson.signer) {
|
|
@@ -689,7 +689,7 @@ function getExerciseFromSentio(vaults, userAddress, startTimestamp) {
|
|
|
689
689
|
// console.log(x);
|
|
690
690
|
var Action = "Auto Exercise";
|
|
691
691
|
if (x.raw_share) {
|
|
692
|
-
var size = Number(x.raw_share) / Math.pow(10, (0,
|
|
692
|
+
var size = Number(x.raw_share) / Math.pow(10, (0, constants_1.assetToDecimal)(o_token));
|
|
693
693
|
Action = "Auto Exercise ".concat(size, " ").concat(o_token);
|
|
694
694
|
}
|
|
695
695
|
var txHistory = {
|
|
@@ -830,9 +830,9 @@ function parseVaultInfo(vaults, Index, action, eventLog) {
|
|
|
830
830
|
break;
|
|
831
831
|
}
|
|
832
832
|
Vault = "".concat(v.info.settlementBaseName, " ").concat(period, " ").concat(optionType);
|
|
833
|
-
d_token = (0,
|
|
834
|
-
b_token = (0,
|
|
835
|
-
o_token = (0,
|
|
833
|
+
d_token = (0, constants_1.typeArgToAsset)("0x" + v.info.depositToken);
|
|
834
|
+
b_token = (0, constants_1.typeArgToAsset)("0x" + v.info.bidToken);
|
|
835
|
+
o_token = (0, constants_1.typeArgToAsset)("0x" + v.info.settlementBase);
|
|
836
836
|
}
|
|
837
837
|
return [Period, Vault, RiskLevel, d_token, b_token, o_token];
|
|
838
838
|
}
|
|
@@ -53,7 +53,7 @@ exports.parseVaultHistory = parseVaultHistory;
|
|
|
53
53
|
exports.getVaultHistoryFromDB = getVaultHistoryFromDB;
|
|
54
54
|
exports.convertGroupEventToVaultHistory = convertGroupEventToVaultHistory;
|
|
55
55
|
exports.parseBidEvents = parseBidEvents;
|
|
56
|
-
var
|
|
56
|
+
var constants_1 = require("../../constants");
|
|
57
57
|
function getVaultHistoryEvents(provider, originPackage, startTimeMs) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function () {
|
|
59
59
|
var senderFilter, result, datas, hasNextPage, cursor, result;
|
|
@@ -307,14 +307,14 @@ function convertGroupEventToVaultHistory(groupEvent) {
|
|
|
307
307
|
ActivationMs = Number((_a = groupEvent.activateEvent) === null || _a === void 0 ? void 0 : _a.timestampMs);
|
|
308
308
|
SettlementTsMs = Number((_b = groupEvent.settleEvent) === null || _b === void 0 ? void 0 : _b.timestampMs);
|
|
309
309
|
if (groupEvent.deliveryEvent) {
|
|
310
|
-
b_token = (0,
|
|
311
|
-
o_token = (0,
|
|
312
|
-
bidder_bid_value = Number(groupEvent.deliveryEvent.bidder_bid_value) / Math.pow(10, (0,
|
|
313
|
-
bidder_fee = Number(groupEvent.deliveryEvent.bidder_fee) / Math.pow(10, (0,
|
|
314
|
-
delivery_price = Number(groupEvent.deliveryEvent.delivery_price) / Math.pow(10, (0,
|
|
315
|
-
delivery_size = Number(groupEvent.deliveryEvent.delivery_size) / Math.pow(10, (0,
|
|
316
|
-
incentive_bid_value = Number(groupEvent.deliveryEvent.incentive_bid_value) / Math.pow(10, (0,
|
|
317
|
-
incentive_fee = Number(groupEvent.deliveryEvent.incentive_fee) / Math.pow(10, (0,
|
|
310
|
+
b_token = (0, constants_1.typeArgToAsset)(groupEvent.deliveryEvent.b_token.name);
|
|
311
|
+
o_token = (0, constants_1.typeArgToAsset)(groupEvent.deliveryEvent.o_token.name);
|
|
312
|
+
bidder_bid_value = Number(groupEvent.deliveryEvent.bidder_bid_value) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
313
|
+
bidder_fee = Number(groupEvent.deliveryEvent.bidder_fee) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
314
|
+
delivery_price = Number(groupEvent.deliveryEvent.delivery_price) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
315
|
+
delivery_size = Number(groupEvent.deliveryEvent.delivery_size) / Math.pow(10, (0, constants_1.assetToDecimal)(o_token));
|
|
316
|
+
incentive_bid_value = Number(groupEvent.deliveryEvent.incentive_bid_value) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
317
|
+
incentive_fee = Number(groupEvent.deliveryEvent.incentive_fee) / Math.pow(10, (0, constants_1.assetToDecimal)(b_token));
|
|
318
318
|
PaidToDepositors = bidder_bid_value + bidder_fee + incentive_bid_value + incentive_fee;
|
|
319
319
|
PaidToBidders = (Number((_c = groupEvent.settleEvent) === null || _c === void 0 ? void 0 : _c.settle_balance) - Number((_d = groupEvent.settleEvent) === null || _d === void 0 ? void 0 : _d.settled_balance)) /
|
|
320
320
|
Math.pow(10, Number((_e = groupEvent.settleEvent) === null || _e === void 0 ? void 0 : _e.d_token_decimal));
|
|
@@ -375,8 +375,8 @@ function parseBidEvents(datas, end_ts_ms) {
|
|
|
375
375
|
parsedJson.txDigest = event.id.txDigest;
|
|
376
376
|
index = parsedJson.index.toString();
|
|
377
377
|
bid_event = parsedJson;
|
|
378
|
-
o_token = (0,
|
|
379
|
-
size = Number(parsedJson.size) / Math.pow(10, (0,
|
|
378
|
+
o_token = (0, constants_1.typeArgToAsset)("0x" + parsedJson.o_token.name);
|
|
379
|
+
size = Number(parsedJson.size) / Math.pow(10, (0, constants_1.assetToDecimal)(o_token));
|
|
380
380
|
bid_event.size = size.toString();
|
|
381
381
|
if (Number(bid_event.ts_ms) > end_ts_ms) {
|
|
382
382
|
return [2 /*return*/, map];
|
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./entry"), exports);
|
|
17
|
+
__exportStar(require("./authority-entry"), exports);
|
|
18
18
|
__exportStar(require("./function"), exports);
|
|
19
19
|
__exportStar(require("./history"), exports);
|
|
20
|
+
__exportStar(require("./token-user-entry"), exports);
|
|
21
|
+
__exportStar(require("./user-entry"), exports);
|
|
20
22
|
__exportStar(require("./view-function"), exports);
|
|
@@ -28,7 +28,7 @@ exports.getMfudCloseStrategyTx = getMfudCloseStrategyTx;
|
|
|
28
28
|
exports.getMfudWithdrawProfitStrategyTx = getMfudWithdrawProfitStrategyTx;
|
|
29
29
|
exports.getMfudCompoundWithRedeemTx = getMfudCompoundWithRedeemTx;
|
|
30
30
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
31
|
-
var constants_1 = require("
|
|
31
|
+
var constants_1 = require("../constants");
|
|
32
32
|
function getMfudRaiseFundTx(input) {
|
|
33
33
|
var typusTokenBalance = input.raiseCoins.length > 0
|
|
34
34
|
? input.tx.moveCall({
|
|
@@ -27,7 +27,7 @@ exports.getMultiTransferBidReceiptTx = getMultiTransferBidReceiptTx;
|
|
|
27
27
|
exports.getRebateTx = getRebateTx;
|
|
28
28
|
exports.getCompoundWithRedeemTx = getCompoundWithRedeemTx;
|
|
29
29
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
30
|
-
var constants_1 = require("
|
|
30
|
+
var constants_1 = require("../constants");
|
|
31
31
|
/**
|
|
32
32
|
public fun public_raise_fund<D_TOKEN, B_TOKEN>(
|
|
33
33
|
typus_ecosystem_version: &TypusEcosystemVersion,
|
|
@@ -60,7 +60,7 @@ exports.getMyBids = getMyBids;
|
|
|
60
60
|
exports.getRefundShares = getRefundShares;
|
|
61
61
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
62
62
|
var bcs_1 = require("@mysten/bcs");
|
|
63
|
-
var
|
|
63
|
+
var utils_1 = require("../utils");
|
|
64
64
|
var SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
65
65
|
function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
66
66
|
return __awaiter(this, arguments, void 0, function (provider, packageId, registry, indexes, sender) {
|
|
@@ -85,7 +85,7 @@ function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
|
85
85
|
result = {};
|
|
86
86
|
reader.readVec(function (reader) {
|
|
87
87
|
reader.read16();
|
|
88
|
-
var id = (0,
|
|
88
|
+
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
89
89
|
var info = {
|
|
90
90
|
index: reader.read64(),
|
|
91
91
|
optionType: reader.read64(),
|
|
@@ -101,7 +101,7 @@ function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
|
101
101
|
dTokenDecimal: reader.read64(),
|
|
102
102
|
bTokenDecimal: reader.read64(),
|
|
103
103
|
oTokenDecimal: reader.read64(),
|
|
104
|
-
creator: (0,
|
|
104
|
+
creator: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
105
105
|
createTsMs: reader.read64(),
|
|
106
106
|
round: reader.read64(),
|
|
107
107
|
status: reader.read64(),
|
|
@@ -161,7 +161,7 @@ function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
|
161
161
|
}),
|
|
162
162
|
};
|
|
163
163
|
var config = {
|
|
164
|
-
oracleId: (0,
|
|
164
|
+
oracleId: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
165
165
|
depositLotSize: reader.read64(),
|
|
166
166
|
bidLotSize: reader.read64(),
|
|
167
167
|
minDepositSize: reader.read64(),
|
|
@@ -250,7 +250,7 @@ function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
|
250
250
|
return reader.readBytes(32);
|
|
251
251
|
}); // tail
|
|
252
252
|
var depositVault = {
|
|
253
|
-
id: (0,
|
|
253
|
+
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
254
254
|
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
255
255
|
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
256
256
|
incentiveToken: reader
|
|
@@ -316,7 +316,7 @@ function getAuctions(provider_1, packageId_1, registry_1, indexes_1) {
|
|
|
316
316
|
result = {};
|
|
317
317
|
reader.readVec(function (reader) {
|
|
318
318
|
reader.read16();
|
|
319
|
-
var id = (0,
|
|
319
|
+
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
320
320
|
var index = reader.read64();
|
|
321
321
|
var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
|
|
322
322
|
var startTsMs = reader.read64();
|
|
@@ -385,7 +385,7 @@ function getAuctionBids(provider_1, packageId_1, registry_1, index_1) {
|
|
|
385
385
|
reader.read8();
|
|
386
386
|
var bid = {
|
|
387
387
|
tsMs: reader.read64(),
|
|
388
|
-
bidder: (0,
|
|
388
|
+
bidder: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
389
389
|
price: reader.read64(),
|
|
390
390
|
size: reader.read64(),
|
|
391
391
|
bidderBalance: reader.read64(),
|
|
@@ -505,7 +505,7 @@ function getMyBids(provider_1, typusFrameworkPackageId_1, packageId_1, registry_
|
|
|
505
505
|
reader.readVec(function (reader, i) {
|
|
506
506
|
reader.read16();
|
|
507
507
|
var bidVault = {
|
|
508
|
-
id: (0,
|
|
508
|
+
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
509
509
|
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
510
510
|
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
511
511
|
incentiveToken: reader
|
|
@@ -320,6 +320,7 @@ function getTailsDynamicField(provider, tailsIds) {
|
|
|
320
320
|
case 2:
|
|
321
321
|
results = _e.sent();
|
|
322
322
|
try {
|
|
323
|
+
// console.log(results);
|
|
323
324
|
for (results_2 = (e_4 = void 0, __values(results)), results_2_1 = results_2.next(); !results_2_1.done; results_2_1 = results_2.next()) {
|
|
324
325
|
result = results_2_1.value;
|
|
325
326
|
owner = (_b = result.data) === null || _b === void 0 ? void 0 : _b.owner.ObjectOwner;
|