UNPKG

@wuwei-labs/srsly

Version:
55 lines 2.01 kB
/** * @purpose Simplified deleteConfig instruction wrapper * * Thin convenience wrapper around Codama-generated deleteConfig instruction. * Deletes the global program configuration and associated vault to allow re-initialization. * * WARNING: This is a destructive operation that will prevent all program * operations until the config is re-initialized. */ import { type Address } from '@solana/kit'; import { type SdkConfig } from '../utils/config'; import { type UniversalSigner } from '../utils/signer'; import { prepareInstructions } from '../utils/instructions'; /** * Parameters for deleting the global program configuration */ export interface DeleteConfigParams { /** * Authority who can delete the config (must be AUTHORIZED_INITIALIZER) * Accepts string address, web3.js Keypair, or @solana/kit signer * Defaults to the hardcoded AUTHORIZED_INITIALIZER if not provided */ authority?: UniversalSigner; /** * Token mint for the vault (optional) * If not provided, auto-fetched from on-chain config. * Falls back to hardcoded addresses if config fetch fails. */ mint?: Address | string; /** * Sets compute units to allocate for the transaction. * @example 200000 */ computeUnits?: number; } /** * Delete the program's global config + vault. Destructive — halts all * program operations until `createConfig` runs again. Authorized * initializer only. * * @param params - Configuration deletion parameters * @param config - Optional SDK configuration overrides * @returns Kit instruction (or web3.js if PublicKey in config) * * @example * ```typescript * // Delete config and vault with required mint * const ix = await deleteConfig({ * authority: authorizedWallet, * mint: atlasMintAddress * }); * ``` */ export declare function deleteConfig(params: DeleteConfigParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>; //# sourceMappingURL=deleteConfig.d.ts.map