@affluent-org/sdk 0.0.1
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/.prettierrc +11 -0
- package/Refactoring.md +548 -0
- package/dist/_compiled/Account.compiled.json +1 -0
- package/dist/_compiled/Receipt.compiled.json +1 -0
- package/dist/_compiled/WTONWallet.compiled.json +1 -0
- package/dist/_compiled/index.d.ts +4 -0
- package/dist/_compiled/index.js +12 -0
- package/dist/affluent.d.ts +14 -0
- package/dist/affluent.js +20 -0
- package/dist/constants/constants.d.ts +2 -0
- package/dist/constants/constants.js +5 -0
- package/dist/constants/contracts.d.ts +9 -0
- package/dist/constants/contracts.js +18 -0
- package/dist/context.d.ts +43 -0
- package/dist/context.js +90 -0
- package/dist/contracts/common/type.d.ts +16 -0
- package/dist/contracts/common/type.js +2 -0
- package/dist/contracts/common/utils.d.ts +3 -0
- package/dist/contracts/common/utils.js +16 -0
- package/dist/contracts/core/account/index.d.ts +38 -0
- package/dist/contracts/core/account/index.js +128 -0
- package/dist/contracts/core/account/type.d.ts +18 -0
- package/dist/contracts/core/account/type.js +2 -0
- package/dist/contracts/core/pool/index.d.ts +149 -0
- package/dist/contracts/core/pool/index.js +379 -0
- package/dist/contracts/core/pool/serializer.d.ts +15 -0
- package/dist/contracts/core/pool/serializer.js +307 -0
- package/dist/contracts/core/pool/type.d.ts +136 -0
- package/dist/contracts/core/pool/type.js +2 -0
- package/dist/contracts/dedust-farm/MockDedustFarm.d.ts +41 -0
- package/dist/contracts/dedust-farm/MockDedustFarm.js +79 -0
- package/dist/contracts/external/tonstaker.d.ts +18 -0
- package/dist/contracts/external/tonstaker.js +26 -0
- package/dist/contracts/factory/factory.d.ts +24 -0
- package/dist/contracts/factory/factory.js +58 -0
- package/dist/contracts/factory/type.d.ts +11 -0
- package/dist/contracts/factory/type.js +2 -0
- package/dist/contracts/farm/distributor.d.ts +43 -0
- package/dist/contracts/farm/distributor.js +83 -0
- package/dist/contracts/farm/receipt.d.ts +40 -0
- package/dist/contracts/farm/receipt.js +68 -0
- package/dist/contracts/irm/jump-irm/serializer.d.ts +4 -0
- package/dist/contracts/irm/jump-irm/serializer.js +26 -0
- package/dist/contracts/irm/jump-irm/type.d.ts +8 -0
- package/dist/contracts/irm/jump-irm/type.js +2 -0
- package/dist/contracts/jetton/jetton-minter.d.ts +23 -0
- package/dist/contracts/jetton/jetton-minter.js +46 -0
- package/dist/contracts/jetton/jetton-wallet.d.ts +67 -0
- package/dist/contracts/jetton/jetton-wallet.js +119 -0
- package/dist/contracts/jetton/type.d.ts +7 -0
- package/dist/contracts/jetton/type.js +2 -0
- package/dist/contracts/liquid_token/dedust/minter.d.ts +56 -0
- package/dist/contracts/liquid_token/dedust/minter.js +112 -0
- package/dist/contracts/liquid_token/dedust/wallet.d.ts +127 -0
- package/dist/contracts/liquid_token/dedust/wallet.js +213 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonMinter.d.ts +53 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonMinter.js +110 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonWallet.d.ts +169 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonWallet.js +288 -0
- package/dist/contracts/oracle/composite-onchain-oracle/index.d.ts +108 -0
- package/dist/contracts/oracle/composite-onchain-oracle/index.js +185 -0
- package/dist/contracts/oracle/parser.d.ts +7 -0
- package/dist/contracts/oracle/parser.js +77 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/index.d.ts +56 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/index.js +159 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/serializer.d.ts +4 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/serializer.js +137 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/type.d.ts +57 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/type.js +18 -0
- package/dist/contracts/oracle/redstone-oracle/serializer.d.ts +3 -0
- package/dist/contracts/oracle/redstone-oracle/serializer.js +30 -0
- package/dist/contracts/oracle/redstone-oracle/type.d.ts +9 -0
- package/dist/contracts/oracle/redstone-oracle/type.js +2 -0
- package/dist/contracts/oracle/redstone-parser.d.ts +9 -0
- package/dist/contracts/oracle/redstone-parser.js +58 -0
- package/dist/contracts/rfq/rfq_auction/index.d.ts +216 -0
- package/dist/contracts/rfq/rfq_auction/index.js +334 -0
- package/dist/contracts/rfq/rfq_batch/index.d.ts +346 -0
- package/dist/contracts/rfq/rfq_batch/index.js +448 -0
- package/dist/contracts/rfq/rfq_event_emitter/index.d.ts +132 -0
- package/dist/contracts/rfq/rfq_event_emitter/index.js +143 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmItem.d.ts +41 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmItem.js +83 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmMinter.d.ts +45 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmMinter.js +92 -0
- package/dist/contracts/unknown-contract/index.d.ts +14 -0
- package/dist/contracts/unknown-contract/index.js +18 -0
- package/dist/contracts/vault/share-vault/index.d.ts +206 -0
- package/dist/contracts/vault/share-vault/index.js +373 -0
- package/dist/contracts/vault/strategy-vault/codec.d.ts +710 -0
- package/dist/contracts/vault/strategy-vault/codec.js +1256 -0
- package/dist/contracts/vault/strategy-vault/computation.d.ts +11 -0
- package/dist/contracts/vault/strategy-vault/computation.js +56 -0
- package/dist/contracts/vault/strategy-vault/constants.d.ts +163 -0
- package/dist/contracts/vault/strategy-vault/constants.js +170 -0
- package/dist/contracts/vault/strategy-vault/index.d.ts +587 -0
- package/dist/contracts/vault/strategy-vault/index.js +406 -0
- package/dist/contracts/vault/strategy-vault/type.d.ts +115 -0
- package/dist/contracts/vault/strategy-vault/type.js +2 -0
- package/dist/contracts/wton/jetton-minter.d.ts +35 -0
- package/dist/contracts/wton/jetton-minter.js +71 -0
- package/dist/contracts/wton/jetton-wallet.d.ts +90 -0
- package/dist/contracts/wton/jetton-wallet.js +153 -0
- package/dist/contracts/wton/type.d.ts +7 -0
- package/dist/contracts/wton/type.js +2 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +65 -0
- package/dist/lib/assert.d.ts +1 -0
- package/dist/lib/assert.js +9 -0
- package/dist/lib/query-cache.d.ts +5 -0
- package/dist/lib/query-cache.js +57 -0
- package/dist/lib/send-msg.d.ts +11 -0
- package/dist/lib/send-msg.js +9 -0
- package/dist/services/composite-oracle/computation.d.ts +55 -0
- package/dist/services/composite-oracle/computation.js +295 -0
- package/dist/services/composite-oracle/index.d.ts +45 -0
- package/dist/services/composite-oracle/index.js +110 -0
- package/dist/services/composite-oracle/query.d.ts +36 -0
- package/dist/services/composite-oracle/query.js +251 -0
- package/dist/services/composite-oracle/types.d.ts +82 -0
- package/dist/services/composite-oracle/types.js +11 -0
- package/dist/services/pool/computation.d.ts +75 -0
- package/dist/services/pool/computation.js +219 -0
- package/dist/services/pool/index.d.ts +94 -0
- package/dist/services/pool/index.js +139 -0
- package/dist/services/pool/oracle.d.ts +20 -0
- package/dist/services/pool/oracle.js +61 -0
- package/dist/services/pool/owner/index.d.ts +37 -0
- package/dist/services/pool/owner/index.js +76 -0
- package/dist/services/pool/owner/types.d.ts +18 -0
- package/dist/services/pool/owner/types.js +2 -0
- package/dist/services/pool/query.d.ts +64 -0
- package/dist/services/pool/query.js +282 -0
- package/dist/services/pool/user/index.d.ts +86 -0
- package/dist/services/pool/user/index.js +285 -0
- package/dist/services/pool/user/types.d.ts +44 -0
- package/dist/services/pool/user/types.js +2 -0
- package/dist/services/rfq-auction/index.d.ts +81 -0
- package/dist/services/rfq-auction/index.js +93 -0
- package/dist/services/rfq-auction/oracle.d.ts +19 -0
- package/dist/services/rfq-auction/oracle.js +60 -0
- package/dist/services/rfq-auction/query.d.ts +50 -0
- package/dist/services/rfq-auction/query.js +19 -0
- package/dist/services/rfq-auction/user/index.d.ts +63 -0
- package/dist/services/rfq-auction/user/index.js +218 -0
- package/dist/services/rfq-auction/user/types.d.ts +29 -0
- package/dist/services/rfq-auction/user/types.js +2 -0
- package/dist/services/rfq-batch/index.d.ts +78 -0
- package/dist/services/rfq-batch/index.js +132 -0
- package/dist/services/rfq-batch/oracle.d.ts +22 -0
- package/dist/services/rfq-batch/oracle.js +54 -0
- package/dist/services/rfq-batch/query.d.ts +46 -0
- package/dist/services/rfq-batch/query.js +34 -0
- package/dist/services/rfq-batch/user/index.d.ts +79 -0
- package/dist/services/rfq-batch/user/index.js +171 -0
- package/dist/services/rfq-batch/user/types.d.ts +37 -0
- package/dist/services/rfq-batch/user/types.js +2 -0
- package/dist/services/share-vault/computation.d.ts +24 -0
- package/dist/services/share-vault/computation.js +42 -0
- package/dist/services/share-vault/index.d.ts +90 -0
- package/dist/services/share-vault/index.js +128 -0
- package/dist/services/share-vault/manager/index.d.ts +40 -0
- package/dist/services/share-vault/manager/index.js +111 -0
- package/dist/services/share-vault/manager/types.d.ts +23 -0
- package/dist/services/share-vault/manager/types.js +2 -0
- package/dist/services/share-vault/owner/index.d.ts +64 -0
- package/dist/services/share-vault/owner/index.js +122 -0
- package/dist/services/share-vault/owner/types.d.ts +33 -0
- package/dist/services/share-vault/owner/types.js +2 -0
- package/dist/services/share-vault/query.d.ts +34 -0
- package/dist/services/share-vault/query.js +138 -0
- package/dist/services/share-vault/user/index.d.ts +33 -0
- package/dist/services/share-vault/user/index.js +106 -0
- package/dist/services/share-vault/user/types.d.ts +13 -0
- package/dist/services/share-vault/user/types.js +2 -0
- package/dist/services/strategy-vault/index.d.ts +2124 -0
- package/dist/services/strategy-vault/index.js +268 -0
- package/dist/services/strategy-vault/manager/index.d.ts +1968 -0
- package/dist/services/strategy-vault/manager/index.js +475 -0
- package/dist/services/strategy-vault/manager/types.d.ts +144 -0
- package/dist/services/strategy-vault/manager/types.js +2 -0
- package/dist/services/strategy-vault/oracle.d.ts +66 -0
- package/dist/services/strategy-vault/oracle.js +162 -0
- package/dist/services/strategy-vault/owner/index.d.ts +277 -0
- package/dist/services/strategy-vault/owner/index.js +333 -0
- package/dist/services/strategy-vault/owner/types.d.ts +146 -0
- package/dist/services/strategy-vault/owner/types.js +2 -0
- package/dist/services/strategy-vault/query.d.ts +138 -0
- package/dist/services/strategy-vault/query.js +59 -0
- package/dist/services/strategy-vault/user/index.d.ts +89 -0
- package/dist/services/strategy-vault/user/index.js +219 -0
- package/dist/services/strategy-vault/user/types.d.ts +46 -0
- package/dist/services/strategy-vault/user/types.js +2 -0
- package/dist/types/sender.d.ts +7 -0
- package/dist/types/sender.js +2 -0
- package/dist/utils/action-parser.d.ts +7 -0
- package/dist/utils/action-parser.js +20 -0
- package/dist/utils/external-message-hash.d.ts +45 -0
- package/dist/utils/external-message-hash.js +65 -0
- package/dist/utils/oracle/redstone/readonlyCachedRedstone.d.ts +3 -0
- package/dist/utils/oracle/redstone/readonlyCachedRedstone.js +25 -0
- package/dist/utils/oracle/redstone/redstoneHelper.d.ts +21 -0
- package/dist/utils/oracle/redstone/redstoneHelper.js +228 -0
- package/dist/utils/parser.d.ts +40 -0
- package/dist/utils/parser.js +580 -0
- package/dist/utils/pending-tracker/index.d.ts +14 -0
- package/dist/utils/pending-tracker/index.js +34 -0
- package/dist/utils/pending-tracker/trackable-sender.d.ts +16 -0
- package/dist/utils/pending-tracker/trackable-sender.js +87 -0
- package/dist/utils/pending-tracker/type.d.ts +78 -0
- package/dist/utils/pending-tracker/type.js +2 -0
- package/dist/utils/pending-tracker/v3-client.d.ts +31 -0
- package/dist/utils/pending-tracker/v3-client.js +104 -0
- package/dist/utils/risk_calculator/risk_calculator.d.ts +45 -0
- package/dist/utils/risk_calculator/risk_calculator.js +332 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +12 -0
- package/package.json +46 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Address, Cell, Contract, ContractProvider, Sender } from "@ton/ton";
|
|
2
|
+
import { WalletState } from "./type";
|
|
3
|
+
export declare function wtonWalletConfigToCell(config: {
|
|
4
|
+
jettonMinter: Address;
|
|
5
|
+
owner: Address;
|
|
6
|
+
walletCode: Cell;
|
|
7
|
+
}): Cell;
|
|
8
|
+
export type WTONWalletConfig = {
|
|
9
|
+
jettonMinter: Address;
|
|
10
|
+
owner: Address;
|
|
11
|
+
walletCode: Cell;
|
|
12
|
+
};
|
|
13
|
+
export declare class WTONWallet implements Contract {
|
|
14
|
+
readonly address: Address;
|
|
15
|
+
readonly init?: {
|
|
16
|
+
code: Cell;
|
|
17
|
+
data: Cell;
|
|
18
|
+
} | undefined;
|
|
19
|
+
constructor(address: Address, init?: {
|
|
20
|
+
code: Cell;
|
|
21
|
+
data: Cell;
|
|
22
|
+
} | undefined);
|
|
23
|
+
static Op: {
|
|
24
|
+
TransferNotification: number;
|
|
25
|
+
InternalTransfer: number;
|
|
26
|
+
ExternalTransfer: number;
|
|
27
|
+
Transfer: number;
|
|
28
|
+
Burn: number;
|
|
29
|
+
Excesses: number;
|
|
30
|
+
BurnNotification: number;
|
|
31
|
+
UnwrapNotification: number;
|
|
32
|
+
};
|
|
33
|
+
static createFromAddress(address: Address): WTONWallet;
|
|
34
|
+
static createFromConfig(config: WTONWalletConfig, code: Cell, workchain?: number): WTONWallet;
|
|
35
|
+
static Gas: {
|
|
36
|
+
ExternalTransfer: bigint;
|
|
37
|
+
};
|
|
38
|
+
sendTransfer(provider: ContractProvider, via: Sender, value: bigint, opts: {
|
|
39
|
+
queryId?: bigint;
|
|
40
|
+
recipient: Address;
|
|
41
|
+
response: Address;
|
|
42
|
+
amount: bigint;
|
|
43
|
+
forwardTonAmount: bigint;
|
|
44
|
+
forwardPayload?: Cell;
|
|
45
|
+
}): Promise<Cell>;
|
|
46
|
+
sendExternalTransfer(provider: ContractProvider, via: Sender, value: bigint, opts: {
|
|
47
|
+
queryId?: bigint;
|
|
48
|
+
recipient: Address;
|
|
49
|
+
response: Address;
|
|
50
|
+
amount: bigint;
|
|
51
|
+
forwardTonAmount: bigint;
|
|
52
|
+
forwardPayload?: Cell;
|
|
53
|
+
}): Promise<Cell>;
|
|
54
|
+
static createExternalTransferBody(opts: {
|
|
55
|
+
queryId?: bigint;
|
|
56
|
+
recipient: Address;
|
|
57
|
+
response: Address;
|
|
58
|
+
amount: bigint;
|
|
59
|
+
forwardTonAmount: bigint;
|
|
60
|
+
forwardPayload?: Cell;
|
|
61
|
+
}): Cell;
|
|
62
|
+
static createTransferBody(opts: {
|
|
63
|
+
queryId?: bigint;
|
|
64
|
+
recipient: Address;
|
|
65
|
+
response: Address;
|
|
66
|
+
amount: bigint;
|
|
67
|
+
forwardTonAmount: bigint;
|
|
68
|
+
forwardPayload?: Cell;
|
|
69
|
+
}): Cell;
|
|
70
|
+
static getBurnMsgBody(opts: {
|
|
71
|
+
amount: bigint;
|
|
72
|
+
response: Address;
|
|
73
|
+
}): Cell;
|
|
74
|
+
sendBurn(provider: ContractProvider, via: Sender, value: bigint, opts: {
|
|
75
|
+
amount: bigint;
|
|
76
|
+
response: Address;
|
|
77
|
+
queryId?: bigint;
|
|
78
|
+
}): Promise<Cell>;
|
|
79
|
+
sendMint(provider: ContractProvider, via: Sender, value: bigint): Promise<Cell>;
|
|
80
|
+
getState(provider: ContractProvider): Promise<import("@ton/ton").ContractState>;
|
|
81
|
+
getWalletData(provider: ContractProvider): Promise<WalletState>;
|
|
82
|
+
createExternalTransferBody(opts: {
|
|
83
|
+
queryId?: bigint;
|
|
84
|
+
recipient: Address;
|
|
85
|
+
response: Address;
|
|
86
|
+
amount: bigint;
|
|
87
|
+
forwardTonAmount: bigint;
|
|
88
|
+
forwardPayload?: Cell;
|
|
89
|
+
}): Cell;
|
|
90
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WTONWallet = void 0;
|
|
4
|
+
exports.wtonWalletConfigToCell = wtonWalletConfigToCell;
|
|
5
|
+
const ton_1 = require("@ton/ton");
|
|
6
|
+
function wtonWalletConfigToCell(config) {
|
|
7
|
+
return (0, ton_1.beginCell)().storeAddress(config.owner).storeAddress(config.jettonMinter).storeRef(config.walletCode).endCell();
|
|
8
|
+
}
|
|
9
|
+
class WTONWallet {
|
|
10
|
+
address;
|
|
11
|
+
init;
|
|
12
|
+
constructor(address, init) {
|
|
13
|
+
this.address = address;
|
|
14
|
+
this.init = init;
|
|
15
|
+
}
|
|
16
|
+
static Op = {
|
|
17
|
+
TransferNotification: 0x7362d09c,
|
|
18
|
+
InternalTransfer: 0x178d4519,
|
|
19
|
+
ExternalTransfer: 0x05db0ab7,
|
|
20
|
+
Transfer: 0xf8a7ea5,
|
|
21
|
+
Burn: 0x595f07bc,
|
|
22
|
+
Excesses: 0xd53276db,
|
|
23
|
+
BurnNotification: 0x7bdd97de,
|
|
24
|
+
UnwrapNotification: 0x90d0a42f,
|
|
25
|
+
};
|
|
26
|
+
static createFromAddress(address) {
|
|
27
|
+
return new WTONWallet(address);
|
|
28
|
+
}
|
|
29
|
+
static createFromConfig(config, code, workchain = 0) {
|
|
30
|
+
const data = wtonWalletConfigToCell(config);
|
|
31
|
+
const init = { code, data };
|
|
32
|
+
return new WTONWallet((0, ton_1.contractAddress)(workchain, init), init);
|
|
33
|
+
}
|
|
34
|
+
static Gas = {
|
|
35
|
+
ExternalTransfer: (0, ton_1.toNano)(0.06),
|
|
36
|
+
};
|
|
37
|
+
async sendTransfer(provider, via, value, opts) {
|
|
38
|
+
const body = (0, ton_1.beginCell)()
|
|
39
|
+
.storeUint(WTONWallet.Op.Transfer, 32)
|
|
40
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
41
|
+
.storeCoins(opts.amount)
|
|
42
|
+
.storeAddress(opts.recipient)
|
|
43
|
+
.storeAddress(opts.response)
|
|
44
|
+
.storeDict(null)
|
|
45
|
+
.storeCoins(opts.forwardTonAmount)
|
|
46
|
+
.storeMaybeRef(opts.forwardPayload)
|
|
47
|
+
.endCell();
|
|
48
|
+
await provider.internal(via, {
|
|
49
|
+
value: value,
|
|
50
|
+
sendMode: ton_1.SendMode.PAY_GAS_SEPARATELY,
|
|
51
|
+
body: body,
|
|
52
|
+
});
|
|
53
|
+
return body;
|
|
54
|
+
}
|
|
55
|
+
async sendExternalTransfer(provider, via, value, opts) {
|
|
56
|
+
const body = (0, ton_1.beginCell)()
|
|
57
|
+
.storeUint(WTONWallet.Op.ExternalTransfer, 32)
|
|
58
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
59
|
+
.storeCoins(opts.amount)
|
|
60
|
+
.storeAddress(opts.response)
|
|
61
|
+
.storeCoins(opts.forwardTonAmount)
|
|
62
|
+
.storeMaybeRef(opts.forwardPayload)
|
|
63
|
+
.endCell();
|
|
64
|
+
const value2 = opts.amount + opts.forwardTonAmount + value;
|
|
65
|
+
await provider.internal(via, {
|
|
66
|
+
value: value2,
|
|
67
|
+
sendMode: ton_1.SendMode.PAY_GAS_SEPARATELY,
|
|
68
|
+
body: body,
|
|
69
|
+
});
|
|
70
|
+
return body;
|
|
71
|
+
}
|
|
72
|
+
static createExternalTransferBody(opts) {
|
|
73
|
+
const body = (0, ton_1.beginCell)()
|
|
74
|
+
.storeUint(WTONWallet.Op.ExternalTransfer, 32)
|
|
75
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
76
|
+
.storeCoins(opts.amount)
|
|
77
|
+
.storeAddress(opts.response)
|
|
78
|
+
.storeCoins(opts.forwardTonAmount)
|
|
79
|
+
.storeMaybeRef(opts.forwardPayload)
|
|
80
|
+
.endCell();
|
|
81
|
+
return body;
|
|
82
|
+
}
|
|
83
|
+
static createTransferBody(opts) {
|
|
84
|
+
const body = (0, ton_1.beginCell)()
|
|
85
|
+
.storeUint(WTONWallet.Op.Transfer, 32)
|
|
86
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
87
|
+
.storeCoins(opts.amount)
|
|
88
|
+
.storeAddress(opts.recipient)
|
|
89
|
+
.storeAddress(opts.response)
|
|
90
|
+
.storeDict(null)
|
|
91
|
+
.storeCoins(opts.forwardTonAmount)
|
|
92
|
+
.storeMaybeRef(opts.forwardPayload)
|
|
93
|
+
.endCell();
|
|
94
|
+
return body;
|
|
95
|
+
}
|
|
96
|
+
static getBurnMsgBody(opts) {
|
|
97
|
+
const body = (0, ton_1.beginCell)()
|
|
98
|
+
.storeUint(WTONWallet.Op.Burn, 32)
|
|
99
|
+
.storeUint(0, 64)
|
|
100
|
+
.storeCoins(opts.amount)
|
|
101
|
+
.storeAddress(opts.response)
|
|
102
|
+
.endCell();
|
|
103
|
+
return body;
|
|
104
|
+
}
|
|
105
|
+
async sendBurn(provider, via, value, opts) {
|
|
106
|
+
const body = (0, ton_1.beginCell)()
|
|
107
|
+
.storeUint(WTONWallet.Op.Burn, 32)
|
|
108
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
109
|
+
.storeCoins(opts.amount)
|
|
110
|
+
.storeAddress(opts.response)
|
|
111
|
+
.endCell();
|
|
112
|
+
await provider.internal(via, {
|
|
113
|
+
value: value,
|
|
114
|
+
sendMode: ton_1.SendMode.PAY_GAS_SEPARATELY,
|
|
115
|
+
body: body,
|
|
116
|
+
});
|
|
117
|
+
return body;
|
|
118
|
+
}
|
|
119
|
+
async sendMint(provider, via, value) {
|
|
120
|
+
await provider.internal(via, {
|
|
121
|
+
value: value,
|
|
122
|
+
sendMode: ton_1.SendMode.PAY_GAS_SEPARATELY,
|
|
123
|
+
body: (0, ton_1.beginCell)().endCell(),
|
|
124
|
+
});
|
|
125
|
+
return (0, ton_1.beginCell)().endCell();
|
|
126
|
+
}
|
|
127
|
+
async getState(provider) {
|
|
128
|
+
return await provider.getState();
|
|
129
|
+
}
|
|
130
|
+
async getWalletData(provider) {
|
|
131
|
+
const _result = await provider.get("get_wallet_data", []);
|
|
132
|
+
const balance = _result.stack.readBigNumber();
|
|
133
|
+
const owner = _result.stack.readAddress();
|
|
134
|
+
const jetton = _result.stack.readAddress();
|
|
135
|
+
return {
|
|
136
|
+
address: this.address,
|
|
137
|
+
balance,
|
|
138
|
+
owner,
|
|
139
|
+
jetton,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
createExternalTransferBody(opts) {
|
|
143
|
+
return (0, ton_1.beginCell)()
|
|
144
|
+
.storeUint(WTONWallet.Op.ExternalTransfer, 32)
|
|
145
|
+
.storeUint(opts.queryId ?? 0, 64)
|
|
146
|
+
.storeCoins(opts.amount)
|
|
147
|
+
.storeAddress(opts.response)
|
|
148
|
+
.storeCoins(opts.forwardTonAmount)
|
|
149
|
+
.storeMaybeRef(opts.forwardPayload)
|
|
150
|
+
.endCell();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.WTONWallet = WTONWallet;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MAINNET_CONTRACTS, TESTNET_CONTRACTS } from "./constants/contracts";
|
|
2
|
+
import { Maybe } from "@ton/ton/dist/utils/maybe";
|
|
3
|
+
import { AccountState, AccountAssetState } from "./contracts/core/account/type";
|
|
4
|
+
import { PoolState, LiquidatePayload, TransferInPayload, TransferOutMsgBody, LiquidateParams, TransferInParams, TransferOutMsgParams, AssetState, BaseActionNotificationMsgBody, SuccessActionNotificationMsgBody, SuccessRepayActionNotificationMsgBody, SuccessLiquidateActionNotificationMsgBody, FailTransferInActionNotificationMsgBody, FailLiquidateActionNotificationMsgBody, FailTransferOutActionNotificationMsgBody, ActionNotificationMsgBody } from "./contracts/core/pool/type";
|
|
5
|
+
import { FactoryState } from "./contracts/factory/type";
|
|
6
|
+
import { JumpIRMConfig } from "./contracts/irm/jump-irm/type";
|
|
7
|
+
import { ShareVaultState, WhitelistedPoolData } from "./contracts/vault/share-vault";
|
|
8
|
+
import { Factory } from "./contracts/factory/factory";
|
|
9
|
+
import { Pool } from "./contracts/core/pool";
|
|
10
|
+
import { Account } from "./contracts/core/account";
|
|
11
|
+
import { RiskCalculator } from "./utils/risk_calculator/risk_calculator";
|
|
12
|
+
import { JettonMinter } from "./contracts/jetton/jetton-minter";
|
|
13
|
+
import { JettonWallet } from "./contracts/jetton/jetton-wallet";
|
|
14
|
+
import { ShareVault } from "./contracts/vault/share-vault";
|
|
15
|
+
import { StrategyVault, strategyVaultConfigToCell } from "./contracts/vault/strategy-vault/";
|
|
16
|
+
import Affluent from "./affluent";
|
|
17
|
+
import { RFQEventEmitter } from "./contracts/rfq/rfq_event_emitter";
|
|
18
|
+
import { RFQAuction } from "./contracts/rfq/rfq_auction";
|
|
19
|
+
import { RFQBatch } from "./contracts/rfq/rfq_batch";
|
|
20
|
+
import { StrategyVaultState } from "./contracts/vault/strategy-vault/";
|
|
21
|
+
import { ONE_PERCENT_IR_PER_SEC } from "./constants/constants";
|
|
22
|
+
import { toPercentBigInt, toPercentNumber } from "./utils/utils";
|
|
23
|
+
import { WTONWalletCompiled } from "./_compiled";
|
|
24
|
+
import { WTON_UNWRAP_CELL, WTONMinter } from "./contracts/wton/jetton-minter";
|
|
25
|
+
import { WTONWallet } from "./contracts/wton/jetton-wallet";
|
|
26
|
+
import { parseAction } from "./utils/action-parser";
|
|
27
|
+
import { CompositeOracleV1 } from "./services/composite-oracle";
|
|
28
|
+
import { StrategyVaultV1 } from "./services/strategy-vault";
|
|
29
|
+
import { PoolServiceV1 } from "./services/pool";
|
|
30
|
+
import { ShareVaultServiceV1 } from "./services/share-vault";
|
|
31
|
+
import { RFQBatchServiceV1 } from "./services/rfq-batch";
|
|
32
|
+
import { RFQAuctionServiceV1 } from "./services/rfq-auction";
|
|
33
|
+
import { sendMsgTracked, createTrackableSender, createTrackableSenderFromMnemonic, ToncenterV3Client, TrackableSender, TrackableSenderConfig, SendResult, TraceResult, WaitOptions } from "./utils/pending-tracker";
|
|
34
|
+
export { Maybe, AccountState, AccountAssetState, strategyVaultConfigToCell, PoolState, LiquidatePayload, TransferInPayload, TransferOutMsgBody, LiquidateParams, TransferInParams, TransferOutMsgParams, AssetState, BaseActionNotificationMsgBody, SuccessActionNotificationMsgBody, SuccessRepayActionNotificationMsgBody, SuccessLiquidateActionNotificationMsgBody, FailTransferInActionNotificationMsgBody, FailLiquidateActionNotificationMsgBody, FailTransferOutActionNotificationMsgBody, ActionNotificationMsgBody, FactoryState, JumpIRMConfig, ShareVaultState, WhitelistedPoolData, StrategyVaultState, Affluent, Factory, Pool, Account, JettonMinter, JettonWallet, ShareVault, RiskCalculator, StrategyVault, RFQEventEmitter, RFQAuction, RFQBatch, MAINNET_CONTRACTS, TESTNET_CONTRACTS, ONE_PERCENT_IR_PER_SEC, toPercentBigInt, toPercentNumber, WTONWalletCompiled, WTONMinter, WTONWallet, WTON_UNWRAP_CELL, parseAction, CompositeOracleV1, StrategyVaultV1, PoolServiceV1, ShareVaultServiceV1, RFQBatchServiceV1, RFQAuctionServiceV1, sendMsgTracked, createTrackableSender, createTrackableSenderFromMnemonic, ToncenterV3Client, TrackableSender, TrackableSenderConfig, SendResult, TraceResult, WaitOptions, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ToncenterV3Client = exports.createTrackableSenderFromMnemonic = exports.createTrackableSender = exports.sendMsgTracked = exports.RFQAuctionServiceV1 = exports.RFQBatchServiceV1 = exports.ShareVaultServiceV1 = exports.PoolServiceV1 = exports.StrategyVaultV1 = exports.CompositeOracleV1 = exports.parseAction = exports.WTON_UNWRAP_CELL = exports.WTONWallet = exports.WTONMinter = exports.WTONWalletCompiled = exports.toPercentNumber = exports.toPercentBigInt = exports.ONE_PERCENT_IR_PER_SEC = exports.TESTNET_CONTRACTS = exports.MAINNET_CONTRACTS = exports.RFQBatch = exports.RFQAuction = exports.RFQEventEmitter = exports.StrategyVault = exports.RiskCalculator = exports.ShareVault = exports.JettonWallet = exports.JettonMinter = exports.Account = exports.Pool = exports.Factory = exports.Affluent = exports.strategyVaultConfigToCell = void 0;
|
|
7
|
+
const contracts_1 = require("./constants/contracts");
|
|
8
|
+
Object.defineProperty(exports, "MAINNET_CONTRACTS", { enumerable: true, get: function () { return contracts_1.MAINNET_CONTRACTS; } });
|
|
9
|
+
Object.defineProperty(exports, "TESTNET_CONTRACTS", { enumerable: true, get: function () { return contracts_1.TESTNET_CONTRACTS; } });
|
|
10
|
+
const factory_1 = require("./contracts/factory/factory");
|
|
11
|
+
Object.defineProperty(exports, "Factory", { enumerable: true, get: function () { return factory_1.Factory; } });
|
|
12
|
+
const pool_1 = require("./contracts/core/pool");
|
|
13
|
+
Object.defineProperty(exports, "Pool", { enumerable: true, get: function () { return pool_1.Pool; } });
|
|
14
|
+
const account_1 = require("./contracts/core/account");
|
|
15
|
+
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_1.Account; } });
|
|
16
|
+
const risk_calculator_1 = require("./utils/risk_calculator/risk_calculator");
|
|
17
|
+
Object.defineProperty(exports, "RiskCalculator", { enumerable: true, get: function () { return risk_calculator_1.RiskCalculator; } });
|
|
18
|
+
const jetton_minter_1 = require("./contracts/jetton/jetton-minter");
|
|
19
|
+
Object.defineProperty(exports, "JettonMinter", { enumerable: true, get: function () { return jetton_minter_1.JettonMinter; } });
|
|
20
|
+
const jetton_wallet_1 = require("./contracts/jetton/jetton-wallet");
|
|
21
|
+
Object.defineProperty(exports, "JettonWallet", { enumerable: true, get: function () { return jetton_wallet_1.JettonWallet; } });
|
|
22
|
+
const share_vault_1 = require("./contracts/vault/share-vault");
|
|
23
|
+
Object.defineProperty(exports, "ShareVault", { enumerable: true, get: function () { return share_vault_1.ShareVault; } });
|
|
24
|
+
const strategy_vault_1 = require("./contracts/vault/strategy-vault/");
|
|
25
|
+
Object.defineProperty(exports, "StrategyVault", { enumerable: true, get: function () { return strategy_vault_1.StrategyVault; } });
|
|
26
|
+
Object.defineProperty(exports, "strategyVaultConfigToCell", { enumerable: true, get: function () { return strategy_vault_1.strategyVaultConfigToCell; } });
|
|
27
|
+
const affluent_1 = __importDefault(require("./affluent"));
|
|
28
|
+
exports.Affluent = affluent_1.default;
|
|
29
|
+
const rfq_event_emitter_1 = require("./contracts/rfq/rfq_event_emitter");
|
|
30
|
+
Object.defineProperty(exports, "RFQEventEmitter", { enumerable: true, get: function () { return rfq_event_emitter_1.RFQEventEmitter; } });
|
|
31
|
+
const rfq_auction_1 = require("./contracts/rfq/rfq_auction");
|
|
32
|
+
Object.defineProperty(exports, "RFQAuction", { enumerable: true, get: function () { return rfq_auction_1.RFQAuction; } });
|
|
33
|
+
const rfq_batch_1 = require("./contracts/rfq/rfq_batch");
|
|
34
|
+
Object.defineProperty(exports, "RFQBatch", { enumerable: true, get: function () { return rfq_batch_1.RFQBatch; } });
|
|
35
|
+
const constants_1 = require("./constants/constants");
|
|
36
|
+
Object.defineProperty(exports, "ONE_PERCENT_IR_PER_SEC", { enumerable: true, get: function () { return constants_1.ONE_PERCENT_IR_PER_SEC; } });
|
|
37
|
+
const utils_1 = require("./utils/utils");
|
|
38
|
+
Object.defineProperty(exports, "toPercentBigInt", { enumerable: true, get: function () { return utils_1.toPercentBigInt; } });
|
|
39
|
+
Object.defineProperty(exports, "toPercentNumber", { enumerable: true, get: function () { return utils_1.toPercentNumber; } });
|
|
40
|
+
const _compiled_1 = require("./_compiled");
|
|
41
|
+
Object.defineProperty(exports, "WTONWalletCompiled", { enumerable: true, get: function () { return _compiled_1.WTONWalletCompiled; } });
|
|
42
|
+
const jetton_minter_2 = require("./contracts/wton/jetton-minter");
|
|
43
|
+
Object.defineProperty(exports, "WTON_UNWRAP_CELL", { enumerable: true, get: function () { return jetton_minter_2.WTON_UNWRAP_CELL; } });
|
|
44
|
+
Object.defineProperty(exports, "WTONMinter", { enumerable: true, get: function () { return jetton_minter_2.WTONMinter; } });
|
|
45
|
+
const jetton_wallet_2 = require("./contracts/wton/jetton-wallet");
|
|
46
|
+
Object.defineProperty(exports, "WTONWallet", { enumerable: true, get: function () { return jetton_wallet_2.WTONWallet; } });
|
|
47
|
+
const action_parser_1 = require("./utils/action-parser");
|
|
48
|
+
Object.defineProperty(exports, "parseAction", { enumerable: true, get: function () { return action_parser_1.parseAction; } });
|
|
49
|
+
const composite_oracle_1 = require("./services/composite-oracle");
|
|
50
|
+
Object.defineProperty(exports, "CompositeOracleV1", { enumerable: true, get: function () { return composite_oracle_1.CompositeOracleV1; } });
|
|
51
|
+
const strategy_vault_2 = require("./services/strategy-vault");
|
|
52
|
+
Object.defineProperty(exports, "StrategyVaultV1", { enumerable: true, get: function () { return strategy_vault_2.StrategyVaultV1; } });
|
|
53
|
+
const pool_2 = require("./services/pool");
|
|
54
|
+
Object.defineProperty(exports, "PoolServiceV1", { enumerable: true, get: function () { return pool_2.PoolServiceV1; } });
|
|
55
|
+
const share_vault_2 = require("./services/share-vault");
|
|
56
|
+
Object.defineProperty(exports, "ShareVaultServiceV1", { enumerable: true, get: function () { return share_vault_2.ShareVaultServiceV1; } });
|
|
57
|
+
const rfq_batch_2 = require("./services/rfq-batch");
|
|
58
|
+
Object.defineProperty(exports, "RFQBatchServiceV1", { enumerable: true, get: function () { return rfq_batch_2.RFQBatchServiceV1; } });
|
|
59
|
+
const rfq_auction_2 = require("./services/rfq-auction");
|
|
60
|
+
Object.defineProperty(exports, "RFQAuctionServiceV1", { enumerable: true, get: function () { return rfq_auction_2.RFQAuctionServiceV1; } });
|
|
61
|
+
const pending_tracker_1 = require("./utils/pending-tracker");
|
|
62
|
+
Object.defineProperty(exports, "sendMsgTracked", { enumerable: true, get: function () { return pending_tracker_1.sendMsgTracked; } });
|
|
63
|
+
Object.defineProperty(exports, "createTrackableSender", { enumerable: true, get: function () { return pending_tracker_1.createTrackableSender; } });
|
|
64
|
+
Object.defineProperty(exports, "createTrackableSenderFromMnemonic", { enumerable: true, get: function () { return pending_tracker_1.createTrackableSenderFromMnemonic; } });
|
|
65
|
+
Object.defineProperty(exports, "ToncenterV3Client", { enumerable: true, get: function () { return pending_tracker_1.ToncenterV3Client; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assert(condition: boolean, message?: string): asserts condition;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assert = assert;
|
|
4
|
+
// Browser-compatible assert function to replace Node.js assert module for webpack5 compatibility
|
|
5
|
+
function assert(condition, message) {
|
|
6
|
+
if (!condition) {
|
|
7
|
+
throw new Error(message || "Assertion failed");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withQueryCache = withQueryCache;
|
|
4
|
+
const ton_1 = require("@ton/ton");
|
|
5
|
+
/**
|
|
6
|
+
* Wraps an object to cache results of get* method calls for TTL milliseconds.
|
|
7
|
+
* Prevents duplicate RPC calls when the same getter is called multiple times.
|
|
8
|
+
*/
|
|
9
|
+
function withQueryCache(instance, ttl = 2500) {
|
|
10
|
+
const cache = new Map();
|
|
11
|
+
const inflightRequests = new Map();
|
|
12
|
+
return new Proxy(instance, {
|
|
13
|
+
get(target, prop) {
|
|
14
|
+
const value = target[prop];
|
|
15
|
+
// Return as-is if not a function
|
|
16
|
+
if (typeof value !== "function") {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
const methodName = String(prop);
|
|
20
|
+
// Only cache methods that start with 'get'
|
|
21
|
+
if (!methodName.startsWith("get")) {
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
// Return cached function
|
|
25
|
+
return async function (...args) {
|
|
26
|
+
// Generate cache key (method name + arguments)
|
|
27
|
+
const params = JSON.stringify(args, (key, value) => typeof value === "bigint" || value instanceof ton_1.Cell || value instanceof ton_1.Address ? value.toString() : value);
|
|
28
|
+
const key = `${methodName}_${params}`;
|
|
29
|
+
const now = Date.now();
|
|
30
|
+
// 1. Check cache
|
|
31
|
+
const cached = cache.get(key);
|
|
32
|
+
if (cached && now < cached.expiry) {
|
|
33
|
+
return cached.data;
|
|
34
|
+
}
|
|
35
|
+
// 2. Check if there's already an inflight request
|
|
36
|
+
const inflight = inflightRequests.get(key);
|
|
37
|
+
if (inflight) {
|
|
38
|
+
return await inflight;
|
|
39
|
+
}
|
|
40
|
+
// 3. Start new request
|
|
41
|
+
const promise = Promise.resolve(value.apply(target, args))
|
|
42
|
+
.then((data) => {
|
|
43
|
+
// Store in cache on success
|
|
44
|
+
cache.set(key, { data, expiry: now + ttl });
|
|
45
|
+
return data;
|
|
46
|
+
})
|
|
47
|
+
.finally(() => {
|
|
48
|
+
// Remove from inflight requests after completion
|
|
49
|
+
inflightRequests.delete(key);
|
|
50
|
+
});
|
|
51
|
+
// Register as inflight request
|
|
52
|
+
inflightRequests.set(key, promise);
|
|
53
|
+
return await promise;
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Address, Cell } from "@ton/core";
|
|
2
|
+
import { AddressSender } from "../types/sender";
|
|
3
|
+
export type InternalMessageInput = {
|
|
4
|
+
to: Address;
|
|
5
|
+
value: bigint;
|
|
6
|
+
body: Cell;
|
|
7
|
+
};
|
|
8
|
+
export declare function sendMsg<T>(sender: AddressSender, msg: Promise<{
|
|
9
|
+
opts: T;
|
|
10
|
+
input: InternalMessageInput;
|
|
11
|
+
}>): Promise<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendMsg = sendMsg;
|
|
4
|
+
const core_1 = require("@ton/core");
|
|
5
|
+
async function sendMsg(sender, msg) {
|
|
6
|
+
const { opts, input } = await msg;
|
|
7
|
+
await sender.send({ ...input, sendMode: core_1.SendMode.PAY_GAS_SEPARATELY });
|
|
8
|
+
return opts;
|
|
9
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Cell } from "@ton/core";
|
|
2
|
+
import { Prices, SyntheticCompositions, VaultPosition, VaultPositions, PoolInfos, VaultPrices, CompositeOracleResult, CompositeOracleInput } from "./types";
|
|
3
|
+
import { AssetPriceInfo, OnchainDataInfo } from "../../contracts/oracle/redstone-onchain-oracle/type";
|
|
4
|
+
export type OracleExposures = {
|
|
5
|
+
assets: Set<string>;
|
|
6
|
+
pools: Set<string>;
|
|
7
|
+
vaults: Set<string>;
|
|
8
|
+
totalSize(): number;
|
|
9
|
+
};
|
|
10
|
+
export declare function createOracleExposures(): OracleExposures;
|
|
11
|
+
export declare function applyPrice(amount: bigint, price: bigint): bigint;
|
|
12
|
+
export declare function calculateSyntheticPrices(rawPrices: Prices, syntheticCompositions: SyntheticCompositions): Prices;
|
|
13
|
+
export declare function computePoolPositionsValue(poolPositions: VaultPosition["poolPositions"], poolInfos: PoolInfos, prices: Prices): {
|
|
14
|
+
totalValue: bigint;
|
|
15
|
+
decomposed: Record<string, {
|
|
16
|
+
supply: bigint;
|
|
17
|
+
borrow: bigint;
|
|
18
|
+
}>;
|
|
19
|
+
assetAmounts: Record<string, bigint>;
|
|
20
|
+
};
|
|
21
|
+
export declare function computeVaultValue(vault: VaultPosition, poolInfos: PoolInfos, prices: Prices): {
|
|
22
|
+
totalValue: bigint;
|
|
23
|
+
price: bigint;
|
|
24
|
+
decomposed: Record<string, {
|
|
25
|
+
supply: bigint;
|
|
26
|
+
borrow: bigint;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
export declare function calculateVaultPrices(vaultPositions: VaultPositions, poolInfos: PoolInfos, assetPrices: Prices): VaultPrices;
|
|
30
|
+
export declare function computeCompositePrices(input: CompositeOracleInput): CompositeOracleResult;
|
|
31
|
+
export declare function getExposures(vaultPositions: VaultPositions): {
|
|
32
|
+
assets: string[];
|
|
33
|
+
pools: string[];
|
|
34
|
+
};
|
|
35
|
+
export declare function separateAssets(allAssets: string[], oracleConfig: {
|
|
36
|
+
redstoneAssetInfo?: Record<string, {
|
|
37
|
+
address: {
|
|
38
|
+
toString(): string;
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
41
|
+
assetOnchainDataInfo?: Record<string, any>;
|
|
42
|
+
}): {
|
|
43
|
+
assets: string[];
|
|
44
|
+
vaultAssets: string[];
|
|
45
|
+
};
|
|
46
|
+
export declare function updateOnchainInternalData(prices: AssetPriceInfo, onchainData: OnchainDataInfo): AssetPriceInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Build oracle params Cell from pre-fetched Redstone payload
|
|
49
|
+
* Pure computation - no network calls
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildOracleParamsCellFromPayload(assets: string[], oracleConfig: any, payload: Cell, pools: string[], vaults: string[]): Cell;
|
|
52
|
+
/**
|
|
53
|
+
* Build oracle params Cell - fetches Redstone payload and builds Cell
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildOracleParamsCell(assets: string[], oracleConfig: any, pools: string[], vaults: string[]): Promise<Cell>;
|