Skip to main content

Send a transfer

In this guide, you will learn how to send native funds, such as Ether for Ethereum, between two addresses using the MARCO API.

Prerequisites

Before you start, complete the following prerequisites:

Step by step

To send a transfer operation, you have two options:

  • Use the recipient's MARCO wallet id: Send a POST request to the Send Operation 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": {}
    },
    "tag": "<TAG>",
    "walletId": "<SENDER_WALLET_ID>",
    "walletPassword": "<SENDER_WALLET_PASSWORD>"
    }'

    Replace:

    • INTENT_UUID: A Universally Unique Identifier (UUID) is a 128-bit string represented in hexadecimal that uniquely identifies an operation or a group of operations. UUIDs are generated using algorithms that ensure their uniqueness. An example of a valid UUID is f1b0c9e0-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 transfer of funds. For example, WAL-pkgv0HncVuM.
    • AMOUNT: The number of native tokens to send from the sender's wallet. The wallet must have at least this amount of tokens. For example, 0x0.
    • TAG (optional): A string used for categorizing and identifying the request.
    • 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 the SENDER_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 transfer of funds. For example, 0x1234567890abcdef1234567890abcdef12345678.
note

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:

{
"actionId": "3dd80efc-3538-4a5e-9b31-4075565a4022",
"intent": "e3c8e28d-9a6f-4aed-8a3f-faa4e538b2df",
"status": "PENDING"
}

Next step

To retrieve the details of the transaction, follow the Search transactions guide.