mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-15 15:40:23 +03:00
Assets name mapping
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.19.31",
|
"version": "0.19.32-rc1",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/index.cjs",
|
"main": "./lib/index.cjs",
|
||||||
"module": "./lib/index.js",
|
"module": "./lib/index.js",
|
||||||
@@ -108,4 +108,4 @@
|
|||||||
"overrides": {
|
"overrides": {
|
||||||
"tsconfig-paths": "^4.0.0"
|
"tsconfig-paths": "^4.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ const swapInfoBase = z.object({
|
|||||||
orderInfo: orderInfoSchema,
|
orderInfo: orderInfoSchema,
|
||||||
isThroughPoolOrCurve: z.boolean(),
|
isThroughPoolOrCurve: z.boolean(),
|
||||||
}).array(),
|
}).array(),
|
||||||
|
anm: z.record(z.string()).optional(), // address to ERC20 names
|
||||||
});
|
});
|
||||||
|
|
||||||
const swapInfoByAmountIn = swapInfoBase.extend({
|
const swapInfoByAmountIn = swapInfoBase.extend({
|
||||||
|
|||||||
@@ -567,6 +567,7 @@ class AggregatorWS {
|
|||||||
availableAmountIn: item.aa,
|
availableAmountIn: item.aa,
|
||||||
availableAmountOut: item.aao,
|
availableAmountOut: item.aao,
|
||||||
})),
|
})),
|
||||||
|
assetsNameMapping: json.anm,
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (json.k) { // kind
|
switch (json.k) { // kind
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ export type SwapInfoBase = {
|
|||||||
safePrice: number
|
safePrice: number
|
||||||
} | undefined
|
} | undefined
|
||||||
alternatives: SwapInfoAlternative[]
|
alternatives: SwapInfoAlternative[]
|
||||||
|
assetsNameMapping?: Partial<Record<string, string>> | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SwapInfoByAmountIn = SwapInfoBase & {
|
export type SwapInfoByAmountIn = SwapInfoBase & {
|
||||||
|
|||||||
Reference in New Issue
Block a user