Transfer a Native Coin

To transfer a native coin, send a POST request to the /wallet/<wallet_name>/coins, calling the :transfer method.

Transfer a native coin

POST https://api.playfix.io/wallet/<wallet_name>/coins:transfer

Path Parameters

Name
Type
Description

wallet_name*

String

Name of the wallet to that contains the coin. This should be the value of name from a previously created wallet. It begins with "wallets/" followed by a ULID.

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

{
  "transactionHash": "0xee0b6d2c894ac4e557d84ac4de31e2967a7162b519c03ba6bb2c0c897a09ab42"
}

Example cURL API Call

curl --request POST \
  --url 'https://api.playfix.io/wallet/<wallet_name>/coins:transfer' \
  --header 'Authorization: Bearer <your_access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "receiverAddress": "<receiver_address>",
    "amount":  "0.2"
    "password": "<wallet_password>"
    }'

Example Python API Call

import requests
import json

payload = {
    "receiverAddress": "<receiver_address>",
    "amount":  "0.2"
    "password": "<wallet_password>"
    }

r = requests.post(
    "https://api.playfix.io/wallet<wallet_name>/coins:transfer",
    headers = {
        "Authorization": "Bearer <your_access_token>",
        "Accept": "application/json",
        "Content-Type": "application/json"
        },
    data = json.dumps(payload)
    )

print(r.text)

Request Body

  • receiverAddress - Wallet address of the destination where you want to send the coin. This begins with "0x..."

  • amount - Amount of the ERC-20 token you want to transfer. The amount must be expressed in WEI. That is, to send 1 unit of a token, express it as 10¹⁸ (1000000000000000000).

  • password - The 32-character long wallet password entered when creating the wallet.

Response

{
  "transactionHash": "0xee0b6d2c894ac4e557d84ac4de31e2967a7162b519c03ba6bb2c0c897a09ab42"
}

Last updated