Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit 5f5e8d9

Browse files
authored
use withdrawer alias instead of owner (#27)
* use withdrawer alias * bump package * comment * fix test * precompute test address
1 parent 079b885 commit 5f5e8d9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reservoir0x/relay-protocol-sdk",
3-
"version": "0.0.63",
3+
"version": "0.0.64",
44
"description": "Relay protocol SDK",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/messages/v2.2/withdrawal-execution.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export type WithdrawalAddressParams = {
5656
depositoryChainId: bigint;
5757
currency: string;
5858
recipientAddress: string;
59-
owner: string;
60-
ownerChainId: string;
59+
withdrawerAlias: string;
6160
amount: bigint;
6261
withdrawalNonce: string;
6362
};
@@ -69,7 +68,8 @@ export type WithdrawalAddressParams = {
6968
* @param depositoryChainId the chain id of the depository contract currently holding the funds
7069
* @param currency the id of the currency as expressed on origin chain (string)
7170
* @param recipientAddress the address that will receive the withdrawn funds on destination chain
72-
* @param owner the address that owns the balance before the withdrawal is initiated
71+
* @param withdrawerAlias the address that owns the balance on the settlement chain
72+
* before the withdrawal is initiated
7373
* @param amount the balance to withdraw
7474
* @param withdrawalNonce nonce to prevent collisions for similar withdrawals
7575
* @returns withdrawal address (in lower case)
@@ -97,7 +97,7 @@ export function getWithdrawalAddress(
9797
withdrawalParams.depositoryChainId,
9898
withdrawalParams.currency,
9999
withdrawalParams.recipientAddress as `0x${string}`,
100-
withdrawalParams.owner as `0x${string}`,
100+
withdrawalParams.withdrawerAlias as `0x${string}`,
101101
withdrawalParams.amount,
102102
nonce,
103103
]

test/withdrawal-execution.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe("getWithdrawalAddress", () => {
99
depositoryChainId: 1n,
1010
currency: "10340230",
1111
recipientAddress: "0x9876543210987654321098765432109876543210",
12-
owner: "0x9876543210987654321098765432109876543210",
12+
withdrawerAlias: "0x9876543210987654321098765432109876543210",
1313
amount: 1000n,
1414
withdrawalNonce: "haha",
1515
};
1616

1717
const address = getWithdrawalAddress(params);
1818
expect(address).toMatch(/^0x[0-9a-f]{40}$/i);
19-
expect(address).toBeTruthy();
19+
expect(address).toBe("0xb73fed6628648bfac09347a115ded54ca2bc58d3");
2020
expect(getAddress(address).toLowerCase()).toMatch(address);
2121
});
2222
});

0 commit comments

Comments
 (0)