mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
Added factory schema
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { SwapExecutor__factory, CurveRegistry__factory } from "@orionprotocol/contracts/lib/ethers-v5/index.js"
|
||||
import type { BigNumberish, providers } from "ethers"
|
||||
import type { SingleSwap } from "../generateSwapCalldata.js"
|
||||
import { addCallParams } from "./utils.js"
|
||||
import type { SingleSwap } from "../../../types.js"
|
||||
|
||||
export async function generateCurveStableSwapCall(
|
||||
amount: BigNumberish,
|
||||
|
||||
@@ -3,8 +3,8 @@ import { SafeArray } from "../../../utils/safeGetters.js"
|
||||
import { BigNumber } from "ethers"
|
||||
import type { BytesLike, BigNumberish } from "ethers"
|
||||
import { defaultAbiCoder, concat } from "ethers/lib/utils.js"
|
||||
import type { SingleSwap } from "../generateSwapCalldata.js"
|
||||
import { addCallParams, generateCalls } from "./utils.js"
|
||||
import type { SingleSwap } from "../../../types.js"
|
||||
|
||||
export async function generateUni2Calls(
|
||||
path: SafeArray<SingleSwap>,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { SwapExecutor__factory, UniswapV3Pool__factory } from "@orionprotocol/contracts/lib/ethers-v5/index.js"
|
||||
import { type BigNumberish, providers, type BytesLike, ethers } from "ethers"
|
||||
import { SafeArray } from "../../../utils/safeGetters.js"
|
||||
import type { SingleSwap } from "../generateSwapCalldata.js"
|
||||
import { addCallParams, generateCalls } from "./utils.js"
|
||||
import type { SingleSwap } from "../../../types.js"
|
||||
|
||||
export async function generateUni3Call(
|
||||
swap: SingleSwap,
|
||||
|
||||
@@ -9,15 +9,11 @@ import { generateUni3Calls, generateOrion3Calls, generateUni3Call, generateOrion
|
||||
import { exchangeToNativeDecimals, generateCalls, pathCallWithBalance } from './callGenerators/utils.js';
|
||||
import { generateApproveCall, generateTransferCall } from './callGenerators/erc20.js';
|
||||
import { generateCurveStableSwapCall } from './callGenerators/curve.js';
|
||||
import type { SingleSwap } from '../../types.js';
|
||||
|
||||
export type Factory = "UniswapV2" | "UniswapV3" | "Curve" | "OrionV2" | "OrionV3"
|
||||
|
||||
export type SingleSwap = {
|
||||
pool: string
|
||||
assetIn: string
|
||||
assetOut: string
|
||||
factory: Factory
|
||||
}
|
||||
|
||||
|
||||
export type GenerateSwapCalldataParams = {
|
||||
amount: BigNumberish
|
||||
|
||||
Reference in New Issue
Block a user