update version

This commit is contained in:
lomonoshka
2023-08-24 16:00:28 +03:00
6 changed files with 24 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.19.48-dev.5-rc0", "version": "0.19.48-dev.6-rc-0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.19.48-dev.5-rc0", "version": "0.19.48-dev.6-rc-0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {

View File

@@ -113,4 +113,4 @@
"overrides": { "overrides": {
"tsconfig-paths": "^4.0.0" "tsconfig-paths": "^4.0.0"
} }
} }

View File

@@ -141,8 +141,6 @@ export default async function generateSwapCalldata({
return { swapDescription, calldata } return { swapDescription, calldata }
} }
export async function generateUni2Calls( export async function generateUni2Calls(
exchangeAddress: string, exchangeAddress: string,
path: SafeArray<SwapInfo> path: SafeArray<SwapInfo>
@@ -314,4 +312,4 @@ function addCallParams(
async function generateCalls(calls: BytesLike[]) { async function generateCalls(calls: BytesLike[]) {
const executorInterface = SwapExecutor__factory.createInterface() const executorInterface = SwapExecutor__factory.createInterface()
return "0x" + executorInterface.encodeFunctionData(EXECUTOR_SWAP_FUNCTION, [ethers.constants.AddressZero, calls]).slice(74) return "0x" + executorInterface.encodeFunctionData(EXECUTOR_SWAP_FUNCTION, [ethers.constants.AddressZero, calls]).slice(74)
} }

View File

@@ -503,6 +503,12 @@ class AggregatorWS {
minAmountIn: json.ma, minAmountIn: json.ma,
path: json.ps, path: json.ps,
exchanges: json.e, exchanges: json.e,
exchangeContractPath: json.eps.map((path) => ({
pool: path.p,
assetIn: path.ai,
assetOut: path.ao,
factory: path.f,
})),
poolOptimal: json.po, poolOptimal: json.po,
...(json.oi) && { ...(json.oi) && {
orderInfo: { orderInfo: {

View File

@@ -33,6 +33,12 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
}).optional(), }).optional(),
as: alternativeSchema.array(), as: alternativeSchema.array(),
anm: z.record(z.string()).optional(), // address to ERC20 names anm: z.record(z.string()).optional(), // address to ERC20 names
eps: z.array(z.object({
p: z.string(), // pool address
ai: z.string().toUpperCase(), // asset in
ao: z.string().toUpperCase(), // asset out
f: z.string().toUpperCase(), // factory
}))
}); });
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({ const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({

View File

@@ -165,6 +165,13 @@ export type SwapInfoAlternative = {
availableAmountOut?: number | undefined availableAmountOut?: number | undefined
} }
type ExchangeContractPath = {
pool: string
assetIn: string
assetOut: string
factory: string
}
export type SwapInfoBase = { export type SwapInfoBase = {
swapRequestId: string swapRequestId: string
assetIn: string assetIn: string
@@ -175,6 +182,7 @@ export type SwapInfoBase = {
minAmountOut: number minAmountOut: number
path: string[] path: string[]
exchangeContractPath: ExchangeContractPath[]
exchanges?: string[] | undefined exchanges?: string[] | undefined
poolOptimal: boolean poolOptimal: boolean