Skip to content

Commit fd4681a

Browse files
committed
Fix solana transactions for relay
1 parent b643acd commit fd4681a

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/adapters/relay/index.ts

+18-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,17 @@ const convertRequestToEvent = (
7777
? {
7878
blockNumber: depositTx.block!,
7979
txHash: depositTx.hash as string,
80-
from: (depositTx.data as any).to,
81-
to: (depositTx.data as any).from,
80+
timestamp: depositTx.timestamp! * 1000,
81+
from: (depositTx.data as any).from
82+
? (depositTx.data as any).from
83+
: depositTx.data
84+
? (depositTx.data as any).signer
85+
: undefined,
86+
to: (depositTx.data as any).to
87+
? (depositTx.data as any).to
88+
: withdrawTx?.data
89+
? (withdrawTx.data as any).signer
90+
: undefined,
8291
token: deposit?.currency?.address!,
8392
amount: deposit?.amountUsd as any,
8493
isDeposit: true,
@@ -91,8 +100,13 @@ const convertRequestToEvent = (
91100
? {
92101
blockNumber: withdrawTx.block!,
93102
txHash: withdrawTx.hash!,
94-
from: (withdrawTx.data as unknown as any).from,
95-
to: (withdrawTx.data as unknown as any).to,
103+
timestamp: withdrawTx.timestamp! * 1000,
104+
from: (withdrawTx.data as any).from
105+
? (withdrawTx.data as any).from
106+
: withdrawTx.data
107+
? (withdrawTx.data as any).signer
108+
: undefined,
109+
to: (withdrawTx.data as any).to ? (withdrawTx.data as any).to : request.data?.metadata?.recipient,
96110
token: withdraw?.currency?.address!,
97111
amount: withdraw?.amountUsd as any,
98112
isDeposit: false,

src/utils/adapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ export const runAdapterHistorical = async (
513513

514514
let solanaTimestampsMap = {} as { [blockNumber: number]: number };
515515

516-
if (chain === "solana" && !["debridgedln", "portal"].includes(bridgeDbName)) {
516+
if (chain === "solana" && !["debridgedln", "portal", "relay"].includes(bridgeDbName)) {
517517
latestSolanaBlock = await getLatestBlock("solana");
518518
const connection = getConnection();
519519

0 commit comments

Comments
 (0)