pub struct TransferRequest {
pub amount: String,
pub amount_type: TransferRequestAmountType,
pub asset: Asset,
pub execute: bool,
pub metadata: Option<Metadata>,
pub source: CreateTransferSource,
pub target: TransferTarget,
pub travel_rule: Option<TravelRule>,
pub validate_only: bool,
}Expand description
A request to create a transfer.
JSON schema
{
"description": "A request to create a transfer.",
"type": "object",
"required": [
"amount",
"asset",
"execute",
"source",
"target"
],
"properties": {
"amount": {
"description": "The amount of the transfer, as a decimal string in standard unit denomination of the asset specified by `asset` (e.g., \"100.00\" for 100 USD, \"0.05\" for 0.05 ETH).",
"examples": [
"100.00"
],
"type": "string"
},
"amountType": {
"description": "Specifies whether the given amount is to be received by the target or taken from the source.\n\n- `target`: The transfer `target` receives the exact value specified in `amount`. Fees are added to the amount taken from the transfer `source`.\n- `source`: The transfer `target` receives the value specified in `amount`, minus any fees.\n",
"default": "source",
"examples": [
"source"
],
"type": "string",
"enum": [
"target",
"source"
]
},
"asset": {
"description": "The symbol of the asset for the amount. This must be one of the assets of the source or target.",
"examples": [
"usd"
],
"allOf": [
{
"$ref": "#/components/schemas/Asset"
}
]
},
"execute": {
"description": "Whether to immediately execute the transfer. If false, the transfer will be created in quoted status and must be executed manually via the /execute endpoint.",
"examples": [
true
],
"type": "boolean"
},
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"source": {
"$ref": "#/components/schemas/CreateTransferSource"
},
"target": {
"$ref": "#/components/schemas/TransferTarget"
},
"travelRule": {
"$ref": "#/components/schemas/TravelRule"
},
"validateOnly": {
"description": "If true, validates the transfer without initiating it. If the request is valid, a 2xx will be returned. If the request is invalid, a 4xx error will be returned. The response will include an errorType, for e.g. invalid_target if the specified target cannot receive funds.",
"default": false,
"examples": [
false
],
"type": "boolean"
}
}
}Fields§
§amount: StringThe amount of the transfer, as a decimal string in standard unit denomination of the asset specified by asset (e.g., “100.00” for 100 USD, “0.05” for 0.05 ETH).
amount_type: TransferRequestAmountTypeSpecifies whether the given amount is to be received by the target or taken from the source.
- `target`: The transfer `target` receives the exact value specified in `amount`. Fees are added to the amount taken from the transfer `source`.
- `source`: The transfer `target` receives the value specified in `amount`, minus any fees.asset: AssetThe symbol of the asset for the amount. This must be one of the assets of the source or target.
execute: boolWhether to immediately execute the transfer. If false, the transfer will be created in quoted status and must be executed manually via the /execute endpoint.
metadata: Option<Metadata>§source: CreateTransferSource§target: TransferTarget§travel_rule: Option<TravelRule>§validate_only: boolIf true, validates the transfer without initiating it. If the request is valid, a 2xx will be returned. If the request is invalid, a 4xx error will be returned. The response will include an errorType, for e.g. invalid_target if the specified target cannot receive funds.
Implementations§
Source§impl TransferRequest
impl TransferRequest
pub fn builder() -> TransferRequest
Trait Implementations§
Source§impl Clone for TransferRequest
impl Clone for TransferRequest
Source§fn clone(&self) -> TransferRequest
fn clone(&self) -> TransferRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more