pub struct WalletAuthorizationOption {
pub amount: String,
pub asset: Asset,
pub network: PaymentSourceNetwork,
pub option_id: String,
pub payloads: Vec<OnchainSignaturePayload>,
pub source: PaymentSourceWallet,
}Expand description
An authorization option for completing payment via a wallet. Specifies the currency, amount, and network the payer would pay on, and the payloads the payer must sign or submit.
JSON schema
{
"title": "Wallet Authorization Option",
"description": "An authorization option for completing payment via a wallet. Specifies the currency, amount, and network the payer would pay on, and the payloads the payer must sign or submit.",
"examples": [
{
"amount": "1.00",
"asset": "usdc",
"network": "base",
"optionId": "opt_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"payloads": [
{
"data": {
"domain": {
"chainId": 8453,
"name": "USD Coin",
"verifyingContract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"version": "2"
},
"message": {
"from": "0x1111111111111111111111111111111111111111",
"nonce": "0x8f5c2d6f4b9a1e3c7d2f8a6b5c4e3d2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d",
"to": "0x2222222222222222222222222222222222222222",
"validAfter": "0",
"validBefore": "1767225600",
"value": "1000000"
},
"primaryType": "TransferWithAuthorization",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"TransferWithAuthorization": [
{
"name": "from",
"type": "address"
},
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
},
{
"name": "validAfter",
"type": "uint256"
},
{
"name": "validBefore",
"type": "uint256"
},
{
"name": "nonce",
"type": "bytes32"
}
]
}
},
"payloadId": "payload_af2937b0-9846-4fe7-bfe9-ccc22d935114",
"type": "eip3009"
}
],
"source": {
"address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
"asset": "usdc",
"network": "base"
}
}
],
"type": "object",
"required": [
"amount",
"asset",
"network",
"optionId",
"payloads",
"source"
],
"properties": {
"amount": {
"description": "A decimal representation of the amount the payer would pay if they choose this option, denominated in `asset`. May differ from the session amount when paying in a different asset.",
"examples": [
"1.00"
],
"type": "string"
},
"asset": {
"description": "The symbol of the asset the payer would pay in for this option.",
"examples": [
"usdc"
],
"allOf": [
{
"$ref": "#/components/schemas/Asset"
}
]
},
"network": {
"description": "The blockchain network the transaction will occur on for this option.",
"examples": [
"base"
],
"allOf": [
{
"$ref": "#/components/schemas/PaymentSourceNetwork"
}
]
},
"optionId": {
"description": "The unique identifier of the authorization option.",
"examples": [
"opt_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
],
"type": "string"
},
"payloads": {
"description": "The payloads the payer must sign or submit to authorize the payment via this option.",
"examples": [
[
{
"data": {
"domain": {
"chainId": 8453,
"name": "USD Coin",
"verifyingContract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"version": "2"
},
"message": {
"from": "0x1111111111111111111111111111111111111111",
"nonce": "0x8f5c2d6f4b9a1e3c7d2f8a6b5c4e3d2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d",
"to": "0x2222222222222222222222222222222222222222",
"validAfter": "0",
"validBefore": "1767225600",
"value": "1000000"
},
"primaryType": "TransferWithAuthorization",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"TransferWithAuthorization": [
{
"name": "from",
"type": "address"
},
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
},
{
"name": "validAfter",
"type": "uint256"
},
{
"name": "validBefore",
"type": "uint256"
},
{
"name": "nonce",
"type": "bytes32"
}
]
}
},
"payloadId": "payload_af2937b0-9846-4fe7-bfe9-ccc22d935114",
"type": "eip3009"
}
]
],
"type": "array",
"items": {
"$ref": "#/components/schemas/OnchainSignaturePayload"
}
},
"source": {
"description": "The source address this authorization option applies to.",
"examples": [
{
"address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
"asset": "usdc",
"network": "base"
}
],
"allOf": [
{
"$ref": "#/components/schemas/PaymentSourceWallet"
}
]
}
}
}Fields§
§amount: StringA decimal representation of the amount the payer would pay if they choose this option, denominated in asset. May differ from the session amount when paying in a different asset.
asset: AssetThe symbol of the asset the payer would pay in for this option.
network: PaymentSourceNetworkThe blockchain network the transaction will occur on for this option.
option_id: StringThe unique identifier of the authorization option.
payloads: Vec<OnchainSignaturePayload>The payloads the payer must sign or submit to authorize the payment via this option.
source: PaymentSourceWalletThe source address this authorization option applies to.
Implementations§
Source§impl WalletAuthorizationOption
impl WalletAuthorizationOption
pub fn builder() -> WalletAuthorizationOption
Trait Implementations§
Source§impl Clone for WalletAuthorizationOption
impl Clone for WalletAuthorizationOption
Source§impl Debug for WalletAuthorizationOption
impl Debug for WalletAuthorizationOption
Source§impl<'de> Deserialize<'de> for WalletAuthorizationOption
impl<'de> Deserialize<'de> for WalletAuthorizationOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&WalletAuthorizationOption> for WalletAuthorizationOption
impl From<&WalletAuthorizationOption> for WalletAuthorizationOption
Source§fn from(value: &WalletAuthorizationOption) -> Self
fn from(value: &WalletAuthorizationOption) -> Self
Converts to this type from the input type.
Source§impl From<WalletAuthorizationOption> for WalletAuthorizationOption
impl From<WalletAuthorizationOption> for WalletAuthorizationOption
Source§fn from(value: WalletAuthorizationOption) -> Self
fn from(value: WalletAuthorizationOption) -> Self
Converts to this type from the input type.
Source§impl TryFrom<WalletAuthorizationOption> for WalletAuthorizationOption
impl TryFrom<WalletAuthorizationOption> for WalletAuthorizationOption
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: WalletAuthorizationOption) -> Result<Self, ConversionError>
fn try_from(value: WalletAuthorizationOption) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for WalletAuthorizationOption
impl RefUnwindSafe for WalletAuthorizationOption
impl Send for WalletAuthorizationOption
impl Sync for WalletAuthorizationOption
impl Unpin for WalletAuthorizationOption
impl UnsafeUnpin for WalletAuthorizationOption
impl UnwindSafe for WalletAuthorizationOption
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more