amount — decimal string in whole units, always present.
spl-token — present exactly when asset is an SPL mint;
absent for the native sentinel SOLANA_NATIVE_ASSET.
reference — the correlation key for chain-level replay
detection (one value; see createPaymentReference).
Parameters are emitted in the Solana Pay specification order
(amount, spl-token, reference) so URLs are deterministic —
the same request encodes to the same string.
Parameters
request: PaymentRequest
Returns string
Throws
if chain is not a Solana CAIP-2 id, payTo
is not a base58-encoded 32-byte address, amount is not a
non-negative decimal string, asset is neither the native
sentinel nor a base58-encoded 32-byte SPL mint, or reference
is not a base58-encoded 32-byte key.
Encodes a Solana
PaymentRequestas a Solana Pay URI for external wallets (Phantom acceptance flow, v1.2 §5.1):solana:<payTo>— recipient (base58; URI-safe as-is).amount— decimal string in whole units, always present.spl-token— present exactly whenassetis an SPL mint; absent for the native sentinel SOLANA_NATIVE_ASSET.reference— the correlation key for chain-level replay detection (one value; seecreatePaymentReference).Parameters are emitted in the Solana Pay specification order (
amount,spl-token,reference) so URLs are deterministic — the same request encodes to the same string.