diff --git a/package.json b/package.json index 10c9d7d..ae2977c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@reservoir0x/relay-protocol-sdk", - "version": "0.0.63", + "version": "0.0.64", "description": "Relay protocol SDK", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/messages/v2.2/withdrawal-execution.ts b/src/messages/v2.2/withdrawal-execution.ts index 1a6423e..2b8a61b 100644 --- a/src/messages/v2.2/withdrawal-execution.ts +++ b/src/messages/v2.2/withdrawal-execution.ts @@ -56,8 +56,7 @@ export type WithdrawalAddressParams = { depositoryChainId: bigint; currency: string; recipientAddress: string; - owner: string; - ownerChainId: string; + withdrawerAlias: string; amount: bigint; withdrawalNonce: string; }; @@ -69,7 +68,8 @@ export type WithdrawalAddressParams = { * @param depositoryChainId the chain id of the depository contract currently holding the funds * @param currency the id of the currency as expressed on origin chain (string) * @param recipientAddress the address that will receive the withdrawn funds on destination chain - * @param owner the address that owns the balance before the withdrawal is initiated + * @param withdrawerAlias the address that owns the balance on the settlement chain + * before the withdrawal is initiated * @param amount the balance to withdraw * @param withdrawalNonce nonce to prevent collisions for similar withdrawals * @returns withdrawal address (in lower case) @@ -97,7 +97,7 @@ export function getWithdrawalAddress( withdrawalParams.depositoryChainId, withdrawalParams.currency, withdrawalParams.recipientAddress as `0x${string}`, - withdrawalParams.owner as `0x${string}`, + withdrawalParams.withdrawerAlias as `0x${string}`, withdrawalParams.amount, nonce, ] diff --git a/test/withdrawal-execution.test.ts b/test/withdrawal-execution.test.ts index 93f9fde..50f577c 100644 --- a/test/withdrawal-execution.test.ts +++ b/test/withdrawal-execution.test.ts @@ -9,14 +9,14 @@ describe("getWithdrawalAddress", () => { depositoryChainId: 1n, currency: "10340230", recipientAddress: "0x9876543210987654321098765432109876543210", - owner: "0x9876543210987654321098765432109876543210", + withdrawerAlias: "0x9876543210987654321098765432109876543210", amount: 1000n, withdrawalNonce: "haha", }; const address = getWithdrawalAddress(params); expect(address).toMatch(/^0x[0-9a-f]{40}$/i); - expect(address).toBeTruthy(); + expect(address).toBe("0xb73fed6628648bfac09347a115ded54ca2bc58d3"); expect(getAddress(address).toLowerCase()).toMatch(address); }); });