pub struct SwapActionResponse {Show 17 fields
pub caip2: String,
pub created_at: DateTime<Utc>,
pub destination_caip2: Option<String>,
pub estimated_fees: Vec<FeeLineItem>,
pub estimated_gas: Option<Gas>,
pub failure_reason: Option<FailureReason>,
pub fees: Vec<FeeLineItem>,
pub gas: Option<Gas>,
pub id: String,
pub input_amount: Option<String>,
pub input_token: String,
pub output_amount: Option<String>,
pub output_token: String,
pub status: WalletActionStatus,
pub steps: Vec<WalletActionStep>,
pub type_: SwapActionResponseType,
pub wallet_id: String,
}Expand description
Response for a swap action.
JSON schema
{
"title": "SwapActionResponse",
"description": "Response for a swap action.",
"type": "object",
"required": [
"caip2",
"created_at",
"id",
"input_token",
"output_token",
"status",
"type",
"wallet_id"
],
"properties": {
"caip2": {
"description": "CAIP-2 chain identifier for the swap.",
"type": "string"
},
"created_at": {
"description": "ISO 8601 timestamp of when the wallet action was
created.",
"type": "string",
"format": "date-time"
},
"destination_caip2": {
"description": "Destination chain CAIP-2 identifier. Present for
cross-chain swaps.",
"type": "string"
},
"estimated_fees": {
"description": "Estimated fee breakdown from the provider quote.
Only present for cross-chain swaps. Populated after on-chain
confirmation.",
"type": "array",
"items": {
"$ref": "#/components/schemas/FeeLineItem"
}
},
"estimated_gas": {
"allOf": [
{
"$ref": "#/components/schemas/Gas"
},
{
"description": "Estimated source-chain gas cost from the
provider quote. Only present for cross-chain swaps. Populated after
on-chain confirmation.",
"type": "object"
}
]
},
"failure_reason": {
"allOf": [
{
"$ref": "#/components/schemas/FailureReason"
},
{
"description": "Top-level failure context for the wallet
action. Present on rejected or failed actions when available."
}
]
},
"fees": {
"description": "Actual fees paid for the swap. Populated after
on-chain confirmation. Only present for cross-chain swaps.",
"type": "array",
"items": {
"$ref": "#/components/schemas/FeeLineItem"
}
},
"gas": {
"allOf": [
{
"$ref": "#/components/schemas/Gas"
},
{
"description": "Actual source-chain gas cost. Populated after
on-chain confirmation. Only present for cross-chain swaps.",
"type": "object"
}
]
},
"id": {
"description": "The ID of the wallet action.",
"type": "string"
},
"input_amount": {
"description": "Exact base-unit amount of input token. Populated
after on-chain confirmation.",
"type": "string"
},
"input_token": {
"description": "Token address or \"native\" for the token being
sold.",
"type": "string"
},
"output_amount": {
"description": "Exact base-unit amount of output token. Populated
after on-chain confirmation.",
"type": "string"
},
"output_token": {
"description": "Token address or \"native\" for the token being
bought.",
"type": "string"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/WalletActionStatus"
},
{
"description": "The current status of the wallet action."
}
]
},
"steps": {
"description": "The steps of the wallet action. Only returned if
`?include=steps` is provided.",
"type": "array",
"items": {
"$ref": "#/components/schemas/WalletActionStep"
}
},
"type": {
"type": "string",
"enum": [
"swap"
]
},
"wallet_id": {
"description": "The ID of the wallet involved in the action.",
"type": "string"
}
},
"x-stainless-model": "wallet_actions.swap_action_response"
}Fields§
§caip2: StringCAIP-2 chain identifier for the swap.
created_at: DateTime<Utc>ISO 8601 timestamp of when the wallet action was created.
destination_caip2: Option<String>Destination chain CAIP-2 identifier. Present for cross-chain swaps.
estimated_fees: Vec<FeeLineItem>Estimated fee breakdown from the provider quote. Only present for cross-chain swaps. Populated after on-chain confirmation.
estimated_gas: Option<Gas>§failure_reason: Option<FailureReason>§fees: Vec<FeeLineItem>Actual fees paid for the swap. Populated after on-chain confirmation. Only present for cross-chain swaps.
gas: Option<Gas>§id: StringThe ID of the wallet action.
input_amount: Option<String>Exact base-unit amount of input token. Populated after on-chain confirmation.
input_token: StringToken address or “native” for the token being sold.
output_amount: Option<String>Exact base-unit amount of output token. Populated after on-chain confirmation.
output_token: StringToken address or “native” for the token being bought.
status: WalletActionStatus§steps: Vec<WalletActionStep>The steps of the wallet action. Only returned if ?include=steps is
provided.
type_: SwapActionResponseType§wallet_id: StringThe ID of the wallet involved in the action.
Trait Implementations§
Source§impl Clone for SwapActionResponse
impl Clone for SwapActionResponse
Source§fn clone(&self) -> SwapActionResponse
fn clone(&self) -> SwapActionResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more