Wallet-only Rust client for the Kuest relayer.
[dependencies]
kuest-builder-relayer-client = "0.1.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }137Polygon mainnet80002Polygon Amoy
Both chains use the same Deposit Wallet contracts:
- Factory:
0x3DaBe8f032833CE42CC26d9149660E6f596759C5 - Implementation:
0xFB2f5D822Ecb062dE63a7B830C5e83C994698851
RELAYER_URLKUEST_BUILDER_API_KEYKUEST_BUILDER_SECRETKUEST_BUILDER_PASSPHRASE
use kuest_builder_relayer_client::{
BuilderApiKeyCreds, BuilderConfig, DepositWalletCall, RelayClient,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let builder_config = BuilderConfig::local(BuilderApiKeyCreds::new(
std::env::var("KUEST_BUILDER_API_KEY")?,
std::env::var("KUEST_BUILDER_SECRET")?,
std::env::var("KUEST_BUILDER_PASSPHRASE")?,
))?;
let client = RelayClient::new_with_private_key(
&std::env::var("RELAYER_URL")?,
80002,
"0xabc123...",
Some(builder_config),
)?;
let wallet = client.derive_deposit_wallet()?;
client.deploy_deposit_wallet().await?;
client
.execute_deposit_wallet_batch(
&[DepositWalletCall {
target: "0x0000000000000000000000000000000000000001".to_owned(),
value: "0".to_owned(),
data: "0x".to_owned(),
}],
&wallet,
"1735689600",
)
.await?;
Ok(())
}get_nonce(address, tx_type)get_transaction(transaction_id)get_transactions()get_deployed(address)derive_deposit_wallet()derive_deposit_wallet_address()get_expected_deposit_wallet()deploy_deposit_wallet()deploy_deposit_wallet_public()execute_deposit_wallet_batch(calls, wallet_address, deadline)execute_deposit_wallet_batch_public(calls, wallet_address, deadline)poll_until_state(transaction_id, states, fail_state, max_polls, poll_frequency)
Local builder auth mirrors the existing SDKs and signs:
timestamp + method + path + body
The generated headers remain:
KUEST_BUILDER_API_KEYKUEST_BUILDER_PASSPHRASEKUEST_BUILDER_TIMESTAMPKUEST_BUILDER_SIGNATURE
Remote signing mode is also supported through BuilderConfig::remote(...).
- Secrets use
secrecy::SecretStringand are redacted in debug output. - The crate does not log raw builder headers, signatures, or secrets.