Token and NFT

Retrieve Account Information

This feature is available only after a successful login. It returns the account information for wallets used in the app.

GET /v1/account?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

walletId

String

O

Response

Success Response

Name
Type
Description

walletId

String

The user's wallet ID.

accounts

Account(Object) []

List of retrieved accounts (Account)

  • Account

    • accountId String

      • Unique identifier for the account

    • accountTokenId String (Optional)

      • Unique identifier for the token account. Returned only if it is a token account.

    • address String

      • Account address

    • addressPath String

      • Account address path

    • label String

      • Account label

    • balance String

      • Account balance

    • coinId Integer (Optional)

      • Identifier for the coin information of the account. Returned only for native coins.

    • name String

      • Name of the coin information of the account

    • network String

      • Network name of the account

    • symbol String

      • Symbol of the account

    • decimals Integer

      • Decimal value of the coin in the account

    • contract String (Optional)

      • Contract address of the token account. Returned only for token accounts.

    • iconUrl String

      • URL for the account's icon image

    • ids String

      • Identifier to retrieve the coin information of the account

Example

// When there is a Klaytn main account and KCT (token) accounts
{
	"walletId": "999999999999999999999999999999999999999999999999999999999999999999",
  "accounts": [
    {
      "accountId": "90",
      "address": "0x9990000000000000000000000000000000000000",
      "addressPath": "m/44'/60'/0'/0/0",
      "coinId": 2,
      "symbol": "KLAY",
      "label": "KLAY-01",
      "name": "Klaytn",
      "network": "KLAYTN",
      "balance": "123407670918639753",
      "decimals": 18,
      "iconUrl": "<https://coin-img.wepin.io/coinlogo/klaytn.png>",
      "ids": "klay-token"
    },
    {
      "accountId": "90",
      "accountTokenId": "91",
      "address": "0x9990000000000000000000000000000000000000",
      "addressPath": "m/44'/60'/0'/0/0",
      "contract": "0x52CFDA3E278837d852C4315586C9464BE762647E",
      "symbol": "COSM",
      "label": "COSM",
      "name": "Cosmo Coin",
      "network": "KLAYTN",
      "balance": "20000000000000000",
      "decimals": 18,
      "iconUrl": "<https://coin-img.wepin.io/coinlogo/cosmo.png>",
      "ids": "cosmo-coin"
    }
  ]
}

Refresh Account Balance

Refreshes the balance of the account. If the refresh is triggered by the user in the front-end service, it is recommended to implement UI/UX to prevent repeated requests within 1 minute.

GET /v1/accountbalance/{accountId}/balance HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

accountId

String

O

Response

Success Response

Name
Type
Description

balance

String

Account balance

decimals

Integer

Decimal value of the account

symbol

String

Symbol of the account

tokens

TokenBalance(Object) []

List of balances for the account's tokens (TokenBalance)

  • TokenBalance

    • balance String

      • Token account balance

    • decimals Integer

      • Decimal value of the token account

    • symbol String

      • Symbol of the token account

    • contract String

      • Contract address of the token account

Example

{
	"balance": "123407670918639753",
  "decimals": 18,
  "symbol": "KLAY",
  "tokens": [
		{
		  "balance": "20000000000000000",
			"decimals": 18,
			"symbol": "COSM",
			"contract": "0x52CFDA3E278837d852C4315586C9464BE762647E"
		}
	]
}

Retrieve NFT Information

This function is available only after a successful login. It returns the NFT information of the wallet used in the app.

GET /v1/nft?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

walletId

String

O

Response

Success Response

Name
Type
Description

nfts

NFT(Object) []

Retrieved NFT list (NFT)

  • NFT

    • id String

      • Unique identifier of the NFT

    • accountId String

      • Unique identifier of the account holding the NFT

    • name String

      • NFT name

    • description String

      • NFT description

    • tokenId String

    • externalLink String

      • NFT external link

    • imageUrl String

      • NFT image URL

    • quantity Integer

      • Number of NFTs

    • contentType Integer

      • Type of NFT content

      • 1 : image

      • 2 : video

    • contract Object

      • Information about the NFT contract (NFTContract)

    Example

    {
    	"nfts": []
    }
  • NFTContract

    • address String

      • NFT Contract address

    • scheme Integer

      • NFT Contract Scheme

      • 1 : ERC721

      • 2 : ERC1155

    • description String

      • NFT Contract 설명

    • network String

      • Network

    • externalLink String

      • NFT contract external link

    • imageUrl String

      • NFT contract image URL

Refresh NFT Information

Refreshes the NFT information. If the refresh is triggered by a user's request in the front-end service, it is recommended to design the UI/UX to prevent repeated requests within 1 minute.

GET /v1/nft/refresh?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

walletId

String

O

Response

The response is identical to that of Retrieve NFT Information.

Last updated