Skip to content

Commit 1eb0581

Browse files
MartinZemanikmartykan
authored andcommitted
fix: whitelist Serum's Asset Owner program
1 parent 495ea98 commit 1eb0581

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/blockchain-link-utils/src/solana.ts

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const SYSTEM_PROGRAM_PUBLIC_KEY = '11111111111111111111111111111111';
3838
export const WSOL_MINT = 'So11111111111111111111111111111111111111112';
3939
export const STAKE_PROGRAM_PUBLIC_KEY = 'Stake11111111111111111111111111111111111111';
4040
export const COMPUTE_BUDGET_PROGRAM_ID = 'ComputeBudget111111111111111111111111111111';
41+
export const SERUM_ASSET_OWNER_PROGRAM_ID = '4MNPdKu9wFMvEeZBMt3Eipfs5ovVWTJb31pEXDJAAxX5'
42+
export const SERUM_ASSET_OWNER_PHANTOM_DEPLOYMENT_PROGRAM_ID = 'DeJBGdMFa1uynnnKiwrVioatTuHmNLpyFKnmB5kaFdzQ'
4143

4244
const tokenProgramNames = ['spl-token', 'spl-token-2022'] as const;
4345
export type TokenProgramName = (typeof tokenProgramNames)[number];
@@ -386,6 +388,10 @@ export const getTxType = (
386388
ASSOCIATED_TOKEN_PROGRAM_PUBLIC_KEY,
387389
STAKE_PROGRAM_PUBLIC_KEY,
388390
COMPUTE_BUDGET_PROGRAM_ID,
391+
// some wallets use Serum's Assert Owner program during SPL transfer transactions, we don't want to report these as `contract` transactions
392+
SERUM_ASSET_OWNER_PROGRAM_ID,
393+
SERUM_ASSET_OWNER_PHANTOM_DEPLOYMENT_PROGRAM_ID
394+
389395
].includes(instruction.programId);
390396

391397
// if there are any unknown program instructions, we interpret the transaction as `contract`

0 commit comments

Comments
 (0)