@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/pool.js
CHANGED
|
@@ -21,6 +21,7 @@ const readonlyCachedRedstone_1 = require("./utils/oracle/redstone/readonlyCached
|
|
|
21
21
|
const unknown_contract_1 = require("./common/unknown-contract");
|
|
22
22
|
const utils_1 = require("./utils/utils");
|
|
23
23
|
const risk_calculator_1 = require("./utils/risk_calculator/risk_calculator");
|
|
24
|
+
const _1 = require(".");
|
|
24
25
|
const toAddress = (value) => {
|
|
25
26
|
if (value instanceof ton_1.Address) {
|
|
26
27
|
return value;
|
|
@@ -137,8 +138,12 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
137
138
|
const queryId = (0, query_id_generactor_1.generateQueryId)(toAddress(params.sender), body);
|
|
138
139
|
const steps = [];
|
|
139
140
|
if (toString(params.asset) == this.contracts.WTON) {
|
|
140
|
-
const
|
|
141
|
-
const poolWTONWallet = this.open(jetton_wallet_2.WTONWallet.
|
|
141
|
+
const wtonWalletCode = ton_1.Cell.fromHex(_1.WTONWalletCompiledJson.hex);
|
|
142
|
+
const poolWTONWallet = this.client.open(jetton_wallet_2.WTONWallet.createFromConfig({
|
|
143
|
+
jettonMinter: toAddress(params.asset),
|
|
144
|
+
owner: toAddress(params.pool),
|
|
145
|
+
walletCode: wtonWalletCode,
|
|
146
|
+
}, wtonWalletCode));
|
|
142
147
|
await poolWTONWallet.sendExternalTransfer(sender, jetton_wallet_2.WTONWallet.Gas.ExternalTransfer, {
|
|
143
148
|
queryId: queryId,
|
|
144
149
|
...opts,
|
|
@@ -148,14 +153,14 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
148
153
|
queryId,
|
|
149
154
|
description: "Sending the tx",
|
|
150
155
|
from: toAddress(params.sender),
|
|
151
|
-
to:
|
|
156
|
+
to: poolWTONWallet.address,
|
|
152
157
|
opcode: jetton_wallet_2.WTONWallet.Op.ExternalTransfer,
|
|
153
158
|
},
|
|
154
159
|
{
|
|
155
160
|
queryId,
|
|
156
161
|
description: "Supplying jetton to the pool",
|
|
157
162
|
from: toAddress(params.sender),
|
|
158
|
-
to:
|
|
163
|
+
to: poolWTONWallet.address,
|
|
159
164
|
opcode: jetton_wallet_2.WTONWallet.Op.ExternalTransfer,
|
|
160
165
|
},
|
|
161
166
|
]);
|
|
@@ -315,43 +320,67 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
315
320
|
};
|
|
316
321
|
}
|
|
317
322
|
async withdraw(sender, params) {
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
const accountData = await senderAccount.getAccountData();
|
|
321
|
-
const pool = this.open(pool_1.Pool.createFromAddress(toAddress(params.pool)));
|
|
322
|
-
const poolData = (await pool.getPoolData());
|
|
323
|
-
let oracleParams = null;
|
|
324
|
-
if (account_1.Account.haveBorrow(accountData)) {
|
|
325
|
-
const assets = [...new Set([...account_1.Account.haveAssets(accountData)])];
|
|
326
|
-
const result = redstone_onchain_oracle_1.RedstoneOnchainOracle.getOracleRequestParams(assets, poolData.oracleConfig);
|
|
327
|
-
const helper = (0, redstoneHelper_1.createRedstoneHelper)("prod");
|
|
328
|
-
const payload = await helper.createPayload(result.redstoneAssetNames);
|
|
329
|
-
const requestAssetCell = redstone_onchain_oracle_1.RedstoneOnchainOracle.createAddressToTupleCell(result.requestAssets);
|
|
330
|
-
const dataFeedIdsTupleBuilder = new ton_1.TupleBuilder();
|
|
331
|
-
result.feedIds.forEach((item) => dataFeedIdsTupleBuilder.writeNumber(item));
|
|
332
|
-
const feedIdCell = (0, ton_1.serializeTuple)(dataFeedIdsTupleBuilder.build());
|
|
333
|
-
oracleParams = (0, ton_1.beginCell)()
|
|
334
|
-
.storeRef(feedIdCell)
|
|
335
|
-
.storeRef(payload)
|
|
336
|
-
.storeRef(requestAssetCell)
|
|
337
|
-
.endCell();
|
|
338
|
-
}
|
|
339
|
-
const isWTON = toString(params.asset) == this.contracts.WTON;
|
|
340
|
-
const jettonForwardTonAmount = isWTON ? (0, ton_1.toNano)(0.02) : 0n;
|
|
341
|
-
const jettonForwardPayload = isWTON ? jetton_minter_2.WTON_UNWRAP_CELL : null;
|
|
342
|
-
const gas = pool_1.Pool.calculateGasFee(pool_1.Pool.Op.Withdraw, pool_1.Pool.Gas.baseFee, pool_1.Pool.Gas.forwardFee, jettonForwardTonAmount, !poolData.oracle, !!oracleParams, poolData.minimumGasFee);
|
|
343
|
-
await pool.sendWithdraw(sender, gas, {
|
|
344
|
-
asset: toAddress(params.asset),
|
|
345
|
-
isShare: params.isShare,
|
|
346
|
-
amount: params.amount,
|
|
347
|
-
recipient: toAddress(params.recipient),
|
|
348
|
-
response: toAddress(params.response),
|
|
349
|
-
jettonForwardTonAmount,
|
|
350
|
-
jettonForwardPayload,
|
|
351
|
-
oracleParams: oracleParams,
|
|
352
|
-
});
|
|
323
|
+
const { pool, gas, opts } = await this._withdrawMessage(params);
|
|
324
|
+
await pool.sendWithdraw(sender, gas + (0, ton_1.toNano)(0.4), opts);
|
|
353
325
|
}
|
|
354
326
|
async withdrawAndWaitTx(sender, params, callbackFn) {
|
|
327
|
+
const { pool, poolData, oracleParams, gas, opts, senderAccountAddress, poolJettonWalletAddress, recipeintJettonWalletAddress, } = await this._withdrawMessage(params);
|
|
328
|
+
await pool.sendWithdraw(sender, gas + (0, ton_1.toNano)(0.4), opts);
|
|
329
|
+
const steps = [
|
|
330
|
+
{
|
|
331
|
+
queryId: opts.queryId,
|
|
332
|
+
description: "Sending the tx",
|
|
333
|
+
from: toAddress(params.sender),
|
|
334
|
+
to: toAddress(params.pool),
|
|
335
|
+
opcode: pool_1.Pool.Op.Withdraw,
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
queryId: opts.queryId,
|
|
339
|
+
description: "Calculating oracle data",
|
|
340
|
+
from: toAddress(poolData.oracle ? poolData.oracle : params.pool),
|
|
341
|
+
to: toAddress(params.pool),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
queryId: opts.queryId,
|
|
345
|
+
description: "Updating the account",
|
|
346
|
+
from: toAddress(params.pool),
|
|
347
|
+
to: senderAccountAddress,
|
|
348
|
+
opcode: pool_1.Pool.Op.ExecuteAction,
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
queryId: opts.queryId,
|
|
352
|
+
description: "Action notification",
|
|
353
|
+
from: toAddress(params.pool),
|
|
354
|
+
to: toAddress(params.sender),
|
|
355
|
+
opcode: pool_1.Pool.Op.ActionNotification,
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
queryId: opts.queryId,
|
|
359
|
+
description: "Withdrawing jetton from the pool",
|
|
360
|
+
from: poolJettonWalletAddress,
|
|
361
|
+
to: recipeintJettonWalletAddress,
|
|
362
|
+
opcode: jetton_wallet_1.JettonWallet.Op.InternalTransfer,
|
|
363
|
+
},
|
|
364
|
+
];
|
|
365
|
+
(async () => {
|
|
366
|
+
const matchedTx0 = await this.findAndCallback(toAddress(params.sender), steps[0], "0", callbackFn);
|
|
367
|
+
if (poolData.oracle && oracleParams) {
|
|
368
|
+
const matchedTx1 = await this.findAndCallback(toAddress(params.pool), steps[1], matchedTx0.lt.toString(), callbackFn);
|
|
369
|
+
}
|
|
370
|
+
const matchedTx2 = await this.findAndCallback(toAddress(senderAccountAddress), steps[2], matchedTx0.lt.toString(), callbackFn);
|
|
371
|
+
const matchedTx3 = await this.findAndCallback(toAddress(params.sender), steps[3], matchedTx2.lt.toString(), callbackFn);
|
|
372
|
+
const matchedTx4 = await this.findAndCallback(toAddress(recipeintJettonWalletAddress), steps[4], matchedTx2.lt.toString(), callbackFn);
|
|
373
|
+
})();
|
|
374
|
+
return {
|
|
375
|
+
action: {
|
|
376
|
+
type: "pool-withdraw",
|
|
377
|
+
params,
|
|
378
|
+
queryId: opts.queryId,
|
|
379
|
+
},
|
|
380
|
+
steps,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
async _withdrawMessage(params) {
|
|
355
384
|
const senderAccountAddress = await this.getAccountAddress(toString(params.sender), toString(params.pool));
|
|
356
385
|
const senderAccount = this.open(account_1.Account.createFromAddress(senderAccountAddress));
|
|
357
386
|
const accountData = await senderAccount.getAccountData();
|
|
@@ -412,10 +441,41 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
412
441
|
const body = pool_1.Pool.createWithdrawMsgBody(opts);
|
|
413
442
|
const queryId = (0, query_id_generactor_1.generateQueryId)(toAddress(params.sender), body);
|
|
414
443
|
const gas = pool_1.Pool.calculateGasFee(pool_1.Pool.Op.Withdraw, pool_1.Pool.Gas.baseFee, pool_1.Pool.Gas.forwardFee, jettonForwardTonAmount, !poolData.oracle, !!oracleParams, poolData.minimumGasFee);
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
444
|
+
return {
|
|
445
|
+
pool,
|
|
446
|
+
poolData,
|
|
447
|
+
oracleParams,
|
|
448
|
+
gas,
|
|
449
|
+
opts: { ...opts, queryId },
|
|
450
|
+
senderAccountAddress,
|
|
451
|
+
poolJettonWalletAddress,
|
|
452
|
+
recipeintJettonWalletAddress,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
async findWithdrawTx(queryId, params, callbackFn) {
|
|
456
|
+
const senderAccountAddress = await this.getAccountAddress(toString(params.sender), toString(params.pool));
|
|
457
|
+
const senderAccount = this.open(account_1.Account.createFromAddress(senderAccountAddress));
|
|
458
|
+
const accountData = await senderAccount.getAccountData();
|
|
459
|
+
const pool = this.open(pool_1.Pool.createFromAddress(toAddress(params.pool)));
|
|
460
|
+
const poolData = (await pool.getPoolData());
|
|
461
|
+
const poolJettonWalletAddress = await this.getJettonWalletAddress(toString(params.pool), toString(params.asset));
|
|
462
|
+
const recipeintJettonWalletAddress = await this.getJettonWalletAddress(toString(params.recipient), toString(params.asset));
|
|
463
|
+
let oracleParams = null;
|
|
464
|
+
if (account_1.Account.haveBorrow(accountData)) {
|
|
465
|
+
const assets = [...new Set([...account_1.Account.haveAssets(accountData)])];
|
|
466
|
+
const result = redstone_onchain_oracle_1.RedstoneOnchainOracle.getOracleRequestParams(assets, poolData.oracleConfig);
|
|
467
|
+
const helper = (0, redstoneHelper_1.createRedstoneHelper)("prod");
|
|
468
|
+
const payload = await helper.createPayload(result.redstoneAssetNames);
|
|
469
|
+
const requestAssetCell = redstone_onchain_oracle_1.RedstoneOnchainOracle.createAddressToTupleCell(result.requestAssets);
|
|
470
|
+
const dataFeedIdsTupleBuilder = new ton_1.TupleBuilder();
|
|
471
|
+
result.feedIds.forEach((item) => dataFeedIdsTupleBuilder.writeNumber(item));
|
|
472
|
+
const feedIdCell = (0, ton_1.serializeTuple)(dataFeedIdsTupleBuilder.build());
|
|
473
|
+
oracleParams = (0, ton_1.beginCell)()
|
|
474
|
+
.storeRef(feedIdCell)
|
|
475
|
+
.storeRef(payload)
|
|
476
|
+
.storeRef(requestAssetCell)
|
|
477
|
+
.endCell();
|
|
478
|
+
}
|
|
419
479
|
const steps = [
|
|
420
480
|
{
|
|
421
481
|
queryId,
|
|
@@ -459,7 +519,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
459
519
|
}
|
|
460
520
|
const matchedTx2 = await this.findAndCallback(toAddress(senderAccountAddress), steps[2], matchedTx0.lt.toString(), callbackFn);
|
|
461
521
|
const matchedTx3 = await this.findAndCallback(toAddress(params.sender), steps[3], matchedTx2.lt.toString(), callbackFn);
|
|
462
|
-
const matchedTx4 = await this.findAndCallback(toAddress(recipeintJettonWalletAddress), steps[4],
|
|
522
|
+
const matchedTx4 = await this.findAndCallback(toAddress(recipeintJettonWalletAddress), steps[4], matchedTx3.lt.toString(), callbackFn);
|
|
463
523
|
})();
|
|
464
524
|
return {
|
|
465
525
|
action: {
|
|
@@ -470,60 +530,43 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
470
530
|
steps,
|
|
471
531
|
};
|
|
472
532
|
}
|
|
473
|
-
async
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const poolData =
|
|
479
|
-
|
|
480
|
-
const recipeintJettonWalletAddress = await this.getJettonWalletAddress(toString(params.recipient), toString(params.asset));
|
|
481
|
-
let oracleParams = null;
|
|
482
|
-
if (account_1.Account.haveBorrow(accountData)) {
|
|
483
|
-
const assets = [...new Set([...account_1.Account.haveAssets(accountData)])];
|
|
484
|
-
const result = redstone_onchain_oracle_1.RedstoneOnchainOracle.getOracleRequestParams(assets, poolData.oracleConfig);
|
|
485
|
-
const helper = (0, redstoneHelper_1.createRedstoneHelper)("prod");
|
|
486
|
-
const payload = await helper.createPayload(result.redstoneAssetNames);
|
|
487
|
-
const requestAssetCell = redstone_onchain_oracle_1.RedstoneOnchainOracle.createAddressToTupleCell(result.requestAssets);
|
|
488
|
-
const dataFeedIdsTupleBuilder = new ton_1.TupleBuilder();
|
|
489
|
-
result.feedIds.forEach((item) => dataFeedIdsTupleBuilder.writeNumber(item));
|
|
490
|
-
const feedIdCell = (0, ton_1.serializeTuple)(dataFeedIdsTupleBuilder.build());
|
|
491
|
-
oracleParams = (0, ton_1.beginCell)()
|
|
492
|
-
.storeRef(feedIdCell)
|
|
493
|
-
.storeRef(payload)
|
|
494
|
-
.storeRef(requestAssetCell)
|
|
495
|
-
.endCell();
|
|
496
|
-
}
|
|
533
|
+
async borrow(sender, params) {
|
|
534
|
+
const { pool, gas, opts } = await this._borrowMessage(params);
|
|
535
|
+
await pool.sendBorrow(sender, gas, opts);
|
|
536
|
+
}
|
|
537
|
+
async borrowAndWaitTx(sender, params, callbackFn) {
|
|
538
|
+
const { pool, poolData, oracleParams, gas, opts, senderAccountAddress, poolJettonWalletAddress, recipeintJettonWalletAddress, } = await this._borrowMessage(params);
|
|
539
|
+
await pool.sendBorrow(sender, gas, opts);
|
|
497
540
|
const steps = [
|
|
498
541
|
{
|
|
499
|
-
queryId,
|
|
542
|
+
queryId: opts.queryId,
|
|
500
543
|
description: "Sending the tx",
|
|
501
544
|
from: toAddress(params.sender),
|
|
502
545
|
to: toAddress(params.pool),
|
|
503
|
-
opcode: pool_1.Pool.Op.
|
|
546
|
+
opcode: pool_1.Pool.Op.Borrow,
|
|
504
547
|
},
|
|
505
548
|
{
|
|
506
|
-
queryId,
|
|
549
|
+
queryId: opts.queryId,
|
|
507
550
|
description: "Calculating oracle data",
|
|
508
551
|
from: toAddress(poolData.oracle ? poolData.oracle : params.pool),
|
|
509
552
|
to: toAddress(params.pool),
|
|
510
553
|
},
|
|
511
554
|
{
|
|
512
|
-
queryId,
|
|
513
|
-
description: "Updating the account",
|
|
514
|
-
from: toAddress(params.pool),
|
|
515
|
-
to: senderAccountAddress,
|
|
516
|
-
opcode: pool_1.Pool.Op.ExecuteAction,
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
queryId,
|
|
555
|
+
queryId: opts.queryId,
|
|
520
556
|
description: "Action notification",
|
|
521
557
|
from: toAddress(params.pool),
|
|
522
558
|
to: toAddress(params.sender),
|
|
523
559
|
opcode: pool_1.Pool.Op.ActionNotification,
|
|
524
560
|
},
|
|
525
561
|
{
|
|
526
|
-
queryId,
|
|
562
|
+
queryId: opts.queryId,
|
|
563
|
+
description: "Updating the account",
|
|
564
|
+
from: toAddress(params.pool),
|
|
565
|
+
to: senderAccountAddress,
|
|
566
|
+
opcode: pool_1.Pool.Op.ProcessBorrowActionResult,
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
queryId: opts.queryId,
|
|
527
570
|
description: "Withdrawing jetton from the pool",
|
|
528
571
|
from: poolJettonWalletAddress,
|
|
529
572
|
to: recipeintJettonWalletAddress,
|
|
@@ -535,56 +578,20 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
535
578
|
if (poolData.oracle && oracleParams) {
|
|
536
579
|
const matchedTx1 = await this.findAndCallback(toAddress(params.pool), steps[1], matchedTx0.lt.toString(), callbackFn);
|
|
537
580
|
}
|
|
538
|
-
const matchedTx2 = await this.findAndCallback(toAddress(
|
|
539
|
-
const
|
|
540
|
-
const
|
|
581
|
+
const matchedTx2 = await this.findAndCallback(toAddress(params.sender), steps[2], matchedTx0.lt.toString(), callbackFn);
|
|
582
|
+
const matchedTx4 = await this.findAndCallback(toAddress(senderAccountAddress), steps[3], matchedTx0.lt.toString(), callbackFn);
|
|
583
|
+
const matchedTx3 = await this.findAndCallback(toAddress(recipeintJettonWalletAddress), steps[4], matchedTx0.lt.toString(), callbackFn);
|
|
541
584
|
})();
|
|
542
585
|
return {
|
|
543
586
|
action: {
|
|
544
|
-
type: "pool-
|
|
587
|
+
type: "pool-borrow",
|
|
545
588
|
params,
|
|
546
|
-
queryId,
|
|
589
|
+
queryId: opts.queryId,
|
|
547
590
|
},
|
|
548
591
|
steps,
|
|
549
592
|
};
|
|
550
593
|
}
|
|
551
|
-
async
|
|
552
|
-
const senderAccountAddress = await this.getAccountAddress(toString(params.sender), toString(params.pool));
|
|
553
|
-
const senderAccount = this.open(account_1.Account.createFromAddress(senderAccountAddress));
|
|
554
|
-
const accountData = await senderAccount.getAccountData();
|
|
555
|
-
const pool = this.open(pool_1.Pool.createFromAddress(toAddress(params.pool)));
|
|
556
|
-
const poolData = (await pool.getPoolData());
|
|
557
|
-
const assets = [
|
|
558
|
-
...new Set([...account_1.Account.haveAssets(accountData), toString(params.asset)]),
|
|
559
|
-
];
|
|
560
|
-
const result = redstone_onchain_oracle_1.RedstoneOnchainOracle.getOracleRequestParams(assets, poolData.oracleConfig);
|
|
561
|
-
const helper = (0, redstoneHelper_1.createRedstoneHelper)("prod");
|
|
562
|
-
const payload = await helper.createPayload(result.redstoneAssetNames);
|
|
563
|
-
const requestAssetCell = redstone_onchain_oracle_1.RedstoneOnchainOracle.createAddressToTupleCell(result.requestAssets);
|
|
564
|
-
const dataFeedIdsTupleBuilder = new ton_1.TupleBuilder();
|
|
565
|
-
result.feedIds.forEach((item) => dataFeedIdsTupleBuilder.writeNumber(item));
|
|
566
|
-
const feedIdCell = (0, ton_1.serializeTuple)(dataFeedIdsTupleBuilder.build());
|
|
567
|
-
const oracleParams = (0, ton_1.beginCell)()
|
|
568
|
-
.storeRef(feedIdCell)
|
|
569
|
-
.storeRef(payload)
|
|
570
|
-
.storeRef(requestAssetCell)
|
|
571
|
-
.endCell();
|
|
572
|
-
const isWTON = toString(params.asset) == this.contracts.WTON;
|
|
573
|
-
const jettonForwardTonAmount = isWTON ? (0, ton_1.toNano)(0.02) : 0n;
|
|
574
|
-
const jettonForwardPayload = isWTON ? jetton_minter_2.WTON_UNWRAP_CELL : null;
|
|
575
|
-
const gas = pool_1.Pool.calculateGasFee(pool_1.Pool.Op.Borrow, pool_1.Pool.Gas.baseFee, pool_1.Pool.Gas.forwardFee, jettonForwardTonAmount, !poolData.oracle, !!oracleParams, poolData.minimumGasFee);
|
|
576
|
-
await pool.sendBorrow(sender, gas, {
|
|
577
|
-
asset: toAddress(params.asset),
|
|
578
|
-
isShare: params.isShare,
|
|
579
|
-
amount: params.amount,
|
|
580
|
-
recipient: toAddress(params.recipient),
|
|
581
|
-
response: toAddress(params.response),
|
|
582
|
-
jettonForwardTonAmount,
|
|
583
|
-
jettonForwardPayload,
|
|
584
|
-
oracleParams: oracleParams,
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
async borrowAndWaitTx(sender, params, callbackFn) {
|
|
594
|
+
async _borrowMessage(params) {
|
|
588
595
|
const senderAccountAddress = await this.getAccountAddress(toString(params.sender), toString(params.pool));
|
|
589
596
|
const senderAccount = this.open(account_1.Account.createFromAddress(senderAccountAddress));
|
|
590
597
|
const accountData = await senderAccount.getAccountData();
|
|
@@ -639,62 +646,18 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
639
646
|
const body = pool_1.Pool.createWithdrawMsgBody(opts);
|
|
640
647
|
const queryId = (0, query_id_generactor_1.generateQueryId)(toAddress(params.sender), body);
|
|
641
648
|
const gas = pool_1.Pool.calculateGasFee(pool_1.Pool.Op.Borrow, pool_1.Pool.Gas.baseFee, pool_1.Pool.Gas.forwardFee, jettonForwardTonAmount, !poolData.oracle, !!oracleParams, poolData.minimumGasFee);
|
|
642
|
-
await pool.sendBorrow(sender, gas, {
|
|
643
|
-
...opts,
|
|
644
|
-
queryId,
|
|
645
|
-
});
|
|
646
|
-
const steps = [
|
|
647
|
-
{
|
|
648
|
-
queryId,
|
|
649
|
-
description: "Sending the tx",
|
|
650
|
-
from: toAddress(params.sender),
|
|
651
|
-
to: toAddress(params.pool),
|
|
652
|
-
opcode: pool_1.Pool.Op.Borrow,
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
queryId,
|
|
656
|
-
description: "Calculating oracle data",
|
|
657
|
-
from: toAddress(poolData.oracle ? poolData.oracle : params.pool),
|
|
658
|
-
to: toAddress(params.pool),
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
queryId,
|
|
662
|
-
description: "Action notification",
|
|
663
|
-
from: toAddress(params.pool),
|
|
664
|
-
to: toAddress(params.sender),
|
|
665
|
-
opcode: pool_1.Pool.Op.ActionNotification,
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
queryId,
|
|
669
|
-
description: "Updating the account",
|
|
670
|
-
from: toAddress(params.pool),
|
|
671
|
-
to: senderAccountAddress,
|
|
672
|
-
opcode: pool_1.Pool.Op.ProcessBorrowActionResult,
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
queryId,
|
|
676
|
-
description: "Withdrawing jetton from the pool",
|
|
677
|
-
from: poolJettonWalletAddress,
|
|
678
|
-
to: recipeintJettonWalletAddress,
|
|
679
|
-
opcode: jetton_wallet_1.JettonWallet.Op.InternalTransfer,
|
|
680
|
-
},
|
|
681
|
-
];
|
|
682
|
-
(async () => {
|
|
683
|
-
const matchedTx0 = await this.findAndCallback(toAddress(params.sender), steps[0], "0", callbackFn);
|
|
684
|
-
if (poolData.oracle && oracleParams) {
|
|
685
|
-
const matchedTx1 = await this.findAndCallback(toAddress(params.pool), steps[1], matchedTx0.lt.toString(), callbackFn);
|
|
686
|
-
}
|
|
687
|
-
const matchedTx2 = await this.findAndCallback(toAddress(params.sender), steps[2], matchedTx0.lt.toString(), callbackFn);
|
|
688
|
-
const matchedTx4 = await this.findAndCallback(toAddress(senderAccountAddress), steps[3], matchedTx0.lt.toString(), callbackFn);
|
|
689
|
-
const matchedTx3 = await this.findAndCallback(toAddress(recipeintJettonWalletAddress), steps[4], matchedTx0.lt.toString(), callbackFn);
|
|
690
|
-
})();
|
|
691
649
|
return {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
650
|
+
pool,
|
|
651
|
+
poolData,
|
|
652
|
+
oracleParams,
|
|
653
|
+
gas,
|
|
654
|
+
opts: {
|
|
655
|
+
...opts,
|
|
695
656
|
queryId,
|
|
696
657
|
},
|
|
697
|
-
|
|
658
|
+
senderAccountAddress,
|
|
659
|
+
poolJettonWalletAddress,
|
|
660
|
+
recipeintJettonWalletAddress,
|
|
698
661
|
};
|
|
699
662
|
}
|
|
700
663
|
async findBorrowTx(queryId, params, callbackFn) {
|
|
@@ -1789,6 +1752,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
1789
1752
|
const { redstonePrices, onchainData: od } = await this.getRedstonePrices(assets, poolData);
|
|
1790
1753
|
const onchainData2 = await this.updateOnchainData(oracleConfig.assetOnchainDataInfo);
|
|
1791
1754
|
const onchainData = { ...od, ...onchainData2 };
|
|
1755
|
+
this.updateOnchainInternalData(redstonePrices, onchainData);
|
|
1792
1756
|
const assetPrices = this.calculatePrices(redstonePrices, onchainData);
|
|
1793
1757
|
const vaultPositions = await this.getParsedVaults([...vaultAssets]);
|
|
1794
1758
|
const exposures = await this.getExposures(vaultPositions);
|
|
@@ -1837,6 +1801,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
1837
1801
|
const { redstonePrices, onchainData: od } = await this.getRedstonePrices(assets, poolData);
|
|
1838
1802
|
const onchainData2 = await this.updateOnchainData(oracleConfig.assetOnchainDataInfo);
|
|
1839
1803
|
const onchainData = { ...od, ...onchainData2 };
|
|
1804
|
+
this.updateOnchainInternalData(redstonePrices, onchainData);
|
|
1840
1805
|
const prices = this.calculatePrices(redstonePrices, onchainData);
|
|
1841
1806
|
const vaultPositions = await this.getParsedVaults([...vaultAssets]);
|
|
1842
1807
|
const exposures = await this.getExposures(vaultPositions);
|
|
@@ -1863,6 +1828,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
1863
1828
|
const { redstonePrices, onchainData: od } = await this.getRedstonePrices(assets, poolData);
|
|
1864
1829
|
const onchainData2 = await this.updateOnchainData(oracleConfig.assetOnchainDataInfo);
|
|
1865
1830
|
const onchainData = { ...od, ...onchainData2 };
|
|
1831
|
+
this.updateOnchainInternalData(redstonePrices, onchainData);
|
|
1866
1832
|
const prices = this.calculatePrices(redstonePrices, onchainData);
|
|
1867
1833
|
const vaultPositions = await this.getParsedVaults([...vaultAssets]);
|
|
1868
1834
|
const exposures = await this.getExposures(vaultPositions);
|
|
@@ -2006,6 +1972,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
2006
1972
|
const pricesData = await this.getPricesV2(poolAddress.toString());
|
|
2007
1973
|
const onchainData2 = await this.updateOnchainData(pool.oracleConfig.assetOnchainDataInfo);
|
|
2008
1974
|
const onchainData = { ...od, ...onchainData2 };
|
|
1975
|
+
this.updateOnchainInternalData(pricesData, onchainData);
|
|
2009
1976
|
// @ts-ignore
|
|
2010
1977
|
pool.oracleConfig.assetOnchainDataInfo = onchainData;
|
|
2011
1978
|
const beforeHealth = this.isHealthyV2(pool, accountState.status, pricesData);
|
|
@@ -2017,7 +1984,9 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
2017
1984
|
const solutionForTargetRatio = hasAnswer
|
|
2018
1985
|
? (0, utils_1.bigIntMin)(solutionsForTargetRatio)
|
|
2019
1986
|
: utils_1.MAX256;
|
|
2020
|
-
const solutionForLeverage = deltaSolutionForLeverage.delta >= 0n
|
|
1987
|
+
const solutionForLeverage = deltaSolutionForLeverage.delta >= 0n
|
|
1988
|
+
? deltaSolutionForLeverage.delta
|
|
1989
|
+
: 0n;
|
|
2021
1990
|
const maxBorrowableAmount = (0, utils_1.bigIntMin)([
|
|
2022
1991
|
solutionForTargetRatio,
|
|
2023
1992
|
solutionForLeverage,
|
|
@@ -2051,7 +2020,6 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
2051
2020
|
afterAccountHealth: afterHealth,
|
|
2052
2021
|
};
|
|
2053
2022
|
}
|
|
2054
|
-
;
|
|
2055
2023
|
async calculateMaxWithdrawableAmount({ withdrawerAddress, poolAddress, tokenAddress, BUFFER = 100n, }) {
|
|
2056
2024
|
if (!poolAddress || !withdrawerAddress)
|
|
2057
2025
|
throw new Error("Pool address or withdrawer address is required");
|
|
@@ -2078,6 +2046,7 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
2078
2046
|
const pricesData = await this.getPricesV2(poolAddress.toString());
|
|
2079
2047
|
const onchainData2 = await this.updateOnchainData(pool.oracleConfig.assetOnchainDataInfo);
|
|
2080
2048
|
const onchainData = { ...od, ...onchainData2 };
|
|
2049
|
+
this.updateOnchainInternalData(pricesData, onchainData);
|
|
2081
2050
|
// @ts-ignore
|
|
2082
2051
|
pool.oracleConfig.assetOnchainDataInfo = onchainData;
|
|
2083
2052
|
const beforeHealth = this.isHealthyV2(pool, accountState.status, pricesData);
|
|
@@ -2128,7 +2097,6 @@ class PoolV1 extends service_1.ServiceBaseV1 {
|
|
|
2128
2097
|
afterAccountHealth: afterHealth,
|
|
2129
2098
|
};
|
|
2130
2099
|
}
|
|
2131
|
-
;
|
|
2132
2100
|
async getPoolData(poolAddress) {
|
|
2133
2101
|
if (!(poolAddress instanceof ton_1.Address)) {
|
|
2134
2102
|
poolAddress = ton_1.Address.parse(poolAddress);
|
package/dist/poolCacheV1.js
CHANGED
|
@@ -1732,6 +1732,7 @@ class PoolCacheV1 extends service_1.ServiceBaseV1 {
|
|
|
1732
1732
|
const { redstonePrices, onchainData: od } = await this.getRedstonePrices(assets, poolData);
|
|
1733
1733
|
const onchainData2 = await this.updateOnchainData(poolData.oracleConfig.assetOnchainDataInfo);
|
|
1734
1734
|
const onchainData = { ...od, ...onchainData2 };
|
|
1735
|
+
this.updateOnchainInternalData(redstonePrices, onchainData);
|
|
1735
1736
|
Object.keys(onchainData).forEach((key) => {
|
|
1736
1737
|
if (!result.requestAssets.map((item) => item.toString()).includes(key) &&
|
|
1737
1738
|
!result.redstoneAssets.map((item) => item.toString()).includes(key)) {
|
package/dist/rfq-auction.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address, Cell, Sender } from "@ton/ton";
|
|
2
2
|
import { AddressInput, AddressLike } from "./contracts/common/type";
|
|
3
|
-
import { StrategyVaultState } from "./contracts/vault/strategy-vault/
|
|
3
|
+
import { StrategyVaultState } from "./contracts/vault/strategy-vault/";
|
|
4
4
|
import { ServiceBaseV1 } from "./common/service";
|
|
5
5
|
export declare class RFQAuctionV1 extends ServiceBaseV1 {
|
|
6
6
|
sendAmountBid(sender: Sender, params: {
|
|
@@ -31,7 +31,7 @@ export declare class RFQAuctionV1 extends ServiceBaseV1 {
|
|
|
31
31
|
clear_counts: number;
|
|
32
32
|
queryId?: number;
|
|
33
33
|
}, value?: bigint): Promise<void>;
|
|
34
|
-
|
|
34
|
+
getRFQData(rfqAuctionAddress: AddressInput): Promise<{
|
|
35
35
|
initialized: boolean;
|
|
36
36
|
index: bigint;
|
|
37
37
|
state: number;
|
package/dist/rfq-auction.js
CHANGED
|
@@ -12,7 +12,7 @@ const service_1 = require("./common/service");
|
|
|
12
12
|
const rfq_auction_1 = require("./contracts/rfq/rfq_auction");
|
|
13
13
|
const jetton_minter_1 = require("./contracts/jetton/jetton-minter");
|
|
14
14
|
const jetton_wallet_1 = require("./contracts/jetton/jetton-wallet");
|
|
15
|
-
const strategy_vault_1 = require("./contracts/vault/strategy-vault");
|
|
15
|
+
const strategy_vault_1 = require("./contracts/vault/strategy-vault/");
|
|
16
16
|
const jetton_minter_2 = require("./contracts/wton/jetton-minter");
|
|
17
17
|
const jetton_wallet_2 = require("./contracts/wton/jetton-wallet");
|
|
18
18
|
const WTONWallet_compiled_json_1 = __importDefault(require("./build/WTONWallet.compiled.json"));
|
|
@@ -27,7 +27,7 @@ const toString = (value) => {
|
|
|
27
27
|
class RFQAuctionV1 extends service_1.ServiceBaseV1 {
|
|
28
28
|
async sendAmountBid(sender, params, value) {
|
|
29
29
|
const rfqAuction = this.getByContract(rfq_auction_1.RFQAuction, (0, utils_1.toAddress)(params.rfqAuctionAddress));
|
|
30
|
-
const rfqData = await rfqAuction.
|
|
30
|
+
const rfqData = await rfqAuction.getRFQData();
|
|
31
31
|
if (rfqData.config.auctionMode !== rfq_auction_1.RFQAuction.AuctionMode.AmountBid)
|
|
32
32
|
throw new Error("Auction mode must be AmountBid.");
|
|
33
33
|
const existingBid = rfqData.bids[sender.address.toString()];
|
|
@@ -87,7 +87,7 @@ class RFQAuctionV1 extends service_1.ServiceBaseV1 {
|
|
|
87
87
|
}
|
|
88
88
|
async sendSlippageBid(sender, params, value) {
|
|
89
89
|
const rfqAuction = this.getByContract(rfq_auction_1.RFQAuction, (0, utils_1.toAddress)(params.rfqAuctionAddress));
|
|
90
|
-
const rfqData = await rfqAuction.
|
|
90
|
+
const rfqData = await rfqAuction.getRFQData();
|
|
91
91
|
if (rfqData.config.auctionMode !== rfq_auction_1.RFQAuction.AuctionMode.SlippageBid)
|
|
92
92
|
throw new Error("Auction mode must be SlippageBid.");
|
|
93
93
|
if (params.slippage < 0)
|
|
@@ -153,7 +153,7 @@ class RFQAuctionV1 extends service_1.ServiceBaseV1 {
|
|
|
153
153
|
async sendSettle(sender, params, value) {
|
|
154
154
|
const rfqAuction = this.getByContract(rfq_auction_1.RFQAuction, (0, utils_1.toAddress)(params.rfqAuctionAddress));
|
|
155
155
|
const oracleLibs = new oracle_1.OracleLibs(this.client, this.network);
|
|
156
|
-
const oracleParams = await oracleLibs.getOracleParamsForStrategyVaultRFQAuction(await rfqAuction.
|
|
156
|
+
const oracleParams = await oracleLibs.getOracleParamsForStrategyVaultRFQAuction(await rfqAuction.getRFQData());
|
|
157
157
|
await rfqAuction.sendSettle(sender, value ?? (0, ton_1.toNano)(1), { oracleParams });
|
|
158
158
|
}
|
|
159
159
|
async sendClearBids(sender, params, value) {
|
|
@@ -161,9 +161,9 @@ class RFQAuctionV1 extends service_1.ServiceBaseV1 {
|
|
|
161
161
|
const fee = value ?? (0, ton_1.toNano)(0.005 * params.clear_counts) + (0, ton_1.toNano)(0.1);
|
|
162
162
|
await rfqAuction.sendClearBids(sender, fee, params.clear_counts);
|
|
163
163
|
}
|
|
164
|
-
async
|
|
164
|
+
async getRFQData(rfqAuctionAddress) {
|
|
165
165
|
const rfqAuction = this.getByContract(rfq_auction_1.RFQAuction, (0, utils_1.toAddress)(rfqAuctionAddress));
|
|
166
|
-
return await rfqAuction.
|
|
166
|
+
return await rfqAuction.getRFQData();
|
|
167
167
|
}
|
|
168
168
|
async getOracleParams(vaultAddress, additionalAssets = [], allFactorialVaults = [], vaultData) {
|
|
169
169
|
const sv = new strategy_vault_2.StrategyVaultV1(this.client, this.network);
|
package/dist/rfq-batch.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Address, Cell,
|
|
1
|
+
import { Address, Cell, Sender } from "@ton/ton";
|
|
2
2
|
import { AddressInput } from "./contracts/common/type";
|
|
3
3
|
import { ServiceBaseV1 } from "./common/service";
|
|
4
|
+
import { MultiSender } from "./types/sender";
|
|
5
|
+
import { InternalMessageInput } from "./types/messages";
|
|
4
6
|
export declare class RFQBatchV1 extends ServiceBaseV1 {
|
|
5
7
|
sendAddOrder(sender: Sender, params: {
|
|
6
8
|
senderAddress: AddressInput;
|
|
@@ -42,13 +44,18 @@ export declare class RFQBatchV1 extends ServiceBaseV1 {
|
|
|
42
44
|
assetAddress: AddressInput;
|
|
43
45
|
count: number;
|
|
44
46
|
}, value?: bigint): Promise<void>;
|
|
47
|
+
sendBatchPayout(sender: MultiSender, params: {
|
|
48
|
+
rfqBatchAddress: AddressInput;
|
|
49
|
+
assetAddress: AddressInput;
|
|
50
|
+
count: number;
|
|
51
|
+
}, value?: bigint): Promise<void>;
|
|
45
52
|
sendReopen(sender: Sender, params: {
|
|
46
53
|
rfqBatchAddress: AddressInput;
|
|
47
54
|
}, value?: bigint): Promise<void>;
|
|
48
55
|
sendCollectFee(sender: Sender, params: {
|
|
49
56
|
rfqBatchAddress: AddressInput;
|
|
50
57
|
}, value?: bigint): Promise<void>;
|
|
51
|
-
|
|
58
|
+
getRFQBatchData(rfqBatchAddress: AddressInput): Promise<{
|
|
52
59
|
index: bigint;
|
|
53
60
|
asset0Address: Address;
|
|
54
61
|
asset1Address: Address;
|
|
@@ -80,6 +87,11 @@ export declare class RFQBatchV1 extends ServiceBaseV1 {
|
|
|
80
87
|
asset1Price: bigint;
|
|
81
88
|
oracleConfig: import("./contracts/oracle/redstone-oracle/type").RedstonOracleConfig | Cell | import("./contracts/oracle/redstone-onchain-oracle/type").RedstoneOnchainOracleConfig | null;
|
|
82
89
|
}>;
|
|
90
|
+
getLockedAmount(params: {
|
|
91
|
+
rfqBatchAddress: AddressInput;
|
|
92
|
+
tokenAddress: AddressInput;
|
|
93
|
+
userAddress: AddressInput;
|
|
94
|
+
}): Promise<bigint>;
|
|
83
95
|
createInternalAddOrder(sender: Sender, params: {
|
|
84
96
|
senderAddress: AddressInput;
|
|
85
97
|
rfqBatchAddress: AddressInput;
|
|
@@ -88,18 +100,16 @@ export declare class RFQBatchV1 extends ServiceBaseV1 {
|
|
|
88
100
|
forwardTonAmount?: bigint;
|
|
89
101
|
forwardPayload?: Cell | null;
|
|
90
102
|
queryId?: bigint;
|
|
91
|
-
}, value?: bigint): Promise<
|
|
92
|
-
to: Address | string;
|
|
93
|
-
value: bigint | string;
|
|
94
|
-
extracurrency?: import("@ton/core/dist/utils/maybe").Maybe<import("@ton/ton").ExtraCurrency>;
|
|
95
|
-
bounce?: import("@ton/core/dist/utils/maybe").Maybe<boolean>;
|
|
96
|
-
init?: import("@ton/core/dist/utils/maybe").Maybe<import("@ton/ton").StateInit>;
|
|
97
|
-
body?: import("@ton/core/dist/utils/maybe").Maybe<Cell | string>;
|
|
98
|
-
}>;
|
|
103
|
+
}, value?: bigint): Promise<InternalMessageInput>;
|
|
99
104
|
createInternalCancelOrder(params: {
|
|
100
105
|
rfqBatchAddress: AddressInput;
|
|
101
106
|
assetAddress: AddressInput;
|
|
102
|
-
}, value?: bigint): Promise<
|
|
107
|
+
}, value?: bigint): Promise<InternalMessageInput>;
|
|
108
|
+
createInternalPayout(params: {
|
|
109
|
+
rfqBatchAddress: AddressInput;
|
|
110
|
+
assetAddress: AddressInput;
|
|
111
|
+
count: bigint;
|
|
112
|
+
}, value?: bigint): Promise<InternalMessageInput>;
|
|
103
113
|
}
|
|
104
114
|
type VaultPosition = {
|
|
105
115
|
assets: Record<string, bigint>;
|