pub struct CreateSpendPermissionRequest {
pub allowance: String,
pub end: String,
pub extra_data: Option<String>,
pub network: SpendPermissionNetwork,
pub paymaster_url: Option<String>,
pub period: String,
pub salt: Option<String>,
pub spender: CreateSpendPermissionRequestSpender,
pub start: String,
pub token: CreateSpendPermissionRequestToken,
}
Expand description
CreateSpendPermissionRequest
JSON schema
{
"type": "object",
"required": [
"allowance",
"end",
"network",
"period",
"spender",
"start",
"token"
],
"properties": {
"allowance": {
"description": "Maximum allowed value to spend, in atomic units for the specified token, within each period.",
"examples": [
"1000000000000000000"
],
"type": "string"
},
"end": {
"description": "The expiration time for this spend permission, in Unix seconds.",
"examples": [
"281474976710655"
],
"type": "string"
},
"extraData": {
"description": "Arbitrary data to include in the permission.",
"examples": [
"0x"
],
"type": "string"
},
"network": {
"$ref": "#/components/schemas/SpendPermissionNetwork"
},
"paymasterUrl": {
"description": "The paymaster URL of the spend permission.",
"examples": [
"https://paymaster.cdp.coinbase.com"
],
"type": "string"
},
"period": {
"description": "Time duration for resetting used allowance on a recurring basis (seconds).",
"examples": [
"86400"
],
"type": "string"
},
"salt": {
"description": "An arbitrary salt to differentiate unique spend permissions with otherwise identical data.",
"examples": [
"95959551014433038874972658238091428449162862973207257628575040053304171156143"
],
"type": "string"
},
"spender": {
"description": "Entity that can spend account's tokens. Can be either a Smart Account or an EOA.",
"examples": [
"0x9Fb909eA400c2b8D99Be292DADf07e63B814527c"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"start": {
"description": "The start time for this spend permission, in Unix seconds.",
"examples": [
"0"
],
"type": "string"
},
"token": {
"description": "ERC-7528 native token address (e.g. \"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\" for native ETH), or an ERC-20 contract address.",
"examples": [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
}
}
Fields§
§allowance: String
Maximum allowed value to spend, in atomic units for the specified token, within each period.
end: String
The expiration time for this spend permission, in Unix seconds.
extra_data: Option<String>
Arbitrary data to include in the permission.
network: SpendPermissionNetwork
§paymaster_url: Option<String>
The paymaster URL of the spend permission.
period: String
Time duration for resetting used allowance on a recurring basis (seconds).
salt: Option<String>
An arbitrary salt to differentiate unique spend permissions with otherwise identical data.
spender: CreateSpendPermissionRequestSpender
Entity that can spend account’s tokens. Can be either a Smart Account or an EOA.
start: String
The start time for this spend permission, in Unix seconds.
token: CreateSpendPermissionRequestToken
ERC-7528 native token address (e.g. “0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE” for native ETH), or an ERC-20 contract address.
Implementations§
Trait Implementations§
Source§impl Clone for CreateSpendPermissionRequest
impl Clone for CreateSpendPermissionRequest
Source§fn clone(&self) -> CreateSpendPermissionRequest
fn clone(&self) -> CreateSpendPermissionRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CreateSpendPermissionRequest
impl Debug for CreateSpendPermissionRequest
Source§impl<'de> Deserialize<'de> for CreateSpendPermissionRequest
impl<'de> Deserialize<'de> for CreateSpendPermissionRequest
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<&CreateSpendPermissionRequest> for CreateSpendPermissionRequest
impl From<&CreateSpendPermissionRequest> for CreateSpendPermissionRequest
Source§fn from(value: &CreateSpendPermissionRequest) -> Self
fn from(value: &CreateSpendPermissionRequest) -> Self
Converts to this type from the input type.
Source§impl From<CreateSpendPermissionRequest> for CreateSpendPermissionRequest
impl From<CreateSpendPermissionRequest> for CreateSpendPermissionRequest
Source§fn from(value: CreateSpendPermissionRequest) -> Self
fn from(value: CreateSpendPermissionRequest) -> Self
Converts to this type from the input type.
Source§impl TryFrom<CreateSpendPermissionRequest> for CreateSpendPermissionRequest
impl TryFrom<CreateSpendPermissionRequest> for CreateSpendPermissionRequest
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: CreateSpendPermissionRequest,
) -> Result<Self, ConversionError>
fn try_from( value: CreateSpendPermissionRequest, ) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for CreateSpendPermissionRequest
impl RefUnwindSafe for CreateSpendPermissionRequest
impl Send for CreateSpendPermissionRequest
impl Sync for CreateSpendPermissionRequest
impl Unpin for CreateSpendPermissionRequest
impl UnwindSafe for CreateSpendPermissionRequest
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