pub enum ApprovalPayload {
Eip2612Payload(Eip2612Payload),
Permit2AllowancePayload(Permit2AllowancePayload),
Erc20ApprovalPayload(Erc20ApprovalPayload),
SolanaSubscriptionPayload(SolanaSubscriptionPayload),
}Expand description
A single payload the customer signs to approve a mandate on a wallet source. Mandates support allowance-style credentials only, since a mandate must be reusable for later debits when the customer is not present. Inspect type to determine how to handle data:
- `eip2612`: pass `data` to `eth_signTypedData_v4`, return the signature.
- `permit2`: a Permit2 `PermitSingle` (AllowanceTransfer) granting a
reusable allowance; pass `data` to `eth_signTypedData_v4`, return the
signature. Preceded by a one-time `erc20_approval` of the Permit2 contract
when the wallet has not yet approved Permit2 for this asset.
- `erc20_approval`: send `data` via `eth_sendTransaction`, return the transaction hash.
- `solana_subscription`: decode `data.transaction` from base64 and pass the
bytes to the Solana Wallet Standard `signTransaction` method (never
`signAndSendTransaction`). From the signed transaction, extract the
64-byte ed25519 signature for the payer that signed, base58-encode it,
and return that string as `OnchainSignedPayload.signature`. Do not
submit the signed transaction bytes.JSON schema
{
"description": "A single payload the customer signs to approve a mandate on a wallet source. Mandates support allowance-style credentials only, since a mandate must be reusable for later debits when the customer is not present. Inspect `type` to determine how to handle `data`:\n\n- `eip2612`: pass `data` to `eth_signTypedData_v4`, return the signature.\n\n- `permit2`: a Permit2 `PermitSingle` (AllowanceTransfer) granting a\n reusable allowance; pass `data` to `eth_signTypedData_v4`, return the\n signature. Preceded by a one-time `erc20_approval` of the Permit2 contract\n when the wallet has not yet approved Permit2 for this asset.\n\n\n- `erc20_approval`: send `data` via `eth_sendTransaction`, return the transaction hash.\n- `solana_subscription`: decode `data.transaction` from base64 and pass the\n bytes to the Solana Wallet Standard `signTransaction` method (never\n `signAndSendTransaction`). From the signed transaction, extract the\n 64-byte ed25519 signature for the payer that signed, base58-encode it,\n and return that string as `OnchainSignedPayload.signature`. Do not\n submit the signed transaction bytes.",
"oneOf": [
{
"$ref": "#/components/schemas/EIP2612Payload"
},
{
"$ref": "#/components/schemas/Permit2AllowancePayload"
},
{
"$ref": "#/components/schemas/Erc20ApprovalPayload"
},
{
"$ref": "#/components/schemas/SolanaSubscriptionPayload"
}
]
}Variants§
Eip2612Payload(Eip2612Payload)
Permit2AllowancePayload(Permit2AllowancePayload)
Erc20ApprovalPayload(Erc20ApprovalPayload)
SolanaSubscriptionPayload(SolanaSubscriptionPayload)
Trait Implementations§
Source§impl Clone for ApprovalPayload
impl Clone for ApprovalPayload
Source§impl Debug for ApprovalPayload
impl Debug for ApprovalPayload
Source§impl<'de> Deserialize<'de> for ApprovalPayload
impl<'de> Deserialize<'de> for ApprovalPayload
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<&ApprovalPayload> for ApprovalPayload
impl From<&ApprovalPayload> for ApprovalPayload
Source§fn from(value: &ApprovalPayload) -> Self
fn from(value: &ApprovalPayload) -> Self
Converts to this type from the input type.
Source§impl From<Eip2612Payload> for ApprovalPayload
impl From<Eip2612Payload> for ApprovalPayload
Source§fn from(value: Eip2612Payload) -> Self
fn from(value: Eip2612Payload) -> Self
Converts to this type from the input type.
Source§impl From<Erc20ApprovalPayload> for ApprovalPayload
impl From<Erc20ApprovalPayload> for ApprovalPayload
Source§fn from(value: Erc20ApprovalPayload) -> Self
fn from(value: Erc20ApprovalPayload) -> Self
Converts to this type from the input type.
Source§impl From<Permit2AllowancePayload> for ApprovalPayload
impl From<Permit2AllowancePayload> for ApprovalPayload
Source§fn from(value: Permit2AllowancePayload) -> Self
fn from(value: Permit2AllowancePayload) -> Self
Converts to this type from the input type.
Source§impl From<SolanaSubscriptionPayload> for ApprovalPayload
impl From<SolanaSubscriptionPayload> for ApprovalPayload
Source§fn from(value: SolanaSubscriptionPayload) -> Self
fn from(value: SolanaSubscriptionPayload) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ApprovalPayload
impl RefUnwindSafe for ApprovalPayload
impl Send for ApprovalPayload
impl Sync for ApprovalPayload
impl Unpin for ApprovalPayload
impl UnsafeUnpin for ApprovalPayload
impl UnwindSafe for ApprovalPayload
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