Send a transfer
In this guide, you will learn how to send native funds between two addresses using the MARCO API.
Before you begin
Before you start, complete the following prerequisites:
Step by step
To send a transaction, you have two options:
Use the recipient's MARCO wallet id: Send a
POST
request to the Send GLO endpoint as follows:curl --location 'https://api-marco.finboot.com/v1/ledger-ops/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'ApplicationToken: <APPLICATION_TOKEN>' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--data '{
"dependencies": [],
"intent": "<INTENT_UUID>",
"glo": {
"version": "0.1.0",
"type": "transfer",
"options": {
"recipient": {
"lookup_service": {
"type": "marco",
"value": "marco"
},
"resource": "<RECIPIENT_WALLET_ID>"
},
"amount": "<AMOUNT>"
},
"meta": {}
},
"walletId": "<SENDER_WALLET_ID>",
"walletPassword": "<SENDER_WALLET_PASSWORD>"
}'Replace:
INTENT_UUID
: An Universally Unique Identifier (UUID) is a 128-bit string represented in hexadecimal that uniquely identifies an action or a group of actions. UUIDs are typically generated using algorithms that ensure their uniqueness. An example of a valid UUID isf1b0c9e0-9f1e-4c4e-8b1a-9b0b9b9b9b9b
. If you need to generate UUIDs for testing purposes, you can use an online tool such as UUID generator.APPLICATION_TOKEN
: The marpp token. For guidance on obtaining this token, see the Quickstart guide.ACCESS_TOKEN
: The access token. For guidance on obtaining this token, ssee the Quickstart guide.RECIPIENT_WALLET_ID
: The resource ID of the wallet that will receive the transaction. For example,WAL-pkgv0HncVuM
.AMOUNT
: The number of native tokens to send from the sender wallet. The wallet must have at least this amount of tokens. For example,0x0
.SENDER_WALLET_ID
: The resource ID of the wallet from which the funds will be sent. For example,WAL-62EPFgDCGOM
.SENDER_WALET_PASSWORD
: The password of theSENDER_WALLET_ID
.
Use the recipient's native address: Send the same request as the previous method, but define the recipient's native address in the
glo.options.recipient
field....
"glo":{
"version":"0.1.0",
"type":"transfer",
"options":{
"recipient":{
"lookup_service":{"type":"ledger","value":"<DLT_ID>"},
"resource":"<RECIPIENT_WALLET_ADDRESS>"
},
"amount":"<AMOUNT>"
},
"meta":{}
},
...Replace:
DLT_ID
: The resource identifier of the DLT. Choose of the supported DLT's. For example,ethereum
.RECIPIENT_WALLET_ADDRESS
: The native address of the wallet that will receive the transaction. For example,0x1234567890abcdef1234567890abcdef12345678
.
Depending on the DLT chosen, you might need to specify additional parameters in the GLO meta
field. For example, the gasPrice
information for Ethereum public network. For more information, refer to the GLO specification.
Once the request is sent, the API returns an action ID and its status:
{
"id": "ac4d8d94-86e9-48b3-a8f1-12fad3b8e1d3",
"status": "PENDING"
}
Next step
To retrieve the details of the transaction, follow to the Query the ledger guide.