@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.
- package/lib/config.json +14 -14
- package/lib/utils/airdrop/authority-entry.d.ts +22 -0
- package/lib/utils/airdrop/authority-entry.js +138 -0
- package/lib/utils/airdrop/user-entry.d.ts +10 -0
- package/lib/utils/airdrop/user-entry.js +21 -0
- package/lib/utils/airdrop/view-functions.d.ts +10 -0
- package/lib/utils/airdrop/view-functions.js +72 -0
- package/lib/utils/leaderboard/authority-entry.d.ts +22 -0
- package/lib/utils/leaderboard/authority-entry.js +91 -0
- package/lib/utils/leaderboard/view-function.d.ts +21 -0
- package/lib/utils/leaderboard/view-function.js +92 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +4 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +5 -1
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +4 -0
- package/lib/utils/typus-dov-single-v2/user-entry.js +10 -2
- package/lib/utils/user/view-functions.d.ts +9 -0
- package/lib/utils/user/view-functions.js +71 -0
- package/package.json +1 -1
- package/lib/utils/typus-dov-double/authorized-entry.d.ts +0 -102
- package/lib/utils/typus-dov-double/authorized-entry.js +0 -295
- package/lib/utils/typus-dov-double/manager-entry.d.ts +0 -219
- package/lib/utils/typus-dov-double/manager-entry.js +0 -584
- package/lib/utils/typus-dov-double/portfolio-vault.d.ts +0 -68
- package/lib/utils/typus-dov-double/portfolio-vault.js +0 -303
- package/lib/utils/typus-dov-double/user-entry.d.ts +0 -93
- package/lib/utils/typus-dov-double/user-entry.js +0 -280
- package/lib/utils/typus-dov-double/view-function.d.ts +0 -11
- package/lib/utils/typus-dov-double/view-function.js +0 -213
- package/lib/utils/typus-dov-single/db-data.d.ts +0 -19
- package/lib/utils/typus-dov-single/db-data.js +0 -226
- package/lib/utils/typus-dov-single/portfolio-vault.d.ts +0 -63
- package/lib/utils/typus-dov-single/portfolio-vault.js +0 -284
- package/lib/utils/typus-dov-single/registry.d.ts +0 -14
- package/lib/utils/typus-dov-single/registry.js +0 -126
- package/lib/utils/typus-dov-single/user-entry.d.ts +0 -103
- package/lib/utils/typus-dov-single/user-entry.js +0 -388
- package/lib/utils/typus-dov-single/user-history.d.ts +0 -17
- package/lib/utils/typus-dov-single/user-history.js +0 -146
- package/lib/utils/typus-dov-single/view-function.d.ts +0 -50
- package/lib/utils/typus-dov-single/view-function.js +0 -444
|
@@ -1,126 +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.getPackageVersion = exports.getRegistry = void 0;
|
|
40
|
-
var tools_1 = require("../tools");
|
|
41
|
-
function getRegistry(provider, registry) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
-
var result, _a, _b;
|
|
44
|
-
var _c, _d;
|
|
45
|
-
return __generator(this, function (_e) {
|
|
46
|
-
switch (_e.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, provider.getObject({ id: registry, options: { showContent: true } })];
|
|
48
|
-
case 1:
|
|
49
|
-
result = _e.sent();
|
|
50
|
-
_c = {
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
version: result.data.content.fields.version,
|
|
53
|
-
// @ts-ignore
|
|
54
|
-
numOfVault: result.data.content.fields.num_of_vault,
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
depositVaultRegistry: result.data.content.fields.deposit_vault_registry.fields.id.id,
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
bidVaultRegistry: result.data.content.fields.bid_vault_registry.fields.id.id,
|
|
59
|
-
restrictActivationTimePeriod: {
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
fromTsMs: result.data.content.fields.restrict_activation_time_period.fields.from_ts_ms,
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
toTsMs: result.data.content.fields.restrict_activation_time_period.fields.to_ts_ms,
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
_b = (_a = provider).multiGetObjects;
|
|
67
|
-
_d = {};
|
|
68
|
-
return [4 /*yield*/, provider.getDynamicFields({
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
parentId: result.data.content.fields.authority.fields.whitelist.fields.id.id,
|
|
71
|
-
})];
|
|
72
|
-
case 2: return [4 /*yield*/, _b.apply(_a, [(_d.ids = (_e.sent()).data.map(function (x) { return x.objectId; }),
|
|
73
|
-
_d.options = { showContent: true },
|
|
74
|
-
_d)])];
|
|
75
|
-
case 3: return [2 /*return*/, (_c.authority = (_e.sent()).map(function (x) {
|
|
76
|
-
// @ts-ignore
|
|
77
|
-
return x.data.content.fields.name;
|
|
78
|
-
}),
|
|
79
|
-
_c)];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
exports.getRegistry = getRegistry;
|
|
85
|
-
function getPackageVersion(provider, packageId) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var packageData, version;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0: return [4 /*yield*/, provider.getObject({
|
|
91
|
-
id: packageId,
|
|
92
|
-
options: {
|
|
93
|
-
showContent: true,
|
|
94
|
-
showBcs: true,
|
|
95
|
-
},
|
|
96
|
-
})];
|
|
97
|
-
case 1:
|
|
98
|
-
packageData = _a.sent();
|
|
99
|
-
version = new RegExp("Constants \\[[^=]+=> u64: ([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])([^\\s][^\\s])").exec(
|
|
100
|
-
// @ts-ignore
|
|
101
|
-
packageData.data.content.disassembled.typus_dov_single
|
|
102
|
-
// " 25: Ret}Constants [0 => u64: e803000000000000jadsfiklajsl1 => u64: 0200000000000000"
|
|
103
|
-
);
|
|
104
|
-
return [2 /*return*/, (0, tools_1.U64FromBytes)([
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
parseInt(version[8], 16),
|
|
107
|
-
// @ts-ignore
|
|
108
|
-
parseInt(version[7], 16),
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
parseInt(version[6], 16),
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
parseInt(version[5], 16),
|
|
113
|
-
// @ts-ignore
|
|
114
|
-
parseInt(version[4], 16),
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
parseInt(version[3], 16),
|
|
117
|
-
// @ts-ignore
|
|
118
|
-
parseInt(version[2], 16),
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
parseInt(version[1], 16),
|
|
121
|
-
])];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
exports.getPackageVersion = getPackageVersion;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
-
/**
|
|
3
|
-
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
4
|
-
registry: &mut Registry,
|
|
5
|
-
index: u64,
|
|
6
|
-
coins: vector<Coin<D_TOKEN>>,
|
|
7
|
-
amount: u64,
|
|
8
|
-
ctx: &mut TxContext
|
|
9
|
-
)
|
|
10
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
11
|
-
*/
|
|
12
|
-
export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
13
|
-
/**
|
|
14
|
-
public(friend) entry fun withdraw<TOKEN>(
|
|
15
|
-
registry: &mut Registry,
|
|
16
|
-
index: u64,
|
|
17
|
-
share: Option<u64>,
|
|
18
|
-
ctx: &mut TxContext
|
|
19
|
-
)
|
|
20
|
-
@param typeArguments [Deposit Vault Token]
|
|
21
|
-
*/
|
|
22
|
-
export declare function getWithdrawTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
23
|
-
/**
|
|
24
|
-
public(friend) entry fun claim<TOKEN>(
|
|
25
|
-
registry: &mut Registry,
|
|
26
|
-
index: u64,
|
|
27
|
-
ctx: &mut TxContext
|
|
28
|
-
)
|
|
29
|
-
@param typeArguments [Deposit Vault Token]
|
|
30
|
-
*/
|
|
31
|
-
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
32
|
-
export declare function getBatchClaimTx(gasBudget: number, packageId: string, registry: string, additional_config_registry: string, requests: {
|
|
33
|
-
typeArguments: string[];
|
|
34
|
-
index: string;
|
|
35
|
-
}[]): Promise<TransactionBlock>;
|
|
36
|
-
export declare function getBatchClaimHarvestTx(gasBudget: number, packageId: string, registry: string, additional_config_registry: string, claimRequests: {
|
|
37
|
-
typeArguments: string[];
|
|
38
|
-
index: string;
|
|
39
|
-
}[], harvestRequests: {
|
|
40
|
-
typeArguments: string[];
|
|
41
|
-
index: string;
|
|
42
|
-
}[]): Promise<TransactionBlock>;
|
|
43
|
-
export declare function getBatchClaimHarvestWithdrawTx(gasBudget: number, packageId: string, registry: string, additional_config_registry: string, claimRequests: {
|
|
44
|
-
typeArguments: string[];
|
|
45
|
-
index: string;
|
|
46
|
-
}[], harvestRequests: {
|
|
47
|
-
typeArguments: string[];
|
|
48
|
-
index: string;
|
|
49
|
-
}[], withdrawRequests: {
|
|
50
|
-
typeArguments: string[];
|
|
51
|
-
index: string;
|
|
52
|
-
}[]): Promise<TransactionBlock>;
|
|
53
|
-
/**
|
|
54
|
-
public(friend) entry fun harvest<TOKEN>(
|
|
55
|
-
registry: &mut Registry,
|
|
56
|
-
index: u64,
|
|
57
|
-
ctx: &mut TxContext
|
|
58
|
-
)
|
|
59
|
-
@param typeArguments [Bid Vault Token]
|
|
60
|
-
*/
|
|
61
|
-
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
62
|
-
/**
|
|
63
|
-
public(friend) entry fun claim_and_harvest<D_TOKEN, B_TOKEN>(
|
|
64
|
-
registry: &mut Registry,
|
|
65
|
-
index: u64,
|
|
66
|
-
ctx: &mut TxContext
|
|
67
|
-
)
|
|
68
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
69
|
-
*/
|
|
70
|
-
export declare function getClaimAndHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
71
|
-
/**
|
|
72
|
-
public(friend) entry fun compound<TOKEN, O_TOKEN>(
|
|
73
|
-
registry: &mut Registry,
|
|
74
|
-
index: u64,
|
|
75
|
-
ctx: &mut TxContext,
|
|
76
|
-
)
|
|
77
|
-
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
78
|
-
*/
|
|
79
|
-
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
80
|
-
/**
|
|
81
|
-
public(friend) entry fun unsubscribe<TOKEN>(
|
|
82
|
-
registry: &mut Registry,
|
|
83
|
-
index: u64,
|
|
84
|
-
share: Option<u64>,
|
|
85
|
-
ctx: &mut TxContext
|
|
86
|
-
)
|
|
87
|
-
@param typeArguments [Deposit Vault Token]
|
|
88
|
-
*/
|
|
89
|
-
export declare function getUnsubscribeTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, share?: string): Promise<TransactionBlock>;
|
|
90
|
-
/**
|
|
91
|
-
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
92
|
-
registry: &mut Registry,
|
|
93
|
-
index: u64,
|
|
94
|
-
price_oracle: &Oracle<O_TOKEN>,
|
|
95
|
-
clock: &Clock,
|
|
96
|
-
coins: vector<Coin<B_TOKEN>>,
|
|
97
|
-
size: u64,
|
|
98
|
-
ctx: &mut TxContext,
|
|
99
|
-
)
|
|
100
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
101
|
-
*/
|
|
102
|
-
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
|
|
103
|
-
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
@@ -1,388 +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.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 transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
|
-
var constants_1 = require("../../constants");
|
|
58
|
-
/**
|
|
59
|
-
public(friend) entry fun deposit<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
60
|
-
registry: &mut Registry,
|
|
61
|
-
index: u64,
|
|
62
|
-
coins: vector<Coin<D_TOKEN>>,
|
|
63
|
-
amount: u64,
|
|
64
|
-
ctx: &mut TxContext
|
|
65
|
-
)
|
|
66
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
67
|
-
*/
|
|
68
|
-
function getDepositTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, coins_1, amount_1) {
|
|
69
|
-
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
|
|
70
|
-
var tx, _a, coin;
|
|
71
|
-
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
72
|
-
return __generator(this, function (_b) {
|
|
73
|
-
tx = new transactions_1.TransactionBlock();
|
|
74
|
-
if (!usingSponsoredGasCoin &&
|
|
75
|
-
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
76
|
-
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
77
|
-
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
78
|
-
tx.moveCall({
|
|
79
|
-
target: "".concat(packageId, "::typus_dov_single::deposit"),
|
|
80
|
-
typeArguments: typeArguments,
|
|
81
|
-
arguments: [
|
|
82
|
-
tx.pure(registry),
|
|
83
|
-
tx.pure(additional_config_registry),
|
|
84
|
-
tx.pure(index),
|
|
85
|
-
tx.makeMoveVec({ objects: [coin] }),
|
|
86
|
-
tx.pure(amount),
|
|
87
|
-
],
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
tx.moveCall({
|
|
92
|
-
target: "".concat(packageId, "::typus_dov_single::deposit"),
|
|
93
|
-
typeArguments: typeArguments,
|
|
94
|
-
arguments: [
|
|
95
|
-
tx.pure(registry),
|
|
96
|
-
tx.pure(additional_config_registry),
|
|
97
|
-
tx.pure(index),
|
|
98
|
-
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
99
|
-
tx.pure(amount),
|
|
100
|
-
],
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
tx.setGasBudget(gasBudget);
|
|
104
|
-
return [2 /*return*/, tx];
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
exports.getDepositTx = getDepositTx;
|
|
109
|
-
/**
|
|
110
|
-
public(friend) entry fun withdraw<TOKEN>(
|
|
111
|
-
registry: &mut Registry,
|
|
112
|
-
index: u64,
|
|
113
|
-
share: Option<u64>,
|
|
114
|
-
ctx: &mut TxContext
|
|
115
|
-
)
|
|
116
|
-
@param typeArguments [Deposit Vault Token]
|
|
117
|
-
*/
|
|
118
|
-
function getWithdrawTx(gasBudget, packageId, typeArguments, registry, index, share) {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
-
var tx;
|
|
121
|
-
return __generator(this, function (_a) {
|
|
122
|
-
tx = new transactions_1.TransactionBlock();
|
|
123
|
-
tx.moveCall({
|
|
124
|
-
target: "".concat(packageId, "::typus_dov_single::withdraw"),
|
|
125
|
-
typeArguments: typeArguments,
|
|
126
|
-
arguments: [tx.pure(registry), tx.pure(index), tx.pure(share ? [share] : [])],
|
|
127
|
-
});
|
|
128
|
-
tx.setGasBudget(gasBudget);
|
|
129
|
-
return [2 /*return*/, tx];
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
exports.getWithdrawTx = getWithdrawTx;
|
|
134
|
-
/**
|
|
135
|
-
public(friend) entry fun claim<TOKEN>(
|
|
136
|
-
registry: &mut Registry,
|
|
137
|
-
index: u64,
|
|
138
|
-
ctx: &mut TxContext
|
|
139
|
-
)
|
|
140
|
-
@param typeArguments [Deposit Vault Token]
|
|
141
|
-
*/
|
|
142
|
-
function getClaimTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
-
var tx;
|
|
145
|
-
return __generator(this, function (_a) {
|
|
146
|
-
tx = new transactions_1.TransactionBlock();
|
|
147
|
-
tx.moveCall({
|
|
148
|
-
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
149
|
-
typeArguments: typeArguments,
|
|
150
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
151
|
-
});
|
|
152
|
-
tx.setGasBudget(gasBudget);
|
|
153
|
-
return [2 /*return*/, tx];
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
exports.getClaimTx = getClaimTx;
|
|
158
|
-
function getBatchClaimTx(gasBudget, packageId, registry, additional_config_registry, requests) {
|
|
159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
var tx;
|
|
161
|
-
return __generator(this, function (_a) {
|
|
162
|
-
tx = new transactions_1.TransactionBlock();
|
|
163
|
-
requests.forEach(function (request) {
|
|
164
|
-
tx.moveCall({
|
|
165
|
-
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
166
|
-
typeArguments: request.typeArguments,
|
|
167
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(request.index)],
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
tx.setGasBudget(gasBudget);
|
|
171
|
-
return [2 /*return*/, tx];
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
exports.getBatchClaimTx = getBatchClaimTx;
|
|
176
|
-
function getBatchClaimHarvestTx(gasBudget, packageId, registry, additional_config_registry, claimRequests, harvestRequests) {
|
|
177
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
-
var tx;
|
|
179
|
-
return __generator(this, function (_a) {
|
|
180
|
-
tx = new transactions_1.TransactionBlock();
|
|
181
|
-
claimRequests.forEach(function (request) {
|
|
182
|
-
tx.moveCall({
|
|
183
|
-
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
184
|
-
typeArguments: request.typeArguments,
|
|
185
|
-
arguments: [tx.object(registry), tx.object(additional_config_registry), tx.pure(request.index)],
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
harvestRequests.forEach(function (request) {
|
|
189
|
-
tx.moveCall({
|
|
190
|
-
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
191
|
-
typeArguments: request.typeArguments,
|
|
192
|
-
arguments: [tx.object(registry), tx.object(additional_config_registry), tx.pure(request.index)],
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
tx.setGasBudget(gasBudget);
|
|
196
|
-
return [2 /*return*/, tx];
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
exports.getBatchClaimHarvestTx = getBatchClaimHarvestTx;
|
|
201
|
-
function getBatchClaimHarvestWithdrawTx(gasBudget, packageId, registry, additional_config_registry, claimRequests, harvestRequests, withdrawRequests // D_TOKEN, B_TOKEN, O_TOKEN
|
|
202
|
-
) {
|
|
203
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
204
|
-
var tx;
|
|
205
|
-
return __generator(this, function (_a) {
|
|
206
|
-
tx = new transactions_1.TransactionBlock();
|
|
207
|
-
claimRequests.forEach(function (request) {
|
|
208
|
-
tx.moveCall({
|
|
209
|
-
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
210
|
-
typeArguments: request.typeArguments,
|
|
211
|
-
arguments: [tx.object(registry), tx.object(additional_config_registry), tx.pure(request.index)],
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
harvestRequests.forEach(function (request) {
|
|
215
|
-
tx.moveCall({
|
|
216
|
-
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
217
|
-
typeArguments: request.typeArguments,
|
|
218
|
-
arguments: [tx.object(registry), tx.object(additional_config_registry), tx.pure(request.index)],
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
withdrawRequests.forEach(function (request) {
|
|
222
|
-
tx.moveCall({
|
|
223
|
-
target: "".concat(packageId, "::tails_staking::withdraw"),
|
|
224
|
-
typeArguments: request.typeArguments,
|
|
225
|
-
arguments: [tx.object(registry), tx.object(additional_config_registry), tx.pure(request.index), tx.pure([]), tx.object(constants_1.CLOCK)],
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
tx.setGasBudget(gasBudget);
|
|
229
|
-
return [2 /*return*/, tx];
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
exports.getBatchClaimHarvestWithdrawTx = getBatchClaimHarvestWithdrawTx;
|
|
234
|
-
/**
|
|
235
|
-
public(friend) entry fun harvest<TOKEN>(
|
|
236
|
-
registry: &mut Registry,
|
|
237
|
-
index: u64,
|
|
238
|
-
ctx: &mut TxContext
|
|
239
|
-
)
|
|
240
|
-
@param typeArguments [Bid Vault Token]
|
|
241
|
-
*/
|
|
242
|
-
function getHarvestTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
243
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var tx;
|
|
245
|
-
return __generator(this, function (_a) {
|
|
246
|
-
tx = new transactions_1.TransactionBlock();
|
|
247
|
-
tx.moveCall({
|
|
248
|
-
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
249
|
-
typeArguments: typeArguments,
|
|
250
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
251
|
-
});
|
|
252
|
-
tx.setGasBudget(gasBudget);
|
|
253
|
-
return [2 /*return*/, tx];
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
exports.getHarvestTx = getHarvestTx;
|
|
258
|
-
/**
|
|
259
|
-
public(friend) entry fun claim_and_harvest<D_TOKEN, B_TOKEN>(
|
|
260
|
-
registry: &mut Registry,
|
|
261
|
-
index: u64,
|
|
262
|
-
ctx: &mut TxContext
|
|
263
|
-
)
|
|
264
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
265
|
-
*/
|
|
266
|
-
function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
267
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
268
|
-
var tx;
|
|
269
|
-
return __generator(this, function (_a) {
|
|
270
|
-
tx = new transactions_1.TransactionBlock();
|
|
271
|
-
tx.moveCall({
|
|
272
|
-
target: "".concat(packageId, "::typus_dov_single::claim_and_harvest"),
|
|
273
|
-
typeArguments: typeArguments,
|
|
274
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
275
|
-
});
|
|
276
|
-
tx.setGasBudget(gasBudget);
|
|
277
|
-
return [2 /*return*/, tx];
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
exports.getClaimAndHarvestTx = getClaimAndHarvestTx;
|
|
282
|
-
/**
|
|
283
|
-
public(friend) entry fun compound<TOKEN, O_TOKEN>(
|
|
284
|
-
registry: &mut Registry,
|
|
285
|
-
index: u64,
|
|
286
|
-
ctx: &mut TxContext,
|
|
287
|
-
)
|
|
288
|
-
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
289
|
-
*/
|
|
290
|
-
function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
291
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
-
var tx;
|
|
293
|
-
return __generator(this, function (_a) {
|
|
294
|
-
tx = new transactions_1.TransactionBlock();
|
|
295
|
-
tx.moveCall({
|
|
296
|
-
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
297
|
-
typeArguments: typeArguments,
|
|
298
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
299
|
-
});
|
|
300
|
-
tx.setGasBudget(gasBudget);
|
|
301
|
-
return [2 /*return*/, tx];
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
exports.getCompoundTx = getCompoundTx;
|
|
306
|
-
/**
|
|
307
|
-
public(friend) entry fun unsubscribe<TOKEN>(
|
|
308
|
-
registry: &mut Registry,
|
|
309
|
-
index: u64,
|
|
310
|
-
share: Option<u64>,
|
|
311
|
-
ctx: &mut TxContext
|
|
312
|
-
)
|
|
313
|
-
@param typeArguments [Deposit Vault Token]
|
|
314
|
-
*/
|
|
315
|
-
function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, share) {
|
|
316
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
-
var tx;
|
|
318
|
-
return __generator(this, function (_a) {
|
|
319
|
-
tx = new transactions_1.TransactionBlock();
|
|
320
|
-
tx.moveCall({
|
|
321
|
-
target: "".concat(packageId, "::typus_dov_single::unsubscribe"),
|
|
322
|
-
typeArguments: typeArguments,
|
|
323
|
-
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index), tx.pure(share ? [share] : [])],
|
|
324
|
-
});
|
|
325
|
-
tx.setGasBudget(gasBudget);
|
|
326
|
-
return [2 /*return*/, tx];
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
331
|
-
/**
|
|
332
|
-
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN, O_TOKEN>(
|
|
333
|
-
registry: &mut Registry,
|
|
334
|
-
index: u64,
|
|
335
|
-
price_oracle: &Oracle<O_TOKEN>,
|
|
336
|
-
clock: &Clock,
|
|
337
|
-
coins: vector<Coin<B_TOKEN>>,
|
|
338
|
-
size: u64,
|
|
339
|
-
ctx: &mut TxContext,
|
|
340
|
-
)
|
|
341
|
-
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
342
|
-
*/
|
|
343
|
-
function getNewBidTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, priceOracle_1, coins_1, size_1, premium_required_1) {
|
|
344
|
-
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
|
|
345
|
-
usingSponsoredGasCoin) {
|
|
346
|
-
var tx, _a, coin;
|
|
347
|
-
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
348
|
-
return __generator(this, function (_b) {
|
|
349
|
-
tx = new transactions_1.TransactionBlock();
|
|
350
|
-
if (!usingSponsoredGasCoin &&
|
|
351
|
-
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
352
|
-
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
353
|
-
_a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
|
|
354
|
-
tx.moveCall({
|
|
355
|
-
target: "".concat(packageId, "::typus_dov_single::new_bid"),
|
|
356
|
-
typeArguments: typeArguments,
|
|
357
|
-
arguments: [
|
|
358
|
-
tx.pure(registry),
|
|
359
|
-
tx.pure(additional_config_registry),
|
|
360
|
-
tx.pure(index),
|
|
361
|
-
tx.pure(priceOracle),
|
|
362
|
-
tx.pure("0x6"),
|
|
363
|
-
tx.makeMoveVec({ objects: [coin] }),
|
|
364
|
-
tx.pure(size),
|
|
365
|
-
],
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
tx.moveCall({
|
|
370
|
-
target: "".concat(packageId, "::typus_dov_single::new_bid"),
|
|
371
|
-
typeArguments: typeArguments,
|
|
372
|
-
arguments: [
|
|
373
|
-
tx.pure(registry),
|
|
374
|
-
tx.pure(additional_config_registry),
|
|
375
|
-
tx.pure(index),
|
|
376
|
-
tx.pure(priceOracle),
|
|
377
|
-
tx.pure("0x6"),
|
|
378
|
-
tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
|
|
379
|
-
tx.pure(size),
|
|
380
|
-
],
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
tx.setGasBudget(gasBudget);
|
|
384
|
-
return [2 /*return*/, tx];
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
exports.getNewBidTx = getNewBidTx;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui.js/client";
|
|
2
|
-
export declare function getUserHistory(provider: SuiClient, originPackage: string, sender: string, startTimeMs: number): Promise<TxHistory[]>;
|
|
3
|
-
interface TxHistory {
|
|
4
|
-
Vault: string;
|
|
5
|
-
Action: string;
|
|
6
|
-
Date: Date;
|
|
7
|
-
txDigest: string;
|
|
8
|
-
Asset: string;
|
|
9
|
-
Amount: number;
|
|
10
|
-
Fee: number;
|
|
11
|
-
BidSize: number;
|
|
12
|
-
BidPaid: number;
|
|
13
|
-
BidPaidWithIncentive: number | undefined;
|
|
14
|
-
BidPaidAsset: string;
|
|
15
|
-
IncentiveValue: number;
|
|
16
|
-
}
|
|
17
|
-
export {};
|