@affluent-org/sdk 0.0.2 → 0.0.3
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/build/Account.compiled.json +1 -0
- package/dist/build/Receipt.compiled.json +1 -0
- package/dist/build/WTONWallet.compiled.json +1 -0
- package/dist/common/cache.d.ts +16 -0
- package/dist/common/cache.js +96 -0
- package/dist/common/service.d.ts +20 -0
- package/dist/common/service.js +69 -0
- package/dist/common/type.d.ts +14 -0
- package/dist/common/type.js +2 -0
- package/dist/common/unknown-contract.d.ts +14 -0
- package/dist/common/unknown-contract.js +18 -0
- package/dist/common/versions.d.ts +14 -0
- package/dist/common/versions.js +22 -0
- package/dist/constants/pool.d.ts +1 -0
- package/dist/constants/pool.js +2 -0
- package/dist/contracts/_mock/simple-oracle.d.ts +34 -0
- package/dist/contracts/_mock/simple-oracle.js +73 -0
- package/dist/contracts/vault/share-vault/type.d.ts +30 -0
- package/dist/contracts/vault/share-vault/type.js +2 -0
- package/dist/contracts/vault/strategy-vault/utils.d.ts +6 -0
- package/dist/contracts/vault/strategy-vault/utils.js +32 -0
- package/dist/factorial.d.ts +14 -0
- package/dist/factorial.js +20 -0
- package/dist/farm.d.ts +92 -0
- package/dist/farm.js +209 -0
- package/dist/monitor.d.ts +57 -0
- package/dist/monitor.js +527 -0
- package/dist/monitorCacheV1.d.ts +52 -0
- package/dist/monitorCacheV1.js +504 -0
- package/dist/oracle/oracle-v2.d.ts +39 -0
- package/dist/oracle/oracle-v2.js +151 -0
- package/dist/oracle/oracle.d.ts +107 -0
- package/dist/oracle/oracle.js +392 -0
- package/dist/periphery.d.ts +259 -0
- package/dist/periphery.js +1087 -0
- package/dist/pool.d.ts +216 -0
- package/dist/pool.js +2298 -0
- package/dist/poolCacheV1.d.ts +139 -0
- package/dist/poolCacheV1.js +1841 -0
- package/dist/rfq-auction.d.ts +75 -0
- package/dist/rfq-auction.js +220 -0
- package/dist/rfq-batch.d.ts +112 -0
- package/dist/rfq-batch.js +284 -0
- package/dist/services/share-vault/computation.d.ts +14 -17
- package/dist/services/share-vault/computation.js +39 -0
- package/dist/services/share-vault/index.js +6 -3
- package/dist/services/share-vault/query.d.ts +38 -8
- package/dist/services/share-vault/query.js +20 -27
- package/dist/services/share-vault/type.d.ts +19 -0
- package/dist/services/share-vault/type.js +2 -0
- package/dist/services/share-vault/user/index.js +3 -1
- package/dist/services/strategy-vault/computation.d.ts +1 -0
- package/dist/services/strategy-vault/computation.js +15 -0
- package/dist/services/strategy-vault/query.d.ts +147 -0
- package/dist/services/strategy-vault/query.js +67 -0
- package/dist/services/strategy-vault/type.d.ts +2 -0
- package/dist/services/strategy-vault/type.js +2 -0
- package/dist/share-vault.d.ts +91 -0
- package/dist/share-vault.js +747 -0
- package/dist/stonfi.d.ts +18 -0
- package/dist/stonfi.js +76 -0
- package/dist/strategy_vault/base.d.ts +399 -0
- package/dist/strategy_vault/base.js +1199 -0
- package/dist/strategy_vault/index.d.ts +3 -0
- package/dist/strategy_vault/index.js +7 -0
- package/dist/strategy_vault/steps.d.ts +49 -0
- package/dist/strategy_vault/steps.js +170 -0
- package/dist/types/action.d.ts +55 -0
- package/dist/types/action.js +2 -0
- package/dist/types/messages.d.ts +7 -0
- package/dist/types/messages.js +2 -0
- package/dist/types/params.d.ts +19 -0
- package/dist/types/params.js +2 -0
- package/dist/types/pool.d.ts +83 -0
- package/dist/types/pool.js +2 -0
- package/dist/types/transaction.d.ts +40 -0
- package/dist/types/transaction.js +2 -0
- package/dist/utils/_parse_temp/JumpIRM.d.ts +37 -0
- package/dist/utils/_parse_temp/JumpIRM.js +71 -0
- package/dist/utils/_parse_temp/Pool.d.ts +559 -0
- package/dist/utils/_parse_temp/Pool.js +1023 -0
- package/dist/utils/_parse_temp/ShareVault.d.ts +264 -0
- package/dist/utils/_parse_temp/ShareVault.js +479 -0
- package/dist/utils/_parse_temp/StrategyVault.d.ts +729 -0
- package/dist/utils/_parse_temp/StrategyVault.js +1865 -0
- package/dist/utils/_parse_temp/parseMsgBody.d.ts +13 -0
- package/dist/utils/_parse_temp/parseMsgBody.js +313 -0
- package/dist/utils/assert.d.ts +1 -0
- package/dist/utils/assert.js +9 -0
- package/dist/utils/client-for-parameter.d.ts +12 -0
- package/dist/utils/client-for-parameter.js +97 -0
- package/dist/utils/oracle/index.d.ts +4 -0
- package/dist/utils/oracle/index.js +19 -0
- package/dist/utils/oracle/redstone/helper.d.ts +22 -0
- package/dist/utils/oracle/redstone/helper.js +186 -0
- package/dist/utils/tracer.d.ts +13 -0
- package/dist/utils/tracer.js +137 -0
- package/dist/utils/tracker/index.d.ts +5 -0
- package/dist/utils/tracker/index.js +118 -0
- package/dist/utils/tracker/query-id-generactor.d.ts +2 -0
- package/dist/utils/tracker/query-id-generactor.js +12 -0
- package/dist/utils/tracker/type.d.ts +34 -0
- package/dist/utils/tracker/type.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Address, Sender } from "@ton/ton";
|
|
2
|
+
import { PoolState } from "./contracts/core/pool/type";
|
|
3
|
+
import { OnchainDataInfo } from "./contracts/oracle/redstone-onchain-oracle/type";
|
|
4
|
+
import { LiquidateActionParams, TransferInActionParams, TansferOutActionParams } from "./types/action";
|
|
5
|
+
import { TxCallBackFn, TxStep } from "./utils/tracker/type";
|
|
6
|
+
import { AssetPriceInfo } from "./contracts/oracle/redstone-onchain-oracle/type";
|
|
7
|
+
import { AccountAssetState, AccountState } from "./contracts/core/account/type";
|
|
8
|
+
import { ServiceBaseV1 } from "./common/service";
|
|
9
|
+
export declare class PoolCacheV1 extends ServiceBaseV1 {
|
|
10
|
+
private walletAddresses;
|
|
11
|
+
private accountAddresses;
|
|
12
|
+
private getJettonWalletAddress;
|
|
13
|
+
getAccountAddress(owner: string, pool: string): Promise<Address>;
|
|
14
|
+
findAndCallback(target: Address, step: TxStep, createdLt: string | bigint, callbackFn?: TxCallBackFn): Promise<import("./utils/tracker/type").MatchedTxResult>;
|
|
15
|
+
supply(sender: Sender, params: TransferInActionParams): Promise<void>;
|
|
16
|
+
supplyAndWaitTx(sender: Sender, params: TransferInActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
17
|
+
action: {
|
|
18
|
+
type: string;
|
|
19
|
+
params: TransferInActionParams;
|
|
20
|
+
queryId: bigint;
|
|
21
|
+
};
|
|
22
|
+
steps: TxStep[];
|
|
23
|
+
}>;
|
|
24
|
+
findTx(action: any, callbackFn?: TxCallBackFn): Promise<{
|
|
25
|
+
action: {
|
|
26
|
+
type: string;
|
|
27
|
+
params: TransferInActionParams;
|
|
28
|
+
queryId: bigint;
|
|
29
|
+
};
|
|
30
|
+
steps: TxStep[];
|
|
31
|
+
} | undefined>;
|
|
32
|
+
getPricesV2(poolAddress: Address | string): Promise<any>;
|
|
33
|
+
findSupplyTx(queryId: bigint, params: TransferInActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
34
|
+
action: {
|
|
35
|
+
type: string;
|
|
36
|
+
params: TransferInActionParams;
|
|
37
|
+
queryId: bigint;
|
|
38
|
+
};
|
|
39
|
+
steps: TxStep[];
|
|
40
|
+
}>;
|
|
41
|
+
withdraw(sender: Sender, params: TansferOutActionParams): Promise<void>;
|
|
42
|
+
withdrawAndWaitTx(sender: Sender, params: TansferOutActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
43
|
+
action: {
|
|
44
|
+
type: string;
|
|
45
|
+
params: TansferOutActionParams;
|
|
46
|
+
queryId: bigint;
|
|
47
|
+
};
|
|
48
|
+
steps: TxStep[];
|
|
49
|
+
}>;
|
|
50
|
+
findWithdrawTx(queryId: bigint, params: TansferOutActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
51
|
+
action: {
|
|
52
|
+
type: string;
|
|
53
|
+
params: TansferOutActionParams;
|
|
54
|
+
queryId: bigint;
|
|
55
|
+
};
|
|
56
|
+
steps: TxStep[];
|
|
57
|
+
}>;
|
|
58
|
+
borrow(sender: Sender, params: TansferOutActionParams): Promise<void>;
|
|
59
|
+
borrowAndWaitTx(sender: Sender, params: TansferOutActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
60
|
+
action: {
|
|
61
|
+
type: string;
|
|
62
|
+
params: TansferOutActionParams;
|
|
63
|
+
queryId: bigint;
|
|
64
|
+
};
|
|
65
|
+
steps: TxStep[];
|
|
66
|
+
}>;
|
|
67
|
+
findBorrowTx(queryId: bigint, params: TansferOutActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
68
|
+
action: {
|
|
69
|
+
type: string;
|
|
70
|
+
params: TansferOutActionParams;
|
|
71
|
+
queryId: bigint;
|
|
72
|
+
};
|
|
73
|
+
steps: TxStep[];
|
|
74
|
+
}>;
|
|
75
|
+
repay(sender: Sender, params: TransferInActionParams): Promise<void>;
|
|
76
|
+
repayAndWaitTx(sender: Sender, params: TransferInActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
77
|
+
action: {
|
|
78
|
+
type: string;
|
|
79
|
+
params: TransferInActionParams;
|
|
80
|
+
queryId: bigint;
|
|
81
|
+
};
|
|
82
|
+
steps: TxStep[];
|
|
83
|
+
}>;
|
|
84
|
+
findRepayTx(queryId: bigint, params: TransferInActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
85
|
+
action: {
|
|
86
|
+
type: string;
|
|
87
|
+
params: TransferInActionParams;
|
|
88
|
+
queryId: bigint;
|
|
89
|
+
};
|
|
90
|
+
steps: TxStep[];
|
|
91
|
+
}>;
|
|
92
|
+
liquidateSimulate(params: LiquidateActionParams): Promise<void>;
|
|
93
|
+
liquidateAndWaitTxSimulate(queryId: bigint, params: LiquidateActionParams, callbackFn?: TxCallBackFn): Promise<TxStep[]>;
|
|
94
|
+
liquidate(sender: Sender, params: LiquidateActionParams): Promise<void>;
|
|
95
|
+
liquidateAndWaitTx(sender: Sender, params: LiquidateActionParams, callbackFn?: TxCallBackFn): Promise<{
|
|
96
|
+
action: {
|
|
97
|
+
type: string;
|
|
98
|
+
params: LiquidateActionParams;
|
|
99
|
+
queryId: bigint;
|
|
100
|
+
};
|
|
101
|
+
steps: TxStep[];
|
|
102
|
+
}>;
|
|
103
|
+
updateOnchainData(onchainDataInfo: OnchainDataInfo): Promise<OnchainDataInfo>;
|
|
104
|
+
getRedstonePrices(assets: string[], poolData: any): Promise<{
|
|
105
|
+
redstonePrices: AssetPriceInfo;
|
|
106
|
+
onchainData: any;
|
|
107
|
+
}>;
|
|
108
|
+
calculatePrices(_prices: AssetPriceInfo, oracleData: any): AssetPriceInfo;
|
|
109
|
+
decomposeAccountStatus(accountStatus: Record<string, AccountAssetState>, prices: AssetPriceInfo, onchainData: OnchainDataInfo): Record<string, Omit<AccountAssetState, "address">>;
|
|
110
|
+
calculateRisk(decomposedAccountStatus: Record<string, Omit<AccountAssetState, "address">>, prices: AssetPriceInfo, poolData: PoolState): {
|
|
111
|
+
result: boolean;
|
|
112
|
+
healthy: boolean;
|
|
113
|
+
unhealthy: boolean;
|
|
114
|
+
collateral: bigint;
|
|
115
|
+
debt: bigint;
|
|
116
|
+
risk: bigint;
|
|
117
|
+
riskRatio: bigint;
|
|
118
|
+
leverageRatio: bigint;
|
|
119
|
+
};
|
|
120
|
+
getOracleRequestParams(assets: string[], oracleConfig: any): Promise<{
|
|
121
|
+
feedIds: bigint[];
|
|
122
|
+
redstoneAssetNames: any[];
|
|
123
|
+
requestAssets: Address[];
|
|
124
|
+
redstoneAssets: Address[];
|
|
125
|
+
}>;
|
|
126
|
+
isHealthy(poolAddress: Address | string, ownerAddress: Address | string): Promise<{
|
|
127
|
+
result: boolean;
|
|
128
|
+
healthy: boolean;
|
|
129
|
+
unhealthy: boolean;
|
|
130
|
+
collateral: bigint;
|
|
131
|
+
debt: bigint;
|
|
132
|
+
risk: bigint;
|
|
133
|
+
riskRatio: bigint;
|
|
134
|
+
leverageRatio: bigint;
|
|
135
|
+
}>;
|
|
136
|
+
getPrices(poolAddress: Address | string): Promise<AssetPriceInfo>;
|
|
137
|
+
getPoolData(poolAddress: Address | string): Promise<PoolState>;
|
|
138
|
+
getAccountData(poolAddress: Address | string, userAddress: Address | string): Promise<AccountState>;
|
|
139
|
+
}
|