mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-05 04:28:16 +03:00
feat: return back swap market / limit
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.20.38",
|
"version": "0.20.39",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/index.cjs",
|
"main": "./lib/index.cjs",
|
||||||
"module": "./lib/index.js",
|
"module": "./lib/index.js",
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import type Unit from '../index.js';
|
import type Unit from '../index.js';
|
||||||
import deposit, { type DepositParams } from './deposit.js';
|
import deposit, { type DepositParams } from './deposit.js';
|
||||||
import getSwapInfo, { type GetSwapInfoParams } from './getSwapInfo.js';
|
import getSwapInfo, { type GetSwapInfoParams } from './getSwapInfo.js';
|
||||||
import {generateSwapCalldataWithUnit, type GenerateSwapCalldataWithUnitParams } from './generateSwapCalldata.js';
|
import { generateSwapCalldataWithUnit, type GenerateSwapCalldataWithUnitParams } from './generateSwapCalldata.js';
|
||||||
import withdraw, { type WithdrawParams } from './withdraw.js';
|
import withdraw, { type WithdrawParams } from './withdraw.js';
|
||||||
|
import type { SwapLimitParams } from './swapLimit.js';
|
||||||
|
import swapLimit from './swapLimit.js';
|
||||||
|
import swapMarket from './swapMarket.js';
|
||||||
|
import type { SwapMarketParams } from './swapMarket.js';
|
||||||
|
|
||||||
type PureDepositParams = Omit<DepositParams, 'unit'>
|
type PureDepositParams = Omit<DepositParams, 'unit'>
|
||||||
type PureWithdrawParams = Omit<WithdrawParams, 'unit'>
|
type PureWithdrawParams = Omit<WithdrawParams, 'unit'>
|
||||||
@@ -44,4 +48,12 @@ export default class Exchange {
|
|||||||
unit: this.unit
|
unit: this.unit
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public swapLimit(params: SwapLimitParams) {
|
||||||
|
return swapLimit(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public swapMarket(params: SwapMarketParams) {
|
||||||
|
return swapMarket(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ export default async function swapLimit({
|
|||||||
options?.logger?.(`Transaction sent. Tx hash: ${swapThroughOrionPoolTxResponse.hash}`);
|
options?.logger?.(`Transaction sent. Tx hash: ${swapThroughOrionPoolTxResponse.hash}`);
|
||||||
return {
|
return {
|
||||||
amountOut: swapInfo.amountOut,
|
amountOut: swapInfo.amountOut,
|
||||||
wait: swapThroughOrionPoolTxResponse.wait,
|
wait: swapThroughOrionPoolTxResponse.wait.bind(swapThroughOrionPoolTxResponse),
|
||||||
through: 'pool',
|
through: 'pool',
|
||||||
txHash: swapThroughOrionPoolTxResponse.hash,
|
txHash: swapThroughOrionPoolTxResponse.hash,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ export default async function swapMarket({
|
|||||||
options?.logger?.(`Transaction sent. Tx hash: ${swapThroughOrionPoolTxResponse.hash}`);
|
options?.logger?.(`Transaction sent. Tx hash: ${swapThroughOrionPoolTxResponse.hash}`);
|
||||||
return {
|
return {
|
||||||
amountOut: swapInfo.amountOut,
|
amountOut: swapInfo.amountOut,
|
||||||
wait: swapThroughOrionPoolTxResponse.wait,
|
wait: swapThroughOrionPoolTxResponse.wait.bind(swapThroughOrionPoolTxResponse),
|
||||||
through: 'pool',
|
through: 'pool',
|
||||||
txHash: swapThroughOrionPoolTxResponse.hash,
|
txHash: swapThroughOrionPoolTxResponse.hash,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user