import { PublicKey, TransactionInstruction, Connection } from "@solana/web3.js"; import { bridge } from "."; export type AppConfig = Omit & { initialAppStateCommitment: string; }; export type App = Omit & { allowedAppVersions: Array; finaStateFactsPrevCmtmt: string; }; export type MaybeApp = { status: "unapproved"; value: AppConfig; } | { status: "approved"; value: App; }; /** Fetch the app account, possibly unapproved. * * The difference with this function is that it supports fetching * an app that has not been approved yet. See the `status` field of * the return value. * */ export declare function fetchApp({ app, conn, }: Readonly<{ app: PublicKey; conn: Connection; }>): Promise; /** Approve the creation of a new app on the bridge. * * @param app - The app account to create * @param appOwner - The owner of the app * @param programId - The program ID of the bridge * @returns An instruction that approves the creation of an app; must be signed by the app owner */ export declare function appCreateApproveIx({ programId, app, appOwner, }: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; }): Promise; /** * Whitelist a new mint for use with the app and configure its limits. * * This function returns two instructions in order to also create the token account for * storing tokens of the mint in the bridge contract's escrow. * * @param programId - The bridge program ID * @param app - The app account to update * @param appOwner - The owner of the app; must sign the transaction * @param payer - The account paying rent for the newly created PDAs; must sign the transaction * @param mint - The mint being whitelisted * @param minDeposit - The minimum deposit amount in token quanta * @param limiterConfig - The withdrawal limiter configuration for the mint * @returns An instruction that whitelists the mint; must be signed by the app owner */ export declare function whitelistAssetIx({ programId, app, appOwner, payer, mint, quantMinDeposit, limiterConfig: { quantMaxBurst, quantRatePerSlot }, }: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; payer: PublicKey; mint: PublicKey; quantMinDeposit: bigint; limiterConfig: { quantMaxBurst: bigint; quantRatePerSlot: bigint; }; }): Promise; /** * Allow a specific application version for an app instance. * * Used to add a new version of the app in preparation for an upgrade. Once * the upgrade is done and a proposal with the new version is created, use * `denyAppVersionIx` to remove the old version. * * @param programId - The bridge program ID * @param app - The app account to update * @param appOwner - The owner of the app; must sign the transaction * @param appVersion - The 32-byte identifier of the app version * @returns An instruction that updates the version allowlist; must be signed by the app owner */ export declare function allowAppVersionIx(x: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; appVersion: Uint8Array; }): Promise; /** * Deny a specific application version for an app instance. * * Used after an app upgrade is done to remove the old version. * * @param programId - The bridge program ID * @param app - The app account to update * @param appOwner - The owner of the app; must sign the transaction * @param appVersion - The 32-byte identifier of the app version * @returns An instruction that updates the version allowlist; must be signed by the app owner */ export declare function denyAppVersionIx(x: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; appVersion: Uint8Array; }): Promise; /** * Update the minimum deposit amount for a given mint. * * @param programId - The bridge program ID * @param app - The app account to update * @param appOwner - The owner of the app; must sign the transaction * @param mint - The mint whose deposit requirements are being updated * @param minDeposit - The new minimum deposit in token quanta * @returns An instruction that updates the minimum deposit; must be signed by the app owner */ export declare function setMinDepositIx({ programId, app, appOwner, mint, quantMinDeposit, }: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; mint: PublicKey; quantMinDeposit: bigint; }): Promise; /** * Configure the withdrawal rate limiter for a given mint. * * @param programId - The bridge program ID * @param app - The app account to update * @param appOwner - The owner of the app; must sign the transaction * @param mint - The mint whose rate limiter is being configured * @param quantMaxBurst - Maximum burst size of the rate limiter, in quanta * @param quantRatePerSlot - Maximum amount of tokens withdrawn per slot, in quanta * @returns An instruction that updates the withdrawal limiter; must be signed by the app owner */ export declare function setWithdrawalRateLimitIx({ programId, app, appOwner, mint, limiterConfig: { quantMaxBurst, quantRatePerSlot }, }: { programId: PublicKey; app: PublicKey; appOwner: PublicKey; mint: PublicKey; limiterConfig: { quantMaxBurst: bigint; quantRatePerSlot: bigint; }; }): Promise;