@evaafi/sdk 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/helpers.js +3 -2
- package/dist/api/math.d.ts +1 -10
- package/dist/api/math.js +26 -74
- package/dist/api/parser.d.ts +2 -1
- package/dist/api/parser.js +42 -56
- package/dist/api/prices.d.ts +2 -1
- package/dist/api/prices.js +29 -19
- package/dist/config.d.ts +1 -2
- package/dist/config.js +2 -3
- package/dist/constants/general.d.ts +7 -5
- package/dist/constants/general.js +29 -10
- package/dist/constants/pools.js +6 -3
- package/dist/constants.d.ts +35 -6
- package/dist/constants.js +47 -92
- package/dist/contracts/MasterContract.d.ts +8 -3
- package/dist/contracts/MasterContract.js +13 -8
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -1
- package/dist/types/Common.d.ts +9 -0
- package/dist/types/Master.d.ts +23 -4
- package/dist/types/User.d.ts +4 -1
- package/dist/utils/merkleProof.js +4 -3
- package/dist/utils/priceUtils.d.ts +2 -2
- package/dist/utils/priceUtils.js +16 -16
- package/dist/utils/sha256BigInt.js +2 -1
- package/dist/utils/tonConnectSender.js +3 -2
- package/dist/utils/userJettonWallet.js +2 -1
- package/dist/utils/utils.js +2 -1
- package/package.json +2 -2
- package/src/api/math.ts +16 -80
- package/src/api/parser.ts +33 -51
- package/src/api/prices.ts +33 -57
- package/src/config.ts +1 -0
- package/src/constants/general.ts +32 -9
- package/src/constants/pools.ts +7 -4
- package/src/contracts/MasterContract.ts +22 -17
- package/src/index.ts +4 -0
- package/src/types/Common.ts +10 -0
- package/src/types/Master.ts +23 -9
- package/src/types/User.ts +2 -3
- package/src/utils/merkleProof.ts +141 -0
- package/src/utils/priceUtils.ts +177 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FEES = exports.OPCODES = exports.JETTON_WALLET_STANDART_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE = exports.LENDING_CODE = exports.
|
|
3
|
+
exports.FEES = exports.OPCODES = exports.JETTON_WALLET_STANDART_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE = exports.LENDING_CODE = exports.ORACLES_LP = exports.ORACLES_TESTNET = exports.ORACLES_MAINNET = exports.EVAA_LP_MAINNET_VERSION = exports.EVAA_LP_MAINNET = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = exports.NULL_ADDRESS = exports.MASTER_CONSTANTS = void 0;
|
|
4
4
|
const core_1 = require("@ton/core");
|
|
5
5
|
exports.MASTER_CONSTANTS = {
|
|
6
6
|
FACTOR_SCALE: BigInt(1e12),
|
|
@@ -14,13 +14,32 @@ exports.MASTER_CONSTANTS = {
|
|
|
14
14
|
};
|
|
15
15
|
exports.NULL_ADDRESS = core_1.Address.parse('UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ');
|
|
16
16
|
exports.EVAA_MASTER_MAINNET = core_1.Address.parse('EQC8rUZqR_pWV1BylWUlPNBzyiTYVoBEmQkMIQDZXICfnuRr');
|
|
17
|
-
exports.MAINNET_VERSION =
|
|
18
|
-
exports.EVAA_MASTER_TESTNET = core_1.Address.parse('
|
|
19
|
-
exports.TESTNET_VERSION =
|
|
17
|
+
exports.MAINNET_VERSION = 6;
|
|
18
|
+
exports.EVAA_MASTER_TESTNET = core_1.Address.parse('EQDLsg3w-iBj26Gww7neYoJAxiT2t77Zo8ro56b0yuHsPp3C');
|
|
19
|
+
exports.TESTNET_VERSION = 0;
|
|
20
20
|
exports.EVAA_LP_MAINNET = core_1.Address.parse('EQBIlZX2URWkXCSg3QF2MJZU-wC5XkBoLww-hdWk2G37Jc6N');
|
|
21
|
-
exports.EVAA_LP_MAINNET_VERSION =
|
|
22
|
-
exports.
|
|
23
|
-
|
|
21
|
+
exports.EVAA_LP_MAINNET_VERSION = 2;
|
|
22
|
+
exports.ORACLES_MAINNET = [
|
|
23
|
+
{ id: 0, address: '0xd3a8c0b9fd44fd25a49289c631e3ac45689281f2f8cf0744400b4c65bed38e5d' },
|
|
24
|
+
{ id: 1, address: '0x2c21cabdaa89739de16bde7bc44e86401fac334a3c7e55305fe5e7563043e191' },
|
|
25
|
+
{ id: 2, address: '0x2eb258ce7b5d02466ab8a178ad8b0ba6ffa7b58ef21de3dc3b6dd359a1e16af0' },
|
|
26
|
+
{ id: 3, address: '0xf9a0769954b4430bca95149fb3d876deb7799d8f74852e0ad4ccc5778ce68b52' },
|
|
27
|
+
];
|
|
28
|
+
exports.ORACLES_TESTNET = [
|
|
29
|
+
{ id: 0, address: '0x3bb147a37b7a7f874c39320440f352bddd2c9337e31a778731910f0266391650' },
|
|
30
|
+
{ id: 1, address: '0x676767e93b05a21aec9023a65f73cffe1c725709c3c964a7c3f0fd4229089bfe' },
|
|
31
|
+
{ id: 2, address: '0x9c9e65951b0c5920c286bdb3410babcaf21f85bc9c90c13172988630f1244e0f' },
|
|
32
|
+
{ id: 3, address: '0x9dcf880229bfb68d7344fd294624b64f1e0b43b9d858f0fdb1bc6434616c08f5' },
|
|
33
|
+
{ id: 4, address: '0x4d1afcf7c0426ca61c405c8cfaef0053a0f0d143740ffed04c8716beb99cd614' },
|
|
34
|
+
{ id: 5, address: '0x11c6baa608ed10733051fd74134441d384e471722fbc496b43ea4e3c6652485f' },
|
|
35
|
+
{ id: 6, address: '0x2b685672f38dc2fce59013bb740bf24c6037049a1c267bb3b5f6f55d5b195f5f' },
|
|
36
|
+
];
|
|
37
|
+
exports.ORACLES_LP = [
|
|
38
|
+
{ id: 0, address: '0xd3a8c0b9fd44fd25a49289c631e3ac45689281f2f8cf0744400b4c65bed38e5d' },
|
|
39
|
+
{ id: 1, address: '0x2c21cabdaa89739de16bde7bc44e86401fac334a3c7e55305fe5e7563043e191' },
|
|
40
|
+
{ id: 2, address: '0x2eb258ce7b5d02466ab8a178ad8b0ba6ffa7b58ef21de3dc3b6dd359a1e16af0' },
|
|
41
|
+
{ id: 3, address: '0xf9a0769954b4430bca95149fb3d876deb7799d8f74852e0ad4ccc5778ce68b52' },
|
|
42
|
+
];
|
|
24
43
|
exports.LENDING_CODE = core_1.Cell.fromBoc(Buffer.from('b5ee9c72c1010e0100fd000d12182a555a6065717691969efd0114ff00f4a413f4bcf2c80b010202c8050202039f740403001ff2f8276a2687d2018fd201800f883b840051d38642c678b64e4400780e58fc10802faf07f80e59fa801e78b096664c02078067c07c100627a7978402014807060007a0ddb0c60201c709080013a0fd007a026900aa90400201200b0a0031b8e1002191960aa00b9e2ca007f4042796d225e8019203f6010201200d0c000bf7c147d2218400b9d10e86981fd201840b07f8138d809797976a2687d2029116382f970fd9178089910374daf81b619fd20182c7883b8701981684100627910eba56001797a6a6ba610fd8200e8768f76a9f6aa00cc2a32a8292878809bef2f1889f883bbcdeb86f01', 'hex'))[0];
|
|
25
44
|
exports.JETTON_WALLET_STANDART_CODE = core_1.Cell.fromBase64('te6cckECEwEAA4UAART/APSkE/S88sgLAQIBYgIDAgLLBAUAG6D2BdqJofQB9IH0gamjAgHOBgcCAVgKCwL3CDHAJJfBOAB0NMDAXGwlRNfA/Ad4PpA+kAx+gAxcdch+gAx+gAwc6m0AALTHwHbPFsyNDQ0JIIQD4p+pbqaMGwiNl4xECPwGuAkghAXjUUZupswbCJeMhAkQwDwG+A3WzaCEFlfB7y6nwJxsPLSwFAjuvLixgHwHOBfBYAgJABE+kQwwADy4U2AAXIBP+DMgbpUwgLH4M94gbvLSmtDTBzHT/9P/9ATTB9Qw0PoA+gD6APoA+gD6ADAACIQP8vACAVgMDQIBSBESAfcBdM/AQH6APpAIfAB7UTQ+gD6QPpA1NFRNqFSLMcF8uLBKsL/8uLCVDRCcFQgE1QUA8hQBPoCWM8WAc8WzMkiyMsBEvQA9ADLAMkgcAH5AHTIywISygfL/8nQBPpA9AQx+gAg10nCAPLixMiAGAHLBVAHzxZw+gJ3ActrgDgLzO1E0PoA+kD6QNTRCtM/AQH6AFFRoAX6QPpAU13HBVRzb3BUIBNUFAPIUAT6AljPFgHPFszJIsjLARL0APQAywDJcAH5AHTIywISygfL/8nQUA/HBR6x8uLDDPoAUcqhKbYIGaFQB6AYoSaSbFXjDSXXCwHDACHCALCAPEACqE8zIghAXjUUZWAoCyx/LP1AH+gIizxZQBs8WJfoCUAPPFslQBcwjkXKRceJQB6gToAiqAFAEoBegFLzy4sUByYBA+wBDAMhQBPoCWM8WAc8WzMntVAByUmmgGKHIghBzYtCcKQLLH8s/UAf6AlAEzxZQB88WyciAEAHLBSfPFlAE+gJxActqE8zJcfsAUEITAHSOI8iAEAHLBVAGzxZQBfoCcAHLaoIQ1TJ221gFAssfyz/JcvsAklsz4kADyFAE+gJYzxYBzxbMye1UAOs7UTQ+gD6QPpA1NEF0z8BAfoAIcIA8uLC+kD0BAHQ05/RAdFRYqFSWMcF8uLBJsL/8uLCyIIQe92X3lgEAssfyz8B+gIjzxYBzxYTy5/JyIAYAcsFI88WcPoCcQHLaszJgED7AEATyFAE+gJYzxYBzxbMye1UgAIcgCDXIe1E0PoA+kD6QNTRBNMfAYQPIYIQF41FGboCghB73ZfeuhKx8vTTPwEw+gAwE6BQI8hQBPoCWM8WAc8WzMntVINjFu1o=');
|
|
26
45
|
exports.JETTON_WALLET_STANDART_CODE_TESTNET = core_1.Cell.fromBase64('te6cckECEQEAAyMAART/APSkE/S88sgLAQIBYgIDAgLMBAUAG6D2BdqJofQB9IH0gahhAgHUBgcCASAICQDDCDHAJJfBOAB0NMDAXGwlRNfA/AM4PpA+kAx+gAxcdch+gAx+gAwc6m0AALTH4IQD4p+pVIgupUxNFnwCeCCEBeNRRlSILqWMUREA/AK4DWCEFlfB7y6k1nwC+BfBIQP8vCAAET6RDBwuvLhTYAIBIAoLAIPUAQa5D2omh9AH0gfSBqGAJpj8EIC8aijKkQXUEIPe7L7wndCVj5cWLpn5j9ABgJ0CgR5CgCfQEsZ4sA54tmZPaqQB8VA9M/+gD6QCHwAe1E0PoA+kD6QNQwUTahUirHBfLiwSjC//LiwlQ0QnBUIBNUFAPIUAT6AljPFgHPFszJIsjLARL0APQAywDJIPkAcHTIywLKB8v/ydAE+kD0BDH6ACDXScIA8uLEd4AYyMsFUAjPFnD6AhfLaxPMgMAgEgDQ4AnoIQF41FGcjLHxnLP1AH+gIizxZQBs8WJfoCUAPPFslQBcwjkXKRceJQCKgToIIJycOAoBS88uLFBMmAQPsAECPIUAT6AljPFgHPFszJ7VQC9ztRND6APpA+kDUMAjTP/oAUVGgBfpA+kBTW8cFVHNtcFQgE1QUA8hQBPoCWM8WAc8WzMkiyMsBEvQA9ADLAMn5AHB0yMsCygfL/8nQUA3HBRyx8uLDCvoAUaihggiYloBmtgihggiYloCgGKEnlxBJEDg3XwTjDSXXCwGAPEADXO1E0PoA+kD6QNQwB9M/+gD6QDBRUaFSSccF8uLBJ8L/8uLCBYIJMS0AoBa88uLDghB73ZfeyMsfFcs/UAP6AiLPFgHPFslxgBjIywUkzxZw+gLLaszJgED7AEATyFAE+gJYzxYBzxbMye1UgAHBSeaAYoYIQc2LQnMjLH1Iwyz9Y+gJQB88WUAfPFslxgBDIywUkzxZQBvoCFctqFMzJcfsAECQQIwB8wwAjwgCwjiGCENUydttwgBDIywVQCM8WUAT6AhbLahLLHxLLP8ly+wCTNWwh4gPIUAT6AljPFgHPFszJ7VSV6u3X');
|
|
@@ -33,9 +52,9 @@ exports.OPCODES = {
|
|
|
33
52
|
};
|
|
34
53
|
exports.FEES = {
|
|
35
54
|
SUPPLY: (0, core_1.toNano)('0.3'),
|
|
36
|
-
WITHDRAW: (0, core_1.toNano)('0.
|
|
37
|
-
SUPPLY_JETTON: (0, core_1.toNano)('0.
|
|
38
|
-
SUPPLY_JETTON_FWD: (0, core_1.toNano)('0.
|
|
55
|
+
WITHDRAW: (0, core_1.toNano)('0.35'),
|
|
56
|
+
SUPPLY_JETTON: (0, core_1.toNano)('0.35'),
|
|
57
|
+
SUPPLY_JETTON_FWD: (0, core_1.toNano)('0.3'),
|
|
39
58
|
LIQUIDATION: (0, core_1.toNano)('0.8'),
|
|
40
59
|
LIQUIDATION_JETTON: (0, core_1.toNano)('1'),
|
|
41
60
|
LIQUIDATION_JETTON_FWD: (0, core_1.toNano)('0.8'),
|
package/dist/constants/pools.js
CHANGED
|
@@ -7,7 +7,8 @@ exports.MAINNET_POOL_CONFIG = {
|
|
|
7
7
|
masterAddress: general_1.EVAA_MASTER_MAINNET,
|
|
8
8
|
masterVersion: general_1.MAINNET_VERSION,
|
|
9
9
|
masterConstants: general_1.MASTER_CONSTANTS,
|
|
10
|
-
|
|
10
|
+
oracles: general_1.ORACLES_MAINNET,
|
|
11
|
+
minimalOracles: 3,
|
|
11
12
|
poolAssetsConfig: [
|
|
12
13
|
assets_1.TON_MAINNET,
|
|
13
14
|
assets_1.JUSDT_MAINNET,
|
|
@@ -22,7 +23,8 @@ exports.TESTNET_POOL_CONFIG = {
|
|
|
22
23
|
masterAddress: general_1.EVAA_MASTER_TESTNET,
|
|
23
24
|
masterVersion: general_1.TESTNET_VERSION,
|
|
24
25
|
masterConstants: general_1.MASTER_CONSTANTS,
|
|
25
|
-
|
|
26
|
+
oracles: general_1.ORACLES_TESTNET,
|
|
27
|
+
minimalOracles: 5,
|
|
26
28
|
poolAssetsConfig: [
|
|
27
29
|
assets_1.TON_MAINNET,
|
|
28
30
|
assets_1.JUSDT_TESTNET,
|
|
@@ -35,7 +37,8 @@ exports.MAINNET_LP_POOL_CONFIG = {
|
|
|
35
37
|
masterAddress: general_1.EVAA_LP_MAINNET,
|
|
36
38
|
masterVersion: general_1.EVAA_LP_MAINNET_VERSION,
|
|
37
39
|
masterConstants: general_1.MASTER_CONSTANTS,
|
|
38
|
-
|
|
40
|
+
oracles: general_1.ORACLES_LP,
|
|
41
|
+
minimalOracles: 3,
|
|
39
42
|
poolAssetsConfig: [
|
|
40
43
|
assets_1.TON_MAINNET,
|
|
41
44
|
assets_1.USDT_MAINNET,
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address, Cell } from '@ton/core';
|
|
2
|
-
import { OracleNFT
|
|
2
|
+
import { OracleNFT } from './types/Master';
|
|
3
3
|
export declare const EVAA_MASTER_MAINNET: Address;
|
|
4
|
-
export declare const MAINNET_VERSION =
|
|
4
|
+
export declare const MAINNET_VERSION = 0;
|
|
5
5
|
export declare const EVAA_MASTER_TESTNET: Address;
|
|
6
|
-
export declare const TESTNET_VERSION =
|
|
6
|
+
export declare const TESTNET_VERSION = 6;
|
|
7
7
|
export declare const ORACLE_NFTS: OracleNFT[];
|
|
8
8
|
export declare const MAINNET_ASSETS_ID: {
|
|
9
9
|
TON: bigint;
|
|
@@ -11,7 +11,6 @@ export declare const MAINNET_ASSETS_ID: {
|
|
|
11
11
|
jUSDC: bigint;
|
|
12
12
|
stTON: bigint;
|
|
13
13
|
tsTON: bigint;
|
|
14
|
-
USDT: bigint;
|
|
15
14
|
};
|
|
16
15
|
export declare const TESTNET_ASSETS_ID: {
|
|
17
16
|
TON: bigint;
|
|
@@ -19,9 +18,39 @@ export declare const TESTNET_ASSETS_ID: {
|
|
|
19
18
|
jUSDC: bigint;
|
|
20
19
|
stTON: bigint;
|
|
21
20
|
};
|
|
21
|
+
export declare const JETTON_MASTER_ADDRESSES: {
|
|
22
|
+
jUSDT_MAINNET: Address;
|
|
23
|
+
jUSDT_TESTNET: Address;
|
|
24
|
+
jUSDC_MAINNET: Address;
|
|
25
|
+
jUSDC_TESTNET: Address;
|
|
26
|
+
stTON_MAINNET: Address;
|
|
27
|
+
stTON_TESTNET: Address;
|
|
28
|
+
tsTON_MAINNET: Address;
|
|
29
|
+
tsTON_TESTNET: null;
|
|
30
|
+
USDT_MAINNET: Address;
|
|
31
|
+
USDT_TESTNET: null;
|
|
32
|
+
};
|
|
33
|
+
export declare const MASTER_CONSTANTS: {
|
|
34
|
+
FACTOR_SCALE: bigint;
|
|
35
|
+
ASSET_COEFFICIENT_SCALE: bigint;
|
|
36
|
+
ASSET_PRICE_SCALE: bigint;
|
|
37
|
+
ASSET_RESERVE_FACTOR_SCALE: bigint;
|
|
38
|
+
ASSET_LIQUIDATION_RESERVE_FACTOR_SCALE: bigint;
|
|
39
|
+
ASSET_ORIGINATION_FEE_SCALE: bigint;
|
|
40
|
+
};
|
|
22
41
|
export declare const LENDING_CODE: Cell;
|
|
23
|
-
export declare const
|
|
24
|
-
|
|
42
|
+
export declare const JETTON_WALLETS_CODE: {
|
|
43
|
+
jUSDT_MAINNET: Cell;
|
|
44
|
+
jUSDT_TESTNET: Cell;
|
|
45
|
+
jUSDC_MAINNET: Cell;
|
|
46
|
+
jUSDC_TESTNET: Cell;
|
|
47
|
+
stTON_MAINNET: Cell;
|
|
48
|
+
stTON_TESTNET: Cell;
|
|
49
|
+
tsTON_MAINNET: Cell;
|
|
50
|
+
tsTON_TESTNET: null;
|
|
51
|
+
USDT_MAINNET: Cell;
|
|
52
|
+
USDT_TESTNET: null;
|
|
53
|
+
};
|
|
25
54
|
export declare const OPCODES: {
|
|
26
55
|
SUPPLY: number;
|
|
27
56
|
WITHDRAW: number;
|
package/dist/constants.js
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FEES = exports.OPCODES = exports.
|
|
3
|
+
exports.FEES = exports.OPCODES = exports.JETTON_WALLETS_CODE = exports.LENDING_CODE = exports.MASTER_CONSTANTS = exports.JETTON_MASTER_ADDRESSES = exports.TESTNET_ASSETS_ID = exports.MAINNET_ASSETS_ID = exports.ORACLE_NFTS = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = void 0;
|
|
4
4
|
const core_1 = require("@ton/core");
|
|
5
5
|
const sha256BigInt_1 = require("./utils/sha256BigInt");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.TESTNET_VERSION = 0;
|
|
18
|
-
exports.ORACLE_NFTS = [{ id: 0, address: '0x3bb147a37b7a7f874c39320440f352bddd2c9337e31a778731910f0266391650' },
|
|
19
|
-
{ id: 1, address: '0x676767e93b05a21aec9023a65f73cffe1c725709c3c964a7c3f0fd4229089bfe' },
|
|
20
|
-
{ id: 2, address: '0x9c9e65951b0c5920c286bdb3410babcaf21f85bc9c90c13172988630f1244e0f' },
|
|
21
|
-
{ id: 3, address: '0x9dcf880229bfb68d7344fd294624b64f1e0b43b9d858f0fdb1bc6434616c08f5' },
|
|
22
|
-
{ id: 4, address: '0x4d1afcf7c0426ca61c405c8cfaef0053a0f0d143740ffed04c8716beb99cd614' },
|
|
23
|
-
{ id: 5, address: '0x11c6baa608ed10733051fd74134441d384e471722fbc496b43ea4e3c6652485f' },
|
|
24
|
-
{ id: 6, address: '0x2b685672f38dc2fce59013bb740bf24c6037049a1c267bb3b5f6f55d5b195f5f' },
|
|
6
|
+
//todo set back to EQC8rUZqR_pWV1BylWUlPNBzyiTYVoBEmQkMIQDZXICfnuRr
|
|
7
|
+
exports.EVAA_MASTER_MAINNET = core_1.Address.parse('EQC_hR5L4G3vkPG0VODURYoohp_3hlMW-gZiGp89HwyulZK4');
|
|
8
|
+
//todo set back to 5 (todo set at 6 on 10.10.2024)
|
|
9
|
+
exports.MAINNET_VERSION = 0;
|
|
10
|
+
exports.EVAA_MASTER_TESTNET = core_1.Address.parse('kQC92pF4XWatZY9-ZS6SGW6s-dCpjk9NtEkdXQ7vFHJUAdT9');
|
|
11
|
+
exports.TESTNET_VERSION = 6;
|
|
12
|
+
exports.ORACLE_NFTS = [
|
|
13
|
+
{ id: 0, address: '0xd3a8c0b9fd44fd25a49289c631e3ac45689281f2f8cf0744400b4c65bed38e5d' },
|
|
14
|
+
{ id: 1, address: '0x2c21cabdaa89739de16bde7bc44e86401fac334a3c7e55305fe5e7563043e191' },
|
|
15
|
+
{ id: 2, address: '0x2eb258ce7b5d02466ab8a178ad8b0ba6ffa7b58ef21de3dc3b6dd359a1e16af0' },
|
|
16
|
+
{ id: 3, address: '0xf9a0769954b4430bca95149fb3d876deb7799d8f74852e0ad4ccc5778ce68b52' },
|
|
25
17
|
];
|
|
26
18
|
exports.MAINNET_ASSETS_ID = {
|
|
27
19
|
TON: (0, sha256BigInt_1.sha256Hash)('TON'),
|
|
@@ -29,86 +21,49 @@ exports.MAINNET_ASSETS_ID = {
|
|
|
29
21
|
jUSDC: (0, sha256BigInt_1.sha256Hash)('jUSDC'),
|
|
30
22
|
stTON: (0, sha256BigInt_1.sha256Hash)('stTON'),
|
|
31
23
|
tsTON: (0, sha256BigInt_1.sha256Hash)('tsTON'),
|
|
32
|
-
|
|
24
|
+
//todo uncomment
|
|
25
|
+
// USDT: sha256Hash('USDT'),
|
|
33
26
|
};
|
|
34
27
|
exports.TESTNET_ASSETS_ID = {
|
|
35
28
|
TON: (0, sha256BigInt_1.sha256Hash)('TON'),
|
|
36
29
|
jUSDT: (0, sha256BigInt_1.sha256Hash)('jUSDT'),
|
|
37
30
|
jUSDC: (0, sha256BigInt_1.sha256Hash)('jUSDC'),
|
|
38
31
|
stTON: (0, sha256BigInt_1.sha256Hash)('stTON'),
|
|
32
|
+
// tsTON: sha256Hash('tsTON'),
|
|
33
|
+
// USDT: sha256Hash('USDT'),
|
|
39
34
|
};
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
name: 'jUSDT',
|
|
52
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('jUSDT'),
|
|
53
|
-
jettonMasterAddress: core_1.Address.parse('EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA'),
|
|
54
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021301000385000114ff00f4a413f4bcf2c80b0102016202030202cb0405001ba0f605da89a1f401f481f481a9a30201ce06070201580a0b02f70831c02497c138007434c0c05c6c2544d7c0fc07783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c076cf16cc8d0d0d09208403e29fa96ea68c1b088d978c4408fc06b809208405e351466ea6cc1b08978c840910c03c06f80dd6cda0841657c1ef2ea7c09c6c3cb4b01408eebcb8b1807c073817c160080900113e910c30003cb85360005c804ff833206e953080b1f833de206ef2d29ad0d30731d3ffd3fff404d307d430d0fa00fa00fa00fa00fa00fa00300008840ff2f00201580c0d020148111201f70174cfc0407e803e90087c007b51343e803e903e903534544da8548b31c17cb8b04ab0bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032481c007e401d3232c084b281f2fff274013e903d010c7e800835d270803cb8b13220060072c15401f3c59c3e809dc072dae00e02f33b51343e803e903e90353442b4cfc0407e80145468017e903e9014d771c1551cdbdc150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0325c007e401d3232c084b281f2fff2741403f1c147ac7cb8b0c33e801472a84a6d8206685401e8062849a49b1578c34975c2c070c00870802c200f1000aa13ccc88210178d4519580a02cb1fcb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25007a813a008aa005004a017a014bcf2e2c501c98040fb004300c85004fa0258cf1601cf16ccc9ed5400725269a018a1c882107362d09c2902cb1fcb3f5007fa025004cf165007cf16c9c8801001cb0527cf165004fa027101cb6a13ccc971fb0050421300748e23c8801001cb055006cf165005fa027001cb6a8210d53276db580502cb1fcb3fc972fb00925b33e24003c85004fa0258cf1601cf16ccc9ed5400eb3b51343e803e903e9035344174cfc0407e800870803cb8b0be903d01007434e7f440745458a8549631c17cb8b049b0bffcb8b0b220841ef765f7960100b2c7f2cfc07e8088f3c58073c584f2e7f27220060072c148f3c59c3e809c4072dab33260103ec01004f214013e809633c58073c5b3327b55200087200835c87b51343e803e903e9035344134c7c06103c8608405e351466e80a0841ef765f7ae84ac7cbd34cfc04c3e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
55
|
-
},
|
|
56
|
-
jUSDC: {
|
|
57
|
-
name: 'jUSDC',
|
|
58
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('jUSDC'),
|
|
59
|
-
jettonMasterAddress: core_1.Address.parse('EQB-MPwrd1G6WKNkLz_VnV6WqBDd142KMQv-g1O-8QUA3728'),
|
|
60
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021301000385000114ff00f4a413f4bcf2c80b0102016202030202cb0405001ba0f605da89a1f401f481f481a9a30201ce06070201580a0b02f70831c02497c138007434c0c05c6c2544d7c0fc07783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c076cf16cc8d0d0d09208403e29fa96ea68c1b088d978c4408fc06b809208405e351466ea6cc1b08978c840910c03c06f80dd6cda0841657c1ef2ea7c09c6c3cb4b01408eebcb8b1807c073817c160080900113e910c30003cb85360005c804ff833206e953080b1f833de206ef2d29ad0d30731d3ffd3fff404d307d430d0fa00fa00fa00fa00fa00fa00300008840ff2f00201580c0d020148111201f70174cfc0407e803e90087c007b51343e803e903e903534544da8548b31c17cb8b04ab0bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032481c007e401d3232c084b281f2fff274013e903d010c7e800835d270803cb8b13220060072c15401f3c59c3e809dc072dae00e02f33b51343e803e903e90353442b4cfc0407e80145468017e903e9014d771c1551cdbdc150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0325c007e401d3232c084b281f2fff2741403f1c147ac7cb8b0c33e801472a84a6d8206685401e8062849a49b1578c34975c2c070c00870802c200f1000aa13ccc88210178d4519580a02cb1fcb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25007a813a008aa005004a017a014bcf2e2c501c98040fb004300c85004fa0258cf1601cf16ccc9ed5400725269a018a1c882107362d09c2902cb1fcb3f5007fa025004cf165007cf16c9c8801001cb0527cf165004fa027101cb6a13ccc971fb0050421300748e23c8801001cb055006cf165005fa027001cb6a8210d53276db580502cb1fcb3fc972fb00925b33e24003c85004fa0258cf1601cf16ccc9ed5400eb3b51343e803e903e9035344174cfc0407e800870803cb8b0be903d01007434e7f440745458a8549631c17cb8b049b0bffcb8b0b220841ef765f7960100b2c7f2cfc07e8088f3c58073c584f2e7f27220060072c148f3c59c3e809c4072dab33260103ec01004f214013e809633c58073c5b3327b55200087200835c87b51343e803e903e9035344134c7c06103c8608405e351466e80a0841ef765f7ae84ac7cbd34cfc04c3e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
61
|
-
},
|
|
62
|
-
stTON: {
|
|
63
|
-
name: 'stTON',
|
|
64
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('stTON'),
|
|
65
|
-
jettonMasterAddress: core_1.Address.parse('EQDNhy-nxYFgUqzfUzImBEP67JqsyMIcyk2S5_RwNNEYku0k'),
|
|
66
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021201000362000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120090a01cf0831c02497c138007434c0c05c6c2544d7c0fc03783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c8608403e29fa96ea54c4d167c02b808608405e351466ea58c511100fc02f80860841657c1ef2ea54c4d167c03380517c1300138c08c2103fcbc200800113e910c30003cb85360007ced44d0fa00fa40fa40d43010235f03018208989680a16d801072226eb32091719170e203c8cb055006cf165004fa02cb6a039358cc019130e201c901fb000201580b0c020148101101f100f4cffe803e90087c007b51343e803e903e90350c144da8548ab1c17cb8b04a30bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032483e401c1d3232c0b281f2fff274013e903d010c7e800835d270803cb8b11de0063232c1540233c59c3e8085f2dac4f3200d02f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad8228608239387028062849e5c412440e0dd7c138c34975c2c0600e0f009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a0820a625a00a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed5400c90c3b51343e803e903e90350c01b4cffe800c145128548df1c17cb8b04970bffcb8b0812082e4e1c02fbcb8b160841ef765f7b232c7c532cfd63e808873c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b55200081200835c87b51343e803e903e90350c0134c7c8608405e351466e80a0841ef765f7ae84ac7cb83234cfcc7e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
67
|
-
},
|
|
68
|
-
tsTON: {
|
|
69
|
-
name: 'tsTON',
|
|
70
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('tsTON'),
|
|
71
|
-
jettonMasterAddress: core_1.Address.parse('EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav'),
|
|
72
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c720101010100230000420212bebb0dc8e202b7e26f721e2547e16bb9ebaec934f657d19f22e76d62bec878', 'hex'))[0],
|
|
73
|
-
},
|
|
74
|
-
USDT: {
|
|
75
|
-
name: 'USDT',
|
|
76
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('USDT'),
|
|
77
|
-
jettonMasterAddress: core_1.Address.parse('EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'),
|
|
78
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c72010101010023000042028f452d7a4dfd74066b682365177259ed05734435be76b5fd4bd5d8af2b7c3d68', 'hex'))[0],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
lendingCode: exports.LENDING_CODE
|
|
35
|
+
exports.JETTON_MASTER_ADDRESSES = {
|
|
36
|
+
jUSDT_MAINNET: core_1.Address.parse('EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA'),
|
|
37
|
+
jUSDT_TESTNET: core_1.Address.parse('kQBe4gtSQMxM5RpMYLr4ydNY72F8JkY-icZXG1NJcsju8XM7'),
|
|
38
|
+
jUSDC_MAINNET: core_1.Address.parse('EQB-MPwrd1G6WKNkLz_VnV6WqBDd142KMQv-g1O-8QUA3728'),
|
|
39
|
+
jUSDC_TESTNET: core_1.Address.parse('kQDaY5yUatYnHei73HBqRX_Ox9LK2XnR7XuCY9MFC2INbfYI'),
|
|
40
|
+
stTON_MAINNET: core_1.Address.parse('EQDNhy-nxYFgUqzfUzImBEP67JqsyMIcyk2S5_RwNNEYku0k'),
|
|
41
|
+
stTON_TESTNET: core_1.Address.parse('kQC3Duw3dg8k98xf5S7Bm7YOWVJ5QW8hm3iLqFfJfa_g9h07'),
|
|
42
|
+
tsTON_MAINNET: core_1.Address.parse('EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav'),
|
|
43
|
+
tsTON_TESTNET: null,
|
|
44
|
+
USDT_MAINNET: core_1.Address.parse('EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'),
|
|
45
|
+
USDT_TESTNET: null,
|
|
82
46
|
};
|
|
83
|
-
exports.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
stTON: {
|
|
105
|
-
name: 'stTON',
|
|
106
|
-
assetId: (0, sha256BigInt_1.sha256Hash)('stTON'),
|
|
107
|
-
jettonMasterAddress: core_1.Address.parse('kQC3Duw3dg8k98xf5S7Bm7YOWVJ5QW8hm3iLqFfJfa_g9h07'),
|
|
108
|
-
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021201000362000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120090a01cf0831c02497c138007434c0c05c6c2544d7c0fc03383e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c8608403e29fa96ea54c4d167c027808608405e351466ea58c511100fc02b80860841657c1ef2ea54c4d167c02f80517c1300138c08c2103fcbc200800113e910c30003cb85360007ced44d0fa00fa40fa40d43010235f03018208989680a16d801072226eb32091719170e203c8cb055006cf165004fa02cb6a039358cc019130e201c901fb000201200b0c0081d40106b90f6a2687d007d207d206a1802698f90c1080bc6a28cdd0141083deecbef5d0958f97064699f98fd001809d02811e428027d012c678b00e78b6664f6aa401f1503d33ffa00fa4021f001ed44d0fa00fa40fa40d4305136a1522ac705f2e2c128c2fff2e2c254344270542013541403c85004fa0258cf1601cf16ccc922c8cb0112f400f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f40431fa0020d749c200f2e2c4778018c8cb055008cf1670fa0217cb6b13cc80d0201200e0f009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a0820a625a00a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5402f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad8228608239387028062849e5c412440e0dd7c138c34975c2c060101100c90c3b51343e803e903e90350c01b4cffe800c145128548df1c17cb8b04970bffcb8b0812082e4e1c02fbcb8b160841ef765f7b232c7c532cfd63e808873c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552000705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54', 'hex'))[0],
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
lendingCode: exports.LENDING_CODE
|
|
47
|
+
exports.MASTER_CONSTANTS = {
|
|
48
|
+
FACTOR_SCALE: BigInt(1e12),
|
|
49
|
+
ASSET_COEFFICIENT_SCALE: 10000n,
|
|
50
|
+
ASSET_PRICE_SCALE: BigInt(1e8),
|
|
51
|
+
ASSET_RESERVE_FACTOR_SCALE: 10000n,
|
|
52
|
+
ASSET_LIQUIDATION_RESERVE_FACTOR_SCALE: 10000n,
|
|
53
|
+
ASSET_ORIGINATION_FEE_SCALE: BigInt(1e9)
|
|
54
|
+
};
|
|
55
|
+
exports.LENDING_CODE = core_1.Cell.fromBoc(Buffer.from('b5ee9c72c1010e0100fd000d12182a555a6065717691969efd0114ff00f4a413f4bcf2c80b010202c8050202039f740403001ff2f8276a2687d2018fd201800f883b840051d38642c678b64e4400780e58fc10802faf07f80e59fa801e78b096664c02078067c07c100627a7978402014807060007a0ddb0c60201c709080013a0fd007a026900aa90400201200b0a0031b8e1002191960aa00b9e2ca007f4042796d225e8019203f6010201200d0c000bf7c147d2218400b9d10e86981fd201840b07f8138d809797976a2687d2029116382f970fd9178089910374daf81b619fd20182c7883b8701981684100627910eba56001797a6a6ba610fd8200e8768f76a9f6aa00cc2a32a8292878809bef2f1889f883bbcdeb86f01', 'hex'))[0];
|
|
56
|
+
exports.JETTON_WALLETS_CODE = {
|
|
57
|
+
jUSDT_MAINNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021301000385000114ff00f4a413f4bcf2c80b0102016202030202cb0405001ba0f605da89a1f401f481f481a9a30201ce06070201580a0b02f70831c02497c138007434c0c05c6c2544d7c0fc07783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c076cf16cc8d0d0d09208403e29fa96ea68c1b088d978c4408fc06b809208405e351466ea6cc1b08978c840910c03c06f80dd6cda0841657c1ef2ea7c09c6c3cb4b01408eebcb8b1807c073817c160080900113e910c30003cb85360005c804ff833206e953080b1f833de206ef2d29ad0d30731d3ffd3fff404d307d430d0fa00fa00fa00fa00fa00fa00300008840ff2f00201580c0d020148111201f70174cfc0407e803e90087c007b51343e803e903e903534544da8548b31c17cb8b04ab0bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032481c007e401d3232c084b281f2fff274013e903d010c7e800835d270803cb8b13220060072c15401f3c59c3e809dc072dae00e02f33b51343e803e903e90353442b4cfc0407e80145468017e903e9014d771c1551cdbdc150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0325c007e401d3232c084b281f2fff2741403f1c147ac7cb8b0c33e801472a84a6d8206685401e8062849a49b1578c34975c2c070c00870802c200f1000aa13ccc88210178d4519580a02cb1fcb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25007a813a008aa005004a017a014bcf2e2c501c98040fb004300c85004fa0258cf1601cf16ccc9ed5400725269a018a1c882107362d09c2902cb1fcb3f5007fa025004cf165007cf16c9c8801001cb0527cf165004fa027101cb6a13ccc971fb0050421300748e23c8801001cb055006cf165005fa027001cb6a8210d53276db580502cb1fcb3fc972fb00925b33e24003c85004fa0258cf1601cf16ccc9ed5400eb3b51343e803e903e9035344174cfc0407e800870803cb8b0be903d01007434e7f440745458a8549631c17cb8b049b0bffcb8b0b220841ef765f7960100b2c7f2cfc07e8088f3c58073c584f2e7f27220060072c148f3c59c3e809c4072dab33260103ec01004f214013e809633c58073c5b3327b55200087200835c87b51343e803e903e9035344134c7c06103c8608405e351466e80a0841ef765f7ae84ac7cbd34cfc04c3e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
58
|
+
jUSDT_TESTNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021101000323000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120080900c30831c02497c138007434c0c05c6c2544d7c0fc03383e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0278208405e3514654882ea58c511100fc02b80d60841657c1ef2ea4d67c02f817c12103fcbc2000113e910c1c2ebcb853600201200a0b0083d40106b90f6a2687d007d207d206a1802698fc1080bc6a28ca9105d41083deecbef09dd0958f97162e99f98fd001809d02811e428027d012c678b00e78b6664f6aa401f1503d33ffa00fa4021f001ed44d0fa00fa40fa40d4305136a1522ac705f2e2c128c2fff2e2c254344270542013541403c85004fa0258cf1601cf16ccc922c8cb0112f400f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f40431fa0020d749c200f2e2c4778018c8cb055008cf1670fa0217cb6b13cc80c0201200d0e009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08209c9c380a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5402f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad822860822625a028062849e5c412440e0dd7c138c34975c2c0600f1000d73b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b08160824c4b402805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552000705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54', 'hex'))[0],
|
|
59
|
+
jUSDC_MAINNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021301000385000114ff00f4a413f4bcf2c80b0102016202030202cb0405001ba0f605da89a1f401f481f481a9a30201ce06070201580a0b02f70831c02497c138007434c0c05c6c2544d7c0fc07783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c076cf16cc8d0d0d09208403e29fa96ea68c1b088d978c4408fc06b809208405e351466ea6cc1b08978c840910c03c06f80dd6cda0841657c1ef2ea7c09c6c3cb4b01408eebcb8b1807c073817c160080900113e910c30003cb85360005c804ff833206e953080b1f833de206ef2d29ad0d30731d3ffd3fff404d307d430d0fa00fa00fa00fa00fa00fa00300008840ff2f00201580c0d020148111201f70174cfc0407e803e90087c007b51343e803e903e903534544da8548b31c17cb8b04ab0bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032481c007e401d3232c084b281f2fff274013e903d010c7e800835d270803cb8b13220060072c15401f3c59c3e809dc072dae00e02f33b51343e803e903e90353442b4cfc0407e80145468017e903e9014d771c1551cdbdc150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0325c007e401d3232c084b281f2fff2741403f1c147ac7cb8b0c33e801472a84a6d8206685401e8062849a49b1578c34975c2c070c00870802c200f1000aa13ccc88210178d4519580a02cb1fcb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25007a813a008aa005004a017a014bcf2e2c501c98040fb004300c85004fa0258cf1601cf16ccc9ed5400725269a018a1c882107362d09c2902cb1fcb3f5007fa025004cf165007cf16c9c8801001cb0527cf165004fa027101cb6a13ccc971fb0050421300748e23c8801001cb055006cf165005fa027001cb6a8210d53276db580502cb1fcb3fc972fb00925b33e24003c85004fa0258cf1601cf16ccc9ed5400eb3b51343e803e903e9035344174cfc0407e800870803cb8b0be903d01007434e7f440745458a8549631c17cb8b049b0bffcb8b0b220841ef765f7960100b2c7f2cfc07e8088f3c58073c584f2e7f27220060072c148f3c59c3e809c4072dab33260103ec01004f214013e809633c58073c5b3327b55200087200835c87b51343e803e903e9035344134c7c06103c8608405e351466e80a0841ef765f7ae84ac7cbd34cfc04c3e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
60
|
+
jUSDC_TESTNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021101000323000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120080900c30831c02497c138007434c0c05c6c2544d7c0fc03383e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0278208405e3514654882ea58c511100fc02b80d60841657c1ef2ea4d67c02f817c12103fcbc2000113e910c1c2ebcb853600201200a0b0083d40106b90f6a2687d007d207d206a1802698fc1080bc6a28ca9105d41083deecbef09dd0958f97162e99f98fd001809d02811e428027d012c678b00e78b6664f6aa401f1503d33ffa00fa4021f001ed44d0fa00fa40fa40d4305136a1522ac705f2e2c128c2fff2e2c254344270542013541403c85004fa0258cf1601cf16ccc922c8cb0112f400f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f40431fa0020d749c200f2e2c4778018c8cb055008cf1670fa0217cb6b13cc80c0201200d0e009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08209c9c380a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5402f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad822860822625a028062849e5c412440e0dd7c138c34975c2c0600f1000d73b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b08160824c4b402805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552000705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54', 'hex'))[0],
|
|
61
|
+
stTON_MAINNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021201000362000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120090a01cf0831c02497c138007434c0c05c6c2544d7c0fc03783e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c8608403e29fa96ea54c4d167c02b808608405e351466ea58c511100fc02f80860841657c1ef2ea54c4d167c03380517c1300138c08c2103fcbc200800113e910c30003cb85360007ced44d0fa00fa40fa40d43010235f03018208989680a16d801072226eb32091719170e203c8cb055006cf165004fa02cb6a039358cc019130e201c901fb000201580b0c020148101101f100f4cffe803e90087c007b51343e803e903e90350c144da8548ab1c17cb8b04a30bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032483e401c1d3232c0b281f2fff274013e903d010c7e800835d270803cb8b11de0063232c1540233c59c3e8085f2dac4f3200d02f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad8228608239387028062849e5c412440e0dd7c138c34975c2c0600e0f009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a0820a625a00a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed5400c90c3b51343e803e903e90350c01b4cffe800c145128548df1c17cb8b04970bffcb8b0812082e4e1c02fbcb8b160841ef765f7b232c7c532cfd63e808873c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b55200081200835c87b51343e803e903e90350c0134c7c8608405e351466e80a0841ef765f7ae84ac7cb83234cfcc7e800c04e81408f214013e809633c58073c5b3327b5520', 'hex'))[0],
|
|
62
|
+
stTON_TESTNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021201000362000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120090a01cf0831c02497c138007434c0c05c6c2544d7c0fc03383e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7c8608403e29fa96ea54c4d167c027808608405e351466ea58c511100fc02b80860841657c1ef2ea54c4d167c02f80517c1300138c08c2103fcbc200800113e910c30003cb85360007ced44d0fa00fa40fa40d43010235f03018208989680a16d801072226eb32091719170e203c8cb055006cf165004fa02cb6a039358cc019130e201c901fb000201200b0c0081d40106b90f6a2687d007d207d206a1802698f90c1080bc6a28cdd0141083deecbef5d0958f97064699f98fd001809d02811e428027d012c678b00e78b6664f6aa401f1503d33ffa00fa4021f001ed44d0fa00fa40fa40d4305136a1522ac705f2e2c128c2fff2e2c254344270542013541403c85004fa0258cf1601cf16ccc922c8cb0112f400f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f40431fa0020d749c200f2e2c4778018c8cb055008cf1670fa0217cb6b13cc80d0201200e0f009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a0820a625a00a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5402f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad8228608239387028062849e5c412440e0dd7c138c34975c2c060101100c90c3b51343e803e903e90350c01b4cffe800c145128548df1c17cb8b04970bffcb8b0812082e4e1c02fbcb8b160841ef765f7b232c7c532cfd63e808873c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552000705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54', 'hex'))[0],
|
|
63
|
+
tsTON_MAINNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c720101010100230000420212bebb0dc8e202b7e26f721e2547e16bb9ebaec934f657d19f22e76d62bec878', 'hex'))[0],
|
|
64
|
+
tsTON_TESTNET: null,
|
|
65
|
+
USDT_MAINNET: core_1.Cell.fromBoc(Buffer.from('b5ee9c72010101010023000042028f452d7a4dfd74066b682365177259ed05734435be76b5fd4bd5d8af2b7c3d68', 'hex'))[0],
|
|
66
|
+
USDT_TESTNET: null,
|
|
112
67
|
};
|
|
113
68
|
exports.OPCODES = {
|
|
114
69
|
SUPPLY: 0x1,
|
|
@@ -27,6 +27,8 @@ export type SupplyParameters = {
|
|
|
27
27
|
userAddress: Address;
|
|
28
28
|
responseAddress?: Address;
|
|
29
29
|
forwardAmount?: bigint;
|
|
30
|
+
amountToTransfer: bigint;
|
|
31
|
+
payload: Cell;
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
34
|
* Parameters for the withdraw message
|
|
@@ -43,8 +45,10 @@ export type WithdrawParameters = {
|
|
|
43
45
|
amount: bigint;
|
|
44
46
|
userAddress: Address;
|
|
45
47
|
includeUserCode: boolean;
|
|
46
|
-
priceData: Cell;
|
|
47
48
|
asset: PoolAssetConfig;
|
|
49
|
+
priceData: Cell;
|
|
50
|
+
amountToTransfer: bigint;
|
|
51
|
+
payload: Cell;
|
|
48
52
|
};
|
|
49
53
|
/**
|
|
50
54
|
* Base data for liquidation. Can be obtained from the user contract liquidationParameters getter
|
|
@@ -62,6 +66,7 @@ export type LiquidationBaseData = {
|
|
|
62
66
|
minCollateralAmount: bigint;
|
|
63
67
|
liquidationAmount: bigint;
|
|
64
68
|
tonLiquidation: boolean;
|
|
69
|
+
forwardAmount?: bigint;
|
|
65
70
|
};
|
|
66
71
|
/**
|
|
67
72
|
* Base parameters for liquidation
|
|
@@ -74,10 +79,10 @@ export type LiquidationParameters = LiquidationBaseData & {
|
|
|
74
79
|
asset: PoolAssetConfig;
|
|
75
80
|
queryID: bigint;
|
|
76
81
|
liquidatorAddress: Address;
|
|
82
|
+
responseAddress: Address;
|
|
77
83
|
includeUserCode: boolean;
|
|
78
84
|
priceData: Cell;
|
|
79
|
-
|
|
80
|
-
forwardAmount?: bigint;
|
|
85
|
+
payload: Cell;
|
|
81
86
|
};
|
|
82
87
|
/**
|
|
83
88
|
* Evaa master contract wrapper
|
|
@@ -41,9 +41,8 @@ class Evaa {
|
|
|
41
41
|
.storeUint(general_1.OPCODES.SUPPLY, 32)
|
|
42
42
|
.storeInt(parameters.includeUserCode ? -1 : 0, 2)
|
|
43
43
|
.storeAddress(parameters.userAddress)
|
|
44
|
-
/* Will be in v6
|
|
45
44
|
.storeUint(parameters.amountToTransfer, 64)
|
|
46
|
-
.storeRef(parameters.payload)
|
|
45
|
+
.storeRef(parameters.payload)
|
|
47
46
|
.endCell())
|
|
48
47
|
.endCell();
|
|
49
48
|
}
|
|
@@ -54,9 +53,8 @@ class Evaa {
|
|
|
54
53
|
.storeInt(parameters.includeUserCode ? -1 : 0, 2)
|
|
55
54
|
.storeUint(parameters.amount, 64)
|
|
56
55
|
.storeAddress(parameters.userAddress)
|
|
57
|
-
/* Will be in v6
|
|
58
56
|
.storeUint(parameters.amountToTransfer, 64)
|
|
59
|
-
.storeRef(parameters.payload)
|
|
57
|
+
.storeRef(parameters.payload)
|
|
60
58
|
.endCell();
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -72,9 +70,8 @@ class Evaa {
|
|
|
72
70
|
.storeUint(parameters.amount, 64)
|
|
73
71
|
.storeAddress(parameters.userAddress)
|
|
74
72
|
.storeInt(parameters.includeUserCode ? -1 : 0, 2)
|
|
75
|
-
/* Will be in v6
|
|
76
73
|
.storeUint(parameters.amountToTransfer, 64)
|
|
77
|
-
.storeRef(parameters.payload)
|
|
74
|
+
.storeRef(parameters.payload)
|
|
78
75
|
.storeRef(parameters.priceData)
|
|
79
76
|
.endCell();
|
|
80
77
|
}
|
|
@@ -103,6 +100,10 @@ class Evaa {
|
|
|
103
100
|
// do not need liquidationAmount in case of jetton liquidation because
|
|
104
101
|
// the exact amount of transferred jettons for liquidation is known
|
|
105
102
|
.storeUint(0, 64)
|
|
103
|
+
.storeRef((0, core_1.beginCell)()
|
|
104
|
+
.storeUint(parameters.forwardAmount ?? 0, 64) // idk .. ) todo check
|
|
105
|
+
.storeRef(parameters.payload)
|
|
106
|
+
.endCell())
|
|
106
107
|
.storeRef(parameters.priceData)
|
|
107
108
|
.endCell())
|
|
108
109
|
.endCell();
|
|
@@ -117,6 +118,10 @@ class Evaa {
|
|
|
117
118
|
.storeUint(parameters.minCollateralAmount, 64)
|
|
118
119
|
.storeInt(parameters.includeUserCode ? -1 : 0, 2)
|
|
119
120
|
.storeUint(parameters.liquidationAmount, 64)
|
|
121
|
+
.storeRef((0, core_1.beginCell)()
|
|
122
|
+
.storeUint(parameters.forwardAmount ?? 0, 64) // idk .. ) todo check
|
|
123
|
+
.storeRef(parameters.payload)
|
|
124
|
+
.endCell())
|
|
120
125
|
.storeRef(parameters.priceData)
|
|
121
126
|
.endCell();
|
|
122
127
|
}
|
|
@@ -233,10 +238,10 @@ class Evaa {
|
|
|
233
238
|
}
|
|
234
239
|
async getPrices(provider, endpoints) {
|
|
235
240
|
if ((endpoints?.length ?? 0) > 0) {
|
|
236
|
-
return await (0, __1.getPrices)(endpoints, this.poolConfig
|
|
241
|
+
return await (0, __1.getPrices)(endpoints, this.poolConfig);
|
|
237
242
|
}
|
|
238
243
|
else {
|
|
239
|
-
return await (0, __1.getPrices)(undefined, this.poolConfig
|
|
244
|
+
return await (0, __1.getPrices)(undefined, this.poolConfig);
|
|
240
245
|
}
|
|
241
246
|
}
|
|
242
247
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { mulFactor, mulDiv, bigIntMin, bigIntMax, calculatePresentValue, calculateCurrentRates, calculateAssetData, calculateAssetInterest, getAvailableToBorrow, calculateMaximumWithdrawAmount, presentValue, calculateLiquidationData, } from './api/math';
|
|
1
|
+
export { mulFactor, mulDiv, bigIntMin, bigIntMax, calculatePresentValue, calculateCurrentRates, calculateAssetData, calculateAssetInterest, getAvailableToBorrow, calculateMaximumWithdrawAmount, presentValue, calculateLiquidationData, predictHealthFactor } from './api/math';
|
|
2
2
|
export { createAssetData, createAssetConfig, parseMasterData, parseUserData, parseUserLiteData } from './api/parser';
|
|
3
3
|
export { getPrices } from './api/prices';
|
|
4
4
|
export { JettonWallet } from './contracts/JettonWallet';
|
|
5
|
-
export { EvaaParameters, WithdrawParameters, LiquidationBaseData, Evaa, } from './contracts/MasterContract';
|
|
5
|
+
export { EvaaParameters, WithdrawParameters, LiquidationBaseData, LiquidationParameters, Evaa, } from './contracts/MasterContract';
|
|
6
6
|
export { EvaaUser } from './contracts/UserContract';
|
|
7
7
|
export { PriceData } from './types/Common';
|
|
8
|
-
export { UpgradeConfig, AssetConfig, MasterConfig, AssetData, AssetInterest, AssetApy, ExtendedAssetData, MasterData, PoolConfig, ExtendedAssetsData, ExtendedAssetsConfig, PoolAssetConfig, PoolAssetsConfig, } from './types/Master';
|
|
8
|
+
export { UpgradeConfig, AssetConfig, MasterConfig, AssetData, AssetInterest, AssetApy, ExtendedAssetData, MasterData, PoolConfig, ExtendedAssetsData, ExtendedAssetsConfig, PoolAssetConfig, PoolAssetsConfig, MasterConstants } from './types/Master';
|
|
9
9
|
export { BalanceType, UserBalance, UserLiqudationData, LiquidableData, NonLiquidableData, LiquidationData, UserDataInactive, UserDataActive, UserData, BalanceChangeType } from './types/User';
|
|
10
10
|
export { EVAA_MASTER_MAINNET, MAINNET_VERSION, EVAA_MASTER_TESTNET, TESTNET_VERSION, LENDING_CODE, OPCODES, FEES, MASTER_CONSTANTS } from './constants/general';
|
|
11
11
|
export { MAINNET_POOL_CONFIG, TESTNET_POOL_CONFIG, MAINNET_LP_POOL_CONFIG, } from './constants/pools';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.getTonConnectSender = exports.getLastSentBoc = exports.STTON_TESTNET = exports.JUSDC_TESTNET = exports.JUSDT_TESTNET = exports.TSTON_MAINNET = exports.STTON_MAINNET = exports.JUSDC_MAINNET = exports.JUSDT_MAINNET = exports.USDT_STORM_MAINNET = exports.TON_STORM_MAINNET = exports.TONUSDT_DEDUST_MAINNET = exports.USDT_MAINNET = exports.TON_MAINNET = exports.UNDEFINED_ASSET = exports.MAINNET_LP_POOL_CONFIG = exports.TESTNET_POOL_CONFIG = exports.MAINNET_POOL_CONFIG = exports.MASTER_CONSTANTS = exports.FEES = exports.OPCODES = exports.LENDING_CODE = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = exports.BalanceChangeType = exports.BalanceType = exports.EvaaUser = exports.Evaa = exports.JettonWallet = exports.getPrices = exports.parseUserLiteData = exports.parseUserData = exports.parseMasterData = exports.createAssetConfig = exports.createAssetData = exports.predictHealthFactor = exports.calculateLiquidationData = exports.presentValue = exports.calculateMaximumWithdrawAmount = exports.getAvailableToBorrow = exports.calculateAssetInterest = exports.calculateAssetData = exports.calculateCurrentRates = exports.calculatePresentValue = exports.bigIntMax = exports.bigIntMin = exports.mulDiv = exports.mulFactor = void 0;
|
|
18
|
+
exports.getUserJettonWallet = void 0;
|
|
18
19
|
// Math
|
|
19
20
|
var math_1 = require("./api/math");
|
|
20
21
|
Object.defineProperty(exports, "mulFactor", { enumerable: true, get: function () { return math_1.mulFactor; } });
|
|
@@ -29,6 +30,7 @@ Object.defineProperty(exports, "getAvailableToBorrow", { enumerable: true, get:
|
|
|
29
30
|
Object.defineProperty(exports, "calculateMaximumWithdrawAmount", { enumerable: true, get: function () { return math_1.calculateMaximumWithdrawAmount; } });
|
|
30
31
|
Object.defineProperty(exports, "presentValue", { enumerable: true, get: function () { return math_1.presentValue; } });
|
|
31
32
|
Object.defineProperty(exports, "calculateLiquidationData", { enumerable: true, get: function () { return math_1.calculateLiquidationData; } });
|
|
33
|
+
Object.defineProperty(exports, "predictHealthFactor", { enumerable: true, get: function () { return math_1.predictHealthFactor; } });
|
|
32
34
|
// Parser
|
|
33
35
|
var parser_1 = require("./api/parser");
|
|
34
36
|
Object.defineProperty(exports, "createAssetData", { enumerable: true, get: function () { return parser_1.createAssetData; } });
|
package/dist/types/Common.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Cell, Dictionary } from '@ton/core';
|
|
3
|
+
export type RawPriceData = {
|
|
4
|
+
dict: Dictionary<bigint, bigint>;
|
|
5
|
+
dataCell: Cell;
|
|
6
|
+
oracleId: number;
|
|
7
|
+
signature: Buffer;
|
|
8
|
+
pubkey: Buffer;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
};
|
|
2
11
|
export type PriceData = {
|
|
3
12
|
dict: Dictionary<bigint, bigint>;
|
|
4
13
|
dataCell: Cell;
|
package/dist/types/Master.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Address, Cell, Dictionary } from '@ton/core';
|
|
2
3
|
export type MasterConstants = {
|
|
3
4
|
FACTOR_SCALE: bigint;
|
|
@@ -20,7 +21,8 @@ export type PoolConfig = {
|
|
|
20
21
|
masterAddress: Address;
|
|
21
22
|
masterVersion: number;
|
|
22
23
|
masterConstants: MasterConstants;
|
|
23
|
-
|
|
24
|
+
oracles: OracleNFT[];
|
|
25
|
+
minimalOracles: number;
|
|
24
26
|
poolAssetsConfig: PoolAssetsConfig;
|
|
25
27
|
lendingCode: Cell;
|
|
26
28
|
};
|
|
@@ -31,7 +33,6 @@ export type UpgradeConfig = {
|
|
|
31
33
|
updateTime: number;
|
|
32
34
|
freezeTime: number;
|
|
33
35
|
userCode: Cell;
|
|
34
|
-
blankCode: Cell;
|
|
35
36
|
newMasterCode: Cell | null;
|
|
36
37
|
newUserCode: Cell | null;
|
|
37
38
|
};
|
|
@@ -52,13 +53,20 @@ export type AssetConfig = {
|
|
|
52
53
|
maxTotalSupply: bigint;
|
|
53
54
|
reserveFactor: bigint;
|
|
54
55
|
liquidationReserveFactor: bigint;
|
|
56
|
+
minPrincipalForRewards: bigint;
|
|
57
|
+
baseTrackingSupplySpeed: bigint;
|
|
58
|
+
baseTrackingBorrowSpeed: bigint;
|
|
55
59
|
};
|
|
56
60
|
export type MasterConfig = {
|
|
57
61
|
ifActive: number;
|
|
58
62
|
admin: Address;
|
|
59
|
-
|
|
63
|
+
oraclesInfo: OraclesInfo;
|
|
60
64
|
tokenKeys: Cell | null;
|
|
61
|
-
|
|
65
|
+
};
|
|
66
|
+
export type OraclesInfo = {
|
|
67
|
+
numOracles: number;
|
|
68
|
+
threshold: number;
|
|
69
|
+
oracles: Cell | null;
|
|
62
70
|
};
|
|
63
71
|
export type AssetData = {
|
|
64
72
|
sRate: bigint;
|
|
@@ -67,6 +75,9 @@ export type AssetData = {
|
|
|
67
75
|
totalBorrow: bigint;
|
|
68
76
|
lastAccural: bigint;
|
|
69
77
|
balance: bigint;
|
|
78
|
+
trackingSupplyIndex: bigint;
|
|
79
|
+
trackingBorrowIndex: bigint;
|
|
80
|
+
awaitedSupply?: bigint;
|
|
70
81
|
};
|
|
71
82
|
export type AssetInterest = {
|
|
72
83
|
supplyInterest: bigint;
|
|
@@ -95,3 +106,11 @@ export type AgregatedBalances = {
|
|
|
95
106
|
totalBorrow: bigint;
|
|
96
107
|
totalSupply: bigint;
|
|
97
108
|
};
|
|
109
|
+
export type OracleNFT = {
|
|
110
|
+
id: number;
|
|
111
|
+
address: string;
|
|
112
|
+
};
|
|
113
|
+
export type Oracle = {
|
|
114
|
+
id: number;
|
|
115
|
+
pubkey: Buffer;
|
|
116
|
+
};
|
package/dist/types/User.d.ts
CHANGED
|
@@ -37,6 +37,9 @@ export type UserLiteData = {
|
|
|
37
37
|
trackingBorrowIndex: bigint;
|
|
38
38
|
dutchAuctionStart: number;
|
|
39
39
|
backupCell: Cell;
|
|
40
|
+
rewards: Dictionary<bigint, UserRewards>;
|
|
41
|
+
backupCell1: Cell | null;
|
|
42
|
+
backupCell2: Cell | null;
|
|
40
43
|
};
|
|
41
44
|
export type UserDataActive = UserLiteData & {
|
|
42
45
|
withdrawalLimits: Dictionary<bigint, bigint>;
|
|
@@ -67,7 +70,7 @@ export declare enum BalanceChangeType {
|
|
|
67
70
|
export type PredictHealthFactorArgs = {
|
|
68
71
|
balanceChangeType: BalanceChangeType;
|
|
69
72
|
amount: bigint;
|
|
70
|
-
|
|
73
|
+
asset: PoolAssetConfig;
|
|
71
74
|
principals: Dictionary<bigint, bigint>;
|
|
72
75
|
prices: Dictionary<bigint, bigint>;
|
|
73
76
|
assetsData: ExtendedAssetsData;
|