Skip to main content

Crate polyoxide_relay

Crate polyoxide_relay 

Source
Expand description

§polyoxide-relay

Gasless transaction relay client for Polymarket’s Safe and Proxy wallet infrastructure.

This crate enables submitting on-chain transactions through Polymarket’s relayer service, which pays gas fees on behalf of users. It supports two wallet types:

  • Safe wallets — Gnosis Safe multisig contracts (must be deployed before first use)
  • Proxy wallets — lightweight proxy contracts that auto-deploy on first transaction

§Authentication

Relay operations require a private key for EIP-712 transaction signing and one of two authentication schemes for relay submission:

  • Builder API credentials — HMAC-SHA256 signed headers (BUILDER_API_KEY, BUILDER_SECRET, BUILDER_PASS_PHRASE)
  • Relayer API keys — static headers (RELAYER_API_KEY, RELAYER_API_KEY_ADDRESS), a simpler alternative

§Example

use polyoxide_relay::{RelayClient, BuilderAccount, BuilderConfig};

let config = BuilderConfig::new("key".into(), "secret".into(), None);
let account = BuilderAccount::new("0xprivatekey...", Some(config))?;
let client = RelayClient::from_account(account)?;

let latency = client.ping().await?;
println!("Relay API latency: {}ms", latency.as_millis());

Structs§

BuilderAccount
Account credentials for authenticated relay operations.
BuilderConfig
API credentials for authenticating relay requests.
ContractConfig
On-chain contract addresses and RPC configuration for a specific chain.
RelayClient
Client for submitting gasless transactions through Polymarket’s relayer service.
RelayerApiKey
A relayer API key record returned by GET /relayer/api/keys.
RelayerApiKeyConfig
Relayer API Key credentials for authenticated relay requests.
RelayerTransaction
Full relayer transaction record returned by GET /transaction.
SafeTransaction
A single transaction to execute through the relayer’s Safe.
SafeTx
The Gnosis Safe execTransaction payload that is EIP-712 signed.
SubmitResponse
Response from POST /submit after a transaction submission.
TransactionRequest
Partial, legacy representation of a relayer submission payload.

Enums§

AuthConfig
Authentication configuration for relay requests.
RelayError
Error types for relay operations.
WalletType
Wallet type for the relayer API