Skip to content
Merged
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
8 changes: 4 additions & 4 deletions clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"devDependencies": {
"@solana-config/oxc": "^0.1.1",
"@solana/kit": "^8.3.0",
"@solana/kit-plugin-litesvm": "^0.18.0",
"@solana/kit-plugin-signer": "^0.18.0",
"@solana/kit": "^8.5.0",
"@solana/kit-plugin-litesvm": "^0.19.0",
"@solana/kit-plugin-signer": "^0.19.0",
"@solana/webcrypto-ed25519-polyfill": "3.0.3",
"@types/node": "^24",
"oxfmt": "^0.55.0",
Expand All @@ -60,7 +60,7 @@
"vitest": "^4.0.15"
},
"peerDependencies": {
"@solana/kit": "^8.3.0"
"@solana/kit": "^8.5.0"
},
"devEngines": {
"runtime": {
Expand Down
1,580 changes: 790 additions & 790 deletions clients/js/pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion clients/js/src/generated/errors/featureGate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {
isProgramError,
type Address,
type HasAddress,
type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,
type SolanaError,
} from '@solana/kit';
Expand Down Expand Up @@ -36,7 +37,10 @@ export function isFeatureGateError<TProgramErrorCode extends FeatureGateError>(
error: unknown,
transactionMessage: { instructions: Record<number, { programAddress: Address }> },
code?: TProgramErrorCode,
config: { programAddress?: Address | HasAddress } = {},
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &
Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {
return isProgramError<TProgramErrorCode>(error, transactionMessage, FEATURE_GATE_PROGRAM_ADDRESS, code);
const programAddressInput = config.programAddress ?? FEATURE_GATE_PROGRAM_ADDRESS;
const programAddress = typeof programAddressInput === 'string' ? programAddressInput : programAddressInput.address;
return isProgramError<TProgramErrorCode>(error, transactionMessage, programAddress, code);
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@ export function getRevokePendingActivationInstruction<
TProgramAddress extends Address = typeof FEATURE_GATE_PROGRAM_ADDRESS,
>(
input: RevokePendingActivationInput<TAccountFeature, TAccountIncinerator, TAccountSystemProgram>,
config?: { programAddress?: TProgramAddress },
config?: { programAddress?: TProgramAddress | { readonly address: TProgramAddress } },
): RevokePendingActivationInstruction<
TProgramAddress,
ResolvedInstructionAccountMeta<TAccountFeature, InstructionAccountInputAddress<TAccountFeature>>,
ResolvedInstructionAccountMeta<TAccountIncinerator, InstructionAccountInputAddress<TAccountIncinerator>>,
ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>
> {
// Program address.
const programAddress = config?.programAddress ?? FEATURE_GATE_PROGRAM_ADDRESS;
const programAddressInput = config?.programAddress ?? FEATURE_GATE_PROGRAM_ADDRESS;
const programAddress = typeof programAddressInput === 'string' ? programAddressInput : programAddressInput.address;

// Account meta helper.
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
Expand Down
13 changes: 10 additions & 3 deletions clients/js/src/generated/programs/featureGate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
type ClientWithTransactionPlanning,
type ClientWithTransactionSending,
type ExtendedClient,
type HasAddress,
type Instruction,
type InstructionWithData,
type ReadonlyUint8Array,
Expand Down Expand Up @@ -83,20 +84,26 @@ export type FeatureGatePlugin = {
export type FeatureGatePluginInstructions = {
revokePendingActivation: (
input: RevokePendingActivationInput,
config?: { programAddress?: Address | HasAddress },
) => ReturnType<typeof getRevokePendingActivationInstruction> & SelfPlanAndSendFunctions;
};

export type FeatureGatePluginRequirements = ClientWithTransactionPlanning & ClientWithTransactionSending;

export function featureGateProgram() {
export function featureGateProgram(config: { programAddress?: Address | HasAddress } = {}) {
return <T extends FeatureGatePluginRequirements>(
client: T,
): ExtendedClient<T, { featureGate: FeatureGatePlugin }> => {
return extendClient(client, {
featureGate: <FeatureGatePlugin>{
instructions: {
revokePendingActivation: input =>
addSelfPlanAndSendFunctions(client, getRevokePendingActivationInstruction(input)),
revokePendingActivation: (input, instructionConfig) =>
addSelfPlanAndSendFunctions(
client,
getRevokePendingActivationInstruction(input, {
programAddress: instructionConfig?.programAddress ?? config.programAddress,
}),
),
},
identifyInstruction: identifyFeatureGateInstruction,
parseInstruction: parseFeatureGateInstruction,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"generate:clients": "codama run --all"
},
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@codama/nodes-from-anchor": "^1.5.1",
"@codama/renderers-js": "^2.5.0",
"@codama/renderers-js": "^2.7.0",
"@codama/renderers-rust": "^3.1.3",
"@iarna/toml": "^2.2.5",
"@metaplex-foundation/shank-js": "^0.1.7",
"codama": "^1.8.0",
"codama": "^1.11.0",
"typescript": "^5.9.3",
"zx": "^8.8.4"
},
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading