User Controller

Core user functionalities

Example Usage

import { UserController } from "@tria-sdk/core";
const user = new UserController({
    baseUrl: "https://prod.tria.so" as string,
    triaName?: "dev@tria" as string,
    environment?: "mainnet" as ENV,
});
chevron-rightTypeshashtag
export type ENV = 'testnet' | 'mainnet-staging' | 'mainnet';

Get avatar

getAvatar(): Promise<{{
    "avatar": string,
    "background": string
}}>
chevron-rightExample Responsehashtag
{
    "avatar": "25",
    "background": "linear-gradient(153.43deg, #FFBBB5 0%, #FFA39A 83.33%)"
}

Update avatar

chevron-rightExample Responsehashtag

Search Buy Token

chevron-rightTypeshashtag

Get user by Address

Get address by chainName

Get Rampnalysis URL

Get Rampnalysis Supported Token

chevron-rightTypeshashtag

Add user activity

This needs to be called after a send txn for displaying recent users.

Get Recent Users

chevron-rightTypeshashtag
chevron-rightExample Responsehashtag

Delete a Recent User

Search User

chevron-rightTypeshashtag

Search Assets

(Not used right now)

Supports EVM asset searching. This is a global function to search any existing asset. Found assets order is on the basis of descending market cap. It will return top 50 found assets. Using Zerionarrow-up-right. Limitation: only Zerion supported chain assets.

chevron-rightTypeshashtag
chevron-rightExample responseshashtag

Get All history

chevron-rightTypeshashtag
chevron-rightExample responsehashtag

Get On Chain Conversation

chevron-rightTypeshashtag
chevron-rightExample Responsehashtag

Get Assets for a tria name

chevron-rightTypeshashtag
chevron-rightExample responsehashtag

Get Assets

(not getting used right now - same as getAssetsForATriaName)

chevron-rightExample responsehashtag

Get Asset Balance For a Tria Name

chevron-rightExample responsehashtag

Get Asset History

chevron-rightExample responsehashtag

Get Asset Details

chevron-rightExample responsehashtag

Get NFTs

Please note that you might not receive "content" field in case of shit/airdropped nfts, so use the SDK with proper error handling.

chevron-rightExample responsehashtag

Get NFT Collections

UseCase - filterByCollectionId in getNFTs

chevron-rightExample responsehashtag

Get NFT Details

"content" -> preview should be used in case ALL NFTs display page

"content" -> video (if available) should be used in case of the particular NFT Detail page.

For shit NFTs might get a 404 not found error, so if getting in getNFTs try to use the same data in the NFT details page, like a single page app. If any doubts, ping on slack.

chevron-rightExample responsehashtag

Get All Networks

chevron-rightExample responsehashtag

Get Total Balance

returns the total balance of a tria name across all supported EVM chains.

chevron-rightExample responsehashtag

Get Native Token Price

Get Enabled Gas Tokens for a chain

Convert Token

Note: In case of native token of the given chain token address should be passed as null.

Get Twitter Feed

chevron-rightExample responsehashtag

Get Enabled Gas Tokens [For AA infra]

chevron-rightExample Responsehashtag

Get Solana Gas Enabled Tokens [For Old Infra]

chevron-rightExample Responsehashtag

Get User Prefs

chevron-rightTypeshashtag
chevron-rightExample Responsehashtag

Get Suggested Dapps

chevron-rightTypehashtag

Get Notification Prefrences

chevron-rightTypehashtag

Update Notification Prefrences

chevron-rightTypehashtag

Add Custom Chain

chevron-rightTypeshashtag

Update Custom Chain

Delete Custom Chain

Add Custom Token

chevron-rightTypeshashtag

Update Custom Token

Delete Custom Token

Last updated