Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/lib/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ export class BaseMessageDecoder {
};
return decodedData.args.messageHash as Hex;
} else if (this.isExecutionLog(log)) {
if (log.topics.length > 2) {
if (log.topics && log.topics.length > 2) {
return log.topics[2] as Hex;
}
} else if (this.isMessageInitLog(log)) {
if (log.topics.length > 1) {
if (log.topics && log.topics.length > 1) {
return log.topics[1] as Hex;
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/lib/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ export class SolanaMessageDecoder {
}
const [tx1, tx2] = res;

// getSignaturesForAddress returns newest first.
// If there are two transactions, tx1 is execution and tx2 is validation.
const validationTx = tx2 ?? tx1;
const executeTx = tx2 ? tx1 : tx2;
const executeTx = tx2 ? tx1 : undefined;

console.log({ executeTx });

Expand Down Expand Up @@ -313,7 +315,7 @@ export class SolanaMessageDecoder {

if (msg.localToken === SOL_ADDRESS) {
asset = "SOL";
amount = String(Number(msg.amount) / 1_000_000_000);
amount = formatUnitsString(String(msg.amount), 9);
} else {
// Figure out what localToken is
const { amount: a, asset: ast } = await this.getSplData(
Expand Down