Skip to content

Commit fef1170

Browse files
authored
Solana withdrawals migration (#99)
* chore: upgrade sdk * feat: prepare for solana withdrawals migration * fix: build * feat: prepare for solana withdrawals migration * feat: prepare for solana withdrawals migration
1 parent 3e4daa0 commit fef1170

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@fastify/swagger-ui": "^5.2.3",
2020
"@fastify/type-provider-typebox": "^5.1.0",
2121
"@near-js/providers": "^2.3.1",
22-
"@reservoir0x/relay-protocol-sdk": "^0.0.50",
22+
"@reservoir0x/relay-protocol-sdk": "^0.0.60",
2323
"@sinclair/typebox": "^0.34.14",
2424
"@solana/web3.js": "^1.98.2",
2525
"asn1.js": "^5.4.1",

src/api/queries/chains/v1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Schema = {
2727
Type.Literal("sui-vm"),
2828
Type.Literal("ton-vm"),
2929
Type.Literal("tron-vm"),
30+
Type.Literal("lighter-vm"),
3031
],
3132
{
3233
description: "The vm type of the chain",

src/services/action-executor/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ export class ActionExecutorService {
105105
// Step 1:
106106
// Ensure the withdrawal request exists in the first place
107107
if (!(await getWithdrawalRequest(message.result.withdrawalId, { tx }))) {
108-
throw externalError("Withdrawal request does not exist");
108+
throw externalError(
109+
`Withdrawal request does not exist: ${message.result.withdrawalId}`
110+
);
109111
}
110112

111113
// Step 2:

src/services/request-handler/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
getDecodedWithdrawalId,
55
getVmTypeNativeCurrency,
66
} from "@reservoir0x/relay-protocol-sdk";
7-
import { PublicKey, Keypair } from "@solana/web3.js";
7+
import { PublicKey, Keypair, SystemProgram } from "@solana/web3.js";
88
import * as bitcoin from "bitcoinjs-lib";
99
import bs58 from "bs58";
1010
import { randomBytes } from "crypto";
@@ -20,6 +20,7 @@ import {
2020
parseAbi,
2121
zeroAddress,
2222
encodeAbiParameters,
23+
zeroHash,
2324
} from "viem";
2425
import { privateKeyToAccount } from "viem/accounts";
2526
import TronWeb from "tronweb";
@@ -208,6 +209,9 @@ export class RequestHandlerService {
208209
amount: request.amount,
209210
nonce: BigInt("0x" + randomBytes(8).toString("hex")).toString(),
210211
expiration,
212+
// TODO: Use correct values fetched from the depository
213+
domain: zeroHash,
214+
vaultAddress: SystemProgram.programId.toBase58(),
211215
};
212216

213217
id = getDecodedWithdrawalId({

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,10 +1463,10 @@
14631463
resolved "https://registry.yarnpkg.com/@protobuf-ts/runtime/-/runtime-2.11.1.tgz#ee2bf2fac6e2d8deac0ca63471a77481548e5553"
14641464
integrity sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==
14651465

1466-
"@reservoir0x/relay-protocol-sdk@^0.0.50":
1467-
version "0.0.50"
1468-
resolved "https://registry.yarnpkg.com/@reservoir0x/relay-protocol-sdk/-/relay-protocol-sdk-0.0.50.tgz#0a5b42e9f52aa8143ed13e6bf389e19274cd8f92"
1469-
integrity sha512-2WcysR1rb2r5yqUxbSXDEvIvUk6lcDfG/pb7GUGr4Ub4AA9TNofCu2fgkB1Yu2HySfDADYWZ420wm7P26SGZQg==
1466+
"@reservoir0x/relay-protocol-sdk@^0.0.60":
1467+
version "0.0.60"
1468+
resolved "https://registry.yarnpkg.com/@reservoir0x/relay-protocol-sdk/-/relay-protocol-sdk-0.0.60.tgz#018ff519442494e8c66a687a789b7f0d9b963c9b"
1469+
integrity sha512-15/1Axrrnwls/dObW4youdlrxpE7Oj43TLipRHvnz5gLKX8HaIHKkbqEogEwAMWtP2W0RHwKj2zEL9/EkK+GZg==
14701470
dependencies:
14711471
"@coral-xyz/anchor" "^0.31.1"
14721472
"@mysten/sui" "^1.24.0"

0 commit comments

Comments
 (0)