@affluent-org/sdk 0.0.5 → 0.0.6
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/affluent.d.ts +3 -3
- package/dist/affluent.js +3 -3
- package/dist/common/computation.d.ts +6 -0
- package/dist/common/computation.js +54 -0
- package/dist/common/helper.d.ts +5 -0
- package/dist/common/helper.js +29 -0
- package/dist/common/service.d.ts +10 -2
- package/dist/common/service.js +56 -3
- package/dist/common/trace-action.d.ts +92 -0
- package/dist/common/trace-action.js +187 -0
- package/dist/common/transform.d.ts +15 -21
- package/dist/common/transform.js +63 -150
- package/dist/common/types.d.ts +9 -13
- package/dist/common/types.js +2 -2
- package/dist/context.d.ts +3 -0
- package/dist/context.js +9 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/index.js +2 -0
- package/dist/contracts/vault/strategy-vault/index.d.ts +2 -1
- package/dist/contracts/vault/strategy-vault/index.js +1 -0
- package/dist/factorial.d.ts +18 -8
- package/dist/factorial.js +26 -14
- package/dist/index.d.ts +4 -2
- package/dist/index.js +18 -2
- package/dist/lib/send-msg.d.ts +16 -2
- package/dist/lib/send-msg.js +23 -2
- package/dist/monitor.js +2 -0
- package/dist/monitorCacheV1.js +3 -2
- package/dist/oracle/oracle.d.ts +3 -2
- package/dist/oracle/oracle.js +25 -2
- package/dist/pool.d.ts +41 -0
- package/dist/pool.js +146 -178
- package/dist/poolCacheV1.js +1 -0
- package/dist/rfq-auction.d.ts +2 -2
- package/dist/rfq-auction.js +6 -6
- package/dist/rfq-batch.d.ts +21 -11
- package/dist/rfq-batch.js +81 -9
- package/dist/services/composite-oracle/computation.d.ts +3 -8
- package/dist/services/composite-oracle/computation.js +91 -56
- package/dist/services/composite-oracle/index.js +4 -5
- package/dist/services/composite-oracle/query.js +1 -3
- package/dist/services/pool/computation.js +9 -61
- package/dist/services/pool/index.d.ts +10 -59
- package/dist/services/pool/index.js +55 -8
- package/dist/services/pool/query.js +1 -1
- package/dist/services/pool/user/trace.d.ts +90 -0
- package/dist/services/pool/user/trace.js +168 -0
- package/dist/services/rfq-auction/index.d.ts +7 -23
- package/dist/services/rfq-auction/index.js +45 -6
- package/dist/services/rfq-auction/user/index.js +1 -1
- package/dist/services/rfq-auction/user/trace.d.ts +53 -0
- package/dist/services/rfq-auction/user/trace.js +68 -0
- package/dist/services/rfq-batch/index.d.ts +16 -13
- package/dist/services/rfq-batch/index.js +34 -10
- package/dist/services/rfq-batch/user/trace.d.ts +49 -0
- package/dist/services/rfq-batch/user/trace.js +67 -0
- package/dist/services/share-vault/index.d.ts +12 -56
- package/dist/services/share-vault/index.js +37 -10
- package/dist/services/share-vault/query.js +1 -1
- package/dist/services/share-vault/user/trace.d.ts +54 -0
- package/dist/services/share-vault/user/trace.js +84 -0
- package/dist/services/strategy-vault/index.d.ts +68 -1981
- package/dist/services/strategy-vault/index.js +114 -53
- package/dist/services/strategy-vault/oracle.js +1 -0
- package/dist/services/strategy-vault/owner/index.d.ts +2 -2
- package/dist/services/strategy-vault/owner/index.js +1 -1
- package/dist/services/strategy-vault/owner/types.d.ts +4 -0
- package/dist/services/strategy-vault/query.js +1 -1
- package/dist/services/strategy-vault/user/trace.d.ts +156 -0
- package/dist/services/strategy-vault/user/trace.js +264 -0
- package/dist/share-vault.d.ts +164 -8
- package/dist/share-vault.js +222 -67
- package/dist/strategy_vault/base.d.ts +521 -105
- package/dist/strategy_vault/base.js +493 -41
- package/dist/strategy_vault/steps.d.ts +120 -3
- package/dist/strategy_vault/steps.js +161 -0
- package/dist/types/sender.d.ts +1 -0
- package/dist/utils/_parse_temp/StrategyVault.d.ts +9 -9
- package/dist/utils/_parse_temp/StrategyVault.js +48 -40
- package/dist/utils/_parse_temp/parseMsgBody.d.ts +2 -2
- package/dist/utils/_parse_temp/parseMsgBody.js +84 -84
- package/dist/utils/external-message-hash.d.ts +7 -3
- package/dist/utils/external-message-hash.js +20 -7
- package/dist/utils/oracle/redstone/helper.js +2 -0
- package/dist/utils/oracle/redstone/redstoneHelper.d.ts +7 -0
- package/dist/utils/oracle/redstone/redstoneHelper.js +103 -1
- package/dist/utils/pending-tracker/trackable-sender.d.ts +37 -4
- package/dist/utils/pending-tracker/trackable-sender.js +47 -8
- package/dist/utils/pending-tracker/v3-client.d.ts +16 -0
- package/dist/utils/pending-tracker/v3-client.js +80 -2
- package/dist/utils/toncenter/index.d.ts +1 -0
- package/dist/utils/toncenter/index.js +17 -0
- package/dist/utils/toncenter/transform.d.ts +11 -0
- package/dist/utils/toncenter/transform.js +40 -0
- package/dist/utils/toncenter/type.d.ts +227 -0
- package/dist/utils/toncenter/type.js +2 -0
- package/package.json +3 -3
package/dist/common/transform.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VaultNativeAmountDecomposedContext = exports.VaultNativeValueDecomposedContext = exports.VaultValueContext = exports.VaultAmountContext = exports.VaultStateContext = exports.PoolContext = exports.PoolAsset = exports.
|
|
3
|
+
exports.VaultNativeAmountDecomposedContext = exports.VaultNativeValueDecomposedContext = exports.VaultValueContext = exports.VaultAmountContext = exports.VaultStateContext = exports.PoolContext = exports.PoolAsset = exports.AmountPosition = exports.ValuePosition = exports.SharePosition = exports.Position = void 0;
|
|
4
4
|
const pool_1 = require("../contracts/core/pool");
|
|
5
5
|
const share_vault_1 = require("../contracts/vault/share-vault");
|
|
6
6
|
const strategy_vault_1 = require("../contracts/vault/strategy-vault");
|
|
7
|
-
const
|
|
7
|
+
const helper_1 = require("./helper");
|
|
8
|
+
const computation_1 = require("../services/composite-oracle/computation");
|
|
8
9
|
class Position {
|
|
9
10
|
supply;
|
|
10
11
|
borrow;
|
|
@@ -12,19 +13,23 @@ class Position {
|
|
|
12
13
|
this.supply = supply;
|
|
13
14
|
this.borrow = borrow;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
this.supply
|
|
17
|
-
this.borrow += borrow;
|
|
18
|
-
return this;
|
|
16
|
+
add(supply, borrow) {
|
|
17
|
+
return new this.constructor(this.supply + supply, this.borrow + borrow);
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
addPosition(position) {
|
|
20
|
+
return position
|
|
21
|
+
? this.add(position.supply, position.borrow)
|
|
22
|
+
: this.clone();
|
|
23
|
+
}
|
|
24
|
+
muldiv(numerator, denominator) {
|
|
25
|
+
return new this.constructor(this.supply * numerator / denominator, this.borrow * numerator / denominator);
|
|
24
26
|
}
|
|
25
27
|
clone() {
|
|
26
28
|
return new this.constructor(this.supply, this.borrow);
|
|
27
29
|
}
|
|
30
|
+
cross(other, denominator) {
|
|
31
|
+
return new this.constructor((this.supply * other.supply + this.borrow * other.borrow) / denominator, (this.supply * other.borrow + this.borrow * other.supply) / denominator);
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
exports.Position = Position;
|
|
30
35
|
class SharePosition extends Position {
|
|
@@ -54,17 +59,6 @@ class AmountPosition extends Position {
|
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
exports.AmountPosition = AmountPosition;
|
|
57
|
-
class AmountPositionWithAddress extends AmountPosition {
|
|
58
|
-
address;
|
|
59
|
-
constructor(address, supply, borrow) {
|
|
60
|
-
super(supply, borrow);
|
|
61
|
-
this.address = address;
|
|
62
|
-
}
|
|
63
|
-
static from(data) {
|
|
64
|
-
return new this(data.address, data.supply, data.borrow);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.AmountPositionWithAddress = AmountPositionWithAddress;
|
|
68
62
|
class PoolAsset {
|
|
69
63
|
amount;
|
|
70
64
|
share;
|
|
@@ -122,10 +116,9 @@ class VaultStateContext {
|
|
|
122
116
|
};
|
|
123
117
|
const pools = {};
|
|
124
118
|
Object.entries(vaultState.whitelistedPools)
|
|
119
|
+
.filter(([_pool, poolState]) => poolState.supply > 0n) // align with getExposures
|
|
125
120
|
.forEach(([pool, poolState]) => {
|
|
126
|
-
pools[pool] = {
|
|
127
|
-
[asset]: new SharePosition(poolState.supply, 0n),
|
|
128
|
-
};
|
|
121
|
+
pools[pool] = { [asset]: new SharePosition(poolState.supply, 0n) };
|
|
129
122
|
});
|
|
130
123
|
return new this(vaultState.address.toString(), vaultState.totalSupply, assets, pools);
|
|
131
124
|
}
|
|
@@ -137,19 +130,22 @@ class VaultStateContext {
|
|
|
137
130
|
const assets = {};
|
|
138
131
|
Object.entries(vaultState.assets)
|
|
139
132
|
.forEach(([asset, assetState]) => {
|
|
133
|
+
if (assetState.cash === 0n)
|
|
134
|
+
return;
|
|
140
135
|
assets[asset] = new AmountPosition(assetState.cash, 0n);
|
|
141
136
|
});
|
|
142
137
|
const pools = {};
|
|
143
138
|
Object.entries(vaultState.factorialPools)
|
|
144
139
|
.forEach(([pool, poolState]) => {
|
|
140
|
+
const exposedPoolAssetEntries = Object.entries(poolState).filter(([_, assetState]) => assetState.supply > 0n || assetState.borrow > 0n);
|
|
141
|
+
if (exposedPoolAssetEntries.length === 0)
|
|
142
|
+
return;
|
|
145
143
|
const poolEntry = {};
|
|
146
|
-
|
|
147
|
-
.forEach(([asset, assetState]) => {
|
|
148
|
-
poolEntry[asset] = new SharePosition(assetState.supply, assetState.borrow);
|
|
149
|
-
});
|
|
144
|
+
exposedPoolAssetEntries.forEach(([asset, assetState]) => poolEntry[asset] = new SharePosition(assetState.supply, assetState.borrow));
|
|
150
145
|
pools[pool] = poolEntry;
|
|
151
146
|
});
|
|
152
|
-
|
|
147
|
+
const result = new this(vaultState.address.toString(), vaultState.totalSupply, assets, pools);
|
|
148
|
+
return result;
|
|
153
149
|
}
|
|
154
150
|
toAmountContext(poolContexts) {
|
|
155
151
|
return VaultAmountContext.fromVaultStateContext(this, poolContexts);
|
|
@@ -168,159 +164,84 @@ class VaultAmountContext {
|
|
|
168
164
|
this.pools = pools;
|
|
169
165
|
}
|
|
170
166
|
static fromVaultStateContext(VaultStateContext, poolContexts) {
|
|
171
|
-
const assets =
|
|
172
|
-
Object.entries(VaultStateContext.assets)
|
|
173
|
-
.forEach(([asset, amount]) => assets[asset] = amount.clone());
|
|
167
|
+
const assets = (0, helper_1.copyPositions)(VaultStateContext.assets);
|
|
174
168
|
const pools = {};
|
|
175
169
|
Object.entries(VaultStateContext.pools)
|
|
176
170
|
.forEach(([pool, poolPosition]) => {
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
pools[pool] =
|
|
171
|
+
const poolContext = poolContexts[pool];
|
|
172
|
+
if (!poolContext)
|
|
173
|
+
throw new Error(`Pool context not found: ${pool}`);
|
|
174
|
+
pools[pool] = (0, helper_1.mapPositions)(poolPosition, (asset, sharePosition) => poolContext.getAmountFrom(asset, sharePosition));
|
|
181
175
|
});
|
|
182
|
-
|
|
176
|
+
const result = new this(VaultStateContext.address, VaultStateContext.totalSupply, assets, pools);
|
|
177
|
+
return result;
|
|
183
178
|
}
|
|
184
179
|
toValueContext(prices) {
|
|
185
180
|
return VaultValueContext.fromAmountContext(this, prices);
|
|
186
181
|
}
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
Object.entries(this.assets)
|
|
190
|
-
.forEach(([asset, position]) => {
|
|
191
|
-
net[asset] = position.clone();
|
|
192
|
-
});
|
|
182
|
+
decompose() {
|
|
183
|
+
const decomposed = (0, helper_1.copyPositions)(this.assets);
|
|
193
184
|
Object.entries(this.pools)
|
|
194
|
-
.forEach(([pool, poolPosition]) =>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
});
|
|
200
|
-
return net;
|
|
185
|
+
.forEach(([pool, poolPosition]) => (0, helper_1.applyPositions)(decomposed, poolPosition));
|
|
186
|
+
return decomposed;
|
|
187
|
+
}
|
|
188
|
+
nativeDecompose(prices) {
|
|
189
|
+
return VaultNativeAmountDecomposedContext.fromAmountContext(this, prices);
|
|
201
190
|
}
|
|
202
191
|
}
|
|
203
192
|
exports.VaultAmountContext = VaultAmountContext;
|
|
204
193
|
class VaultValueContext {
|
|
205
194
|
address;
|
|
195
|
+
totalSupply;
|
|
206
196
|
assets;
|
|
207
197
|
pools;
|
|
208
|
-
constructor(address, assets, pools) {
|
|
198
|
+
constructor(address, totalSupply, assets, pools) {
|
|
209
199
|
this.address = address;
|
|
200
|
+
this.totalSupply = totalSupply;
|
|
210
201
|
this.assets = assets;
|
|
211
202
|
this.pools = pools;
|
|
212
203
|
}
|
|
213
204
|
static fromAmountContext(amountContext, prices) {
|
|
214
|
-
const assets =
|
|
215
|
-
Object.entries(amountContext.assets)
|
|
216
|
-
.forEach(([asset, position]) => assets[asset] = position.toValuePosition(prices[asset].price));
|
|
205
|
+
const assets = (0, helper_1.mapPositions)(amountContext.assets, (asset, position) => position.toValuePosition(prices[asset].price));
|
|
217
206
|
const pools = {};
|
|
218
207
|
Object.entries(amountContext.pools)
|
|
219
|
-
.forEach(([pool, poolState]) =>
|
|
220
|
-
|
|
221
|
-
Object.entries(poolState)
|
|
222
|
-
.forEach(([asset, assetState]) => poolEntry[asset] = assetState.toValuePosition(prices[asset].price));
|
|
223
|
-
pools[pool] = poolEntry;
|
|
224
|
-
});
|
|
225
|
-
return new this(amountContext.address, assets, pools);
|
|
208
|
+
.forEach(([pool, poolState]) => pools[pool] = (0, helper_1.mapPositions)(poolState, (asset, position) => position.toValuePosition(prices[asset].price)));
|
|
209
|
+
return new this(amountContext.address, amountContext.totalSupply, assets, pools);
|
|
226
210
|
}
|
|
227
211
|
get totalValue() {
|
|
228
212
|
let totalValue = 0n;
|
|
229
|
-
|
|
230
|
-
.forEach(([asset, position]) => totalValue += position.net());
|
|
213
|
+
(0, helper_1.mapPositions)(this.assets, (_asset, position) => totalValue += position.net());
|
|
231
214
|
Object.entries(this.pools)
|
|
232
|
-
.forEach(([_pool, poolPosition]) =>
|
|
233
|
-
.forEach(([_, position]) => totalValue += position.net()));
|
|
215
|
+
.forEach(([_pool, poolPosition]) => (0, helper_1.mapPositions)(poolPosition, (_asset, position) => totalValue += position.net()));
|
|
234
216
|
return totalValue;
|
|
235
217
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
});
|
|
218
|
+
get price() {
|
|
219
|
+
return this.totalSupply === 0n ? 0n : (this.totalValue / this.totalSupply);
|
|
220
|
+
}
|
|
221
|
+
decompose() {
|
|
222
|
+
const decomposed = (0, helper_1.copyPositions)(this.assets);
|
|
242
223
|
Object.entries(this.pools)
|
|
243
|
-
.forEach(([
|
|
244
|
-
|
|
245
|
-
.forEach(([asset, position]) => {
|
|
246
|
-
net[asset] = (net[asset] ?? new ValuePosition()).applyPosition(position);
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
return net;
|
|
224
|
+
.forEach(([pool, poolPosition]) => (0, helper_1.applyPositions)(decomposed, poolPosition));
|
|
225
|
+
return decomposed;
|
|
250
226
|
}
|
|
251
227
|
}
|
|
252
228
|
exports.VaultValueContext = VaultValueContext;
|
|
253
229
|
class VaultNativeValueDecomposedContext extends VaultValueContext {
|
|
254
230
|
static fromValueContext(valueContext, prices) {
|
|
255
|
-
const assetsNativePositions =
|
|
256
|
-
VaultNativeValueDecomposedContext.decomposeContext(valueContext.assets, prices, assetsNativePositions);
|
|
231
|
+
const assetsNativePositions = (0, computation_1.nativeDecomposeContext)(valueContext.assets, prices);
|
|
257
232
|
const poolsNativePositions = {};
|
|
258
233
|
Object.entries(valueContext.pools)
|
|
259
234
|
.forEach(([pool, poolPosition]) => {
|
|
260
|
-
const nativePoolPosition =
|
|
261
|
-
VaultNativeValueDecomposedContext.decomposeContext(poolPosition, prices, nativePoolPosition);
|
|
235
|
+
const nativePoolPosition = (0, computation_1.nativeDecomposeContext)(poolPosition, prices);
|
|
262
236
|
poolsNativePositions[pool] = nativePoolPosition;
|
|
263
237
|
});
|
|
264
|
-
return new this(valueContext.address, assetsNativePositions, poolsNativePositions);
|
|
265
|
-
}
|
|
266
|
-
static decomposeContext(valueContext, prices, nativeAssets) {
|
|
267
|
-
Object.entries(valueContext)
|
|
268
|
-
.forEach(([asset, position]) => {
|
|
269
|
-
const price = prices[asset];
|
|
270
|
-
if (price.type === types_1.CompositeAssetType.NATIVE) {
|
|
271
|
-
nativeAssets[asset] = (nativeAssets[asset] ?? new ValuePosition()).applyPosition(position);
|
|
272
|
-
}
|
|
273
|
-
else if (price.type === types_1.CompositeAssetType.SYNTHETIC1) {
|
|
274
|
-
if (prices[price.additionalData.underlying].type !== types_1.CompositeAssetType.NATIVE)
|
|
275
|
-
throw new Error(`Invalid underlying asset type: ${price.additionalData.underlying}`);
|
|
276
|
-
nativeAssets[price.additionalData.underlying] = (nativeAssets[price.additionalData.underlying] ?? new ValuePosition())
|
|
277
|
-
.apply(position.supply, position.borrow);
|
|
278
|
-
}
|
|
279
|
-
else if (price.type === types_1.CompositeAssetType.SYNTHETIC2) {
|
|
280
|
-
if (prices[price.additionalData0.underlying].type !== types_1.CompositeAssetType.NATIVE)
|
|
281
|
-
throw new Error(`Invalid underlying asset type: ${price.additionalData0.underlying}`);
|
|
282
|
-
if (prices[price.additionalData1.underlying].type !== types_1.CompositeAssetType.NATIVE)
|
|
283
|
-
throw new Error(`Invalid underlying asset type: ${price.additionalData1.underlying}`);
|
|
284
|
-
const price0 = prices[price.additionalData0.underlying].price;
|
|
285
|
-
const price1 = prices[price.additionalData1.underlying].price;
|
|
286
|
-
const totalValue = price.additionalData0.reserve * price0 + price.additionalData1.reserve * price1;
|
|
287
|
-
nativeAssets[price.additionalData0.underlying] = (nativeAssets[price.additionalData0.underlying] ?? new ValuePosition())
|
|
288
|
-
.apply(position.supply * price.additionalData0.reserve * price0 / totalValue, position.borrow * price.additionalData0.reserve * price0 / totalValue);
|
|
289
|
-
nativeAssets[price.additionalData1.underlying] = (nativeAssets[price.additionalData1.underlying] ?? new ValuePosition())
|
|
290
|
-
.apply(position.supply * price.additionalData1.reserve * price1 / totalValue, position.borrow * price.additionalData1.reserve * price1 / totalValue);
|
|
291
|
-
}
|
|
292
|
-
else if (price.type === types_1.CompositeAssetType.VAULT) {
|
|
293
|
-
// dependencyVaultValue
|
|
294
|
-
const depVaultValue = price.price * price.additionalData.totalSupply;
|
|
295
|
-
const decomposedPosition = {};
|
|
296
|
-
Object.entries(price.additionalData.decomposed)
|
|
297
|
-
.forEach(([depAsset, depPosition]) => {
|
|
298
|
-
const decomposedAssetPrice = prices[depAsset].price;
|
|
299
|
-
const depVaultPosition = new AmountPosition(depPosition.supply, depPosition.borrow)
|
|
300
|
-
.toValuePosition(decomposedAssetPrice);
|
|
301
|
-
decomposedPosition[depAsset] = new ValuePosition((position.supply * depVaultPosition.supply + position.borrow * depVaultPosition.borrow) / depVaultValue, (position.supply * depVaultPosition.borrow + position.borrow * depVaultPosition.supply) / depVaultValue);
|
|
302
|
-
});
|
|
303
|
-
VaultNativeValueDecomposedContext.decomposeContext(decomposedPosition, prices, nativeAssets);
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
throw new Error(`Invalid asset type: ${price}`);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
return nativeAssets;
|
|
238
|
+
return new this(valueContext.address, valueContext.totalSupply, assetsNativePositions, poolsNativePositions);
|
|
310
239
|
}
|
|
311
240
|
net() {
|
|
312
241
|
const net = {};
|
|
313
|
-
|
|
314
|
-
.forEach(([asset, position]) => {
|
|
315
|
-
net[asset] ??= new ValuePosition();
|
|
316
|
-
net[asset].applyPosition(position);
|
|
317
|
-
});
|
|
242
|
+
(0, helper_1.applyPositions)(net, this.assets);
|
|
318
243
|
Object.entries(this.pools)
|
|
319
|
-
.forEach(([_pool, poolPosition]) =>
|
|
320
|
-
.forEach(([asset, position]) => {
|
|
321
|
-
net[asset] ??= new ValuePosition();
|
|
322
|
-
net[asset].applyPosition(position);
|
|
323
|
-
}));
|
|
244
|
+
.forEach(([_pool, poolPosition]) => (0, helper_1.applyPositions)(net, poolPosition));
|
|
324
245
|
return net;
|
|
325
246
|
}
|
|
326
247
|
}
|
|
@@ -334,18 +255,10 @@ class VaultNativeAmountDecomposedContext {
|
|
|
334
255
|
this.totalSupply = totalSupply;
|
|
335
256
|
this.assets = assets;
|
|
336
257
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const totalSupply = decomposedValueContext.totalValue / prices[decomposedValueContext.address].price;
|
|
342
|
-
const net = decomposedValueContext.net();
|
|
343
|
-
const assets = {};
|
|
344
|
-
Object.entries(net)
|
|
345
|
-
.forEach(([asset, position]) => {
|
|
346
|
-
assets[asset] = position.toAmountPosition(prices[asset].price);
|
|
347
|
-
});
|
|
348
|
-
return new this(decomposedValueContext.address, totalSupply, assets);
|
|
258
|
+
static fromAmountContext(valueContext, prices) {
|
|
259
|
+
const decomposed = valueContext.decompose();
|
|
260
|
+
const nativeDecomposed = (0, computation_1.nativeDecomposeContext)(decomposed, prices);
|
|
261
|
+
return new this(valueContext.address, valueContext.totalSupply, nativeDecomposed);
|
|
349
262
|
}
|
|
350
263
|
}
|
|
351
264
|
exports.VaultNativeAmountDecomposedContext = VaultNativeAmountDecomposedContext;
|
package/dist/common/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from "@ton/core";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const VALUE_SCALE = 100000000n;
|
|
3
3
|
export declare enum CompositeAssetType {
|
|
4
4
|
NATIVE = 0,
|
|
5
5
|
SYNTHETIC1 = 1,
|
|
@@ -65,11 +65,7 @@ export type OnchainData = SyntheticComposition;
|
|
|
65
65
|
/** @deprecated Use SyntheticCompositions instead */
|
|
66
66
|
export type OnchainDataMap = SyntheticCompositions;
|
|
67
67
|
export type VaultComposition = {
|
|
68
|
-
|
|
69
|
-
supply: bigint;
|
|
70
|
-
borrow: bigint;
|
|
71
|
-
}>;
|
|
72
|
-
totalSupply: bigint;
|
|
68
|
+
amountContext: IVaultAmountContext;
|
|
73
69
|
};
|
|
74
70
|
export type VaultCompositions = Record<string, VaultComposition>;
|
|
75
71
|
export type VaultPrices = Record<string, VaultPriceEntry>;
|
|
@@ -87,9 +83,11 @@ export type CompositeOracleInput = {
|
|
|
87
83
|
export interface IPosition {
|
|
88
84
|
supply: bigint;
|
|
89
85
|
borrow: bigint;
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
add(supply: bigint, borrow: bigint): this;
|
|
87
|
+
addPosition(position?: this): this;
|
|
88
|
+
muldiv(numerator: bigint, denominator: bigint): this;
|
|
92
89
|
clone(): this;
|
|
90
|
+
cross(other: IPosition, denominator: bigint): this;
|
|
93
91
|
}
|
|
94
92
|
export interface ISharePosition extends IPosition {
|
|
95
93
|
readonly _brand: 'SharePosition';
|
|
@@ -105,9 +103,6 @@ export interface IAmountPosition extends IPosition {
|
|
|
105
103
|
toValuePosition(price: bigint): IValuePosition;
|
|
106
104
|
net(): bigint;
|
|
107
105
|
}
|
|
108
|
-
export interface IAmountPositionWithAddress extends IAmountPosition {
|
|
109
|
-
address: Address;
|
|
110
|
-
}
|
|
111
106
|
export interface IPoolAsset {
|
|
112
107
|
amount: IAmountPosition;
|
|
113
108
|
share: ISharePosition;
|
|
@@ -133,12 +128,13 @@ export interface IVaultAmountContext {
|
|
|
133
128
|
readonly totalSupply: bigint;
|
|
134
129
|
readonly assets: Record<string, IAmountPosition>;
|
|
135
130
|
readonly pools: IPoolAmountPositions;
|
|
136
|
-
|
|
131
|
+
decompose(): Record<string, IAmountPosition>;
|
|
132
|
+
toValueContext(prices: Prices): IVaultValueContext;
|
|
137
133
|
}
|
|
138
134
|
export interface IVaultValueContext {
|
|
139
135
|
readonly address: string;
|
|
140
136
|
readonly assets: Record<string, IValuePosition>;
|
|
141
137
|
readonly pools: IPoolValuePositions;
|
|
142
138
|
readonly totalValue: bigint;
|
|
143
|
-
|
|
139
|
+
decompose(): Record<string, IValuePosition>;
|
|
144
140
|
}
|
package/dist/common/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositeAssetType = exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.CompositeAssetType = exports.VALUE_SCALE = void 0;
|
|
4
|
+
exports.VALUE_SCALE = 100000000n;
|
|
5
5
|
var CompositeAssetType;
|
|
6
6
|
(function (CompositeAssetType) {
|
|
7
7
|
CompositeAssetType[CompositeAssetType["NATIVE"] = 0] = "NATIVE";
|
package/dist/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Address } from "@ton/core";
|
|
|
3
3
|
import { AddressInput, AddressLike } from "./contracts/common/type";
|
|
4
4
|
import { ShareVault } from "./contracts/vault/share-vault";
|
|
5
5
|
import { StrategyVault } from "./contracts/vault/strategy-vault";
|
|
6
|
+
import { ToncenterV3Client } from "./utils/pending-tracker/v3-client";
|
|
6
7
|
export type UnderlyingAssetType = {
|
|
7
8
|
type: "underlying-asset";
|
|
8
9
|
};
|
|
@@ -28,6 +29,7 @@ export declare class AffluentContext {
|
|
|
28
29
|
readonly wtonAddress: Address;
|
|
29
30
|
private readonly cacheTtl;
|
|
30
31
|
private readonly openedContracts;
|
|
32
|
+
private _toncenterClient?;
|
|
31
33
|
constructor(config: AffluentContextConfig);
|
|
32
34
|
static initialize(config: AffluentContextConfig): AffluentContext;
|
|
33
35
|
static getInstance(): AffluentContext;
|
|
@@ -39,5 +41,6 @@ export declare class AffluentContext {
|
|
|
39
41
|
name?: string;
|
|
40
42
|
}, address: AddressInput): OpenedContract<T>;
|
|
41
43
|
private open;
|
|
44
|
+
get toncenterClient(): ToncenterV3Client;
|
|
42
45
|
getAssetType(assetAddress: AddressInput): Promise<AssetType>;
|
|
43
46
|
}
|
package/dist/context.js
CHANGED
|
@@ -7,6 +7,7 @@ const core_1 = require("@ton/core");
|
|
|
7
7
|
const utils_1 = require("./contracts/common/utils");
|
|
8
8
|
const share_vault_1 = require("./contracts/vault/share-vault");
|
|
9
9
|
const strategy_vault_1 = require("./contracts/vault/strategy-vault");
|
|
10
|
+
const v3_client_1 = require("./utils/pending-tracker/v3-client");
|
|
10
11
|
class AffluentContext {
|
|
11
12
|
static instance = null;
|
|
12
13
|
client;
|
|
@@ -14,6 +15,7 @@ class AffluentContext {
|
|
|
14
15
|
wtonAddress;
|
|
15
16
|
cacheTtl;
|
|
16
17
|
openedContracts = new Map();
|
|
18
|
+
_toncenterClient;
|
|
17
19
|
constructor(config) {
|
|
18
20
|
const { client, network, customWtonAddress, cacheTtl = 2500 } = config;
|
|
19
21
|
if (network === "custom" && !customWtonAddress) {
|
|
@@ -64,6 +66,13 @@ class AffluentContext {
|
|
|
64
66
|
this.openedContracts.set(key, openedContract);
|
|
65
67
|
return openedContract;
|
|
66
68
|
}
|
|
69
|
+
get toncenterClient() {
|
|
70
|
+
if (!this._toncenterClient) {
|
|
71
|
+
const network = this.network === "custom" ? "mainnet" : this.network;
|
|
72
|
+
this._toncenterClient = new v3_client_1.ToncenterV3Client(network);
|
|
73
|
+
}
|
|
74
|
+
return this._toncenterClient;
|
|
75
|
+
}
|
|
67
76
|
async getAssetType(assetAddress) {
|
|
68
77
|
const address = (0, utils_1.toAddress)(assetAddress);
|
|
69
78
|
const state = await this.client.getContractState(address);
|
|
@@ -13,6 +13,8 @@ const NAME_MAP = {
|
|
|
13
13
|
"5783893": "XAU",
|
|
14
14
|
"4346947": "BTC",
|
|
15
15
|
"495352759397": "sUSDe",
|
|
16
|
+
"500151111502": "tsTON",
|
|
17
|
+
"128038701581413": "tsUSDe",
|
|
16
18
|
};
|
|
17
19
|
function redstonOnchainOracleConfigToCell(config) {
|
|
18
20
|
return (0, core_1.beginCell)().storeCoins(0).storeAddress(config.owner).storeRef(config.reserveAggregatorCode).endCell();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address, Cell, Contract, ContractProvider, Dictionary } from "@ton/core";
|
|
2
2
|
import { StrategyVaultConfig, AssetV2, FactorialPool, InteractiveVaultConfigItem, InteractiveVaultDict, XChainConfig } from "./type";
|
|
3
|
-
import { strategyVaultConfigToCell, strategyVaultConfigToCellV1, strategyVaultConfigToCellV2, createRFQConfig, getOpName, getErrorName, createInteractiveVaultDict, createDepositPayloadV1, createDepositPayload, createDepositQueuePayload, createWithdrawPayload, createWithdrawQueuePayload, createSetTimelockMsgBody, createExecuteOwnerActionMsgBody, createRevertOwnerActionMsgBody, parseSetTimelockMsgBody, parseExecuteOwnerActionMsgBody, parseRevertOwnerActionMsgBody, createSetProtocolFeeRatePerYearMsgBody, createSetProtocolFeeManagerAddressMsgBody, createClaimProtocolFeeMsgBody, parseSetProtocolFeeRatePerYearMsgBody, parseSetProtocolFeeManagerAddressMsgBody, parseClaimProtocolFeeMsgBody, createSetManagementFeeRatePerYearMsgBody, createSetManagementFeeRecipientAddressMsgBody, createClaimManagementFeeMsgBody, parseSetManagementFeeRatePerYearMsgBody, parseSetManagementFeeRecipientAddressMsgBody, parseClaimManagementFeeMsgBody, createSetWalletCodeMsgBody, createSetDataAggregatorCodeMsgBody, createSetRFQCodeMsgBody, createUpgradeCodeMsgBody, createSetContentMsgBody, parseSetWalletCodeMsgBody, parseSetDataAggregatorCodeMsgBody, parseSetRFQCodeMsgBody, parseUpgradeCodeMsgBody, parseSetContentMsgBody, createSetOwnerAddressMsgBody, createSetGuardianAddressMsgBody, createSetManagerAddressMsgBody, parseSetOwnerAddressMsgBody, parseSetGuardianAddressMsgBody, parseSetManagerAddressMsgBody, createSetAssetConfigMsgBody, parseSetAssetConfigMsgBody, createSetFactorialPoolConfigMsgBody, parseSetFactorialPoolConfigMsgBody, createSetRFQConfigMsgBody, parseSetRFQConfigMsgBody, createSetOracleConfigMsgBody, parseSetOracleConfigMsgBody, createSetGasConfigMsgBody, parseSetGasConfigMsgBody, createSetPrivateVaultMsgBody, createSetWhitelistedMintersMsgBody, parseSetPrivateVaultMsgBody, parseSetWhitelistedMintersMsgBody, createSetMaxLeverageRatioMsgBody, createSetDepositCloseTimestampMsgBody, createSetWithdrawOpenTimestampMsgBody, parseSetMaxLeverageRatioMsgBody, parseSetDepositCloseTimestampMsgBody, parseSetWithdrawOpenTimestampMsgBody, createSetXChainConnectorAddressMsgBody, createSetXChainConfigMsgBody, createRequestEidConnectionMsgBody, createInitializeMsgBody, createExecuteStrategyMsgBody, parseInitializeMsgBody, parseExecuteStrategyMsgBody, createSupplyToFactorialMsgBody, createWithdrawFromFactorialMsgBody, createBorrowFromFactorialMsgBody, createRepayToFactorialMsgBody, createLiquidateToFactorialMsgBody, parseSupplyToFactorialMsgBody, parseWithdrawFromFactorialMsgBody, parseBorrowFromFactorialMsgBody, parseRepayToFactorialMsgBody, parseLiquidateToFactorialMsgBody, createCreateRFQMsgBody, createCancelRFQMsgBody, parseCreateRFQMsgBody, parseCancelRFQMsgBody, createExecuteXChainStrategyPayload, createDepositToVaultMsgBody, parseExecuteDepositQueueMsgBody, parseExecuteWithdrawQueueMsgBody, parseConfirmQueueLog, parseQueueBatchExecuteLog, parseCancelDepositQueueMsgBody, parseCancelWithdrawQueueMsgBody, parseDepositQueueMsgBody, parseWithdrawQueueMsgBody, parseUserQueueLog, parseVaultData, parseVaultDataV1, parseVaultDataV2, parseRFQConfig, parseGasConfig, parseXChainOftConfig, parseXChainStrategyConfig } from "./codec";
|
|
3
|
+
import { strategyVaultConfigToCell, strategyVaultConfigToCellV1, strategyVaultConfigToCellV2, createRFQConfig, getOpName, getErrorName, createInteractiveVaultDict, createDepositPayloadV1, createDepositPayload, createDepositQueuePayload, createWithdrawPayload, createWithdrawQueuePayload, createSetTimelockMsgBody, createExecuteOwnerActionMsgBody, createRevertOwnerActionMsgBody, parseSetTimelockMsgBody, parseExecuteOwnerActionMsgBody, parseRevertOwnerActionMsgBody, createSetProtocolFeeRatePerYearMsgBody, createSetProtocolFeeManagerAddressMsgBody, createClaimProtocolFeeMsgBody, parseSetProtocolFeeRatePerYearMsgBody, parseSetProtocolFeeManagerAddressMsgBody, parseClaimProtocolFeeMsgBody, createSetManagementFeeRatePerYearMsgBody, createSetManagementFeeRecipientAddressMsgBody, createClaimManagementFeeMsgBody, parseSetManagementFeeRatePerYearMsgBody, parseSetManagementFeeRecipientAddressMsgBody, parseClaimManagementFeeMsgBody, createSetWalletCodeMsgBody, createSetDataAggregatorCodeMsgBody, createSetRFQCodeMsgBody, createUpgradeCodeMsgBody, createSetContentMsgBody, parseSetWalletCodeMsgBody, parseSetDataAggregatorCodeMsgBody, parseSetRFQCodeMsgBody, parseUpgradeCodeMsgBody, parseSetContentMsgBody, createSetOwnerAddressMsgBody, createSetGuardianAddressMsgBody, createSetManagerAddressMsgBody, parseSetOwnerAddressMsgBody, parseSetGuardianAddressMsgBody, parseSetManagerAddressMsgBody, createSetAssetConfigMsgBody, createSetAssetConfigV2MsgBody, parseSetAssetConfigMsgBody, createSetFactorialPoolConfigMsgBody, parseSetFactorialPoolConfigMsgBody, createSetRFQConfigMsgBody, parseSetRFQConfigMsgBody, createSetOracleConfigMsgBody, parseSetOracleConfigMsgBody, createSetGasConfigMsgBody, parseSetGasConfigMsgBody, createSetPrivateVaultMsgBody, createSetWhitelistedMintersMsgBody, parseSetPrivateVaultMsgBody, parseSetWhitelistedMintersMsgBody, createSetMaxLeverageRatioMsgBody, createSetDepositCloseTimestampMsgBody, createSetWithdrawOpenTimestampMsgBody, parseSetMaxLeverageRatioMsgBody, parseSetDepositCloseTimestampMsgBody, parseSetWithdrawOpenTimestampMsgBody, createSetXChainConnectorAddressMsgBody, createSetXChainConfigMsgBody, createRequestEidConnectionMsgBody, createInitializeMsgBody, createExecuteStrategyMsgBody, parseInitializeMsgBody, parseExecuteStrategyMsgBody, createSupplyToFactorialMsgBody, createWithdrawFromFactorialMsgBody, createBorrowFromFactorialMsgBody, createRepayToFactorialMsgBody, createLiquidateToFactorialMsgBody, parseSupplyToFactorialMsgBody, parseWithdrawFromFactorialMsgBody, parseBorrowFromFactorialMsgBody, parseRepayToFactorialMsgBody, parseLiquidateToFactorialMsgBody, createCreateRFQMsgBody, createCancelRFQMsgBody, parseCreateRFQMsgBody, parseCancelRFQMsgBody, createExecuteXChainStrategyPayload, createDepositToVaultMsgBody, parseExecuteDepositQueueMsgBody, parseExecuteWithdrawQueueMsgBody, parseConfirmQueueLog, parseQueueBatchExecuteLog, parseCancelDepositQueueMsgBody, parseCancelWithdrawQueueMsgBody, parseDepositQueueMsgBody, parseWithdrawQueueMsgBody, parseUserQueueLog, parseVaultData, parseVaultDataV1, parseVaultDataV2, parseRFQConfig, parseGasConfig, parseXChainOftConfig, parseXChainStrategyConfig } from "./codec";
|
|
4
4
|
export { strategyVaultConfigToCell };
|
|
5
5
|
export type { StrategyVaultConfig } from "./type";
|
|
6
6
|
export type { VaultResponseOptions, FactorialPoolShare, FactorialPool, AssetV1, AssetV2, RequestQueueItem, SumQueue, QueueManager, InteractiveVaultConfigItem, XChainConfig, InteractiveVaultDict, } from "./type";
|
|
@@ -290,6 +290,7 @@ export declare class StrategyVault implements Contract {
|
|
|
290
290
|
static createCancelRFQMsgBody: typeof createCancelRFQMsgBody;
|
|
291
291
|
static createDepositToVaultMsgBody: typeof createDepositToVaultMsgBody;
|
|
292
292
|
static createSetAssetConfigMsgBody: typeof createSetAssetConfigMsgBody;
|
|
293
|
+
static createSetAssetConfigV2MsgBody: typeof createSetAssetConfigV2MsgBody;
|
|
293
294
|
static createSetFactorialPoolConfigMsgBody: typeof createSetFactorialPoolConfigMsgBody;
|
|
294
295
|
static createClaimManagementFeeMsgBody: typeof createClaimManagementFeeMsgBody;
|
|
295
296
|
static createClaimProtocolFeeMsgBody: typeof createClaimProtocolFeeMsgBody;
|
|
@@ -47,6 +47,7 @@ class StrategyVault {
|
|
|
47
47
|
static createCancelRFQMsgBody = codec_1.createCancelRFQMsgBody;
|
|
48
48
|
static createDepositToVaultMsgBody = codec_1.createDepositToVaultMsgBody;
|
|
49
49
|
static createSetAssetConfigMsgBody = codec_1.createSetAssetConfigMsgBody;
|
|
50
|
+
static createSetAssetConfigV2MsgBody = codec_1.createSetAssetConfigV2MsgBody;
|
|
50
51
|
static createSetFactorialPoolConfigMsgBody = codec_1.createSetFactorialPoolConfigMsgBody;
|
|
51
52
|
static createClaimManagementFeeMsgBody = codec_1.createClaimManagementFeeMsgBody;
|
|
52
53
|
static createClaimProtocolFeeMsgBody = codec_1.createClaimProtocolFeeMsgBody;
|
package/dist/factorial.d.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { StrategyVaultV1 } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { PoolV1 } from "./pool";
|
|
2
|
+
import { ShareVaultV1 } from "./share-vault";
|
|
3
|
+
import { StrategyVaultV1 } from "./strategy_vault";
|
|
4
|
+
import { PeripheryV1 } from "./periphery";
|
|
5
|
+
import { MonitorV1 } from "./monitor";
|
|
6
|
+
import { FarmV1 } from "./farm";
|
|
7
|
+
import { RFQAuctionV1 } from "./rfq-auction";
|
|
8
|
+
import { MonitorCacheV1 } from "./monitorCacheV1";
|
|
9
|
+
import { PoolCacheV1 } from "./poolCacheV1";
|
|
10
|
+
import { RFQBatchV1 } from "./rfq-batch";
|
|
11
|
+
export { PoolV1, ShareVaultV1, PeripheryV1, StrategyVaultV1, RFQAuctionV1, MonitorCacheV1, RFQBatchV1, };
|
|
7
12
|
declare const _default: {
|
|
8
13
|
PoolV1: typeof PoolV1;
|
|
9
14
|
ShareVaultV1: typeof ShareVaultV1;
|
|
10
15
|
StrategyVaultV1: typeof StrategyVaultV1;
|
|
11
|
-
RFQAuctionV1: typeof
|
|
12
|
-
|
|
16
|
+
RFQAuctionV1: typeof RFQAuctionV1;
|
|
17
|
+
PeripheryV1: typeof PeripheryV1;
|
|
18
|
+
MonitorV1: typeof MonitorV1;
|
|
19
|
+
FarmV1: typeof FarmV1;
|
|
20
|
+
MonitorCacheV1: typeof MonitorCacheV1;
|
|
21
|
+
PoolCacheV1: typeof PoolCacheV1;
|
|
22
|
+
RFQBatchV1: typeof RFQBatchV1;
|
|
13
23
|
};
|
|
14
24
|
export default _default;
|
package/dist/factorial.js
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RFQBatchV1 = exports.RFQAuctionV1 = exports.StrategyVaultV1 = exports.ShareVaultV1 = exports.PoolV1 = void 0;
|
|
4
|
-
const pool_1 = require("./
|
|
5
|
-
Object.defineProperty(exports, "PoolV1", { enumerable: true, get: function () { return pool_1.
|
|
6
|
-
const share_vault_1 = require("./
|
|
7
|
-
Object.defineProperty(exports, "ShareVaultV1", { enumerable: true, get: function () { return share_vault_1.
|
|
8
|
-
const strategy_vault_1 = require("./
|
|
3
|
+
exports.RFQBatchV1 = exports.MonitorCacheV1 = exports.RFQAuctionV1 = exports.StrategyVaultV1 = exports.PeripheryV1 = exports.ShareVaultV1 = exports.PoolV1 = void 0;
|
|
4
|
+
const pool_1 = require("./pool");
|
|
5
|
+
Object.defineProperty(exports, "PoolV1", { enumerable: true, get: function () { return pool_1.PoolV1; } });
|
|
6
|
+
const share_vault_1 = require("./share-vault");
|
|
7
|
+
Object.defineProperty(exports, "ShareVaultV1", { enumerable: true, get: function () { return share_vault_1.ShareVaultV1; } });
|
|
8
|
+
const strategy_vault_1 = require("./strategy_vault");
|
|
9
9
|
Object.defineProperty(exports, "StrategyVaultV1", { enumerable: true, get: function () { return strategy_vault_1.StrategyVaultV1; } });
|
|
10
|
-
const
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
const periphery_1 = require("./periphery");
|
|
11
|
+
Object.defineProperty(exports, "PeripheryV1", { enumerable: true, get: function () { return periphery_1.PeripheryV1; } });
|
|
12
|
+
const monitor_1 = require("./monitor");
|
|
13
|
+
const farm_1 = require("./farm");
|
|
14
|
+
const rfq_auction_1 = require("./rfq-auction");
|
|
15
|
+
Object.defineProperty(exports, "RFQAuctionV1", { enumerable: true, get: function () { return rfq_auction_1.RFQAuctionV1; } });
|
|
16
|
+
const monitorCacheV1_1 = require("./monitorCacheV1");
|
|
17
|
+
Object.defineProperty(exports, "MonitorCacheV1", { enumerable: true, get: function () { return monitorCacheV1_1.MonitorCacheV1; } });
|
|
18
|
+
const poolCacheV1_1 = require("./poolCacheV1");
|
|
19
|
+
const rfq_batch_1 = require("./rfq-batch");
|
|
20
|
+
Object.defineProperty(exports, "RFQBatchV1", { enumerable: true, get: function () { return rfq_batch_1.RFQBatchV1; } });
|
|
14
21
|
exports.default = {
|
|
15
|
-
PoolV1: pool_1.
|
|
16
|
-
ShareVaultV1: share_vault_1.
|
|
22
|
+
PoolV1: pool_1.PoolV1,
|
|
23
|
+
ShareVaultV1: share_vault_1.ShareVaultV1,
|
|
17
24
|
StrategyVaultV1: strategy_vault_1.StrategyVaultV1,
|
|
18
|
-
RFQAuctionV1: rfq_auction_1.
|
|
19
|
-
|
|
25
|
+
RFQAuctionV1: rfq_auction_1.RFQAuctionV1,
|
|
26
|
+
PeripheryV1: periphery_1.PeripheryV1,
|
|
27
|
+
MonitorV1: monitor_1.MonitorV1,
|
|
28
|
+
FarmV1: farm_1.FarmV1,
|
|
29
|
+
MonitorCacheV1: monitorCacheV1_1.MonitorCacheV1,
|
|
30
|
+
PoolCacheV1: poolCacheV1_1.PoolCacheV1,
|
|
31
|
+
RFQBatchV1: rfq_batch_1.RFQBatchV1,
|
|
20
32
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,10 +25,12 @@ import { WTON_UNWRAP_CELL, WTONMinter } from "./contracts/wton/jetton-minter";
|
|
|
25
25
|
import { WTONWallet } from "./contracts/wton/jetton-wallet";
|
|
26
26
|
import { parseAction } from "./utils/action-parser";
|
|
27
27
|
import { CompositeOracleV1 } from "./services/composite-oracle";
|
|
28
|
-
import {
|
|
28
|
+
import { StrategyVaultServiceV1 } from "./services/strategy-vault";
|
|
29
29
|
import { PoolServiceV1 } from "./services/pool";
|
|
30
30
|
import { ShareVaultServiceV1 } from "./services/share-vault";
|
|
31
31
|
import { RFQBatchServiceV1 } from "./services/rfq-batch";
|
|
32
32
|
import { RFQAuctionServiceV1 } from "./services/rfq-auction";
|
|
33
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,
|
|
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, StrategyVaultServiceV1, PoolServiceV1, ShareVaultServiceV1, RFQBatchServiceV1, RFQAuctionServiceV1, sendMsgTracked, createTrackableSender, createTrackableSenderFromMnemonic, ToncenterV3Client, TrackableSender, TrackableSenderConfig, SendResult, TraceResult, WaitOptions, };
|
|
35
|
+
export * from "./utils/toncenter";
|
|
36
|
+
export * from "./common/trace-action";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ToncenterV3Client = exports.createTrackableSenderFromMnemonic = exports.createTrackableSender = exports.sendMsgTracked = exports.RFQAuctionServiceV1 = exports.RFQBatchServiceV1 = exports.ShareVaultServiceV1 = exports.PoolServiceV1 = exports.
|
|
20
|
+
exports.ToncenterV3Client = exports.createTrackableSenderFromMnemonic = exports.createTrackableSender = exports.sendMsgTracked = exports.RFQAuctionServiceV1 = exports.RFQBatchServiceV1 = exports.ShareVaultServiceV1 = exports.PoolServiceV1 = exports.StrategyVaultServiceV1 = 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
21
|
const contracts_1 = require("./constants/contracts");
|
|
8
22
|
Object.defineProperty(exports, "MAINNET_CONTRACTS", { enumerable: true, get: function () { return contracts_1.MAINNET_CONTRACTS; } });
|
|
9
23
|
Object.defineProperty(exports, "TESTNET_CONTRACTS", { enumerable: true, get: function () { return contracts_1.TESTNET_CONTRACTS; } });
|
|
@@ -49,7 +63,7 @@ Object.defineProperty(exports, "parseAction", { enumerable: true, get: function
|
|
|
49
63
|
const composite_oracle_1 = require("./services/composite-oracle");
|
|
50
64
|
Object.defineProperty(exports, "CompositeOracleV1", { enumerable: true, get: function () { return composite_oracle_1.CompositeOracleV1; } });
|
|
51
65
|
const strategy_vault_2 = require("./services/strategy-vault");
|
|
52
|
-
Object.defineProperty(exports, "
|
|
66
|
+
Object.defineProperty(exports, "StrategyVaultServiceV1", { enumerable: true, get: function () { return strategy_vault_2.StrategyVaultServiceV1; } });
|
|
53
67
|
const pool_2 = require("./services/pool");
|
|
54
68
|
Object.defineProperty(exports, "PoolServiceV1", { enumerable: true, get: function () { return pool_2.PoolServiceV1; } });
|
|
55
69
|
const share_vault_2 = require("./services/share-vault");
|
|
@@ -63,3 +77,5 @@ Object.defineProperty(exports, "sendMsgTracked", { enumerable: true, get: functi
|
|
|
63
77
|
Object.defineProperty(exports, "createTrackableSender", { enumerable: true, get: function () { return pending_tracker_1.createTrackableSender; } });
|
|
64
78
|
Object.defineProperty(exports, "createTrackableSenderFromMnemonic", { enumerable: true, get: function () { return pending_tracker_1.createTrackableSenderFromMnemonic; } });
|
|
65
79
|
Object.defineProperty(exports, "ToncenterV3Client", { enumerable: true, get: function () { return pending_tracker_1.ToncenterV3Client; } });
|
|
80
|
+
__exportStar(require("./utils/toncenter"), exports);
|
|
81
|
+
__exportStar(require("./common/trace-action"), exports);
|