pub struct PaymentConfig {
pub scheme: String,
pub key: String,
pub pay_network: String,
pub asset: String,
pub max_amount: String,
pub svm_rpc_url: Option<String>,
pub base_url_override: Option<String>,
}Expand description
Binding-facing crypto-micropayment configuration. Plain data — all
fields are strings so this can be a napi(object) / pyclass / Ruby hash;
it is converted to the internal enum Signer + resolved config at the Rust
boundary. The private key field stays readable to the caller, but the
SDK’s own Debug redacts it (below) so an SDK log line or panic can’t leak
it.
Do not log your own PaymentConfig — println!("{config:?}") on the
derived-Debug binding object (napi/pyclass/hash) still shows the raw key.
Only the SDK’s internal rendering is redacted.
Fields§
§scheme: StringPayment protocol: "x402" (pay-per-request) or "mpp" (MPP charge).
key: StringRaw private key. EVM/Tempo: hex (with or without 0x). Solana: base58
64-byte secret key.
pay_network: StringCAIP-2 pay network selector, e.g. "eip155:84532" (x402/EVM),
"solana:5eykt4…" (x402/Solana), or "eip155:42431" (MPP/Tempo).
asset: StringAsset (token) address/mint to pay in. Matches the offered menu entry’s
asset. EVM: token contract hex. Solana: mint base58.
max_amount: StringSpend ceiling in base units of asset (integer string). Required.
The selector skips any offered entry above this, and the driver refuses
to sign one — guarding against a buggy/hostile gateway overcharging a
custodied key.
svm_rpc_url: Option<String>Explicit Solana RPC URL for x402/Solana payment-build reads: the mint (for its decimals and owning token program) and a recent blockhash, so two reads per payment. Optional; when unset the SDK falls back to a public Solana RPC matching the pay cluster. Set this at any real volume — the public default rate-limits aggressively.
base_url_override: Option<String>Test-only gateway base override (points the lane at a mock gateway).
Trait Implementations§
Source§impl Clone for PaymentConfig
impl Clone for PaymentConfig
Source§fn clone(&self) -> PaymentConfig
fn clone(&self) -> PaymentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more