@typus/typus-sdk 1.4.84-ts → 1.5.0
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 +5 -5
- package/dist/src/typus/tails-staking/authority-entry.d.ts +4 -2
- package/dist/src/typus/tails-staking/authority-entry.js +4 -2
- package/dist/src/typus-dov-single-v2/view-function.js +18 -18
- package/dist/src/typus-launch/airdrop/view-function.d.ts +1 -0
- package/dist/src/typus-launch/airdrop/view-function.js +3 -2
- package/dist/src/typus-launch/funding-vault/view-function.js +1 -1
- package/dist/src/typus-launch/improvement-proposal/authority-entry.d.ts +2 -0
- package/dist/src/typus-launch/improvement-proposal/authority-entry.js +2 -0
- package/dist/src/typus-launch/improvement-proposal/view-function.d.ts +6 -1
- package/dist/src/typus-launch/improvement-proposal/view-function.js +22 -14
- package/dist/src/typus-launch/ve-typus/user-entry.js +4 -1
- package/dist/src/typus-perp/readVec.js +9 -9
- package/dist/src/typus-safu/user-history.js +1 -1
- package/dist/src/typus-safu/view-function.js +3 -3
- package/package.json +1 -1
|
@@ -164,7 +164,7 @@ function getUserStrategies(config, input
|
|
|
164
164
|
id: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
|
|
165
165
|
vid: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
|
|
166
166
|
index: reader.read64(),
|
|
167
|
-
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
167
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
168
168
|
u64_padding: reader.readVec(function (reader) {
|
|
169
169
|
return reader.read64();
|
|
170
170
|
}),
|
|
@@ -192,16 +192,16 @@ function getUserStrategies(config, input
|
|
|
192
192
|
reader.read16();
|
|
193
193
|
var bidVault = {
|
|
194
194
|
id: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
|
|
195
|
-
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
196
|
-
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
195
|
+
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
196
|
+
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
197
197
|
incentiveToken: reader
|
|
198
198
|
.readVec(function (reader) {
|
|
199
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
199
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
200
200
|
})
|
|
201
201
|
.at(0),
|
|
202
202
|
index: reader.read64(),
|
|
203
203
|
shareSupply: reader.read64(),
|
|
204
|
-
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
204
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
205
205
|
u64Padding: reader.readVec(function (reader) {
|
|
206
206
|
return reader.read64();
|
|
207
207
|
}),
|
|
@@ -110,11 +110,13 @@ export declare function getUpdateTailsStakingRegistryConfigTx(config: TypusConfi
|
|
|
110
110
|
value: string;
|
|
111
111
|
}): Transaction;
|
|
112
112
|
/**
|
|
113
|
-
entry fun set_profit_sharing<TOKEN>(
|
|
113
|
+
entry fun set_profit_sharing<TOKEN, N_TOKEN>(
|
|
114
114
|
version: &Version,
|
|
115
115
|
tails_staking_registry: &mut TailsStakingRegistry,
|
|
116
116
|
level_profits: vector<u64>,
|
|
117
|
-
|
|
117
|
+
profit: Coin<TOKEN>,
|
|
118
|
+
amount: u64,
|
|
119
|
+
ts_ms: u64,
|
|
118
120
|
ctx: &TxContext,
|
|
119
121
|
) {
|
|
120
122
|
*/
|
|
@@ -182,11 +182,13 @@ function getUpdateTailsStakingRegistryConfigTx(config, tx, input) {
|
|
|
182
182
|
return tx;
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
|
-
entry fun set_profit_sharing<TOKEN>(
|
|
185
|
+
entry fun set_profit_sharing<TOKEN, N_TOKEN>(
|
|
186
186
|
version: &Version,
|
|
187
187
|
tails_staking_registry: &mut TailsStakingRegistry,
|
|
188
188
|
level_profits: vector<u64>,
|
|
189
|
-
|
|
189
|
+
profit: Coin<TOKEN>,
|
|
190
|
+
amount: u64,
|
|
191
|
+
ts_ms: u64,
|
|
190
192
|
ctx: &TxContext,
|
|
191
193
|
) {
|
|
192
194
|
*/
|
|
@@ -93,12 +93,12 @@ function getVaults(config, input) {
|
|
|
93
93
|
period: reader.read8() + "",
|
|
94
94
|
activationTsMs: reader.read64(),
|
|
95
95
|
expirationTsMs: reader.read64(),
|
|
96
|
-
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
97
|
-
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
98
|
-
settlementBase: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
99
|
-
settlementQuote: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
100
|
-
settlementBaseName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
101
|
-
settlementQuoteName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
96
|
+
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
97
|
+
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
98
|
+
settlementBase: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
99
|
+
settlementQuote: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
100
|
+
settlementBaseName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
101
|
+
settlementQuoteName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
102
102
|
dTokenDecimal: reader.read64(),
|
|
103
103
|
bTokenDecimal: reader.read64(),
|
|
104
104
|
oTokenDecimal: reader.read64(),
|
|
@@ -173,7 +173,7 @@ function getVaults(config, input) {
|
|
|
173
173
|
depositFeeShareBp: reader.read64(),
|
|
174
174
|
depositSharedFeePool: reader
|
|
175
175
|
.readVec(function (reader) {
|
|
176
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
176
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
177
177
|
})
|
|
178
178
|
.at(0),
|
|
179
179
|
bidFeeBp: reader.read64(),
|
|
@@ -252,11 +252,11 @@ function getVaults(config, input) {
|
|
|
252
252
|
}); // tail
|
|
253
253
|
var depositVault = {
|
|
254
254
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
255
|
-
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
256
|
-
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
255
|
+
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
256
|
+
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
257
257
|
incentiveToken: reader
|
|
258
258
|
.readVec(function (reader) {
|
|
259
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
259
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
260
260
|
})
|
|
261
261
|
.at(0),
|
|
262
262
|
index: reader.read64(),
|
|
@@ -264,7 +264,7 @@ function getVaults(config, input) {
|
|
|
264
264
|
feeShareBp: reader.read64(),
|
|
265
265
|
sharedFeePool: reader
|
|
266
266
|
.readVec(function (reader) {
|
|
267
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
267
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
268
268
|
})
|
|
269
269
|
.at(0),
|
|
270
270
|
activeShareSupply: reader.read64(),
|
|
@@ -274,7 +274,7 @@ function getVaults(config, input) {
|
|
|
274
274
|
premiumShareSupply: reader.read64(), // harvest
|
|
275
275
|
incentiveShareSupply: reader.read64(), // redeem
|
|
276
276
|
hasNext: reader.read8() > 0,
|
|
277
|
-
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
277
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
278
278
|
u64Padding: reader.readVec(function (reader) {
|
|
279
279
|
return reader.read64();
|
|
280
280
|
}),
|
|
@@ -319,7 +319,7 @@ function getAuctions(config, input) {
|
|
|
319
319
|
reader.read16();
|
|
320
320
|
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
321
321
|
var index = reader.read64();
|
|
322
|
-
var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
322
|
+
var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
323
323
|
var startTsMs = reader.read64();
|
|
324
324
|
var endTsMs = reader.read64();
|
|
325
325
|
var size = reader.read64();
|
|
@@ -507,16 +507,16 @@ function getMyBids(config, input) {
|
|
|
507
507
|
reader.read16();
|
|
508
508
|
var bidVault = {
|
|
509
509
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
510
|
-
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
511
|
-
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
510
|
+
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
511
|
+
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
512
512
|
incentiveToken: reader
|
|
513
513
|
.readVec(function (reader) {
|
|
514
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
514
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
515
515
|
})
|
|
516
516
|
.at(0),
|
|
517
517
|
index: reader.read64(),
|
|
518
518
|
shareSupply: reader.read64(),
|
|
519
|
-
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
519
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
520
520
|
u64Padding: reader.readVec(function (reader) {
|
|
521
521
|
return reader.read64();
|
|
522
522
|
}),
|
|
@@ -569,7 +569,7 @@ function getRefundShares(config, input) {
|
|
|
569
569
|
var bytes = result.returnValues[0][0];
|
|
570
570
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
571
571
|
reader.read8();
|
|
572
|
-
refundShares[String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
572
|
+
refundShares[String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())))] = reader.read64();
|
|
573
573
|
});
|
|
574
574
|
// @ts-ignore
|
|
575
575
|
return [2 /*return*/, refundShares];
|
|
@@ -67,9 +67,10 @@ function getAirdrop(config, input) {
|
|
|
67
67
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
68
68
|
reader.readULEB();
|
|
69
69
|
return {
|
|
70
|
-
key: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
71
|
-
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
70
|
+
key: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
71
|
+
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
72
72
|
value: reader.read64(),
|
|
73
|
+
claimed: reader.read8() == 0 ? false : true,
|
|
73
74
|
};
|
|
74
75
|
})];
|
|
75
76
|
}
|
|
@@ -69,7 +69,7 @@ function getVault(config, input) {
|
|
|
69
69
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
70
70
|
reader.readULEB();
|
|
71
71
|
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
72
|
-
var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
72
|
+
var token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
73
73
|
var info = reader.readVec(function (reader) {
|
|
74
74
|
return reader.read64();
|
|
75
75
|
});
|
|
@@ -82,6 +82,7 @@ export declare function updateConfig(config: TypusConfig, tx: Transaction, input
|
|
|
82
82
|
version: &Version,
|
|
83
83
|
registry: &mut Registry,
|
|
84
84
|
index: u64,
|
|
85
|
+
key: String,
|
|
85
86
|
amount: u64,
|
|
86
87
|
ctx: &TxContext,
|
|
87
88
|
) {
|
|
@@ -89,6 +90,7 @@ export declare function updateConfig(config: TypusConfig, tx: Transaction, input
|
|
|
89
90
|
export declare function setReward(config: TypusConfig, tx: Transaction, input: {
|
|
90
91
|
typeArguments: string[];
|
|
91
92
|
index: string;
|
|
93
|
+
key: string;
|
|
92
94
|
amount: string;
|
|
93
95
|
}): void;
|
|
94
96
|
/**
|
|
@@ -167,6 +167,7 @@ function updateConfig(config, tx, input) {
|
|
|
167
167
|
version: &Version,
|
|
168
168
|
registry: &mut Registry,
|
|
169
169
|
index: u64,
|
|
170
|
+
key: String,
|
|
170
171
|
amount: u64,
|
|
171
172
|
ctx: &TxContext,
|
|
172
173
|
) {
|
|
@@ -179,6 +180,7 @@ function setReward(config, tx, input) {
|
|
|
179
180
|
tx.object(config.version.launch.improvementProposal),
|
|
180
181
|
tx.object(config.registry.launch.improvementProposal),
|
|
181
182
|
tx.pure.u64(input.index),
|
|
183
|
+
tx.pure.string(input.key),
|
|
182
184
|
tx.pure.u64(input.amount),
|
|
183
185
|
],
|
|
184
186
|
});
|
|
@@ -11,13 +11,18 @@ export interface Tip {
|
|
|
11
11
|
votes: any;
|
|
12
12
|
u64Padding: any;
|
|
13
13
|
bcsPadding: any;
|
|
14
|
+
votingPower: any;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
public(package) fun get_ongoing_tips_bcs(
|
|
17
18
|
registry: &Registry,
|
|
19
|
+
ve_typus_registry: &VeTypusRegistry,
|
|
20
|
+
user_opt: Option<address>,
|
|
18
21
|
): vector<u8> {
|
|
19
22
|
*/
|
|
20
|
-
export declare function getOngoingTips(config: TypusConfig
|
|
23
|
+
export declare function getOngoingTips(config: TypusConfig, input: {
|
|
24
|
+
user?: string;
|
|
25
|
+
}): Promise<Tip[]>;
|
|
21
26
|
/**
|
|
22
27
|
public(package) fun get_ended_tips_bcs(
|
|
23
28
|
registry: &Registry,
|
|
@@ -48,9 +48,11 @@ var constants_1 = require("../../../src/constants");
|
|
|
48
48
|
/**
|
|
49
49
|
public(package) fun get_ongoing_tips_bcs(
|
|
50
50
|
registry: &Registry,
|
|
51
|
+
ve_typus_registry: &VeTypusRegistry,
|
|
52
|
+
user_opt: Option<address>,
|
|
51
53
|
): vector<u8> {
|
|
52
54
|
*/
|
|
53
|
-
function getOngoingTips(config) {
|
|
55
|
+
function getOngoingTips(config, input) {
|
|
54
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
55
57
|
var provider, transaction, bytes, reader;
|
|
56
58
|
return __generator(this, function (_a) {
|
|
@@ -60,7 +62,11 @@ function getOngoingTips(config) {
|
|
|
60
62
|
transaction = new transactions_1.Transaction();
|
|
61
63
|
transaction.moveCall({
|
|
62
64
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_ongoing_tips_bcs"),
|
|
63
|
-
arguments: [
|
|
65
|
+
arguments: [
|
|
66
|
+
transaction.object(config.registry.launch.improvementProposal),
|
|
67
|
+
transaction.object(config.registry.launch.veTypus),
|
|
68
|
+
transaction.pure.option("address", input.user),
|
|
69
|
+
],
|
|
64
70
|
});
|
|
65
71
|
return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: constants_1.SENDER, transaction: transaction })];
|
|
66
72
|
case 1:
|
|
@@ -72,9 +78,9 @@ function getOngoingTips(config) {
|
|
|
72
78
|
return {
|
|
73
79
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
74
80
|
index: reader.read64(),
|
|
75
|
-
description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
76
|
-
imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
77
|
-
proposal: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
81
|
+
description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
82
|
+
imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
83
|
+
proposal: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
78
84
|
info: reader.readVec(function (reader) {
|
|
79
85
|
return reader.read64();
|
|
80
86
|
}),
|
|
@@ -83,14 +89,15 @@ function getOngoingTips(config) {
|
|
|
83
89
|
}),
|
|
84
90
|
rewards: reader.readVec(function (reader) {
|
|
85
91
|
return {
|
|
86
|
-
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
92
|
+
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
93
|
+
key: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
87
94
|
amount: reader.read64(),
|
|
88
95
|
};
|
|
89
96
|
}),
|
|
90
97
|
votes: {
|
|
91
98
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
92
|
-
key_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
93
|
-
value_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
99
|
+
key_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
100
|
+
value_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
94
101
|
slice_idx: reader.read16(),
|
|
95
102
|
slice_size: reader.read32(),
|
|
96
103
|
length: reader.read64(),
|
|
@@ -101,6 +108,7 @@ function getOngoingTips(config) {
|
|
|
101
108
|
bcsPadding: reader.readVec(function (reader) {
|
|
102
109
|
return reader.read8();
|
|
103
110
|
}),
|
|
111
|
+
votingPower: input.user ? reader.read64() : 0,
|
|
104
112
|
};
|
|
105
113
|
})];
|
|
106
114
|
}
|
|
@@ -134,9 +142,9 @@ function getEndedTips(config) {
|
|
|
134
142
|
return {
|
|
135
143
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
136
144
|
index: reader.read64(),
|
|
137
|
-
description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
138
|
-
imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
139
|
-
proposal: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
145
|
+
description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
146
|
+
imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
147
|
+
proposal: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
140
148
|
info: reader.readVec(function (reader) {
|
|
141
149
|
return reader.read64();
|
|
142
150
|
}),
|
|
@@ -145,14 +153,14 @@ function getEndedTips(config) {
|
|
|
145
153
|
}),
|
|
146
154
|
rewards: reader.readVec(function (reader) {
|
|
147
155
|
return {
|
|
148
|
-
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
156
|
+
token: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
149
157
|
amount: reader.read64(),
|
|
150
158
|
};
|
|
151
159
|
}),
|
|
152
160
|
votes: {
|
|
153
161
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
154
|
-
key_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
155
|
-
value_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
162
|
+
key_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
163
|
+
value_type: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
156
164
|
slice_idx: reader.read16(),
|
|
157
165
|
slice_size: reader.read32(),
|
|
158
166
|
length: reader.read64(),
|
|
@@ -20,6 +20,7 @@ exports.mint = mint;
|
|
|
20
20
|
exports.burn = burn;
|
|
21
21
|
exports.renew = renew;
|
|
22
22
|
var constants_1 = require("../../../src/constants");
|
|
23
|
+
var improvement_proposal_1 = require("../improvement-proposal");
|
|
23
24
|
/**
|
|
24
25
|
public fun mint(
|
|
25
26
|
version: &Version,
|
|
@@ -48,6 +49,7 @@ function mint(config, tx, input) {
|
|
|
48
49
|
tx.object(constants_1.CLOCK),
|
|
49
50
|
],
|
|
50
51
|
});
|
|
52
|
+
(0, improvement_proposal_1.updateVotes)(config, tx);
|
|
51
53
|
}
|
|
52
54
|
/**
|
|
53
55
|
public fun burn(
|
|
@@ -81,7 +83,7 @@ function burn(config, tx, input) {
|
|
|
81
83
|
) {
|
|
82
84
|
*/
|
|
83
85
|
function renew(config, tx, input) {
|
|
84
|
-
|
|
86
|
+
tx.moveCall({
|
|
85
87
|
target: "".concat(config.package.launch.veTypus, "::ve_typus::renew"),
|
|
86
88
|
arguments: [
|
|
87
89
|
tx.object(config.version.launch.veTypus),
|
|
@@ -91,4 +93,5 @@ function renew(config, tx, input) {
|
|
|
91
93
|
tx.object(constants_1.CLOCK),
|
|
92
94
|
],
|
|
93
95
|
});
|
|
96
|
+
(0, improvement_proposal_1.updateVotes)(config, tx);
|
|
94
97
|
}
|
|
@@ -20,11 +20,11 @@ function readVecPosition(bytes) {
|
|
|
20
20
|
isLong: reader.read8(),
|
|
21
21
|
size: reader.read64(),
|
|
22
22
|
sizeDecimal: reader.read64(),
|
|
23
|
-
collateralToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
23
|
+
collateralToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
24
24
|
collateralTokenDecimal: reader.read64(),
|
|
25
25
|
symbol: {
|
|
26
|
-
baseToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
27
|
-
quoteToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
26
|
+
baseToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
27
|
+
quoteToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
28
28
|
},
|
|
29
29
|
collateralAmount: reader.read64(),
|
|
30
30
|
reserveAmount: reader.read64(),
|
|
@@ -41,7 +41,7 @@ function readVecPosition(bytes) {
|
|
|
41
41
|
.readVec(function (reader) {
|
|
42
42
|
return {
|
|
43
43
|
index: reader.read64(),
|
|
44
|
-
bid_token: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
44
|
+
bid_token: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
45
45
|
};
|
|
46
46
|
})
|
|
47
47
|
.at(0),
|
|
@@ -64,11 +64,11 @@ function readVecOrder(bytes) {
|
|
|
64
64
|
})
|
|
65
65
|
.at(0),
|
|
66
66
|
user: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
67
|
-
collateralToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
67
|
+
collateralToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
68
68
|
collateralTokenDecimal: reader.read64(),
|
|
69
69
|
symbol: {
|
|
70
|
-
baseToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
71
|
-
quoteToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
70
|
+
baseToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
71
|
+
quoteToken: { name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
72
72
|
},
|
|
73
73
|
leveragePct: reader.read64(),
|
|
74
74
|
reduceOnly: reader.read8(),
|
|
@@ -99,7 +99,7 @@ function readVecShares(bytes) {
|
|
|
99
99
|
unsubscribedTsMs: reader.read64(),
|
|
100
100
|
unlockedTsMs: reader.read64(),
|
|
101
101
|
unsubscribedIncentivePriceIndex: reader.readVec(function (reader) { return [
|
|
102
|
-
{ name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
102
|
+
{ name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
103
103
|
reader.read64(),
|
|
104
104
|
]; }),
|
|
105
105
|
u64Padding: reader.readVec(function (reader) { return reader.read64(); }),
|
|
@@ -107,7 +107,7 @@ function readVecShares(bytes) {
|
|
|
107
107
|
return deactivatingShares;
|
|
108
108
|
}),
|
|
109
109
|
lastIncentivePriceIndex: reader.readVec(function (reader) { return [
|
|
110
|
-
{ name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
110
|
+
{ name: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))) },
|
|
111
111
|
reader.read64(),
|
|
112
112
|
]; }),
|
|
113
113
|
u64Padding: reader.readVec(function (reader) { return reader.read64(); }),
|
|
@@ -165,7 +165,7 @@ function parseTxHistory(datas) {
|
|
|
165
165
|
// skip the event without tokenType
|
|
166
166
|
if (event.parsedJson.bcs_padding.length > 0) {
|
|
167
167
|
reader = new bcs_1.BcsReader(new Uint8Array(event.parsedJson.bcs_padding[0]));
|
|
168
|
-
Token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
168
|
+
Token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
169
169
|
asset = (0, constants_1.typeArgToAsset)(Token);
|
|
170
170
|
decimal = (0, constants_1.assetToDecimal)(asset);
|
|
171
171
|
// console.log(asset, decimal);
|
|
@@ -65,9 +65,9 @@ function getVaultData(config, input) {
|
|
|
65
65
|
reader.readVec(function (reader) {
|
|
66
66
|
reader.readULEB();
|
|
67
67
|
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
68
|
-
var depositToken = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
68
|
+
var depositToken = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
69
69
|
var rewardToken = reader.readVec(function (reader) {
|
|
70
|
-
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
70
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())));
|
|
71
71
|
});
|
|
72
72
|
var infoArray = reader.readVec(function (reader) {
|
|
73
73
|
return reader.read64();
|
|
@@ -139,7 +139,7 @@ function getVaultData(config, input) {
|
|
|
139
139
|
id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
140
140
|
vid: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
|
|
141
141
|
index: reader.read64(),
|
|
142
|
-
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.
|
|
142
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB()))),
|
|
143
143
|
u64_padding: reader.readVec(function (reader) {
|
|
144
144
|
return reader.read64();
|
|
145
145
|
}),
|