Skip to content

Commit 02b4920

Browse files
committed
fix: correctly encode all solana TransferRequest structs
1 parent d8396f8 commit 02b4920

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
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.59",
3+
"version": "0.0.60",
44
"description": "Relay protocol SDK",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/messages/v2.1/depository-withdrawal.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ export const getDecodedWithdrawalId = (
614614
case "solana-vm": {
615615
const coder = new BorshCoder(RelayDepositoryIdl as Idl);
616616
const encodedWithdrawal = coder.types.encode("TransferRequest", {
617+
domain: Buffer.from(
618+
decodedWithdrawal.withdrawal.domain.slice(2),
619+
"hex"
620+
),
617621
recipient: new PublicKey(decodedWithdrawal.withdrawal.recipient),
618622
token:
619623
decodedWithdrawal.withdrawal.token ===
@@ -623,6 +627,7 @@ export const getDecodedWithdrawalId = (
623627
amount: new anchor.BN(decodedWithdrawal.withdrawal.amount),
624628
nonce: new anchor.BN(decodedWithdrawal.withdrawal.nonce),
625629
expiration: new anchor.BN(decodedWithdrawal.withdrawal.expiration),
630+
vault_address: new PublicKey(decodedWithdrawal.withdrawal.vaultAddress),
626631
});
627632

628633
return (

0 commit comments

Comments
 (0)