import { SendTransactionOptions } from '@solana/wallet-adapter-base'; import { VersionedTransaction, PublicKey, Transaction } from '@solana/web3.js'; import type { TokenName } from '../../types'; import { type GetOrCreateUserBankRequest, type DeriveUserBankRequest, type CreateTransferRequest, type CreateSecpRequest, ClaimableTokensConfig } from './types'; export declare class ClaimableTokensError extends Error { name: string; code: number; instructionName: string; customErrorName?: string; constructor({ code, instructionName, cause }: { code: number; instructionName: string; cause?: Error; }); } /** * Connected client to the ClaimableTokens Solana program. * * The ClaimableTokens program is responsible for creation of program-owned * associated token accounts that are permissioned to users by their Ethereum * hedgehog wallet private keys. */ export declare class ClaimableTokensClient { private readonly client; /** The program ID of the ClaimableTokensProgram instance. */ private readonly programId; /** Map from token mint name to public key address. */ private readonly preconfiguredMints; /** Map from token mint name to derived user bank authority. */ private readonly authorities; private readonly logger; private readonly audiusWalletClient; /** * Map of user banks to user bank creation promises. * Prevents concurrent attempts to create the same user bank. */ private _pendingUserBankCreationPromises; constructor(config: ClaimableTokensConfig); /** * Creates a user bank or returns the existing user bank for a user. */ getOrCreateUserBank(params: GetOrCreateUserBankRequest): Promise<{ userBank: PublicKey; didExist: boolean; }>; /** * Creates a claimable tokens program transfer instruction using configured * program ID, mint addresses, derived nonce, and derived authorities. * * Must be paired with a matching Secp256k1 instruction. * @see {@link createTransferSecpInstruction} */ createTransferInstruction(params: CreateTransferRequest): Promise; /** * Creates a signed Secp256k1 instruction for a claimable tokens transfer * using configured program ID, derived nonce, and derived authorities. * * @see {@link createTransferInstruction} */ createTransferSecpInstruction(params: CreateSecpRequest): Promise; /** * Reads the current on-chain nonce for a user's claimable tokens account. * Useful for callers that need to know the nonce before/after a transaction * so they can pass it explicitly to subsequent {@link createTransferSecpInstruction} calls. */ getNonce({ ethWallet, mint: mintOrToken }: { ethWallet: string; mint: PublicKey | TokenName; }): Promise; /** * Derives the user bank of a user from their Ethereum wallet and the token mint. * * Use {@link getOrCreateUserBank} instead if you want to ensure the userBank exists. */ deriveUserBank(params: DeriveUserBankRequest): Promise; /** * Derives the authority for a given mint. * If the authority is not already cached, it will derive it. */ private deriveAuthority; /** * Override the sendTransaction method to provide some more friendly errors * back to the consumer for ClaimableTokens instructions */ sendTransaction(transaction: Transaction | VersionedTransaction, sendOptions?: SendTransactionOptions | undefined): Promise; private getDefaultWalletAddress; }