@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.
40 lines • 1.68 kB
TypeScript
import type { GetSignaturesForAddressApi, Rpc } from '@solana/kit';
import type { Commitment, Signature } from '@solana/kit';
import type { Reference } from './types.js';
/**
* Thrown when no transaction signature can be found referencing a given address.
*/
export declare class FindReferenceError extends Error {
name: string;
}
/** Options for {@link findReference}. */
export interface FindReferenceOptions {
/** Limit the number of signatures returned. */
limit?: number;
/** Start searching backwards from this signature. */
before?: Signature;
/** Search until this signature is reached. */
until?: Signature;
/** Commitment level to use for the query. */
commitment?: Exclude<Commitment, 'processed'>;
}
/** A confirmed signature info entry returned by the RPC. */
export interface ConfirmedSignatureInfo {
signature: Signature;
slot: bigint | number;
err: unknown | null;
memo: string | null;
blockTime: bigint | number | null;
confirmationStatus: Commitment | null;
}
/**
* Find the oldest transaction signature referencing a given address.
*
* @param rpc - An RPC client supporting `getSignaturesForAddress`.
* @param reference - `reference` in the [Solana Pay spec](https://github.com/solana-foundation/pay/blob/main/typescript/packages/solana-pay/spec/SPEC.md#reference).
* @param options - Options for `getSignaturesForAddress`.
*
* @throws {FindReferenceError}
*/
export declare function findReference(rpc: Rpc<GetSignaturesForAddressApi>, reference: Reference, { commitment, ...options }?: FindReferenceOptions): Promise<ConfirmedSignatureInfo>;
//# sourceMappingURL=findReference.d.ts.map