This utility automatically detects the JSON-RPC method type and applies optimized encoding for
wallet_sendCalls (EIP-5792), wallet_sign (EIP-7871), or generic JSON-RPC requests. The result is a compressed, base64url-encoded string perfect for URLs, QR codes, and deep links.Import
Parameters
ProlinkRequest
required
The JSON-RPC request to encode.
Returns
Promise<string>
A promise that resolves to a base64url-encoded prolink payload. This string is URL-safe and can be used in links, QR codes, or storage.
Examples
Encode wallet_sendCalls (ERC20 Transfer)
Encode wallet_sendCalls (Native Transfer)
Encode wallet_sendCalls with Capabilities
Encode wallet_sign (Spend Permission)
Encode Generic JSON-RPC
Batch Multiple Calls
Performance
Prolinks automatically apply compression for larger payloads:- Small payloads (< 1KB): Base64url encoding only
- Large payloads (≥ 1KB): Gzip compression + base64url encoding
Related
decodeProlink
Decode a prolink payload back to a JSON-RPC request
wallet_sendCalls
Learn about transaction batching
Capabilities
Configure wallet capabilities