Skip to main content

Using API for wallet

Postman collection with all endpoints - Using_API_for_wallet.postman_collection.zip

Login to merchant

You need to get api keys for your merchant and login to your merchant in order to get the token necessary for creating wallets and further actions on them.

post
Endpoint POST /api/public/auth
Endpoint allows you to log in to the system under the merchant. publicKey and privateKey can be obtained from the merchant. There is a corresponding endpoint that generates these keys for the merchant.

Parameters

Body

  • publicKey

    *

    string

  • privateKey

    *

    string

  • walletId

    *

    string

  • passphrase

    *

    string

Responses

  • 200:OK
    {
    token: "string"
    }
  • 200:OK

    Example

    {
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxOTIzNjAyNjM3OTE4MDFkMGQzODgzNiIsInVzZXIiOiI2MDlhNjM0MGU1ZTFjZjAyMTU2ZDBkZjciLCJpYXQiOjE2NjQzMTg5MjksImV4cCI6MTY2NDQwNTMyOX0.mXXCUt8RTjFBejwMTBXaZX6Bj9P2h1xOzJqfH7GvKaA"
    }
  • 400:Bad request

    If request body parameters are empty or have incorrect type (not string)

    {
    status: "fail",
    data: {
    message: [
    "publicKey should not be empty",
    "privateKey should not be empty"
    ]
    }
    }
  • 401

    If you use incorrect merchant token

    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

Wallet creating

post
Endpoint POST ​/api​/public​/wallet​/{currencyId}
You need to log in to the merchant.

Parameters

Path

  • currencyId

    *

    string

Body

  • typeWallet

    *

    string

  • privateKey

    string

  • isMnemonic

    boolean

    if true then fill mnemonic phrase to privateKey parameter

  • setMain

    boolean

  • password

    string

  • typeWallet

    string

    merchant, user

Responses

  • 200:OK
    {
    data: {
    id: "string",
    address: "string",
    balance: 0,
    balanceUSD: 0,
    passphrase: "string"
    }
    }
  • 200:OK

    Example

    {
    data: {
    id: "63321da650a1280200bcacca",
    address: "0x3Cf221e9AFdCc4792c5fF7631CB84b6e8a066c7a",
    balance: "0",
    balanceUSD: "0",
    passphrase: "d1295f73-1cfc-4bde-bcca-c496944b9dd5"
    }
    }
  • 400:Bad request
    {
    message: "This currency is not supported."
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

You can login to wallet and get wallet access token necessary for witdrawal from wallet and for getting wallet ballance. You need to get api keys for your merchant, also you need wallet Id and wallet passphrase.

Wallet login

post
Endpoint POST /api/public/auth

Parameters

Body

  • walletId

    *

    string

  • passphrase

    *

    string

  • publicKey

    *

    string

  • privateKey

    *

    string

Responses

  • 200:OK
    {
    token: "string"
    }
  • 200:OK

    Example

    {
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxOTIzNjAyNjM3OTE4MDFkMGQzODgzNiIsInVzZXIiOiI2MDlhNjM0MGU1ZTFjZjAyMTU2ZDBkZjciLCJpYXQiOjE2NjQzMTg5MjksImV4cCI6MTY2NDQwNTMyOX0.mXXCUt8RTjFBejwMTBXaZX6Bj9P2h1xOzJqfH7GvKaA"
    }
  • 400:Bad request
    {
    status: "fail",
    data: {
    message: [
    "publicKey should not be empty"
    ]
    }
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

View private key

get
Endpoint GET /api/public/wallet/private-key

Responses

  • 200:OK
    {
    data: "string"
    }
  • 200:OK

    Example

    {
    data:"0xf1a8eabb865942f710307d1ae6f313d88612dc67f76a983a572487d0b3d16de0"
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

View mnemonic phrase

get
Endpoint GET /api/public/wallet/mnemonic
Endpoint allows you to withdraw funds to another wallet outside the system. The header contains the Bearer token, which can be obtained upon authorization under the merchant in conjunction with the wallet. You need to log in with the wallet in conjunction with the merchant.

Responses

  • 200:OK
    {
    data: "string"
    }
  • 200:OK

    Example

    {
    data: "snow drift panel frost what reward session pupil pause scout junk purpose"
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

Getting the maximum possible withdrawal amount

post
Endpoint POST /api/public/withdrawal/estimate-max

Parameters

Body

  • to

    *

    string

  • currencyToken

    *

    string

  • password

    string

  • sign

    string

    base64 format

Responses

  • 200:OK
    {
    data: {
    amount: "number"
    }
    }
  • 200:OK

    Example

    {
    data: {
    amount: "0"
    }
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized."
    }
    }

Withdrawal from wallet

post
Endpoint POST ​/api​/public​/withdrawal

Parameters

Body

  • to

    *

    string

  • amount

    *

    number

  • currencyToken

    string

    Used if withdrawals are made from the merchant’s wallet

  • comment

    string

    Use for TON and USDT TON

  • password

    string

  • sign

    string

    base64 format

Responses

  • 200:OK
    {
    data: {
    id: "string"
    }
    }
  • 200:OK

    Example

    {
    data: {
    id: "63321f4d50a1280200bcaccd"
    }
    }
  • 400:Bad request
    {
    status: "fail",
    data: {
    message: "Address INVALID"
    }
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }

Internal transfer for client wallets

post
Endpoint POST /api​/public​/withdrawal​/internal
Internal Transfer is the ability to transfer funds between client wallets using the API, within one merchant, without creating a transaction on the blockchain.

Parameters

Body

  • to

    *

    string

  • amount

    *

    number

Responses

  • 200:OK
    {
    "data": {
    "id": "String"
    }
    }
  • 200:OK

    Example

    {
    "data": {
    "id": "634ecbb9053b310076f5c309"
    }
    }
  • 400:Bad request
    {
    "status": "fail",
    "data": {
    "message": "Wallet not found in this merchant."
    }
    }

Get wallet ballance

get
Endpoint GET /api/public/wallet
The endpoint allows you to get the current balance of the wallet. You need to log in with the wallet in conjunction with the merchant.

Responses

  • 200:OK
    {
    data: {
    balance: "string",
    balanceUSD: "string",
    holdBalance: "string",
    availableBalance: "string",
    availableBalanceUSD: "string",
    tokens: [
    {
    currencyId: "string",
    balance: "string",
    holdBalance: "string"
    }
    ]
    }
    }
  • 200:OK

    Example

    {
    data: {
    balance: "0.06728",
    holdBalance: "0",
    balanceUSD: "18.16",
    availableBalance: "0.06728",
    availableBalanceUSD: "18.16",
    tokens: [
    {
    currencyId: "60eee72676d1ef1761cf916c",
    balance: "5.42025",
    holdBalance: 0
    }
    ]
    }
    }
  • 401
    {
    status: "fail",
    data: {
    message: "Unauthorized"
    }
    }