@solana/pay
Version:
`@solana/pay` is a JavaScript library for facilitating commerce on Solana by using a token transfer URL scheme. The URL scheme ensures that no matter the wallet or service used, the payment request must be created and interpreted in one standard way.
22 lines • 1.05 kB
TypeScript
import { type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type Rpc, type TransactionSigner } from '@solana/kit';
import type { TransferFields } from './types.js';
/**
* Thrown when a Solana Pay transfer transaction can't be created from the fields provided.
*/
export declare class CreateTransferError extends Error {
name: string;
}
/**
* Create instructions for a Solana Pay transfer.
*
* Returns an array of {@link Instruction} that the caller composes into a transaction message
* using `pipe(createTransactionMessage(...), ...)`.
*
* @param rpc - An RPC client supporting `getAccountInfo`.
* @param sender - The signer that will send the transfer.
* @param fields - Fields of a Solana Pay transfer request URL.
*
* @throws {CreateTransferError}
*/
export declare function createTransfer(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, sender: TransactionSigner, { recipient, amount, splToken, reference, memo }: TransferFields): Promise<Instruction[]>;
//# sourceMappingURL=createTransfer.d.ts.map