Native Coin

Native Coin Functions

Get balance

Description

Returns the balance of blockchain native currency in the user's wallet for the supported blockchains, filtered by the blockchainIds

Parameters

NameTypeRequiredDefaultDescription

blockchainIds

String[]

defaultBlockchainIds

Blockchain ids

userId

String

✔️

User id

Return type

Promise<{
   [blockchainId: string]: string
}>

Usage Example

const balance = await sdk.coin.getBalance({ userId: '123' })

Response Example

{
  "tezosGhost": {
    "value": "8.092449",
    "coinMetadata": {
      "coinName": "Tezos",
      "coinSymbol": "XTZ",
      "coinDecimals": "6"
    }
  },
  "ethereumSepolia": {
    "value": "0.099638562787420425",
    "coinMetadata": {
      "coinName": "Sepolia Ether",
      "coinSymbol": "ETH",
      "coinDecimals": "18"
    }
  }
}

Get transactions

Description

Returns a list of blockchain native coin transactions for the supported blockchains, filtered by the blockchainIds

Parameters

NameTypeRequiredDefaultDescription

blockchainIds

String[]

defaultBlockchainIds

Blockchain ids

userId

String

✔️

User id

Return type

Promise<{
  [blockchainId: string] : {
    createdAt: string
    value: string
    cryptoCurrencyId: string
    direction: string
    fiatCurrencyAmount?: string
    fiatCurrencyId?: string
    fromAddress: string
    gasLimit?: string
    gasPrice?: string
    id: string
    status: string
    toAddress: string,
    type: "buy" | "fund" | "receive" | "sell" | "send"
  }[]
}>

Usage Example

const transactions = await sdk.coin.getTransactions({ userId: '123' })

Response Example

{
  "ethereum": [
    {
      "fromAddress": "0x3a27c671c01be1b8ba8fd0be94e8cfe5f77fc67b",
      "toAddress": "0xe15501dd8857a885defe240147ea3b1c998855be",
      "value": "0.0",
      "gasUsed": "52155",
      "gasPrice": "4926498365",
      "direction": "incoming",
      "createdAt": "2023-06-28T08:17:58Z",
      "nonce": "1",
      "id": "0x01e3183570f73a714cdc876916e6d83d8246b8aa0ad8da7975f5bc258822c4bc",
      "coinMetadata": {
        "coinName": "Sepolia Ether",
        "coinSymbol": "ETH",
        "coinDecimals": "18"
      },
      "status": "completed",
      "type": "send"
    }
  ]
}

Last updated