stackswap-front-api-test-02 1.0.102 → 1.0.105
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/README.md +10 -10
- package/dist/esm/index.d.ts +86 -86
- package/dist/esm/index.js +145 -145
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stackswap/config.d.ts +117 -114
- package/dist/esm/stackswap/config.js +194 -188
- package/dist/esm/stackswap/config.js.map +1 -1
- package/dist/esm/stackswap/manager/farm.manager.d.ts +41 -41
- package/dist/esm/stackswap/manager/farm.manager.js +293 -293
- package/dist/esm/stackswap/manager/farm2.manager.d.ts +60 -60
- package/dist/esm/stackswap/manager/farm2.manager.js +403 -403
- package/dist/esm/stackswap/manager/governance.manager.d.ts +9 -9
- package/dist/esm/stackswap/manager/governance.manager.js +53 -53
- package/dist/esm/stackswap/manager/launchpad.manager.d.ts +13 -13
- package/dist/esm/stackswap/manager/launchpad.manager.js +147 -147
- package/dist/esm/stackswap/manager/lbtc.manager.d.ts +31 -31
- package/dist/esm/stackswap/manager/lbtc.manager.js +326 -326
- package/dist/esm/stackswap/manager/lbtcstaking.manager.d.ts +51 -51
- package/dist/esm/stackswap/manager/lbtcstaking.manager.js +191 -191
- package/dist/esm/stackswap/manager/lbtcstaking.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/multisig.manager.d.ts +11 -11
- package/dist/esm/stackswap/manager/multisig.manager.js +51 -51
- package/dist/esm/stackswap/manager/nft.manager.d.ts +52 -52
- package/dist/esm/stackswap/manager/nft.manager.js +243 -243
- package/dist/esm/stackswap/manager/operator.manager.d.ts +17 -17
- package/dist/esm/stackswap/manager/operator.manager.js +85 -85
- package/dist/esm/stackswap/manager/other.manager.d.ts +9 -9
- package/dist/esm/stackswap/manager/other.manager.js +47 -47
- package/dist/esm/stackswap/manager/pool.manager.d.ts +34 -34
- package/dist/esm/stackswap/manager/pool.manager.js +171 -171
- package/dist/esm/stackswap/manager/poxl.manager.d.ts +16 -16
- package/dist/esm/stackswap/manager/poxl.manager.js +71 -71
- package/dist/esm/stackswap/manager/staking.manager.d.ts +25 -25
- package/dist/esm/stackswap/manager/staking.manager.js +233 -233
- package/dist/esm/stackswap/manager/swap.manager.d.ts +39 -39
- package/dist/esm/stackswap/manager/swap.manager.js +332 -332
- package/dist/esm/stackswap/manager/token.manager.d.ts +31 -31
- package/dist/esm/stackswap/manager/token.manager.js +133 -133
- package/dist/esm/stackswap/util.d.ts +35 -35
- package/dist/esm/stackswap/util.js +201 -201
- package/dist/esm/stackswap/util.js.map +1 -1
- package/dist/index.d.ts +86 -86
- package/dist/index.js +154 -154
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/stackswap/config.d.ts +117 -114
- package/dist/stackswap/config.js +199 -193
- package/dist/stackswap/config.js.map +1 -1
- package/dist/stackswap/manager/farm.manager.d.ts +41 -41
- package/dist/stackswap/manager/farm.manager.js +301 -301
- package/dist/stackswap/manager/farm2.manager.d.ts +60 -60
- package/dist/stackswap/manager/farm2.manager.js +410 -410
- package/dist/stackswap/manager/governance.manager.d.ts +9 -9
- package/dist/stackswap/manager/governance.manager.js +60 -60
- package/dist/stackswap/manager/launchpad.manager.d.ts +13 -13
- package/dist/stackswap/manager/launchpad.manager.js +151 -151
- package/dist/stackswap/manager/lbtc.manager.d.ts +31 -31
- package/dist/stackswap/manager/lbtc.manager.js +333 -333
- package/dist/stackswap/manager/lbtcstaking.manager.d.ts +51 -51
- package/dist/stackswap/manager/lbtcstaking.manager.js +198 -198
- package/dist/stackswap/manager/lbtcstaking.manager.js.map +1 -1
- package/dist/stackswap/manager/multisig.manager.d.ts +11 -11
- package/dist/stackswap/manager/multisig.manager.js +55 -55
- package/dist/stackswap/manager/nft.manager.d.ts +52 -52
- package/dist/stackswap/manager/nft.manager.js +250 -250
- package/dist/stackswap/manager/operator.manager.d.ts +17 -17
- package/dist/stackswap/manager/operator.manager.js +92 -92
- package/dist/stackswap/manager/other.manager.d.ts +9 -9
- package/dist/stackswap/manager/other.manager.js +54 -54
- package/dist/stackswap/manager/pool.manager.d.ts +34 -34
- package/dist/stackswap/manager/pool.manager.js +179 -179
- package/dist/stackswap/manager/poxl.manager.d.ts +16 -16
- package/dist/stackswap/manager/poxl.manager.js +78 -78
- package/dist/stackswap/manager/staking.manager.d.ts +25 -25
- package/dist/stackswap/manager/staking.manager.js +240 -240
- package/dist/stackswap/manager/swap.manager.d.ts +39 -39
- package/dist/stackswap/manager/swap.manager.js +339 -339
- package/dist/stackswap/manager/token.manager.d.ts +31 -31
- package/dist/stackswap/manager/token.manager.js +141 -141
- package/dist/stackswap/util.d.ts +35 -35
- package/dist/stackswap/util.js +218 -218
- package/dist/stackswap/util.js.map +1 -1
- package/package.json +43 -43
- package/src/index.ts +207 -207
- package/src/stackswap/config.ts +305 -297
- package/src/stackswap/manager/farm.manager.ts +399 -399
- package/src/stackswap/manager/farm2.manager.ts +463 -463
- package/src/stackswap/manager/governance.manager.ts +95 -95
- package/src/stackswap/manager/launchpad.manager.ts +190 -190
- package/src/stackswap/manager/lbtcstaking.manager.ts +277 -277
- package/src/stackswap/manager/multisig.manager.ts +87 -87
- package/src/stackswap/manager/nft.manager.ts +307 -307
- package/src/stackswap/manager/operator.manager.ts +123 -123
- package/src/stackswap/manager/other.manager.ts +71 -71
- package/src/stackswap/manager/pool.manager.ts +202 -202
- package/src/stackswap/manager/poxl.manager.ts +99 -99
- package/src/stackswap/manager/staking.manager.ts +321 -321
- package/src/stackswap/manager/swap.manager.ts +392 -392
- package/src/stackswap/manager/token.manager.ts +167 -167
- package/src/stackswap/util.ts +237 -237
|
@@ -1,241 +1,241 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StakingManager = void 0;
|
|
7
|
-
const transactions_1 = require("@stacks/transactions");
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
const connect_1 = require("@stacks/connect");
|
|
10
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
11
|
-
const util_1 = require("../util");
|
|
12
|
-
class StakingManager {
|
|
13
|
-
constructor(stackswap) {
|
|
14
|
-
this.stackswap = stackswap;
|
|
15
|
-
}
|
|
16
|
-
async getStackingRoundFirstBlock(cycle) {
|
|
17
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'get-first-stacks-block-in-reward-cycle', [
|
|
18
|
-
(0, transactions_1.uintCV)(cycle)
|
|
19
|
-
]);
|
|
20
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
21
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
async getStakingSTSWBalance(source) {
|
|
25
|
-
const pair_details_options = (0, util_1.getReadOptions)(source, this.stackswap.config.BASE_STSW_DATA().addr, 'get-balance', [(0, transactions_1.contractPrincipalCV)(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.BASE_vSTSW_DATA().addr.split('.')[1])]);
|
|
26
|
-
try {
|
|
27
|
-
const result = await (0, transactions_1.callReadOnlyFunction)(pair_details_options);
|
|
28
|
-
return (0, transactions_1.cvToValue)(result).value;
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
return 0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async getRewardRoundID_V2(source) {
|
|
35
|
-
try {
|
|
36
|
-
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
37
|
-
const round = Number(await this.getCurrentStakingRound(ADDR));
|
|
38
|
-
const options = (0, util_1.getReadOptions)(source, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'get-staker', [
|
|
39
|
-
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
40
|
-
]);
|
|
41
|
-
const result = await (0, transactions_1.callReadOnlyFunction)(options);
|
|
42
|
-
const unclaimedList = [];
|
|
43
|
-
for (const unclaimedElement of (0, transactions_1.cvToValue)(result).value) {
|
|
44
|
-
if (unclaimedElement.value < round) {
|
|
45
|
-
unclaimedList.push(unclaimedElement.value);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return unclaimedList;
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async getStakingRound(contract_address, block) {
|
|
55
|
-
try {
|
|
56
|
-
const options = (0, util_1.getReadOptions)(this.stackswap, contract_address, 'get-reward-cycle', [
|
|
57
|
-
(0, transactions_1.uintCV)(block),
|
|
58
|
-
]);
|
|
59
|
-
const result = await (0, transactions_1.callReadOnlyFunction)(options);
|
|
60
|
-
return (0, transactions_1.cvToValue)(result).value;
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
return 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async getCurrentStakingRound(contract_address) {
|
|
67
|
-
const bh = await this.stackswap.getCurrentBlock();
|
|
68
|
-
return await this.getStakingRound(contract_address, bh);
|
|
69
|
-
}
|
|
70
|
-
async getRewardRoundID(offset) {
|
|
71
|
-
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
72
|
-
const get_result = await axios_1.default.get(this.stackswap.config.STACKS_API_URL() + '/extended/v1/address/' + this.stackswap.getSenderAddress() + '/transactions', {
|
|
73
|
-
params: {
|
|
74
|
-
limit: 50,
|
|
75
|
-
offset,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
const results = get_result.data.results;
|
|
79
|
-
const reward_id = [];
|
|
80
|
-
for (const item of results) {
|
|
81
|
-
if ('contract_call' in item) {
|
|
82
|
-
if (ADDR === item.contract_call.contract_id &&
|
|
83
|
-
item.contract_call.function_name === 'stake-tokens' &&
|
|
84
|
-
item.tx_status === 'success') {
|
|
85
|
-
const tx_block_number = item.block_height;
|
|
86
|
-
let start_round = await this.getStakingRound(ADDR, tx_block_number);
|
|
87
|
-
start_round = parseInt(start_round) + 1;
|
|
88
|
-
const end_round = start_round + Number(item.contract_call.function_args[1].repr.replace('u', '')) - 1;
|
|
89
|
-
const round_list = this.range_number(start_round, end_round);
|
|
90
|
-
reward_id.push(...round_list);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return Array.from(new Set(reward_id)).sort((a, b) => { return a - b; });
|
|
95
|
-
}
|
|
96
|
-
range_number(start, end) {
|
|
97
|
-
let ans = [];
|
|
98
|
-
for (let i = start; i <= end; i++) {
|
|
99
|
-
ans.push(i);
|
|
100
|
-
}
|
|
101
|
-
return ans;
|
|
102
|
-
}
|
|
103
|
-
async getReward(contract_addr, round_id) {
|
|
104
|
-
contract_addr = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
105
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, contract_addr, 'get-staking-reward-per-user', [
|
|
106
|
-
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
107
|
-
(0, transactions_1.uintCV)(round_id)
|
|
108
|
-
]);
|
|
109
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
110
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
111
|
-
return Number(result);
|
|
112
|
-
}
|
|
113
|
-
async txClaimReward(round_id, stsw_amount, callback = null) {
|
|
114
|
-
const post_condition = [await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), this.stackswap.config.BASE_STSW_DATA().addr, stsw_amount, transactions_1.FungibleConditionCode.Equal)];
|
|
115
|
-
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'claim-staking-reward', [(0, transactions_1.uintCV)(round_id)], post_condition, callback);
|
|
116
|
-
await (0, connect_1.openContractCall)(function_option);
|
|
117
|
-
}
|
|
118
|
-
async getUserCountFromVSTSW() {
|
|
119
|
-
const address = this.stackswap.config.BASE_vSTSW_DATA().addr.split('.');
|
|
120
|
-
address[0], address[1];
|
|
121
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-count', [(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress())]);
|
|
122
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
123
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
124
|
-
if (result == null) {
|
|
125
|
-
return 0;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return parseInt(result.value.idx.value);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async getStakingBalanceFromVSTSW_V2() {
|
|
132
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-count', [(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress())]);
|
|
133
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
134
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
135
|
-
if (result == null) {
|
|
136
|
-
return 0;
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
return new bignumber_js_1.default(result.value.stakedSTX.value).dividedBy(new bignumber_js_1.default(10).exponentiatedBy(this.stackswap.config.BASE_vSTSW_DATA().decimal));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
async getClaimRewardListFromVSTSW() {
|
|
143
|
-
let res_dict = {};
|
|
144
|
-
let id_list = [];
|
|
145
|
-
const count = await this.getUserCountFromVSTSW();
|
|
146
|
-
for (let i = 1; i <= count; i++) {
|
|
147
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-info', [
|
|
148
|
-
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
149
|
-
(0, transactions_1.uintCV)(i)
|
|
150
|
-
]);
|
|
151
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
152
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
153
|
-
if (!result.value.returned.value) {
|
|
154
|
-
res_dict[i] = result;
|
|
155
|
-
id_list.push(i);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return [id_list, res_dict];
|
|
159
|
-
}
|
|
160
|
-
async getStakingBalanceFromVSTSW() {
|
|
161
|
-
let staking_balance = 0;
|
|
162
|
-
const count = await this.getUserCountFromVSTSW();
|
|
163
|
-
for (let i = 1; i <= count; i++) {
|
|
164
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-info', [
|
|
165
|
-
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
166
|
-
(0, transactions_1.uintCV)(i)
|
|
167
|
-
]);
|
|
168
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
169
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
170
|
-
if (result.value.returned.value === false) {
|
|
171
|
-
staking_balance += parseInt(result.value.amountSTSW.value);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return staking_balance;
|
|
175
|
-
}
|
|
176
|
-
async txStakeFromStaking(invest_amt, period_month, callback = null) {
|
|
177
|
-
const invest_amt_bn = new bignumber_js_1.default(10 ** 6).multipliedBy(invest_amt).toFixed(0).toString();
|
|
178
|
-
const postConditions = [];
|
|
179
|
-
postConditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, invest_amt_bn, transactions_1.FungibleConditionCode.Equal));
|
|
180
|
-
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'stake-tokens', [
|
|
181
|
-
(0, transactions_1.uintCV)(invest_amt_bn), (0, transactions_1.uintCV)(period_month)
|
|
182
|
-
], postConditions, callback);
|
|
183
|
-
await (0, connect_1.openContractCall)(function_option);
|
|
184
|
-
}
|
|
185
|
-
async txCooldownFromVSTSW(index, callback = null) {
|
|
186
|
-
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'unstake-tokens', [(0, transactions_1.uintCV)(index)], [], callback);
|
|
187
|
-
await (0, connect_1.openContractCall)(function_option);
|
|
188
|
-
}
|
|
189
|
-
async txUnstakingFromVSTSW(index, amountSTX, amountvSTX, callback = null) {
|
|
190
|
-
const post_conditions = [];
|
|
191
|
-
post_conditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_vSTSW_DATA().addr, amountvSTX, transactions_1.FungibleConditionCode.Equal));
|
|
192
|
-
post_conditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, this.stackswap.config.BASE_STSW_DATA().addr, amountSTX, transactions_1.FungibleConditionCode.Equal));
|
|
193
|
-
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'reclaim-tokens', [(0, transactions_1.uintCV)(index)], post_conditions, callback);
|
|
194
|
-
await (0, connect_1.openContractCall)(function_option);
|
|
195
|
-
}
|
|
196
|
-
async getRewardBalanceFromStaking() {
|
|
197
|
-
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
198
|
-
let reward_balance = 0;
|
|
199
|
-
const current_round = await this.getCurrentStakingRound(ADDR);
|
|
200
|
-
for (let i = 0; i <= current_round; i++) {
|
|
201
|
-
const result = await this.getReward(ADDR, i);
|
|
202
|
-
reward_balance += result;
|
|
203
|
-
}
|
|
204
|
-
return reward_balance;
|
|
205
|
-
}
|
|
206
|
-
async getRewardBalanceFromStakingFromList(unclaimed_list) {
|
|
207
|
-
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
208
|
-
let reward_balance = 0;
|
|
209
|
-
const current_round = await this.getCurrentStakingRound(ADDR);
|
|
210
|
-
const temp = [];
|
|
211
|
-
for (const unclaimed of unclaimed_list) {
|
|
212
|
-
if (unclaimed < Number(current_round)) {
|
|
213
|
-
temp.push((0, transactions_1.uintCV)(unclaimed));
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
for (let i = 0; i <= current_round; i++) {
|
|
217
|
-
const result = await this.getReward(ADDR, i);
|
|
218
|
-
reward_balance += result;
|
|
219
|
-
}
|
|
220
|
-
return reward_balance;
|
|
221
|
-
}
|
|
222
|
-
async getRewardTotal(reward_list) {
|
|
223
|
-
const contract_addr = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
224
|
-
if (reward_list.length === 0) {
|
|
225
|
-
return 0;
|
|
226
|
-
}
|
|
227
|
-
const temp_list = [];
|
|
228
|
-
for (const rewardListElement of reward_list) {
|
|
229
|
-
temp_list.push((0, transactions_1.uintCV)(rewardListElement));
|
|
230
|
-
}
|
|
231
|
-
const function_option = (0, util_1.getReadOptions)(this.stackswap, contract_addr, 'get-staking-reward-from-list', [
|
|
232
|
-
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
233
|
-
(0, transactions_1.listCV)(temp_list),
|
|
234
|
-
]);
|
|
235
|
-
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
236
|
-
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
237
|
-
return result.rewardSum.value;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
exports.StakingManager = StakingManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StakingManager = void 0;
|
|
7
|
+
const transactions_1 = require("@stacks/transactions");
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const connect_1 = require("@stacks/connect");
|
|
10
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
11
|
+
const util_1 = require("../util");
|
|
12
|
+
class StakingManager {
|
|
13
|
+
constructor(stackswap) {
|
|
14
|
+
this.stackswap = stackswap;
|
|
15
|
+
}
|
|
16
|
+
async getStackingRoundFirstBlock(cycle) {
|
|
17
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'get-first-stacks-block-in-reward-cycle', [
|
|
18
|
+
(0, transactions_1.uintCV)(cycle)
|
|
19
|
+
]);
|
|
20
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
21
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
async getStakingSTSWBalance(source) {
|
|
25
|
+
const pair_details_options = (0, util_1.getReadOptions)(source, this.stackswap.config.BASE_STSW_DATA().addr, 'get-balance', [(0, transactions_1.contractPrincipalCV)(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.BASE_vSTSW_DATA().addr.split('.')[1])]);
|
|
26
|
+
try {
|
|
27
|
+
const result = await (0, transactions_1.callReadOnlyFunction)(pair_details_options);
|
|
28
|
+
return (0, transactions_1.cvToValue)(result).value;
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async getRewardRoundID_V2(source) {
|
|
35
|
+
try {
|
|
36
|
+
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
37
|
+
const round = Number(await this.getCurrentStakingRound(ADDR));
|
|
38
|
+
const options = (0, util_1.getReadOptions)(source, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'get-staker', [
|
|
39
|
+
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
40
|
+
]);
|
|
41
|
+
const result = await (0, transactions_1.callReadOnlyFunction)(options);
|
|
42
|
+
const unclaimedList = [];
|
|
43
|
+
for (const unclaimedElement of (0, transactions_1.cvToValue)(result).value) {
|
|
44
|
+
if (unclaimedElement.value < round) {
|
|
45
|
+
unclaimedList.push(unclaimedElement.value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return unclaimedList;
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async getStakingRound(contract_address, block) {
|
|
55
|
+
try {
|
|
56
|
+
const options = (0, util_1.getReadOptions)(this.stackswap, contract_address, 'get-reward-cycle', [
|
|
57
|
+
(0, transactions_1.uintCV)(block),
|
|
58
|
+
]);
|
|
59
|
+
const result = await (0, transactions_1.callReadOnlyFunction)(options);
|
|
60
|
+
return (0, transactions_1.cvToValue)(result).value;
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async getCurrentStakingRound(contract_address) {
|
|
67
|
+
const bh = await this.stackswap.getCurrentBlock();
|
|
68
|
+
return await this.getStakingRound(contract_address, bh);
|
|
69
|
+
}
|
|
70
|
+
async getRewardRoundID(offset) {
|
|
71
|
+
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
72
|
+
const get_result = await axios_1.default.get(this.stackswap.config.STACKS_API_URL() + '/extended/v1/address/' + this.stackswap.getSenderAddress() + '/transactions', {
|
|
73
|
+
params: {
|
|
74
|
+
limit: 50,
|
|
75
|
+
offset,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const results = get_result.data.results;
|
|
79
|
+
const reward_id = [];
|
|
80
|
+
for (const item of results) {
|
|
81
|
+
if ('contract_call' in item) {
|
|
82
|
+
if (ADDR === item.contract_call.contract_id &&
|
|
83
|
+
item.contract_call.function_name === 'stake-tokens' &&
|
|
84
|
+
item.tx_status === 'success') {
|
|
85
|
+
const tx_block_number = item.block_height;
|
|
86
|
+
let start_round = await this.getStakingRound(ADDR, tx_block_number);
|
|
87
|
+
start_round = parseInt(start_round) + 1;
|
|
88
|
+
const end_round = start_round + Number(item.contract_call.function_args[1].repr.replace('u', '')) - 1;
|
|
89
|
+
const round_list = this.range_number(start_round, end_round);
|
|
90
|
+
reward_id.push(...round_list);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return Array.from(new Set(reward_id)).sort((a, b) => { return a - b; });
|
|
95
|
+
}
|
|
96
|
+
range_number(start, end) {
|
|
97
|
+
let ans = [];
|
|
98
|
+
for (let i = start; i <= end; i++) {
|
|
99
|
+
ans.push(i);
|
|
100
|
+
}
|
|
101
|
+
return ans;
|
|
102
|
+
}
|
|
103
|
+
async getReward(contract_addr, round_id) {
|
|
104
|
+
contract_addr = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
105
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, contract_addr, 'get-staking-reward-per-user', [
|
|
106
|
+
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
107
|
+
(0, transactions_1.uintCV)(round_id)
|
|
108
|
+
]);
|
|
109
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
110
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
111
|
+
return Number(result);
|
|
112
|
+
}
|
|
113
|
+
async txClaimReward(round_id, stsw_amount, callback = null) {
|
|
114
|
+
const post_condition = [await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), this.stackswap.config.BASE_STSW_DATA().addr, stsw_amount, transactions_1.FungibleConditionCode.Equal)];
|
|
115
|
+
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'claim-staking-reward', [(0, transactions_1.uintCV)(round_id)], post_condition, callback);
|
|
116
|
+
await (0, connect_1.openContractCall)(function_option);
|
|
117
|
+
}
|
|
118
|
+
async getUserCountFromVSTSW() {
|
|
119
|
+
const address = this.stackswap.config.BASE_vSTSW_DATA().addr.split('.');
|
|
120
|
+
address[0], address[1];
|
|
121
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-count', [(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress())]);
|
|
122
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
123
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
124
|
+
if (result == null) {
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return parseInt(result.value.idx.value);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async getStakingBalanceFromVSTSW_V2() {
|
|
132
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-count', [(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress())]);
|
|
133
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
134
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
135
|
+
if (result == null) {
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return new bignumber_js_1.default(result.value.stakedSTX.value).dividedBy(new bignumber_js_1.default(10).exponentiatedBy(this.stackswap.config.BASE_vSTSW_DATA().decimal));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async getClaimRewardListFromVSTSW() {
|
|
143
|
+
let res_dict = {};
|
|
144
|
+
let id_list = [];
|
|
145
|
+
const count = await this.getUserCountFromVSTSW();
|
|
146
|
+
for (let i = 1; i <= count; i++) {
|
|
147
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-info', [
|
|
148
|
+
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
149
|
+
(0, transactions_1.uintCV)(i)
|
|
150
|
+
]);
|
|
151
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
152
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
153
|
+
if (!result.value.returned.value) {
|
|
154
|
+
res_dict[i] = result;
|
|
155
|
+
id_list.push(i);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return [id_list, res_dict];
|
|
159
|
+
}
|
|
160
|
+
async getStakingBalanceFromVSTSW() {
|
|
161
|
+
let staking_balance = 0;
|
|
162
|
+
const count = await this.getUserCountFromVSTSW();
|
|
163
|
+
for (let i = 1; i <= count; i++) {
|
|
164
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'get-user-info', [
|
|
165
|
+
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
166
|
+
(0, transactions_1.uintCV)(i)
|
|
167
|
+
]);
|
|
168
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
169
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
170
|
+
if (result.value.returned.value === false) {
|
|
171
|
+
staking_balance += parseInt(result.value.amountSTSW.value);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return staking_balance;
|
|
175
|
+
}
|
|
176
|
+
async txStakeFromStaking(invest_amt, period_month, callback = null) {
|
|
177
|
+
const invest_amt_bn = new bignumber_js_1.default(10 ** 6).multipliedBy(invest_amt).toFixed(0).toString();
|
|
178
|
+
const postConditions = [];
|
|
179
|
+
postConditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, invest_amt_bn, transactions_1.FungibleConditionCode.Equal));
|
|
180
|
+
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING(), 'stake-tokens', [
|
|
181
|
+
(0, transactions_1.uintCV)(invest_amt_bn), (0, transactions_1.uintCV)(period_month)
|
|
182
|
+
], postConditions, callback);
|
|
183
|
+
await (0, connect_1.openContractCall)(function_option);
|
|
184
|
+
}
|
|
185
|
+
async txCooldownFromVSTSW(index, callback = null) {
|
|
186
|
+
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'unstake-tokens', [(0, transactions_1.uintCV)(index)], [], callback);
|
|
187
|
+
await (0, connect_1.openContractCall)(function_option);
|
|
188
|
+
}
|
|
189
|
+
async txUnstakingFromVSTSW(index, amountSTX, amountvSTX, callback = null) {
|
|
190
|
+
const post_conditions = [];
|
|
191
|
+
post_conditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_vSTSW_DATA().addr, amountvSTX, transactions_1.FungibleConditionCode.Equal));
|
|
192
|
+
post_conditions.push(await (0, util_1.getPostConditionFromAsset)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, this.stackswap.config.BASE_STSW_DATA().addr, amountSTX, transactions_1.FungibleConditionCode.Equal));
|
|
193
|
+
const function_option = (0, util_1.getWriteOptions)(this.stackswap, this.stackswap.config.BASE_vSTSW_DATA().addr, 'reclaim-tokens', [(0, transactions_1.uintCV)(index)], post_conditions, callback);
|
|
194
|
+
await (0, connect_1.openContractCall)(function_option);
|
|
195
|
+
}
|
|
196
|
+
async getRewardBalanceFromStaking() {
|
|
197
|
+
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
198
|
+
let reward_balance = 0;
|
|
199
|
+
const current_round = await this.getCurrentStakingRound(ADDR);
|
|
200
|
+
for (let i = 0; i <= current_round; i++) {
|
|
201
|
+
const result = await this.getReward(ADDR, i);
|
|
202
|
+
reward_balance += result;
|
|
203
|
+
}
|
|
204
|
+
return reward_balance;
|
|
205
|
+
}
|
|
206
|
+
async getRewardBalanceFromStakingFromList(unclaimed_list) {
|
|
207
|
+
const ADDR = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
208
|
+
let reward_balance = 0;
|
|
209
|
+
const current_round = await this.getCurrentStakingRound(ADDR);
|
|
210
|
+
const temp = [];
|
|
211
|
+
for (const unclaimed of unclaimed_list) {
|
|
212
|
+
if (unclaimed < Number(current_round)) {
|
|
213
|
+
temp.push((0, transactions_1.uintCV)(unclaimed));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
for (let i = 0; i <= current_round; i++) {
|
|
217
|
+
const result = await this.getReward(ADDR, i);
|
|
218
|
+
reward_balance += result;
|
|
219
|
+
}
|
|
220
|
+
return reward_balance;
|
|
221
|
+
}
|
|
222
|
+
async getRewardTotal(reward_list) {
|
|
223
|
+
const contract_addr = this.stackswap.config.STACKSWAP_ADDRESS() + '.' + this.stackswap.config.CONTRACT_NAME_STACKSWAP_STACKING();
|
|
224
|
+
if (reward_list.length === 0) {
|
|
225
|
+
return 0;
|
|
226
|
+
}
|
|
227
|
+
const temp_list = [];
|
|
228
|
+
for (const rewardListElement of reward_list) {
|
|
229
|
+
temp_list.push((0, transactions_1.uintCV)(rewardListElement));
|
|
230
|
+
}
|
|
231
|
+
const function_option = (0, util_1.getReadOptions)(this.stackswap, contract_addr, 'get-staking-reward-from-list', [
|
|
232
|
+
(0, transactions_1.standardPrincipalCV)(this.stackswap.getSenderAddress()),
|
|
233
|
+
(0, transactions_1.listCV)(temp_list),
|
|
234
|
+
]);
|
|
235
|
+
const result_raw = await (0, transactions_1.callReadOnlyFunction)(function_option);
|
|
236
|
+
const result = (0, transactions_1.cvToValue)(result_raw);
|
|
237
|
+
return result.rewardSum.value;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
exports.StakingManager = StakingManager;
|
|
241
241
|
//# sourceMappingURL=staking.manager.js.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { StackswapAPI } from "../../index";
|
|
2
|
-
import { LiquidityPool } from "./pool.manager";
|
|
3
|
-
import { Token } from "./token.manager";
|
|
4
|
-
export declare enum SwapType {
|
|
5
|
-
NO_ROUTE = 0,
|
|
6
|
-
ON_LOADING = 1,
|
|
7
|
-
SINGLE = 2,
|
|
8
|
-
ROUTER_STX = 10,
|
|
9
|
-
ROUTER_STSW = 11
|
|
10
|
-
}
|
|
11
|
-
export declare class SwapManager {
|
|
12
|
-
stackswap: StackswapAPI;
|
|
13
|
-
constructor(stackswap: StackswapAPI);
|
|
14
|
-
findRouter2(token_x: Token, token_y: Token, current_block: number): Promise<{
|
|
15
|
-
valid: SwapType;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}>;
|
|
18
|
-
findRouter(token_x: Token, token_y: Token, current_block: number): Promise<{
|
|
19
|
-
valid: SwapType;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}>;
|
|
22
|
-
routerSwapContractCall(token_from_amount: string, token_to_amount: string, token_bridge_amount: string, pair_from: LiquidityPool, pair_to: LiquidityPool, router_from_mode: boolean, router_to_mode: boolean, tolerance: number, callback?: any): Promise<void>;
|
|
23
|
-
swapContractCall(token_x_amount: string, token_y_amount: string, pair: LiquidityPool, x_to_y: boolean, tolerance: number, callback?: any): Promise<void>;
|
|
24
|
-
importContractCall(pair: LiquidityPool, x_to_y: boolean, amount_x: string, amount_y: string, callback?: any): Promise<void>;
|
|
25
|
-
removeContractCall(pair: LiquidityPool, percent: number, user_lp_total: string, dx: any, dy: any, swap_contract?: string, callback?: any): Promise<void>;
|
|
26
|
-
createContractCall(token_x: Token, token_y: Token, token_x_amount: string, token_y_amount: string, liquidity_token_addr: any, callback?: any): Promise<void>;
|
|
27
|
-
price_impact(x_to_y: boolean, pair: LiquidityPool, token_x_amount: string): string | 0 | 100;
|
|
28
|
-
price_impact_router(router_from_mode: boolean, router_to_mode: boolean, pair_from: LiquidityPool, pair_to: LiquidityPool, token_from_amount: string): string | 0 | 100;
|
|
29
|
-
getPriceString(pair: LiquidityPool | null, token_x: Token | null, token_y: Token | null, price: number, price_invert: boolean): string;
|
|
30
|
-
getPricesWithSwapData(swap_data: {
|
|
31
|
-
valid: SwapType;
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
}, token_x_amount: string, price_invert: boolean): {
|
|
34
|
-
price: number;
|
|
35
|
-
dy: string;
|
|
36
|
-
price_strings: string;
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
1
|
+
import { StackswapAPI } from "../../index";
|
|
2
|
+
import { LiquidityPool } from "./pool.manager";
|
|
3
|
+
import { Token } from "./token.manager";
|
|
4
|
+
export declare enum SwapType {
|
|
5
|
+
NO_ROUTE = 0,
|
|
6
|
+
ON_LOADING = 1,
|
|
7
|
+
SINGLE = 2,
|
|
8
|
+
ROUTER_STX = 10,
|
|
9
|
+
ROUTER_STSW = 11
|
|
10
|
+
}
|
|
11
|
+
export declare class SwapManager {
|
|
12
|
+
stackswap: StackswapAPI;
|
|
13
|
+
constructor(stackswap: StackswapAPI);
|
|
14
|
+
findRouter2(token_x: Token, token_y: Token, current_block: number): Promise<{
|
|
15
|
+
valid: SwapType;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
findRouter(token_x: Token, token_y: Token, current_block: number): Promise<{
|
|
19
|
+
valid: SwapType;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>;
|
|
22
|
+
routerSwapContractCall(token_from_amount: string, token_to_amount: string, token_bridge_amount: string, pair_from: LiquidityPool, pair_to: LiquidityPool, router_from_mode: boolean, router_to_mode: boolean, tolerance: number, callback?: any): Promise<void>;
|
|
23
|
+
swapContractCall(token_x_amount: string, token_y_amount: string, pair: LiquidityPool, x_to_y: boolean, tolerance: number, callback?: any): Promise<void>;
|
|
24
|
+
importContractCall(pair: LiquidityPool, x_to_y: boolean, amount_x: string, amount_y: string, callback?: any): Promise<void>;
|
|
25
|
+
removeContractCall(pair: LiquidityPool, percent: number, user_lp_total: string, dx: any, dy: any, swap_contract?: string, callback?: any): Promise<void>;
|
|
26
|
+
createContractCall(token_x: Token, token_y: Token, token_x_amount: string, token_y_amount: string, liquidity_token_addr: any, callback?: any): Promise<void>;
|
|
27
|
+
price_impact(x_to_y: boolean, pair: LiquidityPool, token_x_amount: string): string | 0 | 100;
|
|
28
|
+
price_impact_router(router_from_mode: boolean, router_to_mode: boolean, pair_from: LiquidityPool, pair_to: LiquidityPool, token_from_amount: string): string | 0 | 100;
|
|
29
|
+
getPriceString(pair: LiquidityPool | null, token_x: Token | null, token_y: Token | null, price: number, price_invert: boolean): string;
|
|
30
|
+
getPricesWithSwapData(swap_data: {
|
|
31
|
+
valid: SwapType;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}, token_x_amount: string, price_invert: boolean): {
|
|
34
|
+
price: number;
|
|
35
|
+
dy: string;
|
|
36
|
+
price_strings: string;
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
};
|
|
39
|
+
}
|