Skip to main content
Defined in the Base Account SDK
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

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
This results in 50-80% size reduction for typical transaction batches.

decodeProlink

Decode a prolink payload back to a JSON-RPC request

wallet_sendCalls

Learn about transaction batching

Capabilities

Configure wallet capabilities