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,9 +1,9 @@
|
|
|
1
|
-
import { StackswapAPI } from "../../index";
|
|
2
|
-
export declare class GovernanceManager {
|
|
3
|
-
stackswap: StackswapAPI;
|
|
4
|
-
constructor(stackswap: StackswapAPI);
|
|
5
|
-
getProposalsList(): Promise<any>;
|
|
6
|
-
getNumVoting(proposal_id: number): Promise<any[]>;
|
|
7
|
-
txWithdrawVoting(proposal_id: number, callback?: any): Promise<void>;
|
|
8
|
-
txVote(proposal_id: number, vote_mode: string, vote_amount: any, callback?: any): Promise<void>;
|
|
9
|
-
}
|
|
1
|
+
import { StackswapAPI } from "../../index";
|
|
2
|
+
export declare class GovernanceManager {
|
|
3
|
+
stackswap: StackswapAPI;
|
|
4
|
+
constructor(stackswap: StackswapAPI);
|
|
5
|
+
getProposalsList(): Promise<any>;
|
|
6
|
+
getNumVoting(proposal_id: number): Promise<any[]>;
|
|
7
|
+
txWithdrawVoting(proposal_id: number, callback?: any): Promise<void>;
|
|
8
|
+
txVote(proposal_id: number, vote_mode: string, vote_amount: any, callback?: any): Promise<void>;
|
|
9
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { callReadOnlyFunction, cvToValue, FungibleConditionCode, standardPrincipalCV, uintCV } from "@stacks/transactions";
|
|
2
|
-
import { openContractCall } from "@stacks/connect";
|
|
3
|
-
import BigNumber from "bignumber.js";
|
|
4
|
-
import { getPostConditionFromAsset, getReadOptions, getWriteOptions } from "../util";
|
|
5
|
-
export class GovernanceManager {
|
|
6
|
-
constructor(stackswap) {
|
|
7
|
-
this.stackswap = stackswap;
|
|
8
|
-
}
|
|
9
|
-
async getProposalsList() {
|
|
10
|
-
const function_option = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'get-proposals', []);
|
|
11
|
-
const result_raw = await callReadOnlyFunction(function_option);
|
|
12
|
-
const result = cvToValue(result_raw);
|
|
13
|
-
let res_list = [];
|
|
14
|
-
result.value.forEach((element) => {
|
|
15
|
-
res_list.push(element.value);
|
|
16
|
-
});
|
|
17
|
-
return res_list;
|
|
18
|
-
}
|
|
19
|
-
async getNumVoting(proposal_id) {
|
|
20
|
-
const function_option = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'get-votes-by-member-by-id', [
|
|
21
|
-
uintCV(proposal_id),
|
|
22
|
-
standardPrincipalCV(this.stackswap.getSenderAddress())
|
|
23
|
-
]);
|
|
24
|
-
const result_raw = await callReadOnlyFunction(function_option);
|
|
25
|
-
const result = cvToValue(result_raw);
|
|
26
|
-
return [result['vote-count'].value, result.returned.value];
|
|
27
|
-
}
|
|
28
|
-
async txWithdrawVoting(proposal_id, callback = null) {
|
|
29
|
-
const function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'return-votes-to-member', [
|
|
30
|
-
uintCV(proposal_id),
|
|
31
|
-
standardPrincipalCV(this.stackswap.getSenderAddress())
|
|
32
|
-
], callback);
|
|
33
|
-
await openContractCall(function_option);
|
|
34
|
-
}
|
|
35
|
-
async txVote(proposal_id, vote_mode, vote_amount, callback = null) {
|
|
36
|
-
const vote_amount_bn = new BigNumber(10 ** 6).multipliedBy(parseFloat(vote_amount)).toFixed(0).toString();
|
|
37
|
-
const post_condition = [await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_vSTSW_DATA().addr, vote_amount_bn, FungibleConditionCode.Equal)];
|
|
38
|
-
let function_option = null;
|
|
39
|
-
if (vote_mode === 'For') {
|
|
40
|
-
function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'vote-for', [
|
|
41
|
-
uintCV(proposal_id), uintCV(vote_amount_bn)
|
|
42
|
-
], post_condition, callback);
|
|
43
|
-
}
|
|
44
|
-
else if (vote_mode === 'Against') {
|
|
45
|
-
function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'vote-against', [
|
|
46
|
-
uintCV(proposal_id), uintCV(vote_amount_bn)
|
|
47
|
-
], post_condition, callback);
|
|
48
|
-
}
|
|
49
|
-
if (function_option != null) {
|
|
50
|
-
await openContractCall(function_option);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import { callReadOnlyFunction, cvToValue, FungibleConditionCode, standardPrincipalCV, uintCV } from "@stacks/transactions";
|
|
2
|
+
import { openContractCall } from "@stacks/connect";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
import { getPostConditionFromAsset, getReadOptions, getWriteOptions } from "../util";
|
|
5
|
+
export class GovernanceManager {
|
|
6
|
+
constructor(stackswap) {
|
|
7
|
+
this.stackswap = stackswap;
|
|
8
|
+
}
|
|
9
|
+
async getProposalsList() {
|
|
10
|
+
const function_option = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'get-proposals', []);
|
|
11
|
+
const result_raw = await callReadOnlyFunction(function_option);
|
|
12
|
+
const result = cvToValue(result_raw);
|
|
13
|
+
let res_list = [];
|
|
14
|
+
result.value.forEach((element) => {
|
|
15
|
+
res_list.push(element.value);
|
|
16
|
+
});
|
|
17
|
+
return res_list;
|
|
18
|
+
}
|
|
19
|
+
async getNumVoting(proposal_id) {
|
|
20
|
+
const function_option = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'get-votes-by-member-by-id', [
|
|
21
|
+
uintCV(proposal_id),
|
|
22
|
+
standardPrincipalCV(this.stackswap.getSenderAddress())
|
|
23
|
+
]);
|
|
24
|
+
const result_raw = await callReadOnlyFunction(function_option);
|
|
25
|
+
const result = cvToValue(result_raw);
|
|
26
|
+
return [result['vote-count'].value, result.returned.value];
|
|
27
|
+
}
|
|
28
|
+
async txWithdrawVoting(proposal_id, callback = null) {
|
|
29
|
+
const function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'return-votes-to-member', [
|
|
30
|
+
uintCV(proposal_id),
|
|
31
|
+
standardPrincipalCV(this.stackswap.getSenderAddress())
|
|
32
|
+
], callback);
|
|
33
|
+
await openContractCall(function_option);
|
|
34
|
+
}
|
|
35
|
+
async txVote(proposal_id, vote_mode, vote_amount, callback = null) {
|
|
36
|
+
const vote_amount_bn = new BigNumber(10 ** 6).multipliedBy(parseFloat(vote_amount)).toFixed(0).toString();
|
|
37
|
+
const post_condition = [await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_vSTSW_DATA().addr, vote_amount_bn, FungibleConditionCode.Equal)];
|
|
38
|
+
let function_option = null;
|
|
39
|
+
if (vote_mode === 'For') {
|
|
40
|
+
function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'vote-for', [
|
|
41
|
+
uintCV(proposal_id), uintCV(vote_amount_bn)
|
|
42
|
+
], post_condition, callback);
|
|
43
|
+
}
|
|
44
|
+
else if (vote_mode === 'Against') {
|
|
45
|
+
function_option = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_GOVERNANCE(), 'vote-against', [
|
|
46
|
+
uintCV(proposal_id), uintCV(vote_amount_bn)
|
|
47
|
+
], post_condition, callback);
|
|
48
|
+
}
|
|
49
|
+
if (function_option != null) {
|
|
50
|
+
await openContractCall(function_option);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
//# sourceMappingURL=governance.manager.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { StackswapAPI } from "../../index";
|
|
2
|
-
export declare class LaunchpadManager {
|
|
3
|
-
stackswap: StackswapAPI;
|
|
4
|
-
constructor(stackswap: StackswapAPI);
|
|
5
|
-
getRandomIntNum(min: number, max: number): number;
|
|
6
|
-
getLiquidityList(): Promise<any>;
|
|
7
|
-
getSoftTokenList(): Promise<any>;
|
|
8
|
-
getPOXLTokenList(): Promise<any>;
|
|
9
|
-
mintSIPContractCall(soft_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
10
|
-
mintPOXLContractCall(poxl_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
11
|
-
mintSIPSTSWContractCall(soft_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
12
|
-
mintPOXLSTSWContractCall(poxl_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import { StackswapAPI } from "../../index";
|
|
2
|
+
export declare class LaunchpadManager {
|
|
3
|
+
stackswap: StackswapAPI;
|
|
4
|
+
constructor(stackswap: StackswapAPI);
|
|
5
|
+
getRandomIntNum(min: number, max: number): number;
|
|
6
|
+
getLiquidityList(): Promise<any>;
|
|
7
|
+
getSoftTokenList(): Promise<any>;
|
|
8
|
+
getPOXLTokenList(): Promise<any>;
|
|
9
|
+
mintSIPContractCall(soft_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
10
|
+
mintPOXLContractCall(poxl_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
11
|
+
mintSIPSTSWContractCall(soft_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
12
|
+
mintPOXLSTSWContractCall(poxl_token: string, liquidity_token: string, data: any, callback?: any): Promise<void>;
|
|
13
|
+
}
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
import { getAmountStringWithDecimal, getAmountWithDecimalString, getPostConditionFromAsset, getReadOptions, getWriteOptions } from "../util";
|
|
2
|
-
import { callReadOnlyFunction, contractPrincipalCV, cvToValue, FungibleConditionCode, stringAsciiCV, stringUtf8CV, uintCV } from "@stacks/transactions";
|
|
3
|
-
import { openContractCall } from "@stacks/connect";
|
|
4
|
-
export class LaunchpadManager {
|
|
5
|
-
constructor(stackswap) {
|
|
6
|
-
this.stackswap = stackswap;
|
|
7
|
-
}
|
|
8
|
-
getRandomIntNum(min, max) {
|
|
9
|
-
min = Math.ceil(min);
|
|
10
|
-
max = Math.floor(max);
|
|
11
|
-
return Math.floor(Math.random() * (max - min)) + min;
|
|
12
|
-
}
|
|
13
|
-
async getLiquidityList() {
|
|
14
|
-
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-liquidity-token-list', []);
|
|
15
|
-
try {
|
|
16
|
-
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
17
|
-
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
return ('');
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async getSoftTokenList() {
|
|
24
|
-
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-soft-token-list', []);
|
|
25
|
-
try {
|
|
26
|
-
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
27
|
-
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
return ('');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async getPOXLTokenList() {
|
|
34
|
-
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-poxl-token-list', []);
|
|
35
|
-
try {
|
|
36
|
-
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
37
|
-
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
return ('');
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async mintSIPContractCall(soft_token, liquidity_token, data, callback = null) {
|
|
44
|
-
const token_y_addr = soft_token.split('.');
|
|
45
|
-
const pair_addr = liquidity_token.split('.');
|
|
46
|
-
const post_condition = [];
|
|
47
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_WSTX_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
48
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), soft_token, 0, FungibleConditionCode.GreaterEqual));
|
|
49
|
-
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-sip10-token-with-stx', [
|
|
50
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
51
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
52
|
-
stringAsciiCV('STX-' + data.token_symbol),
|
|
53
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount_x, 6)),
|
|
54
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount_y, data.token_decimal)),
|
|
55
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
56
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
57
|
-
stringAsciiCV(data.token_name),
|
|
58
|
-
stringAsciiCV(data.token_symbol),
|
|
59
|
-
uintCV(data.token_decimal),
|
|
60
|
-
stringUtf8CV(data.token_uri),
|
|
61
|
-
stringUtf8CV(data.token_website),
|
|
62
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount, data.token_decimal)),
|
|
63
|
-
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
64
|
-
], post_condition, callback);
|
|
65
|
-
openContractCall(options);
|
|
66
|
-
}
|
|
67
|
-
async mintPOXLContractCall(poxl_token, liquidity_token, data, callback = null) {
|
|
68
|
-
const token_y_addr = poxl_token.split('.');
|
|
69
|
-
const pair_addr = liquidity_token.split('.');
|
|
70
|
-
const post_condition = [];
|
|
71
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_WSTX_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
72
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), poxl_token, 0, FungibleConditionCode.GreaterEqual));
|
|
73
|
-
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-poxl-token-with-stx', [
|
|
74
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
75
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
76
|
-
stringAsciiCV('STX-' + data.token_symbol),
|
|
77
|
-
uintCV(getAmountWithDecimalString(data.initial_amount_x, 6)),
|
|
78
|
-
uintCV(getAmountWithDecimalString(data.initial_amount_y, data.token_decimal)),
|
|
79
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
80
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
81
|
-
stringAsciiCV(data.token_name),
|
|
82
|
-
stringAsciiCV(data.token_symbol),
|
|
83
|
-
uintCV(data.token_decimal),
|
|
84
|
-
stringUtf8CV(data.token_uri),
|
|
85
|
-
stringUtf8CV(data.token_website),
|
|
86
|
-
uintCV(getAmountWithDecimalString(data.initial_amount, data.token_decimal)),
|
|
87
|
-
uintCV(data.first_stacking_block),
|
|
88
|
-
uintCV(data.reward_cycle_block),
|
|
89
|
-
uintCV(data.token_reward_maturity),
|
|
90
|
-
uintCV(getAmountWithDecimalString(data.coinbase_reward, data.token_decimal)),
|
|
91
|
-
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
92
|
-
], post_condition, callback);
|
|
93
|
-
openContractCall(options);
|
|
94
|
-
}
|
|
95
|
-
async mintSIPSTSWContractCall(soft_token, liquidity_token, data, callback = null) {
|
|
96
|
-
const token_y_addr = soft_token.split('.');
|
|
97
|
-
const pair_addr = liquidity_token.split('.');
|
|
98
|
-
const post_condition = [];
|
|
99
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
100
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), soft_token, 0, FungibleConditionCode.GreaterEqual));
|
|
101
|
-
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-sip10-token-with-stsw', [
|
|
102
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
103
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
104
|
-
stringAsciiCV('STX-' + data.token_symbol),
|
|
105
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount_x, 6)),
|
|
106
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount_y, data.token_decimal)),
|
|
107
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
108
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
109
|
-
stringAsciiCV(data.token_name),
|
|
110
|
-
stringAsciiCV(data.token_symbol),
|
|
111
|
-
uintCV(data.token_decimal),
|
|
112
|
-
stringUtf8CV(data.token_uri),
|
|
113
|
-
stringUtf8CV(data.token_website),
|
|
114
|
-
uintCV(getAmountStringWithDecimal(data.initial_amount, data.token_decimal)),
|
|
115
|
-
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
116
|
-
], post_condition, callback);
|
|
117
|
-
openContractCall(options);
|
|
118
|
-
}
|
|
119
|
-
async mintPOXLSTSWContractCall(poxl_token, liquidity_token, data, callback = null) {
|
|
120
|
-
const token_y_addr = poxl_token.split('.');
|
|
121
|
-
const pair_addr = liquidity_token.split('.');
|
|
122
|
-
const post_condition = [];
|
|
123
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
124
|
-
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), poxl_token, 0, FungibleConditionCode.GreaterEqual));
|
|
125
|
-
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-poxl-token-with-stsw', [
|
|
126
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
127
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
128
|
-
stringAsciiCV('STX-' + data.token_symbol),
|
|
129
|
-
uintCV(getAmountWithDecimalString(data.initial_amount_x, 6)),
|
|
130
|
-
uintCV(getAmountWithDecimalString(data.initial_amount_y, data.token_decimal)),
|
|
131
|
-
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
132
|
-
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
133
|
-
stringAsciiCV(data.token_name),
|
|
134
|
-
stringAsciiCV(data.token_symbol),
|
|
135
|
-
uintCV(data.token_decimal),
|
|
136
|
-
stringUtf8CV(data.token_uri),
|
|
137
|
-
stringUtf8CV(data.token_website),
|
|
138
|
-
uintCV(getAmountWithDecimalString(data.initial_amount, data.token_decimal)),
|
|
139
|
-
uintCV(data.first_stacking_block),
|
|
140
|
-
uintCV(data.reward_cycle_block),
|
|
141
|
-
uintCV(data.token_reward_maturity),
|
|
142
|
-
uintCV(getAmountWithDecimalString(data.coinbase_reward, data.token_decimal)),
|
|
143
|
-
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
144
|
-
], post_condition, callback);
|
|
145
|
-
openContractCall(options);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
1
|
+
import { getAmountStringWithDecimal, getAmountWithDecimalString, getPostConditionFromAsset, getReadOptions, getWriteOptions } from "../util";
|
|
2
|
+
import { callReadOnlyFunction, contractPrincipalCV, cvToValue, FungibleConditionCode, stringAsciiCV, stringUtf8CV, uintCV } from "@stacks/transactions";
|
|
3
|
+
import { openContractCall } from "@stacks/connect";
|
|
4
|
+
export class LaunchpadManager {
|
|
5
|
+
constructor(stackswap) {
|
|
6
|
+
this.stackswap = stackswap;
|
|
7
|
+
}
|
|
8
|
+
getRandomIntNum(min, max) {
|
|
9
|
+
min = Math.ceil(min);
|
|
10
|
+
max = Math.floor(max);
|
|
11
|
+
return Math.floor(Math.random() * (max - min)) + min;
|
|
12
|
+
}
|
|
13
|
+
async getLiquidityList() {
|
|
14
|
+
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-liquidity-token-list', []);
|
|
15
|
+
try {
|
|
16
|
+
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
17
|
+
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
return ('');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async getSoftTokenList() {
|
|
24
|
+
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-soft-token-list', []);
|
|
25
|
+
try {
|
|
26
|
+
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
27
|
+
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return ('');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async getPOXLTokenList() {
|
|
34
|
+
const pair_details_options = getReadOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'get-poxl-token-list', []);
|
|
35
|
+
try {
|
|
36
|
+
const result = cvToValue(await callReadOnlyFunction(pair_details_options)).value;
|
|
37
|
+
return result[this.getRandomIntNum(0, result.length - 1)].value;
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
return ('');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async mintSIPContractCall(soft_token, liquidity_token, data, callback = null) {
|
|
44
|
+
const token_y_addr = soft_token.split('.');
|
|
45
|
+
const pair_addr = liquidity_token.split('.');
|
|
46
|
+
const post_condition = [];
|
|
47
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_WSTX_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
48
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), soft_token, 0, FungibleConditionCode.GreaterEqual));
|
|
49
|
+
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-sip10-token-with-stx', [
|
|
50
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
51
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
52
|
+
stringAsciiCV('STX-' + data.token_symbol),
|
|
53
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount_x, 6)),
|
|
54
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount_y, data.token_decimal)),
|
|
55
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
56
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
57
|
+
stringAsciiCV(data.token_name),
|
|
58
|
+
stringAsciiCV(data.token_symbol),
|
|
59
|
+
uintCV(data.token_decimal),
|
|
60
|
+
stringUtf8CV(data.token_uri),
|
|
61
|
+
stringUtf8CV(data.token_website),
|
|
62
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount, data.token_decimal)),
|
|
63
|
+
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
64
|
+
], post_condition, callback);
|
|
65
|
+
openContractCall(options);
|
|
66
|
+
}
|
|
67
|
+
async mintPOXLContractCall(poxl_token, liquidity_token, data, callback = null) {
|
|
68
|
+
const token_y_addr = poxl_token.split('.');
|
|
69
|
+
const pair_addr = liquidity_token.split('.');
|
|
70
|
+
const post_condition = [];
|
|
71
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_WSTX_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
72
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), poxl_token, 0, FungibleConditionCode.GreaterEqual));
|
|
73
|
+
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-poxl-token-with-stx', [
|
|
74
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
75
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
76
|
+
stringAsciiCV('STX-' + data.token_symbol),
|
|
77
|
+
uintCV(getAmountWithDecimalString(data.initial_amount_x, 6)),
|
|
78
|
+
uintCV(getAmountWithDecimalString(data.initial_amount_y, data.token_decimal)),
|
|
79
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
80
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
81
|
+
stringAsciiCV(data.token_name),
|
|
82
|
+
stringAsciiCV(data.token_symbol),
|
|
83
|
+
uintCV(data.token_decimal),
|
|
84
|
+
stringUtf8CV(data.token_uri),
|
|
85
|
+
stringUtf8CV(data.token_website),
|
|
86
|
+
uintCV(getAmountWithDecimalString(data.initial_amount, data.token_decimal)),
|
|
87
|
+
uintCV(data.first_stacking_block),
|
|
88
|
+
uintCV(data.reward_cycle_block),
|
|
89
|
+
uintCV(data.token_reward_maturity),
|
|
90
|
+
uintCV(getAmountWithDecimalString(data.coinbase_reward, data.token_decimal)),
|
|
91
|
+
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
92
|
+
], post_condition, callback);
|
|
93
|
+
openContractCall(options);
|
|
94
|
+
}
|
|
95
|
+
async mintSIPSTSWContractCall(soft_token, liquidity_token, data, callback = null) {
|
|
96
|
+
const token_y_addr = soft_token.split('.');
|
|
97
|
+
const pair_addr = liquidity_token.split('.');
|
|
98
|
+
const post_condition = [];
|
|
99
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
100
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), soft_token, 0, FungibleConditionCode.GreaterEqual));
|
|
101
|
+
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-sip10-token-with-stsw', [
|
|
102
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
103
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
104
|
+
stringAsciiCV('STX-' + data.token_symbol),
|
|
105
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount_x, 6)),
|
|
106
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount_y, data.token_decimal)),
|
|
107
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
108
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
109
|
+
stringAsciiCV(data.token_name),
|
|
110
|
+
stringAsciiCV(data.token_symbol),
|
|
111
|
+
uintCV(data.token_decimal),
|
|
112
|
+
stringUtf8CV(data.token_uri),
|
|
113
|
+
stringUtf8CV(data.token_website),
|
|
114
|
+
uintCV(getAmountStringWithDecimal(data.initial_amount, data.token_decimal)),
|
|
115
|
+
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
116
|
+
], post_condition, callback);
|
|
117
|
+
openContractCall(options);
|
|
118
|
+
}
|
|
119
|
+
async mintPOXLSTSWContractCall(poxl_token, liquidity_token, data, callback = null) {
|
|
120
|
+
const token_y_addr = poxl_token.split('.');
|
|
121
|
+
const pair_addr = liquidity_token.split('.');
|
|
122
|
+
const post_condition = [];
|
|
123
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), this.stackswap.config.BASE_STSW_DATA().addr, getAmountWithDecimalString(data.initial_amount_x, 6), FungibleConditionCode.Equal));
|
|
124
|
+
post_condition.push(await getPostConditionFromAsset(this.stackswap, this.stackswap.getSenderAddress(), poxl_token, 0, FungibleConditionCode.GreaterEqual));
|
|
125
|
+
const options = getWriteOptions(this.stackswap, this.stackswap.config.CONTRACT_NAME_STACKSWAP_ONE_STEP_MINT(), 'create-pair-new-poxl-token-with-stsw', [
|
|
126
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
127
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
128
|
+
stringAsciiCV('STX-' + data.token_symbol),
|
|
129
|
+
uintCV(getAmountWithDecimalString(data.initial_amount_x, 6)),
|
|
130
|
+
uintCV(getAmountWithDecimalString(data.initial_amount_y, data.token_decimal)),
|
|
131
|
+
contractPrincipalCV(token_y_addr[0], token_y_addr[1]),
|
|
132
|
+
contractPrincipalCV(pair_addr[0], pair_addr[1]),
|
|
133
|
+
stringAsciiCV(data.token_name),
|
|
134
|
+
stringAsciiCV(data.token_symbol),
|
|
135
|
+
uintCV(data.token_decimal),
|
|
136
|
+
stringUtf8CV(data.token_uri),
|
|
137
|
+
stringUtf8CV(data.token_website),
|
|
138
|
+
uintCV(getAmountWithDecimalString(data.initial_amount, data.token_decimal)),
|
|
139
|
+
uintCV(data.first_stacking_block),
|
|
140
|
+
uintCV(data.reward_cycle_block),
|
|
141
|
+
uintCV(data.token_reward_maturity),
|
|
142
|
+
uintCV(getAmountWithDecimalString(data.coinbase_reward, data.token_decimal)),
|
|
143
|
+
contractPrincipalCV(this.stackswap.config.STACKSWAP_ADDRESS(), this.stackswap.config.CONTRACT_NAME_STACKSWAP_SWAP())
|
|
144
|
+
], post_condition, callback);
|
|
145
|
+
openContractCall(options);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
148
|
//# sourceMappingURL=launchpad.manager.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
|
-
import { StackswapAPI } from "../../index";
|
|
3
|
-
export declare class LbtcManager {
|
|
4
|
-
stackswap: StackswapAPI;
|
|
5
|
-
constructor(stackswap: StackswapAPI);
|
|
6
|
-
getPoxInfo(): Promise<any>;
|
|
7
|
-
getVaultTypeInfo(coll_type: string): Promise<any>;
|
|
8
|
-
getVaultIDFromUser(): Promise<any>;
|
|
9
|
-
getVaultInfoFromID(vault_id: string): Promise<any>;
|
|
10
|
-
getVaultIDFromUser2(): Promise<any>;
|
|
11
|
-
txCreateVaultWithSTX(coll_amt: BigNumber, debt_amt: BigNumber, coll_type: string, isStack: boolean, callback?: any): Promise<void>;
|
|
12
|
-
txCreateVaultWithSTSW(coll_amt: BigNumber, debt_amt: BigNumber, coll_type: string, callback?: any): Promise<void>;
|
|
13
|
-
txDepositCollateral(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
14
|
-
txToggleStacking(vault_id: number, callback?: any): Promise<void>;
|
|
15
|
-
txStackCollateral(vault_id: number, callback?: any): Promise<void>;
|
|
16
|
-
resolveStacker(stacker_name: string): string;
|
|
17
|
-
txEnableWithdraw(vault_id: number, stacker_name: string, callback?: any): Promise<void>;
|
|
18
|
-
txWithdrawCollateral(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
19
|
-
txMintDebt(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
20
|
-
txBurnDebt(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
21
|
-
txCloseVault(vault_id: number, coll_token: string, coll_amount: string, debt_amount: string, callback?: any): Promise<void>;
|
|
22
|
-
txFinalLiquidation(vault_id: number, callback?: any): Promise<void>;
|
|
23
|
-
txUnliquidationDeposit(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
24
|
-
txUnliquidationBurn(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
25
|
-
txLiquidationWithdraw(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
26
|
-
txLiquidationBurn(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
27
|
-
txCloseVaultLiquidated(vault_id: number, coll_token: string, callback?: any): Promise<void>;
|
|
28
|
-
getDebtRatio(coll_amt: BigNumber, debt_amt: BigNumber, coll_token: string): Promise<any>;
|
|
29
|
-
getPrice(token: string): Promise<any>;
|
|
30
|
-
getStabilityFee(vault_id: string): Promise<any>;
|
|
31
|
-
}
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { StackswapAPI } from "../../index";
|
|
3
|
+
export declare class LbtcManager {
|
|
4
|
+
stackswap: StackswapAPI;
|
|
5
|
+
constructor(stackswap: StackswapAPI);
|
|
6
|
+
getPoxInfo(): Promise<any>;
|
|
7
|
+
getVaultTypeInfo(coll_type: string): Promise<any>;
|
|
8
|
+
getVaultIDFromUser(): Promise<any>;
|
|
9
|
+
getVaultInfoFromID(vault_id: string): Promise<any>;
|
|
10
|
+
getVaultIDFromUser2(): Promise<any>;
|
|
11
|
+
txCreateVaultWithSTX(coll_amt: BigNumber, debt_amt: BigNumber, coll_type: string, isStack: boolean, callback?: any): Promise<void>;
|
|
12
|
+
txCreateVaultWithSTSW(coll_amt: BigNumber, debt_amt: BigNumber, coll_type: string, callback?: any): Promise<void>;
|
|
13
|
+
txDepositCollateral(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
14
|
+
txToggleStacking(vault_id: number, callback?: any): Promise<void>;
|
|
15
|
+
txStackCollateral(vault_id: number, callback?: any): Promise<void>;
|
|
16
|
+
resolveStacker(stacker_name: string): string;
|
|
17
|
+
txEnableWithdraw(vault_id: number, stacker_name: string, callback?: any): Promise<void>;
|
|
18
|
+
txWithdrawCollateral(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
19
|
+
txMintDebt(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
20
|
+
txBurnDebt(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
21
|
+
txCloseVault(vault_id: number, coll_token: string, coll_amount: string, debt_amount: string, callback?: any): Promise<void>;
|
|
22
|
+
txFinalLiquidation(vault_id: number, callback?: any): Promise<void>;
|
|
23
|
+
txUnliquidationDeposit(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
24
|
+
txUnliquidationBurn(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
25
|
+
txLiquidationWithdraw(vault_id: number, coll_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
26
|
+
txLiquidationBurn(vault_id: number, debt_amt: BigNumber, coll_token: string, callback?: any): Promise<void>;
|
|
27
|
+
txCloseVaultLiquidated(vault_id: number, coll_token: string, callback?: any): Promise<void>;
|
|
28
|
+
getDebtRatio(coll_amt: BigNumber, debt_amt: BigNumber, coll_token: string): Promise<any>;
|
|
29
|
+
getPrice(token: string): Promise<any>;
|
|
30
|
+
getStabilityFee(vault_id: string): Promise<any>;
|
|
31
|
+
}
|