From caef23a9360567d363a5c00cd477d39425b5a95c Mon Sep 17 00:00:00 2001 From: Ivan Herger Date: Thu, 28 Sep 2023 10:21:18 +0200 Subject: [PATCH] fix: improve 1Inch function naming --- .changeset/weak-doors-promise.md | 5 +++++ .../internal/Extensions/IntegrationAdapters/OneInchV5.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/weak-doors-promise.md diff --git a/.changeset/weak-doors-promise.md b/.changeset/weak-doors-promise.md new file mode 100644 index 00000000..ef56d3ee --- /dev/null +++ b/.changeset/weak-doors-promise.md @@ -0,0 +1,5 @@ +--- +"@enzymefinance/sdk": patch +--- + +Improve 1Inch naming diff --git a/packages/sdk/src/internal/Extensions/IntegrationAdapters/OneInchV5.ts b/packages/sdk/src/internal/Extensions/IntegrationAdapters/OneInchV5.ts index 787b3783..64d03826 100644 --- a/packages/sdk/src/internal/Extensions/IntegrationAdapters/OneInchV5.ts +++ b/packages/sdk/src/internal/Extensions/IntegrationAdapters/OneInchV5.ts @@ -91,7 +91,7 @@ export function takeOrderDecode(encoded: Hex): TakeOrderArgs { }; } -const oneInchSwapArgsEncoding = [ +const swapArgsEncoding = [ { name: "executor", type: "address", @@ -144,8 +144,8 @@ const oneInchSwapArgsEncoding = [ }, ] as const; -export function decodedOneInchSwapArgs(encoded: Hex): TakeOrderArgs { - const [executor, orderDescription, , data] = decodeAbiParameters(oneInchSwapArgsEncoding, `0x${encoded.slice(10)}`); +export function decodedSwapArgs(encoded: Hex): TakeOrderArgs { + const [executor, orderDescription, , data] = decodeAbiParameters(swapArgsEncoding, `0x${encoded.slice(10)}`); const { srcToken, dstToken, srcReceiver, dstReceiver, amount, minReturnAmount, flags } = orderDescription; return {