Skip to content

Commit

Permalink
fix(blockchain-link-utils): support multisigAuthority in solana txs
Browse files Browse the repository at this point in the history
(cherry picked from commit dfd96d2)
  • Loading branch information
memoriesadrift authored and komret committed Jan 12, 2024
1 parent 41ad7bd commit b529bd1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/blockchain-link-utils/src/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ type TokenTransferInstruction = {
info: {
destination: string;
authority: string;
multisigAuthority?: string;
source: string;
mint?: string;
tokenAmount?: {
Expand Down Expand Up @@ -442,8 +443,9 @@ const isTokenTransferInstruction = (
(parsed.type === 'transferChecked' || parsed.type === 'transfer') &&
'info' in parsed &&
typeof parsed.info === 'object' &&
'authority' in parsed.info &&
typeof parsed.info.authority === 'string' &&
(('authority' in parsed.info && typeof parsed.info.authority === 'string') ||
('multisigAuthority' in parsed.info &&
typeof parsed.info.multisigAuthority === 'string')) &&
'source' in parsed.info &&
typeof parsed.info.source === 'string' &&
'destination' in parsed.info &&
Expand All @@ -470,7 +472,7 @@ export const getTokens = (
const isAccountDestination = accountAddresses.includes(parsed.info.destination);

const isAccountSource = accountAddresses.includes(
parsed.info.authority || parsed.info.source,
parsed.info.multisigAuthority || parsed.info.authority || parsed.info.source,
);

if (isAccountDestination && isAccountSource) {
Expand Down

0 comments on commit b529bd1

Please sign in to comment.