Skip to content

Commit

Permalink
Added cpi guard instruction extension
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCipherCoder committed Nov 13, 2024
1 parent 0533751 commit afb5d2c
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions clients/js/src/getInitializeInstructionsForExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import {
ExtensionArgs,
getDisableMemoTransfersInstruction,
getEnableMemoTransfersInstruction,
getEnableCpiGuardInstruction,
getDisableCpiGuardInstruction,
getInitializeConfidentialTransferMintInstruction,
getInitializeDefaultAccountStateInstruction,
getInitializeGroupMemberPointerInstruction,
getInitializeGroupPointerInstruction,
getInitializeMetadataPointerInstruction,
getInitializeTokenGroupInstruction,
getInitializeTokenMetadataInstruction,
getInitializeTransferFeeConfigInstruction,
getInitializeTransferFeeConfigInstruction
} from './generated';

/**
Expand Down Expand Up @@ -153,10 +155,20 @@ export function getPostInitializeInstructionsForTokenExtensions(
extension.requireIncomingTransferMemos
? getEnableMemoTransfersInstruction({ owner, token, multiSigners })
: getDisableMemoTransfersInstruction({
owner,
token,
multiSigners,
}),
owner,
token,
multiSigners,
}),
];
case 'CpiGuard':
return [
extension.lockCpi
? getEnableCpiGuardInstruction({ owner, token, multiSigners })
: getDisableCpiGuardInstruction({
owner,
token,
multiSigners,
}),
];
default:
return [];
Expand Down

0 comments on commit afb5d2c

Please sign in to comment.