| Crates.io | builder-relayer-client-rust |
| lib.rs | builder-relayer-client-rust |
| version | 0.2.1 |
| created_at | 2025-11-12 17:19:00.942694+00 |
| updated_at | 2025-12-14 10:53:55.758718+00 |
| description | Builder + Relayer client utilities: build, sign and submit transactions for Gnosis Safe/Builder workflows used by Polymarket. |
| homepage | |
| repository | https://github.com/imangoMah/polymarket-rs-sdk |
| max_upload_size | |
| id | 1929672 |
| size | 253,767 |
Utilities and helpers for building, signing and encoding transactions intended for Builder/Relayer workflows and Gnosis Safe interactions.
This crate focuses on producing properly-formed EIP-712 typed data and transaction payloads for two main flows:
The crate intentionally separates typed-data construction logic from signing implementations so that alternative signers (hardware keys, remote signers) can be integrated.
safe_address derivation, transaction packing, operation type handling).git clone <repo-url>
cd builder-relayer-client-rust
cargo build --release
Run examples (some require credentials):
cargo run --example deploy_safe
cargo run --example multisend_batch
Public modules of interest:
builder::safe — helpers to build safe transaction requests and safe create requests.signer — traits and test signers (e.g. DummySigner) used by examples and tests.encode::safe — encoding helpers for MultiSend and calldata.PK — local EOA private key used by DummySigner examples.BUILDER_API_KEY, BUILDER_SECRET_B64, BUILDER_PASSPHRASE — used when constructing builder auth headers.This crate contains a set of compatibility tests (tests/signature_compatibility_tests.rs) which assert parity against known TypeScript reference outputs for signatures and encodings. Run cargo test to execute them locally.
cargo fmt and cargo clippy when filing PRs.Dual-licensed under MIT OR Apache-2.0. See LICENSE files at repository root.
Representative output from running deploy_safe (values will differ):
Transaction request built: { type: "safe", signature: "0x...", to: "0x..." }
Signed SafeTx signature: 0x...
DummySigner for examples/tests. You can implement AbstractSigner to plug hardware or remote signers.Short descriptions for the examples included in examples/:
approve_tokens.rs — Approve token allowance used before submitting orders or interacting with contracts.builder_auth_execute.rs — Demonstrates building a builder auth header and executing a transaction.client_execute.rs — Example of client-side execute flow against a relayer.client_get_transactions.rs — Poll relayer for transactions associated with a request.client_poll.rs — Polling pattern example for long-running requests.ctf_operations.rs — Demo of CTF-specific operations (project-specific).deploy_safe.rs — Build and sign a Safe transaction request; uses SafeTransactionArgs.deploy_safe_create.rs — Build the SafeCreate typed data to initialize a new Safe.monitor_transactions.rs — Monitor transaction status via the relayer / provider.multisend_batch.rs — Build a MultiSend batch and its calldata.quick_start.rs — Short script demonstrating the basic auth + build + sign flow.relayer_client_demo.rs — End-to-end relayer client demo.