stackswap-front-api-test-02 0.10.10 → 0.10.11
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/esm/stackswap/manager/bridge.manager.js +11 -11
- package/dist/esm/stackswap/manager/bridge.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/farm.manager.js +11 -11
- package/dist/esm/stackswap/manager/farm.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/farm2.manager.js +14 -14
- package/dist/esm/stackswap/manager/farm2.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/farm3.manager.js +10 -10
- package/dist/esm/stackswap/manager/farm3.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/governance.manager.js +3 -3
- package/dist/esm/stackswap/manager/governance.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/groupfarm.manager.d.ts +2 -0
- package/dist/esm/stackswap/manager/groupfarm.manager.js +40 -20
- package/dist/esm/stackswap/manager/groupfarm.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/launchpad.manager.js +6 -6
- package/dist/esm/stackswap/manager/launchpad.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/lbtc.manager.js +9 -9
- package/dist/esm/stackswap/manager/lbtc.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/lbtcstaking.manager.js +18 -11
- package/dist/esm/stackswap/manager/lbtcstaking.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/multisig.manager.js +3 -3
- package/dist/esm/stackswap/manager/multisig.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/nft.manager.d.ts +2 -2
- package/dist/esm/stackswap/manager/nft.manager.js +27 -11
- package/dist/esm/stackswap/manager/nft.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/operator.manager.js +3 -3
- package/dist/esm/stackswap/manager/operator.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/other.manager.js +3 -3
- package/dist/esm/stackswap/manager/other.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/pool.manager.js +5 -5
- package/dist/esm/stackswap/manager/pool.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/poxl.manager.js +3 -3
- package/dist/esm/stackswap/manager/poxl.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/staking.manager.js +14 -14
- package/dist/esm/stackswap/manager/staking.manager.js.map +1 -1
- package/dist/esm/stackswap/manager/token.manager.js +6 -6
- package/dist/esm/stackswap/manager/token.manager.js.map +1 -1
- package/dist/esm/stackswap/util.d.ts +3 -3
- package/dist/esm/stackswap/util.js +34 -3
- package/dist/esm/stackswap/util.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/stackswap/manager/bridge.manager.js +10 -10
- package/dist/stackswap/manager/bridge.manager.js.map +1 -1
- package/dist/stackswap/manager/farm.manager.js +10 -10
- package/dist/stackswap/manager/farm.manager.js.map +1 -1
- package/dist/stackswap/manager/farm2.manager.js +13 -13
- package/dist/stackswap/manager/farm2.manager.js.map +1 -1
- package/dist/stackswap/manager/farm3.manager.js +9 -9
- package/dist/stackswap/manager/farm3.manager.js.map +1 -1
- package/dist/stackswap/manager/governance.manager.js +2 -2
- package/dist/stackswap/manager/governance.manager.js.map +1 -1
- package/dist/stackswap/manager/groupfarm.manager.d.ts +2 -0
- package/dist/stackswap/manager/groupfarm.manager.js +39 -19
- package/dist/stackswap/manager/groupfarm.manager.js.map +1 -1
- package/dist/stackswap/manager/launchpad.manager.js +5 -5
- package/dist/stackswap/manager/launchpad.manager.js.map +1 -1
- package/dist/stackswap/manager/lbtc.manager.js +8 -8
- package/dist/stackswap/manager/lbtc.manager.js.map +1 -1
- package/dist/stackswap/manager/lbtcstaking.manager.js +17 -10
- package/dist/stackswap/manager/lbtcstaking.manager.js.map +1 -1
- package/dist/stackswap/manager/multisig.manager.js +2 -2
- package/dist/stackswap/manager/multisig.manager.js.map +1 -1
- package/dist/stackswap/manager/nft.manager.d.ts +2 -2
- package/dist/stackswap/manager/nft.manager.js +26 -10
- package/dist/stackswap/manager/nft.manager.js.map +1 -1
- package/dist/stackswap/manager/operator.manager.js +2 -2
- package/dist/stackswap/manager/operator.manager.js.map +1 -1
- package/dist/stackswap/manager/other.manager.js +2 -2
- package/dist/stackswap/manager/other.manager.js.map +1 -1
- package/dist/stackswap/manager/pool.manager.js +4 -4
- package/dist/stackswap/manager/pool.manager.js.map +1 -1
- package/dist/stackswap/manager/poxl.manager.js +2 -2
- package/dist/stackswap/manager/poxl.manager.js.map +1 -1
- package/dist/stackswap/manager/staking.manager.js +13 -13
- package/dist/stackswap/manager/staking.manager.js.map +1 -1
- package/dist/stackswap/manager/token.manager.js +5 -5
- package/dist/stackswap/manager/token.manager.js.map +1 -1
- package/dist/stackswap/util.d.ts +3 -3
- package/dist/stackswap/util.js +33 -2
- package/dist/stackswap/util.js.map +1 -1
- package/package.json +2 -2
- package/src/stackswap/manager/bridge.manager.ts +11 -11
- package/src/stackswap/manager/farm.manager.ts +11 -11
- package/src/stackswap/manager/farm2.manager.ts +14 -14
- package/src/stackswap/manager/farm3.manager.ts +10 -10
- package/src/stackswap/manager/governance.manager.ts +3 -3
- package/src/stackswap/manager/groupfarm.manager.ts +46 -23
- package/src/stackswap/manager/launchpad.manager.ts +6 -6
- package/src/stackswap/manager/lbtc.manager.ts +9 -9
- package/src/stackswap/manager/lbtcstaking.manager.ts +22 -13
- package/src/stackswap/manager/multisig.manager.ts +3 -3
- package/src/stackswap/manager/nft.manager.ts +31 -12
- package/src/stackswap/manager/operator.manager.ts +3 -3
- package/src/stackswap/manager/other.manager.ts +3 -3
- package/src/stackswap/manager/pool.manager.ts +5 -5
- package/src/stackswap/manager/poxl.manager.ts +3 -3
- package/src/stackswap/manager/staking.manager.ts +14 -14
- package/src/stackswap/manager/token.manager.ts +6 -6
- package/src/stackswap/util.ts +41 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
fetchCallReadOnlyFunction,
|
|
3
3
|
contractPrincipalCV,
|
|
4
4
|
cvToValue,
|
|
5
5
|
FungibleConditionCode,
|
|
6
|
-
listCV,
|
|
6
|
+
listCV,
|
|
7
7
|
NonFungibleConditionCode,
|
|
8
8
|
standardPrincipalCV,
|
|
9
|
-
uintCV,
|
|
9
|
+
uintCV, NonFungiblePostCondition,
|
|
10
10
|
} from '@stacks/transactions';
|
|
11
11
|
import BigNumber from 'bignumber.js';
|
|
12
12
|
import {openContractCall} from '@stacks/connect';
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import {StackswapAPI} from "../../index";
|
|
20
20
|
import {BaseToken, Token} from "./token.manager";
|
|
21
21
|
import axios from "axios";
|
|
22
|
+
import {NonFungibleComparator} from "@stacks/transactions/src/postcondition-types";
|
|
22
23
|
|
|
23
24
|
export enum Mode {
|
|
24
25
|
WITH_SERVER,
|
|
@@ -35,7 +36,7 @@ export class GroupFarmManager {
|
|
|
35
36
|
async getFarmCounts() {
|
|
36
37
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_GROUP_FARM(), 'get-farm-counts', []);
|
|
37
38
|
try {
|
|
38
|
-
const result = cvToValue(await
|
|
39
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
39
40
|
return result;
|
|
40
41
|
} catch (e) {
|
|
41
42
|
return('');
|
|
@@ -49,7 +50,7 @@ export class GroupFarmManager {
|
|
|
49
50
|
}
|
|
50
51
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_GROUP_FARM(), 'get-farms', [listCV(listTemp)]);
|
|
51
52
|
try {
|
|
52
|
-
const result = cvToValue(await
|
|
53
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
53
54
|
// console.log('farmLists', result);
|
|
54
55
|
return result;
|
|
55
56
|
} catch (e) {
|
|
@@ -60,7 +61,7 @@ export class GroupFarmManager {
|
|
|
60
61
|
async getAllDatas(farming_contract: string) {
|
|
61
62
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getAllDatas', [
|
|
62
63
|
]);
|
|
63
|
-
const result_raw = await
|
|
64
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
64
65
|
const result = cvToValue(result_raw);
|
|
65
66
|
// // console.log('getFarmingUserRewardTotal', result);
|
|
66
67
|
return result;
|
|
@@ -68,7 +69,7 @@ export class GroupFarmManager {
|
|
|
68
69
|
async getRewardData(farming_contract: string) {
|
|
69
70
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getAllRewardData', [
|
|
70
71
|
]);
|
|
71
|
-
const result_raw = await
|
|
72
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
72
73
|
const result = cvToValue(result_raw);
|
|
73
74
|
// // console.log('getFarmingUserRewardTotal', result);
|
|
74
75
|
return result;
|
|
@@ -79,7 +80,7 @@ export class GroupFarmManager {
|
|
|
79
80
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getRewardRound', [
|
|
80
81
|
uintCV(bh)
|
|
81
82
|
]);
|
|
82
|
-
const result_raw = await
|
|
83
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
83
84
|
const result = cvToValue(result_raw);
|
|
84
85
|
// // console.log('farming round', result);
|
|
85
86
|
return result.value;
|
|
@@ -98,7 +99,7 @@ export class GroupFarmManager {
|
|
|
98
99
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getFirstBlockOfRound', [
|
|
99
100
|
uintCV(cycle)
|
|
100
101
|
]);
|
|
101
|
-
const result_raw = await
|
|
102
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
102
103
|
const result = cvToValue(result_raw);
|
|
103
104
|
// // console.log(result);
|
|
104
105
|
return result;
|
|
@@ -112,7 +113,7 @@ export class GroupFarmManager {
|
|
|
112
113
|
contractPrincipalCV(address[0], address[1]),
|
|
113
114
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
114
115
|
]);
|
|
115
|
-
const result_raw = await
|
|
116
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
116
117
|
const result = cvToValue(result_raw);
|
|
117
118
|
try {
|
|
118
119
|
// console.log('getFarmingStakerStatus', result);
|
|
@@ -140,7 +141,7 @@ export class GroupFarmManager {
|
|
|
140
141
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getTotalData', [
|
|
141
142
|
contractPrincipalCV(address[0], address[1]),
|
|
142
143
|
]);
|
|
143
|
-
const result_raw = await
|
|
144
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
144
145
|
const result = cvToValue(result_raw);
|
|
145
146
|
// // console.log('lp total data', result);
|
|
146
147
|
try {
|
|
@@ -157,7 +158,7 @@ export class GroupFarmManager {
|
|
|
157
158
|
contractPrincipalCV(address[0], address[1]),
|
|
158
159
|
uintCV(cycle),
|
|
159
160
|
]);
|
|
160
|
-
const result_raw = await
|
|
161
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
161
162
|
const result = cvToValue(result_raw);
|
|
162
163
|
// // console.log('lp round data', result);
|
|
163
164
|
try {
|
|
@@ -174,7 +175,7 @@ export class GroupFarmManager {
|
|
|
174
175
|
contractPrincipalCV(address[0], address[1]),
|
|
175
176
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
176
177
|
]);
|
|
177
|
-
const result_raw = await
|
|
178
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
178
179
|
const result = cvToValue(result_raw);
|
|
179
180
|
// // console.log('get_farming_total',result.value);
|
|
180
181
|
return result.value;
|
|
@@ -188,7 +189,7 @@ export class GroupFarmManager {
|
|
|
188
189
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getUserNFTData', [
|
|
189
190
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
190
191
|
]);
|
|
191
|
-
const result_raw = await
|
|
192
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
192
193
|
const result = cvToValue(result_raw);
|
|
193
194
|
// // console.log('get_farming_total',result.value);
|
|
194
195
|
return result.value;
|
|
@@ -222,7 +223,7 @@ export class GroupFarmManager {
|
|
|
222
223
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
223
224
|
uintCV(cycle),
|
|
224
225
|
]);
|
|
225
|
-
const result_raw = await
|
|
226
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
226
227
|
const result = cvToValue(result_raw);
|
|
227
228
|
// // console.log('reward', result);
|
|
228
229
|
return result;
|
|
@@ -235,7 +236,7 @@ export class GroupFarmManager {
|
|
|
235
236
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
236
237
|
uintCV(round),
|
|
237
238
|
]);
|
|
238
|
-
const result_raw = await
|
|
239
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
239
240
|
const result = cvToValue(result_raw);
|
|
240
241
|
// // console.log('getFarmingUserRewardTotal', result);
|
|
241
242
|
return result;
|
|
@@ -245,7 +246,7 @@ export class GroupFarmManager {
|
|
|
245
246
|
const function_option = getReadOptions(this.stackswap, farming_contract, 'getNFTFarmingReward', [
|
|
246
247
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
247
248
|
]);
|
|
248
|
-
const result_raw = await
|
|
249
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
249
250
|
const result = cvToValue(result_raw);
|
|
250
251
|
// // console.log('getFarmingUserRewardTotal', result);
|
|
251
252
|
return result;
|
|
@@ -258,7 +259,7 @@ export class GroupFarmManager {
|
|
|
258
259
|
contractPrincipalCV(address[0], address[1]),
|
|
259
260
|
listCV(unclaimed_list),
|
|
260
261
|
]);
|
|
261
|
-
const result_raw = await
|
|
262
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
262
263
|
const result = cvToValue(result_raw);
|
|
263
264
|
// // console.log('getFarmingUserRewardTotal', result);
|
|
264
265
|
return result;
|
|
@@ -269,7 +270,7 @@ export class GroupFarmManager {
|
|
|
269
270
|
const pair_details_options: any = getReadOptions(this.stackswap, token.addr, 'get-balance',
|
|
270
271
|
[contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), farming_contract)]);
|
|
271
272
|
try {
|
|
272
|
-
const result = await
|
|
273
|
+
const result = await fetchCallReadOnlyFunction(pair_details_options);
|
|
273
274
|
return cvToValue(result).value;
|
|
274
275
|
} catch (e) {
|
|
275
276
|
return 0;
|
|
@@ -364,13 +365,15 @@ export class GroupFarmManager {
|
|
|
364
365
|
for (const gold of goldList) {
|
|
365
366
|
gold_list.push(uintCV(gold))
|
|
366
367
|
post_condition.push(
|
|
367
|
-
|
|
368
|
+
await this.getPostConditionFromAssetNFT(this.stackswap.getSenderAddress(), gold_asset_string, NonFungibleConditionCode.Sends, `${gold}`),
|
|
369
|
+
// makeStandardNonFungiblePostCondition(this.stackswap.getSenderAddress(), NonFungibleConditionCode.Sends, gold_asset_string, uintCV(gold)),
|
|
368
370
|
)
|
|
369
371
|
}
|
|
370
372
|
for (const silver of silverList) {
|
|
371
373
|
silver_list.push(uintCV(silver))
|
|
372
374
|
post_condition.push(
|
|
373
|
-
|
|
375
|
+
await this.getPostConditionFromAssetNFT(this.stackswap.getSenderAddress(), silver_asset_string, NonFungibleConditionCode.Sends, `${silver}`),
|
|
376
|
+
// makeStandardNonFungiblePostCondition(this.stackswap.getSenderAddress(), NonFungibleConditionCode.Sends, silver_asset_string, uintCV(silver)),
|
|
374
377
|
)
|
|
375
378
|
}
|
|
376
379
|
const function_option = getWriteOptions(this.stackswap, farming_contract, 'stakeNFTs', [
|
|
@@ -380,14 +383,34 @@ export class GroupFarmManager {
|
|
|
380
383
|
await openContractCall(function_option);
|
|
381
384
|
}
|
|
382
385
|
|
|
386
|
+
async getPostConditionFromAssetNFT(account: string, assetString: string, condition: NonFungibleConditionCode, id: string) {
|
|
383
387
|
|
|
388
|
+
let conditionString: NonFungibleComparator = 'sent';
|
|
389
|
+
switch (condition) {
|
|
390
|
+
case NonFungibleConditionCode.Sends:
|
|
391
|
+
conditionString = 'sent';
|
|
392
|
+
break
|
|
393
|
+
case NonFungibleConditionCode.DoesNotSend:
|
|
394
|
+
conditionString = 'not-sent';
|
|
395
|
+
break
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const nftPostCondition: NonFungiblePostCondition = {
|
|
399
|
+
type: 'nft-postcondition',
|
|
400
|
+
address: account,
|
|
401
|
+
condition: conditionString,
|
|
402
|
+
asset: assetString as any,
|
|
403
|
+
assetId: uintCV(id),
|
|
404
|
+
};
|
|
405
|
+
return nftPostCondition;
|
|
406
|
+
}
|
|
384
407
|
async claimNFTStakingReward( rewardToken1: string, rewardToken2: string, rewardToken3: string, rewardToken4: string, rewardList: any, callback: any, farming_contract: string) {
|
|
385
408
|
const post_condition: any = [];
|
|
386
409
|
const gold_asset_string = await this.getNFTAsset(this.stackswap.config.STACKSWAP_ADDRESS()+'.'+this.stackswap.config.CONTRACT_NAME_GOLD_PASS());
|
|
387
410
|
for (const gold of rewardList.returnNFTS.value) {
|
|
388
|
-
|
|
411
|
+
console.log(gold);
|
|
389
412
|
post_condition.push(
|
|
390
|
-
|
|
413
|
+
await this.getPostConditionFromAssetNFT(farming_contract, gold_asset_string, NonFungibleConditionCode.Sends, gold.value),
|
|
391
414
|
)
|
|
392
415
|
}
|
|
393
416
|
if(rewardToken1 !== Token.getBaseTokens(this.stackswap, BaseToken.NULL).addr){
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getWriteOptions, parseAddressToCV
|
|
6
6
|
} from "../util";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
fetchCallReadOnlyFunction, contractPrincipalCV,
|
|
9
9
|
cvToValue,
|
|
10
10
|
FungibleConditionCode, listCV,
|
|
11
11
|
stringAsciiCV,
|
|
@@ -33,7 +33,7 @@ export class LaunchpadManager {
|
|
|
33
33
|
async getLiquidityList() {
|
|
34
34
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-liquidity-token-list', []);
|
|
35
35
|
try {
|
|
36
|
-
const result = cvToValue(await
|
|
36
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
37
37
|
|
|
38
38
|
return result[this.getRandomIntNum(0, result.length-1)].value;
|
|
39
39
|
|
|
@@ -47,7 +47,7 @@ export class LaunchpadManager {
|
|
|
47
47
|
async getSoftTokenList() {
|
|
48
48
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-soft-token-list', []);
|
|
49
49
|
try {
|
|
50
|
-
const result = cvToValue(await
|
|
50
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
51
51
|
return result[this.getRandomIntNum(0, result.length-1)].value;
|
|
52
52
|
} catch (e) {
|
|
53
53
|
return('');
|
|
@@ -58,7 +58,7 @@ export class LaunchpadManager {
|
|
|
58
58
|
async getPOXLTokenList() {
|
|
59
59
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-poxl-token-list', []);
|
|
60
60
|
try {
|
|
61
|
-
const result = cvToValue(await
|
|
61
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
62
62
|
|
|
63
63
|
return result[this.getRandomIntNum(0, result.length-1)].value;
|
|
64
64
|
} catch (e) {
|
|
@@ -69,7 +69,7 @@ export class LaunchpadManager {
|
|
|
69
69
|
async getCITYTokenList() {
|
|
70
70
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT_CITY(), 'get-city-token-list', []);
|
|
71
71
|
try {
|
|
72
|
-
const result = cvToValue(await
|
|
72
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
73
73
|
|
|
74
74
|
return result[this.getRandomIntNum(0, result.length-1)].value;
|
|
75
75
|
} catch (e) {
|
|
@@ -80,7 +80,7 @@ export class LaunchpadManager {
|
|
|
80
80
|
async getTemplatetFarmList() {
|
|
81
81
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_GROUP_FARM(), 'get-template-farm-list', []);
|
|
82
82
|
try {
|
|
83
|
-
const result = cvToValue(await
|
|
83
|
+
const result = cvToValue(await fetchCallReadOnlyFunction(pair_details_options)).value;
|
|
84
84
|
|
|
85
85
|
return result[this.getRandomIntNum(0, result.length-1)].value;
|
|
86
86
|
} catch (e) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {getPostConditionFromAsset, getReadOptions, getWriteOptions} from "../util";
|
|
2
2
|
import BigNumber from "bignumber.js";
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
fetchCallReadOnlyFunction,
|
|
5
5
|
contractPrincipalCV, cvToValue, falseCV,
|
|
6
6
|
FungibleConditionCode,
|
|
7
7
|
standardPrincipalCV,
|
|
@@ -26,7 +26,7 @@ export class LbtcManager {
|
|
|
26
26
|
[]
|
|
27
27
|
);
|
|
28
28
|
// @ts-ignore
|
|
29
|
-
const result_raw = await
|
|
29
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
30
30
|
return cvToValue(result_raw);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -37,7 +37,7 @@ export class LbtcManager {
|
|
|
37
37
|
'get-collateral-type-by-name',
|
|
38
38
|
[stringAsciiCV(coll_type)]
|
|
39
39
|
);
|
|
40
|
-
const result_raw = await
|
|
40
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
41
41
|
return cvToValue(result_raw);
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@ export class LbtcManager {
|
|
|
48
48
|
'get-vaults',
|
|
49
49
|
[standardPrincipalCV(this.stackswap.getSenderAddress())]
|
|
50
50
|
);
|
|
51
|
-
const result_raw = await
|
|
51
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
52
52
|
return cvToValue(result_raw);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -59,7 +59,7 @@ export class LbtcManager {
|
|
|
59
59
|
'get-vault-by-id',
|
|
60
60
|
[uintCV(vault_id)]
|
|
61
61
|
);
|
|
62
|
-
const result_raw = await
|
|
62
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
63
63
|
return cvToValue(result_raw);
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -69,7 +69,7 @@ export class LbtcManager {
|
|
|
69
69
|
'get-vault-entries',
|
|
70
70
|
[standardPrincipalCV(this.stackswap.getSenderAddress())]
|
|
71
71
|
);
|
|
72
|
-
const result_raw = await
|
|
72
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
73
73
|
// // console.log('getVaultIDFromUser2', cvToValue(result_raw))
|
|
74
74
|
return cvToValue(result_raw);
|
|
75
75
|
}
|
|
@@ -528,7 +528,7 @@ export class LbtcManager {
|
|
|
528
528
|
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_ORACLE())
|
|
529
529
|
]
|
|
530
530
|
);
|
|
531
|
-
const result_raw = await
|
|
531
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
532
532
|
return cvToValue(result_raw);
|
|
533
533
|
}
|
|
534
534
|
|
|
@@ -543,7 +543,7 @@ export class LbtcManager {
|
|
|
543
543
|
stringAsciiCV(token)
|
|
544
544
|
]
|
|
545
545
|
);
|
|
546
|
-
const result_raw = await
|
|
546
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
547
547
|
// // console.log(cvToValue(result_raw))
|
|
548
548
|
return cvToValue(result_raw);
|
|
549
549
|
}
|
|
@@ -558,7 +558,7 @@ export class LbtcManager {
|
|
|
558
558
|
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_COLLATERAL_TYPES()),
|
|
559
559
|
]
|
|
560
560
|
);
|
|
561
|
-
const result_raw = await
|
|
561
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
562
562
|
// // console.log(cvToValue(result_raw))
|
|
563
563
|
return cvToValue(result_raw);
|
|
564
564
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
fetchCallReadOnlyFunction,
|
|
4
4
|
cvToValue,
|
|
5
|
-
FungibleConditionCode, listCV,
|
|
5
|
+
FungibleConditionCode, listCV,
|
|
6
6
|
standardPrincipalCV,
|
|
7
|
-
uintCV
|
|
7
|
+
uintCV, NonFungiblePostCondition
|
|
8
8
|
} from "@stacks/transactions";
|
|
9
9
|
import axios from "axios";
|
|
10
10
|
import {openContractCall} from "@stacks/connect";
|
|
@@ -32,7 +32,7 @@ export class LBTCStakingManager {
|
|
|
32
32
|
'get-first-stacks-block-in-reward-cycle', [
|
|
33
33
|
uintCV(cycle)
|
|
34
34
|
]);
|
|
35
|
-
const result_raw = await
|
|
35
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
36
36
|
const result = cvToValue(result_raw);
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
@@ -43,7 +43,7 @@ export class LBTCStakingManager {
|
|
|
43
43
|
const options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_LBTC_STACKING_LOGIC_V3(), 'get-reward-cycle', [
|
|
44
44
|
uintCV(block),
|
|
45
45
|
]);
|
|
46
|
-
const result = await
|
|
46
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
47
47
|
// // console.log(cvToValue(result));
|
|
48
48
|
return cvToValue(result).value;
|
|
49
49
|
} catch (e) {
|
|
@@ -62,7 +62,7 @@ export class LBTCStakingManager {
|
|
|
62
62
|
const options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_LBTC_STACKING_DATA_V3(), 'get-staker', [
|
|
63
63
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
64
64
|
]);
|
|
65
|
-
const result = await
|
|
65
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
66
66
|
// // console.log('reward', round, cvToValue(result));
|
|
67
67
|
const res = cvToValue(result).value;
|
|
68
68
|
// // console.log('getStaker', res);
|
|
@@ -87,7 +87,7 @@ export class LBTCStakingManager {
|
|
|
87
87
|
const options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_LBTC_STACKING_DATA_V3(), 'get-staking-stats-at-cycle', [
|
|
88
88
|
uintCV(round),
|
|
89
89
|
]);
|
|
90
|
-
const result = await
|
|
90
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
91
91
|
// // console.log('reward', round, cvToValue(result));
|
|
92
92
|
const res = cvToValue(result).value;
|
|
93
93
|
// // console.log('getRoundData', res);
|
|
@@ -103,7 +103,7 @@ export class LBTCStakingManager {
|
|
|
103
103
|
const options : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_STSW_STACKING_DATA_V2(), 'get-staking-stats-at-cycle-or-default', [
|
|
104
104
|
uintCV(round),
|
|
105
105
|
]);
|
|
106
|
-
const result = await
|
|
106
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
107
107
|
// // console.log('reward', round, cvToValue(result));
|
|
108
108
|
const res = cvToValue(result).value;
|
|
109
109
|
// // console.log('getRoundData', res);
|
|
@@ -137,7 +137,7 @@ export class LBTCStakingManager {
|
|
|
137
137
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
138
138
|
uintCV(round_id)
|
|
139
139
|
]);
|
|
140
|
-
const result_raw = await
|
|
140
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
141
141
|
const result = cvToValue(result_raw);
|
|
142
142
|
// // console.log("reward", round_id, result, result_raw)
|
|
143
143
|
return result;
|
|
@@ -156,7 +156,7 @@ export class LBTCStakingManager {
|
|
|
156
156
|
'get-staking-vault',[
|
|
157
157
|
uintCV(nft)]
|
|
158
158
|
);
|
|
159
|
-
const result_raw = await
|
|
159
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
160
160
|
const result = cvToValue(result_raw);
|
|
161
161
|
res_dict[nft] = result;
|
|
162
162
|
id_list.push(nft);
|
|
@@ -217,7 +217,16 @@ export class LBTCStakingManager {
|
|
|
217
217
|
// // console.log("Unstaking", amountSTX)
|
|
218
218
|
const post_conditions = [];
|
|
219
219
|
const assetString = `${this.stackswap.config.STACKSWAP_ADDRESS()}.${this.stackswap.config.CONTRACT_NAME_STACKSWAP_LBTC_STACKING_DATA_V3()}::lBTC-staking-vault`
|
|
220
|
-
|
|
220
|
+
|
|
221
|
+
const nftPostCondition: NonFungiblePostCondition = {
|
|
222
|
+
type: 'nft-postcondition',
|
|
223
|
+
address: this.stackswap.getSenderAddress(),
|
|
224
|
+
condition: 'sent',
|
|
225
|
+
asset: assetString as any,
|
|
226
|
+
assetId: uintCV(index),
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
post_conditions.push(nftPostCondition)
|
|
221
230
|
post_conditions.push(await getPostConditionFromAsset(this.stackswap, `${this.stackswap.config.STACKSWAP_ADDRESS()}.${this.stackswap.config.CONTRACT_NAME_STACKSWAP_LBTC_STACKING_DATA_V3()}`, this.stackswap.config.BASE_LBTC_DATA().addr, amountSTX, FungibleConditionCode.Equal))
|
|
222
231
|
const function_option : any = getWriteOptions(
|
|
223
232
|
this.stackswap,
|
|
@@ -242,7 +251,7 @@ export class LBTCStakingManager {
|
|
|
242
251
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
243
252
|
listCV(reward_list),
|
|
244
253
|
]);
|
|
245
|
-
const result_raw = await
|
|
254
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
246
255
|
const result = cvToValue(result_raw);
|
|
247
256
|
// // console.log("reward", result.rewardSum.value, result_raw)
|
|
248
257
|
return result.rewardSum.value;
|
|
@@ -346,7 +355,7 @@ export class LBTCStakingManager {
|
|
|
346
355
|
uintCV(cycle),
|
|
347
356
|
standardPrincipalCV(user),
|
|
348
357
|
]);
|
|
349
|
-
const result = await
|
|
358
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
350
359
|
// // console.log(cvToValue(result));
|
|
351
360
|
const res = cvToValue(result).value;
|
|
352
361
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {openContractCall} from "@stacks/connect";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
fetchCallReadOnlyFunction,
|
|
4
4
|
cvToValue,
|
|
5
5
|
falseCV,
|
|
6
6
|
FungibleConditionCode,
|
|
@@ -62,7 +62,7 @@ export class MultisigManager {
|
|
|
62
62
|
const pair_details_options : any = getReadOptions(this.stackswap, this.stackswap.config.BASE_STSW_DATA().addr, 'get-balance',
|
|
63
63
|
[parseAddressToCV('SPVRC3RHFD58B2PY1HZD2V71THPW7G445WBRCQYW.octopus_v01')]);
|
|
64
64
|
try {
|
|
65
|
-
const result = await
|
|
65
|
+
const result = await fetchCallReadOnlyFunction(pair_details_options);
|
|
66
66
|
// // console.log('get-balance', cvToValue(result));
|
|
67
67
|
return cvToValue(result).value;
|
|
68
68
|
} catch (e) {
|
|
@@ -75,7 +75,7 @@ export class MultisigManager {
|
|
|
75
75
|
async getMultisigResult(functionName: string) {
|
|
76
76
|
const pair_details_options : any = getReadOptions(this.stackswap, 'SPVRC3RHFD58B2PY1HZD2V71THPW7G445WBRCQYW.octopus_v01', functionName,
|
|
77
77
|
[]);
|
|
78
|
-
const result = await
|
|
78
|
+
const result = await fetchCallReadOnlyFunction(pair_details_options);
|
|
79
79
|
// // console.log(functionName, cvToValue(result));
|
|
80
80
|
return cvToValue(result);
|
|
81
81
|
}
|
|
@@ -7,16 +7,17 @@ import {
|
|
|
7
7
|
} from "../util";
|
|
8
8
|
import {openContractCall} from "@stacks/connect";
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
fetchCallReadOnlyFunction, contractPrincipalCV,
|
|
11
11
|
cvToValue,
|
|
12
12
|
FungibleConditionCode,
|
|
13
13
|
listCV,
|
|
14
14
|
standardPrincipalCV,
|
|
15
15
|
TupleCV,
|
|
16
|
-
uintCV, NonFungibleConditionCode,
|
|
16
|
+
uintCV, NonFungibleConditionCode, NonFungiblePostCondition,
|
|
17
17
|
} from "@stacks/transactions";
|
|
18
18
|
import BigNumber from "bignumber.js";
|
|
19
19
|
import axios from "axios";
|
|
20
|
+
import {NonFungibleComparator} from "@stacks/transactions/src/postcondition-types";
|
|
20
21
|
|
|
21
22
|
export class NftManager {
|
|
22
23
|
stackswap : StackswapAPI;
|
|
@@ -70,7 +71,25 @@ export class NftManager {
|
|
|
70
71
|
}
|
|
71
72
|
async getPostConditionFromAssetNFT(account: string, tokenStr: string, condition: NonFungibleConditionCode, id: string) {
|
|
72
73
|
const assetString = await this.getNFTAsset(tokenStr);
|
|
73
|
-
|
|
74
|
+
|
|
75
|
+
let conditionString : NonFungibleComparator = 'sent';
|
|
76
|
+
switch (condition) {
|
|
77
|
+
case NonFungibleConditionCode.Sends:
|
|
78
|
+
conditionString = 'sent';
|
|
79
|
+
break
|
|
80
|
+
case NonFungibleConditionCode.DoesNotSend:
|
|
81
|
+
conditionString = 'not-sent';
|
|
82
|
+
break
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const nftPostCondition: NonFungiblePostCondition = {
|
|
86
|
+
type: 'nft-postcondition',
|
|
87
|
+
address: account,
|
|
88
|
+
condition: conditionString,
|
|
89
|
+
asset: assetString as any,
|
|
90
|
+
assetId: uintCV(id),
|
|
91
|
+
};
|
|
92
|
+
return nftPostCondition;
|
|
74
93
|
}
|
|
75
94
|
|
|
76
95
|
async mintNFT(price: string | number, addr: string, callback: any = null){
|
|
@@ -183,7 +202,7 @@ export class NftManager {
|
|
|
183
202
|
const function_option:any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-nft-data', [
|
|
184
203
|
uintCV(id),
|
|
185
204
|
]);
|
|
186
|
-
const result_raw = await
|
|
205
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
187
206
|
const result = cvToValue(result_raw);
|
|
188
207
|
// // console.log(result);
|
|
189
208
|
return result.value;
|
|
@@ -193,7 +212,7 @@ export class NftManager {
|
|
|
193
212
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-owner', [
|
|
194
213
|
uintCV(id),
|
|
195
214
|
]);
|
|
196
|
-
const result_raw = await
|
|
215
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
197
216
|
const result = cvToValue(result_raw);
|
|
198
217
|
try{
|
|
199
218
|
return result.value.value;
|
|
@@ -206,7 +225,7 @@ export class NftManager {
|
|
|
206
225
|
const function_option : any = getReadOptions(this.stackswap, contract, 'get-mint-pass-balance', [
|
|
207
226
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
208
227
|
]);
|
|
209
|
-
const result_raw = await
|
|
228
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
210
229
|
const result = cvToValue(result_raw);
|
|
211
230
|
try{
|
|
212
231
|
return result;
|
|
@@ -219,7 +238,7 @@ export class NftManager {
|
|
|
219
238
|
const function_option : any = getReadOptions(this.stackswap, contract, 'get-balance', [
|
|
220
239
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
221
240
|
]);
|
|
222
|
-
const result_raw = await
|
|
241
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
223
242
|
try{
|
|
224
243
|
// // console.log('result_raw', result_raw);
|
|
225
244
|
// const result = cvToValue(result_raw);
|
|
@@ -235,7 +254,7 @@ export class NftManager {
|
|
|
235
254
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-reserve-amount', [
|
|
236
255
|
uintCV(id),
|
|
237
256
|
]);
|
|
238
|
-
const result_raw = await
|
|
257
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
239
258
|
const result = cvToValue(result_raw);
|
|
240
259
|
// // console.log(result);
|
|
241
260
|
return result.value;
|
|
@@ -245,7 +264,7 @@ export class NftManager {
|
|
|
245
264
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-token-uri', [
|
|
246
265
|
uintCV(id),
|
|
247
266
|
]);
|
|
248
|
-
const result_raw = await
|
|
267
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
249
268
|
const result = cvToValue(result_raw);
|
|
250
269
|
// // console.log(result);
|
|
251
270
|
return result.value;
|
|
@@ -254,7 +273,7 @@ export class NftManager {
|
|
|
254
273
|
async getTotalList(){
|
|
255
274
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-total-list', [
|
|
256
275
|
]);
|
|
257
|
-
const result_raw = await
|
|
276
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
258
277
|
try{
|
|
259
278
|
const result = cvToValue(result_raw);
|
|
260
279
|
return result;
|
|
@@ -266,7 +285,7 @@ export class NftManager {
|
|
|
266
285
|
async getMarketList(){
|
|
267
286
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-market-list', [
|
|
268
287
|
], );
|
|
269
|
-
const result_raw = await
|
|
288
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
270
289
|
try{
|
|
271
290
|
const result = cvToValue(result_raw);
|
|
272
291
|
return result;
|
|
@@ -279,7 +298,7 @@ export class NftManager {
|
|
|
279
298
|
const function_option : any = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_AINFT(), 'get-listing-in-ustx', [
|
|
280
299
|
uintCV(id),
|
|
281
300
|
]);
|
|
282
|
-
const result_raw = await
|
|
301
|
+
const result_raw = await fetchCallReadOnlyFunction(function_option);
|
|
283
302
|
const result = cvToValue(result_raw);
|
|
284
303
|
try{
|
|
285
304
|
// // console.log(result.value.price.value);
|
|
@@ -3,7 +3,7 @@ import BigNumber from "bignumber.js";
|
|
|
3
3
|
import {openContractCall} from "@stacks/connect";
|
|
4
4
|
import {getPostConditionFromAsset, getReadOptions, getWriteOptions} from "../util";
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
fetchCallReadOnlyFunction, contractPrincipalCV,
|
|
7
7
|
cvToValue,
|
|
8
8
|
FungibleConditionCode, listCV,
|
|
9
9
|
standardPrincipalCV, stringUtf8CV,
|
|
@@ -81,7 +81,7 @@ export class OperatorManager {
|
|
|
81
81
|
async distributorGetInvestor(){
|
|
82
82
|
const options = getReadOptions(this.stackswap, 'distributor0001', 'get-invester',
|
|
83
83
|
[ standardPrincipalCV(this.stackswap.getSenderAddress())]);
|
|
84
|
-
const result = await
|
|
84
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
85
85
|
// // console.log(cvToValue(result));
|
|
86
86
|
|
|
87
87
|
return cvToValue(result).value;
|
|
@@ -89,7 +89,7 @@ export class OperatorManager {
|
|
|
89
89
|
async distributorGetReclaim(){
|
|
90
90
|
const options : any = getReadOptions(this.stackswap, 'distributor0001', 'get-claimable-amount',
|
|
91
91
|
[ standardPrincipalCV(this.stackswap.getSenderAddress())]);
|
|
92
|
-
const result = await
|
|
92
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
93
93
|
// // console.log(cvToValue(result));
|
|
94
94
|
|
|
95
95
|
return cvToValue(result);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {openContractCall} from "@stacks/connect";
|
|
2
2
|
import {
|
|
3
3
|
// bufferCV,
|
|
4
|
-
|
|
4
|
+
fetchCallReadOnlyFunction,
|
|
5
5
|
cvToValue,
|
|
6
6
|
FungibleConditionCode,
|
|
7
7
|
standardPrincipalCV,
|
|
@@ -24,7 +24,7 @@ export class OtherManager {
|
|
|
24
24
|
const options = getReadOptions(this.stackswap, contract_address, 'get-user-rewards', [
|
|
25
25
|
standardPrincipalCV(this.stackswap.getSenderAddress()),
|
|
26
26
|
]);
|
|
27
|
-
const result = await
|
|
27
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
28
28
|
return cvToValue(result).value;
|
|
29
29
|
} catch (e) {
|
|
30
30
|
return 0;
|
|
@@ -47,7 +47,7 @@ export class OtherManager {
|
|
|
47
47
|
async get_pox_info(){
|
|
48
48
|
const options = getReadOptions(this.stackswap, 'SP000000000000000000002Q6VF78.pox', 'get-pox-info',
|
|
49
49
|
[ ]);
|
|
50
|
-
const result = await
|
|
50
|
+
const result = await fetchCallReadOnlyFunction(options);
|
|
51
51
|
// // console.log(cvToValue(result).value);
|
|
52
52
|
return cvToValue(result).value;
|
|
53
53
|
}
|