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
Response
Success Response
walletId
String
The user's wallet ID.
accounts
Account(Object) []
List of retrieved accounts (Account)
AccountaccountIdStringUnique identifier for the account
accountTokenIdString (Optional)Unique identifier for the token account. Returned only if it is a token account.
addressStringAccount address
addressPathStringAccount address path
labelStringAccount label
balanceStringAccount balance
coinIdInteger (Optional)Identifier for the coin information of the account. Returned only for native coins.
nameStringName of the coin information of the account
networkStringNetwork name of the account
symbolStringSymbol of the account
decimalsIntegerDecimal value of the coin in the account
contractString (Optional)Contract address of the token account. Returned only for token accounts.
iconUrlStringURL for the account's icon image
idsStringIdentifier 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
Response
Success Response
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)
TokenBalancebalanceStringToken account balance
decimalsIntegerDecimal value of the token account
symbolStringSymbol of the token account
contractStringContract 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
Response
Success Response
nfts
NFT(Object) []
Retrieved NFT list (NFT)
NFTidStringUnique identifier of the NFT
accountIdStringUnique identifier of the account holding the NFT
nameStringNFT name
descriptionStringNFT description
externalLinkStringNFT external link
imageUrlStringNFT image URL
quantityIntegerNumber of NFTs
contentTypeIntegerType of NFT content
1: image2: video
contractObjectInformation about the NFT contract (
NFTContract)
Example
{ "nfts": [] }NFTContractaddressStringNFT Contract address
schemeIntegerNFT Contract Scheme
1: ERC7212: ERC1155
descriptionStringNFT Contract 설명
networkStringNetwork
externalLinkStringNFT contract external link
imageUrlStringNFT 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
Response
The response is identical to that of Retrieve NFT Information.
Last updated
Was this helpful?