@candy-swap/candy-sdk
Version:
Candy SDK for Solana
51 lines (50 loc) • 1.96 kB
TypeScript
import { PublicKey } from "@solana/web3.js";
import { Connection, Keypair } from "@solana/web3.js";
/**
* Get token account address
* @param mint Token mint address
* @param owner Owner address
* @returns Token account address
*/
export declare function getTokenAccount(mint: PublicKey, owner: PublicKey): Promise<PublicKey>;
/**
* Get liquidity pool PDA address
* @param programId Program ID
* @param mint Token mint address
* @returns Liquidity pool address
*/
export declare function getLiquidityPoolAddress(programId: PublicKey, mint: PublicKey): Promise<[PublicKey, number]>;
/**
* Get cashier PDA address
* @param programId Program ID
* @returns Cashier address
*/
export declare function getCashierAddress(programId: PublicKey): Promise<[PublicKey, number]>;
/**
* Create and initialize Address Lookup Table
* @param connection Solana connection instance
* @param payer Payer keypair
* @param slot Current slot
* @returns Address Lookup Table address
*/
export declare function createAddressLookupTable(connection: Connection, payer: Keypair, slot: number): Promise<PublicKey>;
/**
* Add addresses to Address Lookup Table
* @param connection Solana connection instance
* @param payer Payer keypair
* @param lookupTableAddress Address Lookup Table address
* @param addresses Addresses to add
*/
export declare function extendAddressLookupTable(connection: Connection, payer: Keypair, lookupTableAddress: PublicKey, addresses: PublicKey[]): Promise<void>;
/**
* Get or create Address Lookup Table for Swap operation
* @param connection Solana connection instance
* @param payer Payer keypair
* @param programId Program ID
* @param mint Token mint address
* @returns Address Lookup Table address and whether it is newly created
*/
export declare function getOrCreateSwapLookupTable(connection: Connection, payer: Keypair, programId: PublicKey, mint: PublicKey): Promise<{
address: PublicKey;
isNew: boolean;
}>;