import { type Address, type Instruction, type Rpc, type SolanaRpcApi, type TransactionSigner } from "@solana/kit"; import { type AuthenticationResponseJSON } from "../utils/passkey/webauthn.js"; import { type Secp256r1VerifyEntry } from "../utils/passkey/secp256r1.js"; /** State from `beginTransfer` needed to collect the tap and build `set_owner`. */ export type TransferSession = { rpc: Rpc; /** Phygital token PDA derived from {@link TransferSession.secp256r1Pubkey}. */ phygitalToken: Address; /** Base64url compressed secp256r1 passkey public key for the physical token. */ secp256r1Pubkey: string; slotHash: Uint8Array; slotNumber: bigint; challenge: Uint8Array; rpId: string; /** Wallet named by the tap. {@link completeTransfer} must use this signer. */ recipient: Address; /** * The token's owner when the session began, or `null` if it had none. */ owner: Address | null; }; /** * Prepares a transfer session with slot-bound challenge data. * The tap names `recipient`, who must sign the transaction. * Must be followed promptly by {@link authenticatePasskeyForTransfer} and * {@link completeTransfer}. * * @param input.rpc - Kit `Rpc`, used to read the latest slot hash. * @param input.secp256r1Pubkey - Base64url compressed secp256r1 public key for the * physical token (same shape as a phygital `response.id` / compressed passkey). The phygital * token PDA is derived via {@link findPhygitalTokenPda}. * @param input.recipient - Wallet that will become the owner. It is part of the signed challenge. * @param input.rpId - Relying party ID for the NFC tap. Defaults to `window.location.hostname`. */ export declare function beginTransfer(input: { rpc: Rpc; secp256r1Pubkey: string; recipient: Address; rpId?: string; }): Promise; /** * Prompts the physical token passkey (WebAuthn / NFC tap). * * Browser: passes {@link TransferSession.secp256r1Pubkey} in `allowCredentials`. * If the platform echoes a random placeholder id, recovery disambiguates by checking * which candidate matches {@link TransferSession.secp256r1Pubkey}. * * Throws `PASSKEY_NOT_RECOGNIZED` if a different tag is tapped. */ export declare function authenticatePasskeyForTransfer(session: TransferSession): Promise; /** * Builds the two on-chain instructions after passkey authentication. * Owner is updated on the phygital token PDA only — no SPL token transfer. * * @param recipient - Kit `TransactionSigner` for the wallet named by the tap. */ export declare function completeTransfer(session: TransferSession, response: AuthenticationResponseJSON, recipient: TransactionSigner, existingSecp256r1VerifyInputs?: Secp256r1VerifyEntry[]): Promise; //# sourceMappingURL=transfer.d.ts.map