Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/messages/v2.2/withdrawal-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export type WithdrawalAddressParams = {
depositoryChainId: bigint;
currency: string;
recipientAddress: string;
owner: string;
ownerChainId: string;
withdrawerAlias: string;
amount: bigint;
withdrawalNonce: string;
};
Expand All @@ -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)
Expand Down Expand Up @@ -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,
]
Expand Down
4 changes: 2 additions & 2 deletions test/withdrawal-execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});