@coral-xyz/barter-sdk
Version:
Node.js client for the Barter protocol
85 lines • 3.76 kB
TypeScript
import { Program } from "@coral-xyz/anchor";
import { PublicKey, Transaction, TransactionInstruction } from "@solana/web3.js";
import type { Barter } from "./barter";
import type { CancelParameters, CreateParameters, FinalizeParameters, SettleParameters } from "./types";
export declare const PROGRAM_ID: PublicKey;
/**
* Creates the full transaction for the `cancel` instruction set.
* @export
* @param {...Parameters<typeof createCancelInstruction>} args
* @returns {Promise<Transaction>}
*/
export declare function createCancelTransaction(...args: Parameters<typeof createCancelInstruction>): Promise<Transaction>;
/**
* Builds the single instruction instance for `cancel`.
* @export
* @param {Program<Barter>} program
* @param {CancelParameters} opts
* @returns {Promise<TransactionInstruction>}
*/
export declare function createCancelInstruction(program: Program<Barter>, opts: CancelParameters): Promise<TransactionInstruction>;
/**
* Creates the full transactino for the `create` instruction set, possibly
* including the convertion of SOL -> wSOL for native barter items.
* @export
* @param {...Parameters<typeof createCreateInstruction>} args
* @returns {Promise<Transaction>}
*/
export declare function createCreateTransaction(...args: Parameters<typeof createCreateInstruction>): Promise<Transaction>;
/**
* Builds the single instruction instance for `create`.
* @export
* @param {Program<Barter>} program
* @param {CreateParameters} opts
* @returns {Promise<TransactionInstruction>}
*/
export declare function createCreateInstruction(program: Program<Barter>, opts: CreateParameters): Promise<TransactionInstruction>;
/**
* Creates the full transaction for the `finalize` instruction set, possibly
* including the convertion of SOL -> wSOL for native barter items.
* @export
* @param {...Parameters<typeof createFinalizeInstruction>} args
* @returns {Promise<Transaction>}
*/
export declare function createFinalizeTransaction(...args: Parameters<typeof createFinalizeInstruction>): Promise<Transaction>;
/**
* Builds the single instruction instance for `finalize`.
* @export
* @param {Program<Barter>} program
* @param {FinalizeParameters} opts
* @returns {Promise<TransactionInstruction>}
*/
export declare function createFinalizeInstruction(program: Program<Barter>, opts: FinalizeParameters): Promise<TransactionInstruction>;
/**
* Creates the full transaction for the `settle` instruction set, including
* the idempotent creation of the destination associated token accounts for settlement.
* @export
* @param {...Parameters<typeof createSettleInstructions>} args
* @returns {Promise<Transaction>}
*/
export declare function createSettleTransaction(...args: Parameters<typeof createSettleInstructions>): Promise<Transaction>;
/**
* Builds the list of ordered instructions for processing the `settle`
* instruction and the pre-instructions that are required.
* @export
* @param {Program<Barter>} program
* @param {SettleParameters} opts
* @returns {Promise<TransactionInstruction[]>}
*/
export declare function createSettleInstructions(program: Program<Barter>, opts: SettleParameters): Promise<TransactionInstruction[]>;
/**
* Derive the program address and nonce for an `Agreement` PDA.
* @export
* @param {PublicKey} initiater
* @param {PublicKey} participant
* @returns {[PublicKey, number]}
*/
export declare function deriveAgreementAddress(initiater: PublicKey, participant: PublicKey): [PublicKey, number];
/**
* Derive the program address and nonce for a `Delegate` PDA.
* @export
* @param {PublicKey} authority
* @returns {[PublicKey, number]}
*/
export declare function deriveDelegateAddress(authority: PublicKey): [PublicKey, number];
//# sourceMappingURL=instructions.d.ts.map