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,
});
Types
export type ENV = 'testnet' | 'mainnet-staging' | 'mainnet';

Get avatar

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

Update avatar

Example Response

Search Buy Token

Types

Get user by Address

Get address by chainName

Get Rampnalysis URL

Get Rampnalysis Supported Token

Types

Add user activity

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

Get Recent Users

Types
Example Response

Delete a Recent User

Search User

Types

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 Zerion. Limitation: only Zerion supported chain assets.

Types
Example responses

Get All history

Types
Example response

Get On Chain Conversation

Types
Example Response

Get Assets for a tria name

Types
Example response

Get Assets

(not getting used right now - same as getAssetsForATriaName)

Example response

Get Asset Balance For a Tria Name

Example response

Get Asset History

Example response

Get Asset Details

Example response

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.

Example response

Get NFT Collections

UseCase - filterByCollectionId in getNFTs

Example response

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.

Example response

Get All Networks

Example response

Get Total Balance

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

Example response

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

Example response

Get Enabled Gas Tokens [For AA infra]

Example Response

Get Solana Gas Enabled Tokens [For Old Infra]

Example Response

Get User Prefs

Types
Example Response

Get Suggested Dapps

Type

Get Notification Prefrences

Type

Update Notification Prefrences

Type

Add Custom Chain

Types

Update Custom Chain

Delete Custom Chain

Add Custom Token

Types

Update Custom Token

Delete Custom Token

Last updated