@typus/typus-sdk 1.0.73 → 1.0.75
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/utils/token.js
CHANGED
|
@@ -11,21 +11,21 @@ function typeArgsToAssets(typeArgs) {
|
|
|
11
11
|
var typeArgs = x.split("::");
|
|
12
12
|
switch ((0, sui_js_1.normalizeSuiAddress)(typeArgs[0])) {
|
|
13
13
|
case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881":
|
|
14
|
-
return "
|
|
14
|
+
return "BTC";
|
|
15
15
|
case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5":
|
|
16
|
-
return "
|
|
16
|
+
return "ETH";
|
|
17
17
|
case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
|
|
18
|
-
return "
|
|
18
|
+
return "SOL";
|
|
19
19
|
case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
|
|
20
20
|
return "USDC";
|
|
21
21
|
case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c":
|
|
22
22
|
return "USDT";
|
|
23
23
|
case config_json_1.default.TOKEN_PACKAGE:
|
|
24
24
|
if (typeArgs[2] == "BTC") {
|
|
25
|
-
return "
|
|
25
|
+
return "BTC";
|
|
26
26
|
}
|
|
27
27
|
else if (typeArgs[2] == "ETH") {
|
|
28
|
-
return "
|
|
28
|
+
return "ETH";
|
|
29
29
|
}
|
|
30
30
|
return typeArgs[2];
|
|
31
31
|
default:
|
|
@@ -28,7 +28,7 @@ export declare function getWithdrawTx(gasBudget: number, packageId: string, type
|
|
|
28
28
|
)
|
|
29
29
|
@param typeArguments [Deposit Vault Token]
|
|
30
30
|
*/
|
|
31
|
-
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
31
|
+
export declare function getClaimTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
32
32
|
/**
|
|
33
33
|
public(friend) entry fun harvest<TOKEN>(
|
|
34
34
|
registry: &mut Registry,
|
|
@@ -37,7 +37,7 @@ export declare function getClaimTx(gasBudget: number, packageId: string, typeArg
|
|
|
37
37
|
)
|
|
38
38
|
@param typeArguments [Bid Vault Token]
|
|
39
39
|
*/
|
|
40
|
-
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
40
|
+
export declare function getHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
41
41
|
/**
|
|
42
42
|
public(friend) entry fun claim_and_harvest<D_TOKEN, B_TOKEN>(
|
|
43
43
|
registry: &mut Registry,
|
|
@@ -46,7 +46,7 @@ export declare function getHarvestTx(gasBudget: number, packageId: string, typeA
|
|
|
46
46
|
)
|
|
47
47
|
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
48
48
|
*/
|
|
49
|
-
export declare function getClaimAndHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
49
|
+
export declare function getClaimAndHarvestTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
50
50
|
/**
|
|
51
51
|
public(friend) entry fun compound<TOKEN, O_TOKEN>(
|
|
52
52
|
registry: &mut Registry,
|
|
@@ -55,7 +55,7 @@ export declare function getClaimAndHarvestTx(gasBudget: number, packageId: strin
|
|
|
55
55
|
)
|
|
56
56
|
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
57
57
|
*/
|
|
58
|
-
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string): Promise<TransactionBlock>;
|
|
58
|
+
export declare function getCompoundTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string): Promise<TransactionBlock>;
|
|
59
59
|
/**
|
|
60
60
|
public(friend) entry fun unsubscribe<TOKEN>(
|
|
61
61
|
registry: &mut Registry,
|
|
@@ -71,7 +71,8 @@ function getDepositTx(gasBudget, packageId, typeArguments, registry, index, coin
|
|
|
71
71
|
return __generator(this, function (_b) {
|
|
72
72
|
tx = new sui_js_1.TransactionBlock();
|
|
73
73
|
if (!usingSponsoredGasCoin &&
|
|
74
|
-
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
74
|
+
(typeArguments[0] == "0x2::sui::SUI" ||
|
|
75
|
+
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
75
76
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
76
77
|
tx.moveCall({
|
|
77
78
|
target: "".concat(packageId, "::typus_dov_single::deposit"),
|
|
@@ -125,7 +126,7 @@ exports.getWithdrawTx = getWithdrawTx;
|
|
|
125
126
|
)
|
|
126
127
|
@param typeArguments [Deposit Vault Token]
|
|
127
128
|
*/
|
|
128
|
-
function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
129
|
+
function getClaimTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
129
130
|
return __awaiter(this, void 0, void 0, function () {
|
|
130
131
|
var tx;
|
|
131
132
|
return __generator(this, function (_a) {
|
|
@@ -133,7 +134,7 @@ function getClaimTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
133
134
|
tx.moveCall({
|
|
134
135
|
target: "".concat(packageId, "::typus_dov_single::claim"),
|
|
135
136
|
typeArguments: typeArguments,
|
|
136
|
-
arguments: [tx.pure(registry), tx.pure(index)],
|
|
137
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
137
138
|
});
|
|
138
139
|
tx.setGasBudget(gasBudget);
|
|
139
140
|
return [2 /*return*/, tx];
|
|
@@ -149,7 +150,7 @@ exports.getClaimTx = getClaimTx;
|
|
|
149
150
|
)
|
|
150
151
|
@param typeArguments [Bid Vault Token]
|
|
151
152
|
*/
|
|
152
|
-
function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
153
|
+
function getHarvestTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
153
154
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
155
|
var tx;
|
|
155
156
|
return __generator(this, function (_a) {
|
|
@@ -157,7 +158,7 @@ function getHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
157
158
|
tx.moveCall({
|
|
158
159
|
target: "".concat(packageId, "::typus_dov_single::harvest"),
|
|
159
160
|
typeArguments: typeArguments,
|
|
160
|
-
arguments: [tx.pure(registry), tx.pure(index)],
|
|
161
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
161
162
|
});
|
|
162
163
|
tx.setGasBudget(gasBudget);
|
|
163
164
|
return [2 /*return*/, tx];
|
|
@@ -173,7 +174,7 @@ exports.getHarvestTx = getHarvestTx;
|
|
|
173
174
|
)
|
|
174
175
|
@param typeArguments [Deposit Vault Token, Bid Vault Token]
|
|
175
176
|
*/
|
|
176
|
-
function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
177
|
+
function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
177
178
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
179
|
var tx;
|
|
179
180
|
return __generator(this, function (_a) {
|
|
@@ -181,7 +182,7 @@ function getClaimAndHarvestTx(gasBudget, packageId, typeArguments, registry, ind
|
|
|
181
182
|
tx.moveCall({
|
|
182
183
|
target: "".concat(packageId, "::typus_dov_single::claim_and_harvest"),
|
|
183
184
|
typeArguments: typeArguments,
|
|
184
|
-
arguments: [tx.pure(registry), tx.pure(index)],
|
|
185
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
185
186
|
});
|
|
186
187
|
tx.setGasBudget(gasBudget);
|
|
187
188
|
return [2 /*return*/, tx];
|
|
@@ -197,7 +198,7 @@ exports.getClaimAndHarvestTx = getClaimAndHarvestTx;
|
|
|
197
198
|
)
|
|
198
199
|
@param typeArguments [Deposit Vault Token, Oracle Token]
|
|
199
200
|
*/
|
|
200
|
-
function getCompoundTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
201
|
+
function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
|
|
201
202
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
203
|
var tx;
|
|
203
204
|
return __generator(this, function (_a) {
|
|
@@ -205,7 +206,7 @@ function getCompoundTx(gasBudget, packageId, typeArguments, registry, index) {
|
|
|
205
206
|
tx.moveCall({
|
|
206
207
|
target: "".concat(packageId, "::typus_dov_single::compound"),
|
|
207
208
|
typeArguments: typeArguments,
|
|
208
|
-
arguments: [tx.pure(registry), tx.pure(index)],
|
|
209
|
+
arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index)],
|
|
209
210
|
});
|
|
210
211
|
tx.setGasBudget(gasBudget);
|
|
211
212
|
return [2 /*return*/, tx];
|
|
@@ -258,7 +259,8 @@ usingSponsoredGasCoin) {
|
|
|
258
259
|
return __generator(this, function (_b) {
|
|
259
260
|
tx = new sui_js_1.TransactionBlock();
|
|
260
261
|
if (!usingSponsoredGasCoin &&
|
|
261
|
-
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
262
|
+
(typeArguments[1] == "0x2::sui::SUI" ||
|
|
263
|
+
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
262
264
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
|
|
263
265
|
tx.moveCall({
|
|
264
266
|
target: "".concat(packageId, "::typus_dov_single::new_bid"),
|