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

updateAvatar(): Promise<{{
    "avatar": string,
    "background": string
}}>
Example Response
{
    "avatar": "25",
    "background": "linear-gradient(153.43deg, #FFBBB5 0%, #FFA39A 83.33%)"
}
getPopularToken(): Promise<Array<{
    tokenName: string,
    chainLogo: string,
    tokenLogo: string,
    coinSymbol: string
}>>

Search Buy Token


searchBuyToken(tokenName: string, currentChainName: string): Promise<{
    currentChain: TokenData[],
    otherChain: TokenData[]
}>
Types
export interface TokenData {
    _id:            string;
    crypto_symbol:  string;
    crypto_name:    string;
    network:        string[];
    coin_name:      string;
    network_name:   string;
    network_logo_url: string;
    coin_symbol:    string;
    network_symbol: string;
    logo:           string;
    coin_gecko_id:  string;
    moonpay:        Guardarian;
    ramp:           null;
    news_ticker:    string;
    transak:        null;
    banxa:          null;
    provider:       null;
    xanpool:        null;
    alchemy:        null;
    mercuryo:       null;
    munzen:         null;
    onramp:         Onramp;
    guardarian:     Guardarian;
    transfi:        null;
    unlimit:        Guardarian;
    swipelux:       null;
    btc_direct:     null;
}

export interface Guardarian {
    uuid:              string;
    crypto_name:       string;
    symbol?:           string;
    network:           string;
    is_buy_supported:  boolean;
    is_sell_supported: boolean;
}

export interface Onramp {
    uuid:              string;
    coinId:            number;
    chainId:           string;
    networkId:         number;
    crypto_name:       null;
    symbol:            string;
    network:           string;
    is_buy_supported:  boolean;
    is_sell_supported: boolean;
}

Get user by Address

getUserByAddress( // resolve address
    address: string,
    chainName: string
): Promise<{success: boolean, triaName: string}>;

Get address by chainName

getAddressByChainName( // resolve tria name
    triaName: string, 
    chainName: string,
    type?: "EOA" | "AA",
): Promise<{address: string}>

Get Rampnalysis URL

async getRampnalysisUrl(address: string, coinSymbol: string): Promise<RampnalysisUrlResponse>
interface RampnalysisUrlResponse {
    url: string | null,
    success: boolean
}

Get Rampnalysis Supported Token

async getRampnalysisSupportedToken(query: string): Promise<RampnalysisSupportedResponse>
Types
interface RampnalysisSupportedResponse {
 data: RampnalysisAssets[] | null,
 success: boolean
}
interface RampnalysisAssets {
  coinSymbol: string,
  assetLogo: string,
  chainName: string,
  chainLogo: string,
}

Add user activity

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

addUserActivity(
    triaName: string, 
    sentToTriaName: string
):Promise<{success: boolean}>

Get Recent Users

getRecentUsersForUser(
    triaName: string
):Promise<{success: boolean, data: RecentUser[]}>
Types
type RecentUser = {
    recentActivity: string,
    triaName: string
}
Example Response
{
    "success": true,
    "data": [
        {
            "recentActivity": "RECEIVED",
            "triaName": "dev2@tria"
        },
        {
            "recentActivity": "SENT",
            "triaName": "dev@tria"
        }
    ]
}

Delete a Recent User

deleteARecentUser(
    user: string, 
    recentUser: string
):Promise<{success: boolean}>

Search User

searchUser(term: string): Promise<{
    success: boolean,
    data: Names[]
}>
Types
type Names = {
    triaName: string,
    address?: string, // only when an address is searched
}

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.

async searchAssets(term: string): Promise<searchResponse>
Types
interface searchResponse {
    success: boolean,
    names: Names[],
    assets: {
        owned: OwnedAsset[],
        found: Asset[]
    }
}
interface Asset {
    name: string,
    symbol: string,
    logoUrl: string,
    verified: boolean,
    chainName: string,
    tokenAddress: string | null,
}
Example responses
{
    "success": true,
    "assets": {
        "found": [
            {
                "name": "Ethereum",
                "symbol": "ETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/eth.png",
                "verified": true,
                "marketPrice": 1834.06,
                "chainName": "ARBITRUM",
                "tokenAddress": null
            },
            {
                "name": "Ethereum",
                "symbol": "ETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/eth.png",
                "verified": true,
                "marketPrice": 1834.06,
                "chainName": "ETH",
                "tokenAddress": null
            },
            {
                "name": "Ethereum",
                "symbol": "ETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/eth.png",
                "verified": true,
                "marketPrice": 1834.06,
                "chainName": "OPTIMISM",
                "tokenAddress": null
            },
            {
                "name": "Lido staked Ether 2.0",
                "symbol": "stETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xae7ab96520de3a18e5e111b5eaab095312d7fe84.png",
                "verified": true,
                "marketPrice": 1832.414206259,
                "chainName": "ETH",
                "tokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "ARBITRUM",
                "tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "AVALANCHE",
                "tokenAddress": "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "BINANCE",
                "tokenAddress": "0x2170ed0880ac9a755fd29b2688956bd959f933f8"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "ETH",
                "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "FANTOM",
                "tokenAddress": "0x74b23882a30290451a17c44f4f05243b6b58c76d"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "OPTIMISM",
                "tokenAddress": "0x4200000000000000000000000000000000000006"
            },
            {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
                "verified": true,
                "marketPrice": 1834.32043652,
                "chainName": "POLYGON",
                "tokenAddress": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"
            },
            {
                "name": "Rocket Pool ETH",
                "symbol": "rETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xae78736cd615f374d3085123a210448e74fc6393.png",
                "verified": true,
                "marketPrice": 1979.3854122199998,
                "chainName": "ARBITRUM",
                "tokenAddress": "0xec70dcb4a1efa46b8f2d97c310c9c4790ba5ffa8"
            },
            {
                "name": "Rocket Pool ETH",
                "symbol": "rETH",
                "logoUrl": "https://token-icons.s3.amazonaws.com/0xae78736cd615f374d3085123a210448e74fc6393.png",
                "verified": true,
                "marketPrice": 1979.3854122199998,
                "chainName": "ETH",
                "tokenAddress": "0xae78736cd615f374d3085123a210448e74fc6393"
            },
            ...
        ]
}

Get All history

getAllHistory(
    filter: 'all' | 'transactionSent' | 'transactionReceived' = 'all',
    filterChainNames?: string[], // ["ETH",  "POLYGON"]
    triaName?: string
): Promise<{
    success: boolean,
    history: History[]
}>
const history = await user.getAllHistory()
Types
interface History {
    timestamp: number,
    chainName: string,
    chainLogo: string,
    wallet: {
      name: string,
      address: string,
      type: "EOA" | "AA",
    },
    txnHash: string,
    from: {
      name: string,
      address: string,
    },
    to: {
      name: string,
      address: string,
    },
    feesInUsd: number,
    viewInExplorer: string,
    description: string,
    desc: {
      action: HistoryActionType,
      receivedFrom?: {
        name: string | null, // null if triaName does not exist for the address
        address: string,
      },
      sentTo?: {
        name: string | null,
        address: string,
      }
      value: string,
      decimals: number,
      assetSymbol: string,
      assetLogo: string,
    }
}

export enum HistoryActionType {
    SENT = 'Sent',
    RECEIVED = 'Received',
    APPROVED = 'Approved',
    SWAP = 'Swap',
    MINT = 'Mint',
    CONTRACT_CALL = 'Contract call',
    CONTRACT_CREATION = 'Contract creation',
}
Example response
// Please note that the example response is not updated with the feeInUsd
{
    "history": [
        {
            "timestamp": 1689923037000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                "type": "EOA"
            },
            "txnHash": "0x405a9ebd565a66be2df7c06942889018c13b431d6ad7c0a51b06cffb49cba0a1",
            "feesInUsd": 0.5385082317177744,
            "viewInExplorer": "https://polygonscan.com/tx/0x405a9ebd565a66be2df7c06942889018c13b431d6ad7c0a51b06cffb49cba0a1",
            "description": "Sent native token",
            "desc": {
                "action": "Sent",
                "sentTo": {
                    "name": null,
                    "address": "0xa0c308e5b949897fe7304bc7ced0a58a58bb76e1"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "1000000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1689922977000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                "type": "EOA"
            },
            "txnHash": "0x2981e810e06f4a9abddbd64dbda86562a1ed452f7dbe3d9586d8f1cb95c919e6",
            "feesInUsd": 0.5385082317177744,
            "viewInExplorer": "https://polygonscan.com/tx/0x2981e810e06f4a9abddbd64dbda86562a1ed452f7dbe3d9586d8f1cb95c919e6",
            "description": "Sent native token",
            "desc": {
                "action": "Sent",
                "sentTo": {
                    "name": null,
                    "address": "0xcfc2a01b6439e7bad1c43306e9124947241e0623"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "1000000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1689902449000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "b.test@tria",
                "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961"
            },
            "txnHash": "0x800f15a1e679216d2253df2b37fa0434cc4567cbb9a87ef01be461f242b06a95",
            "viewInExplorer": "https://polygonscan.com/tx/0x800f15a1e679216d2253df2b37fa0434cc4567cbb9a87ef01be461f242b06a95",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0xaede9e602689ffdad72ca9c988797001deb9ed8d"
                }
            }
        },
        {
            "timestamp": 1689885917000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xbee89034db64bd6e21e40dffef0535bd5c285d66d55decb9ad8e474afac2022f",
            "viewInExplorer": "https://polygonscan.com/tx/0xbee89034db64bd6e21e40dffef0535bd5c285d66d55decb9ad8e474afac2022f",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0xaede9e602689ffdad72ca9c988797001deb9ed8d"
                }
            }
        },
        {
            "timestamp": 1689774350000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x9ba4039a33fc55b8127eadc3c569d6e64d28a55d42d36e9f71c32f7b78756bd4",
            "viewInExplorer": "https://polygonscan.com/tx/0x9ba4039a33fc55b8127eadc3c569d6e64d28a55d42d36e9f71c32f7b78756bd4",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x11ca035991963594b297fa7f0a08ef249125e97d"
                }
            }
        },
        {
            "timestamp": 1689772635000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "viewInExplorer": "https://polygonscan.com/tx/0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "description": "Sent or approved a erc20 asset",
            "desc": {
                "action": "Sent",
                "assetSymbol": "USDC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
                "value": "100",
                "decimals": 6,
                "sentTo": {
                    "name": null,
                    "address": "0x17f68d204bfe1f7ee6e9ef3c79a3086830388961"
                }
            }
        },
        {
            "timestamp": 1689772635000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "b.test@tria",
                "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961"
            },
            "txnHash": "0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "viewInExplorer": "https://polygonscan.com/tx/0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2"
                },
                "assetSymbol": "USDC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
                "value": "100",
                "decimals": 6
            }
        },
        {
            "timestamp": 1689686232000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x9499f64b7f765c47fcf3fa10a5cb9d09ee621a887cb1aab426a334718513ab6c",
            "viewInExplorer": "https://polygonscan.com/tx/0x9499f64b7f765c47fcf3fa10a5cb9d09ee621a887cb1aab426a334718513ab6c",
            "description": "Sent or approved a erc20 asset",
            "desc": {
                "action": "Approved",
                "assetSymbol": "USDC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
                "decimals": 6,
                "value": "1000"
            }
        },
        {
            "timestamp": 1689523541000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x45d24f0a4420d0fd994fbac472ae67008cc31570cb3784cd29c658f1d63e7e10",
            "viewInExplorer": "https://polygonscan.com/tx/0x45d24f0a4420d0fd994fbac472ae67008cc31570cb3784cd29c658f1d63e7e10",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x2fcccfeb8aa30d0f1dad7bb93fb9a3e9d6e45350"
                }
            }
        },
        {
            "timestamp": 1689108440000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xd365c9d270fd19bb50f228e140f0a5bb50224e123e9fb292ac04c8008363db5e",
            "viewInExplorer": "https://polygonscan.com/tx/0xd365c9d270fd19bb50f228e140f0a5bb50224e123e9fb292ac04c8008363db5e",
            "description": "Sent native token",
            "desc": {
                "action": "Sent",
                "sentTo": {
                    "name": null,
                    "address": "0x17f68d204bfe1f7ee6e9ef3c79a3086830388961"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "10000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1689108440000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "b.test@tria",
                "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961"
            },
            "txnHash": "0xd365c9d270fd19bb50f228e140f0a5bb50224e123e9fb292ac04c8008363db5e",
            "viewInExplorer": "https://polygonscan.com/tx/0xd365c9d270fd19bb50f228e140f0a5bb50224e123e9fb292ac04c8008363db5e",
            "description": "Received native token",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "10000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1689108410000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xc7ff65fedce686d2f7370159bbaea75f5bef9160b6fdbb022aaf53e4915ebdec",
            "viewInExplorer": "https://polygonscan.com/tx/0xc7ff65fedce686d2f7370159bbaea75f5bef9160b6fdbb022aaf53e4915ebdec",
            "description": "Sent native token",
            "desc": {
                "action": "Sent",
                "sentTo": {
                    "name": null,
                    "address": "0x17f68d204bfe1f7ee6e9ef3c79a3086830388961"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "10000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1689108410000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "b.test@tria",
                "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961"
            },
            "txnHash": "0xc7ff65fedce686d2f7370159bbaea75f5bef9160b6fdbb022aaf53e4915ebdec",
            "viewInExplorer": "https://polygonscan.com/tx/0xc7ff65fedce686d2f7370159bbaea75f5bef9160b6fdbb022aaf53e4915ebdec",
            "description": "Received native token",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "10000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1688558940000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x458ef9b0a7d0cf17cf8175ef7b3644e35f043896602f165c01a9e17401d4b6fb",
            "viewInExplorer": "https://polygonscan.com/tx/0x458ef9b0a7d0cf17cf8175ef7b3644e35f043896602f165c01a9e17401d4b6fb",
            "description": "Swap using 1inch router",
            "desc": {
                "action": "Swap"
            }
        },
        {
            "timestamp": 1688558068000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x259fecaa14bf70d969a0f80f057e75c6533262047bf39affee6518526797dfa5",
            "viewInExplorer": "https://polygonscan.com/tx/0x259fecaa14bf70d969a0f80f057e75c6533262047bf39affee6518526797dfa5",
            "description": "Sent or approved a erc20 asset",
            "desc": {
                "action": "Approved",
                "assetSymbol": "USDC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
                "decimals": 6,
                "value": "1000"
            }
        },
        {
            "timestamp": 1688534475000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x354fee6d697621fc37f196e6b5f04f88f45fd5f8bc6617031ff68495d68f628e",
            "viewInExplorer": "https://polygonscan.com/tx/0x354fee6d697621fc37f196e6b5f04f88f45fd5f8bc6617031ff68495d68f628e",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0xd4d01e066624b3d979e8111ff53114f1852ef180"
                }
            }
        },
        {
            "timestamp": 1688508104000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x524d98abf8c510dc9c7b4a6c94c924a354f2731c139fb8dec8748e8163a7da7c",
            "viewInExplorer": "https://polygonscan.com/tx/0x524d98abf8c510dc9c7b4a6c94c924a354f2731c139fb8dec8748e8163a7da7c",
            "description": "Swap",
            "desc": {}
        },
        {
            "timestamp": 1688328122000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xa6557ed8803b3c2f643473a90a0ae4fb56dd9f91ce230800c4a05c04d965539d",
            "viewInExplorer": "https://polygonscan.com/tx/0xa6557ed8803b3c2f643473a90a0ae4fb56dd9f91ce230800c4a05c04d965539d",
            "description": "Sent or approved a erc20 asset",
            "desc": {
                "action": "Sent",
                "assetSymbol": "UNI",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/7083.png",
                "value": "1000000000000000",
                "decimals": 18,
                "sentTo": {
                    "name": null,
                    "address": "0x17f68d204bfe1f7ee6e9ef3c79a3086830388961"
                }
            }
        },
        {
            "timestamp": 1688328122000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "b.test@tria",
                "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961"
            },
            "txnHash": "0xa6557ed8803b3c2f643473a90a0ae4fb56dd9f91ce230800c4a05c04d965539d",
            "viewInExplorer": "https://polygonscan.com/tx/0xa6557ed8803b3c2f643473a90a0ae4fb56dd9f91ce230800c4a05c04d965539d",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2"
                },
                "assetSymbol": "UNI",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/7083.png",
                "value": "1000000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1688327523000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x0b4c0652b9576b7da10a79b55f5b2a68ad62178e32021d1ef0231af70ad57aea",
            "viewInExplorer": "https://polygonscan.com/tx/0x0b4c0652b9576b7da10a79b55f5b2a68ad62178e32021d1ef0231af70ad57aea",
            "description": "Swap",
            "desc": {}
        },
        {
            "timestamp": 1688290272000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0xcdc02d3d7090de4d2b598c860f04161a4ad1ca2e7c868c1974dd658d0de5131d",
            "viewInExplorer": "https://polygonscan.com/tx/0xcdc02d3d7090de4d2b598c860f04161a4ad1ca2e7c868c1974dd658d0de5131d",
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x51e3d44172868acc60d68ca99591ce4230bc75e0"
                },
                "assetSymbol": "QUICK",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/8206.png",
                "value": "120050000000000000",
                "decimals": 18
            }
        },
        {
            "timestamp": 1688290086000,
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "wallet": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "txnHash": "0x95f3ebbd41114491dcf0cf206d1470a01530a8ce2f189bbce0846ed6278ebeb6",
            "viewInExplorer": "https://polygonscan.com/tx/0x95f3ebbd41114491dcf0cf206d1470a01530a8ce2f189bbce0846ed6278ebeb6",
            "description": "Received native token",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": null,
                    "address": "0x51e3d44172868acc60d68ca99591ce4230bc75e0"
                },
                "assetSymbol": "MATIC",
                "assetLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
                "value": "6960000000000000000",
                "decimals": 18
            }
        }
    ],
    "success": true
}

Get On Chain Conversation

async getOnChainConversation(
    withTriaName: string,
    triaName?: string
): Promise<Conversation[]>
Types
interface Conversation {
    timestamp: number,
    tag: string, // "Sent" or "Received"
    chainName: string,
    chainLogo: string,
    wallet: {
        name: string, 
        address: string,
    },
    participant: {
        name: string,
        address: string,
    },
    asset: Asset,
    value: string,
    decimals: number,
    feesInUsd: number,
    viewInExplorer: string,
}
interface Asset {
    //name: string,
    symbol: string, // right now only symbol, logo
    logo: string,
    //address: string | null, // null in case of native token
}
Example Response
{
    "conversation": [
        {
            "timestamp": 1689923262000,
            "tag": "Received",
            "chainName": "ARBITRUM",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "wallet": {
                "name": "Dakaitest3@tria",
                "address": "0xA0C308e5b949897fE7304BC7Ced0a58a58bb76E1"
            },
            "participant": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "asset": {
                "symbol": "USDC",
                "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png"
            },
            "value": "2000000",
            "decimals": 6,
            "feesInUsd": 0.07455466248731503,
            "viewInExplorer": "https://arbiscan.io/tx/0x3cf733f94a1619068a69d37b89248d710ad82429ac0a547c0dbdf471f2a30d59"
        },
        {
            "timestamp": 1689923143000,
            "tag": "Received",
            "chainName": "ARBITRUM",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "wallet": {
                "name": "Dakaitest3@tria",
                "address": "0xA0C308e5b949897fE7304BC7Ced0a58a58bb76E1"
            },
            "participant": {
                "name": "test@tria",
                "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2"
            },
            "asset": {
                "symbol": "ARB",
                "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png"
            },
            "value": "2000000000000000000",
            "decimals": 18,
            "feesInUsd": 0.07413154221254585,
            "viewInExplorer": "https://arbiscan.io/tx/0x422271c70fbe5b46317be28c45c94237338a10e30cdfacce6933ea3124521ac1"
        }
    ],
    "success": true
}

Get Assets for a tria name

getAssetsForATriaName(
    triaName: string, 
    filterChainNames?: string[],
    sort?: 'amountAsc' | 'amountDesc'
):Promise<{
    success: boolean,
    assets: [{
        wallet: {
            name: string,
            address: string,
            type: "EOA" | "AA",
        }, //'test@tria', // triaName owning the asset
        ...Asset
    }]
}>;
Types
interface Asset {
    name: string,
    symbol: string,
    logoUrl: string,
    chainName: string, // ETH, POLYGON, APTOS ...
    chainLogo: string,
    balanceInTokens: number,
    balanceOfTokensInUnits: string,
    decimals: number,
    balanceInUSD: number,
    quoteRate: number, // value in USD of one token // eg. 1 ETH = 1916.545 
    tokenAddress: string,
    isNativeToken: boolean,
    isSpam: boolean,
    percentChangein24hr: number, // e.g. -0.3412 
    isFavroutie: boolean
}
Example response
{
    "assets": [
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623",
                "type": "EOA"
            },
            "name": "USD Coin",
            "symbol": "USDC",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
            "chainName": "ARBITRUM",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "balanceInTokens": 2,
            "balanceOfTokensInUnits": "2000010",
            "decimals": 6,
            "balanceInUSD": 2.0007987,
            "quoteRate": 1.0003943,
            "tokenAddress": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.1688
        },
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623",
                "type": "EOA"
            },
            "name": "Tether USD",
            "symbol": "USDT",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
            "chainName": "BINANCE",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
            "balanceInTokens": 2,
            "balanceOfTokensInUnits": "2000000000000000000",
            "decimals": 18,
            "balanceInUSD": 1.9996,
            "quoteRate": 0.9998,
            "tokenAddress": "0x55d398326f99059ff775485246999027b3197955",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.02
        },
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623"
            },
            "name": "Arbitrum",
            "symbol": "ARB",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "chainName": "ARBITRUM",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "balanceInTokens": 1.163,
            "balanceOfTokensInUnits": "1163390401917148600",
            "decimals": 18,
            "balanceInUSD": 1.3533728,
            "quoteRate": 1.1633006,
            "tokenAddress": "0x912ce59144191c1204e64559fe8253a0e49e6548",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.438
        },
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623"
            },
            "name": "Arbitrum Mainnet Ether",
            "symbol": "ETH",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
            "chainName": "ARBITRUM",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/11841.png",
            "balanceInTokens": 0,
            "balanceOfTokensInUnits": "572706494943794",
            "decimals": 18,
            "balanceInUSD": 1.0617718,
            "quoteRate": 1853.9545,
            "tokenAddress": null,
            "isNativeToken": true,
            "isSpam": false,
            "percentChangein24hr": -0.2254
        },
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623"
            },
            "name": "Binance Coin",
            "symbol": "BNB",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
            "chainName": "BINANCE",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
            "balanceInTokens": 0.003,
            "balanceOfTokensInUnits": "3559007992736294",
            "decimals": 18,
            "balanceInUSD": 0.84596556,
            "quoteRate": 237.697,
            "tokenAddress": null,
            "isNativeToken": true,
            "isSpam": false,
            "percentChangein24hr": -0.0425
        },
        {
            "wallet": {
                "name": "Dakaitest1@tria",
                "address": "0xCfC2A01b6439e7bad1C43306e9124947241E0623"
            },
            "name": "Matic Token",
            "symbol": "MATIC",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 1,
            "balanceOfTokensInUnits": "1000000000000000000",
            "decimals": 18,
            "balanceInUSD": 0.7061,
            "quoteRate": 0.7061,
            "tokenAddress": null,
            "isNativeToken": true,
            "isSpam": false,
            "percentChangein24hr": -0.2684
        }
    ],
    "success": true
}

Get Assets

(not getting used right now - same as getAssetsForATriaName)

getAssets(
    filterChainNames?: string[],
    filter?: 'all' | 'favorites', // default is 'all'
    sort?: 'amountAsc' | 'amountDesc', // default is 'amountDesc'
    triaName?: string
):Promise<{
    success: boolean,
    assets: [{
        ...Asset,
        wallets: Wallet[]
    }]
}>;

interface Wallet {
    name: string,
    address: string,
    balanceInUSD: number, 
    balanceInTokens: number
}
// Example
const assets = await user.getAssets();
// Or, for fetching assets on particular chains
// like, example when showing to Choose Asset, when sending to a sub name only on "OPTIMISM"
const assets = await user.getAssets(["OPTIMISM"]);
Example response
{
    "assets": [
        {
            "name": "Ether",
            "symbol": "ETH",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
            "chainName": "ETH",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
            "balanceInTokens": 0.006,
            "balanceOfTokensInUnits": "6125330399432988",
            "decimals": 18,
            "balanceInUSD": 11.358268,
            "quoteRate": 1854.311,
            "tokenAddress": null,
            "isNativeToken": true,
            "isSpam": false,
            "percentChangein24hr": -0.2062,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 11.358268,
                    "balanceInTokens": 0.006
                }
            ]
            ,"isFavorite": true
        },
        {
            "name": "Quickswap",
            "symbol": "QUICK",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/8206.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 0.12,
            "balanceOfTokensInUnits": "120050000000000000",
            "decimals": 18,
            "balanceInUSD": 6.5255938,
            "quoteRate": 54.3573,
            "tokenAddress": "0x831753dd7087cac61ab5644b308642cc1c33dc13",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.7318,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 6.5255938,
                    "balanceInTokens": 0.12
                }
            ]
            ,"isFavorite": true
        },
        {
            "name": "Uniswap (PoS)",
            "symbol": "UNI",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7083.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 0.241,
            "balanceOfTokensInUnits": "241182388323224819",
            "decimals": 18,
            "balanceInUSD": 1.4051768,
            "quoteRate": 5.8262,
            "tokenAddress": "0xb33eaad8d922b1083446dc23f610c2567fb5180f",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": 0.5783,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 1.3993506,
                    "balanceInTokens": 0.24
                },
                {
                    "name": "a.test@tria",
                    "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961",
                    "balanceInUSD": 0.0058262,
                    "balanceInTokens": 0.001
                }
            ]
            ,"isFavorite": true
        },
        {
            "name": "Matic Token",
            "symbol": "MATIC",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 1.773,
            "balanceOfTokensInUnits": "1773482341959742004",
            "decimals": 18,
            "balanceInUSD": 1.2522558,
            "quoteRate": 0.7061,
            "tokenAddress": null,
            "isNativeToken": true,
            "isSpam": false,
            "percentChangein24hr": -0.2684,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 1.2374277,
                    "balanceInTokens": 1.752
                },
                {
                    "name": "a.test@tria",
                    "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961",
                    "balanceInUSD": 0.0148281,
                    "balanceInTokens": 0.021
                }
            ]
            ,"isFavorite": true
        },
        {
            "name": "USD Coin (PoS)",
            "symbol": "USDC",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 0.689,
            "balanceOfTokensInUnits": "689882",
            "decimals": 6,
            "balanceInUSD": 0.689882,
            "quoteRate": 1,
            "tokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.1996,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 0.689782,
                    "balanceInTokens": 0.689
                },
                {
                    "name": "a.test@tria",
                    "address": "0x17F68d204BFe1F7ee6E9EF3C79A3086830388961",
                    "balanceInUSD": 0.0001,
                    "balanceInTokens": 0
                }
            ],
            "isFavorite": true
        },
        {
            "name": "Gas DAO",
            "symbol": "GAS",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1785.png",
            "chainName": "ETH",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
            "balanceInTokens": 922747.36,
            "balanceOfTokensInUnits": "922747360000000000000000",
            "decimals": 18,
            "balanceInUSD": 0.5792639,
            "quoteRate": 6.2776e-7,
            "tokenAddress": "0x6bba316c48b49bd1eac44573c5c871ff02958469",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.9733,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 0.5792639,
                    "balanceInTokens": 922747.36
                }
            ],"isFavorite": true
        },
        {
            "name": "(PoS) Tether USD",
            "symbol": "USDT",
            "logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "balanceInTokens": 0,
            "balanceOfTokensInUnits": "997",
            "decimals": 6,
            "balanceInUSD": 0.0009968006,
            "quoteRate": 0.9998,
            "tokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
            "isNativeToken": false,
            "isSpam": false,
            "percentChangein24hr": -0.02,
            "wallets": [
                {
                    "name": "test@tria",
                    "address": "0x1dE58d46D05a379e020b1cBED0Db98a2F55831B2",
                    "balanceInUSD": 0.0009968006,
                    "balanceInTokens": 0
                }
            ],
            "isFavorite": true
        }
    ],
    "success": true
}

Get Asset Balance For a Tria Name

getAssetBalanceForATriaName(
    triaName: string, 
    chainName: string, 
    tokenAddress?: string,
    type: "EOA" | "AA"
):Promise<{
    success: boolean,
    data?: {
        balanceInTokens: number,
        balanceInUSD: number
    },
    message?: string
}>
Example response
{
    "success": true,
    "data": {
        "balanceInTokens": 1.5920203104089163,
        "balanceInUSD": 1.0740565024173754
    }
}

Get Asset History

getAssetHistory(
    chainName: string, 
    tokenAddress?: string,
    triaName?: string
): Promise<{
    success: boolean,
    data: History[]
}>
Example response
{
    "data": [
        {
            "timestamp": 1689772635000,
            "chainName": "POLYGON",
            "txnHash": "0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "from": {
                "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2",
                "name": "test@tria"
            },
            "to": {
                "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
                "name": null
            },
            "feesInUsd": 0.005479197968653925,
            "viewInExplorer": "https://polygonscan.com/tx/0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "success": true,
            "description": "Sent or approved a erc20 asset",
            "desc": {
                "action": "Sent",
                "assetSymbol": "USDC",
                "assetLogo": null,
                "value": "100",
                "decimals": 6,
                "sentTo": {
                    "name": "a.test@tria",
                    "address": "0x17f68d204bfe1f7ee6e9ef3c79a3086830388961"
                }
            }
        },
        {
            "timestamp": 1689772635000,
            "chainName": "POLYGON",
            "txnHash": "0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "from": {
                "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2",
                "name": "test@tria"
            },
            "to": {
                "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
                "name": null
            },
            "feesInUsd": 0.005479197968653925,
            "viewInExplorer": "https://polygonscan.com/tx/0xe75d69efab550fe3d995cd907b9f86c985efd6c8f1ed6f79d8261a4f141a343b",
            "success": true,
            "description": "Received an asset",
            "desc": {
                "action": "Received",
                "receivedFrom": {
                    "name": "test@tria",
                    "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2"
                },
                "assetSymbol": "USDC",
                "assetLogo": null,
                "value": "100",
                "decimals": 6
            }
        },
        {
            "timestamp": 1688558940000,
            "chainName": "POLYGON",
            "txnHash": "0x458ef9b0a7d0cf17cf8175ef7b3644e35f043896602f165c01a9e17401d4b6fb",
            "from": {
                "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2",
                "name": "test@tria"
            },
            "to": {
                "address": "0x1111111254eeb25477b68fb85ed929f73a960582",
                "name": null
            },
            "feesInUsd": 0.033661264180228315,
            "viewInExplorer": "https://polygonscan.com/tx/0x458ef9b0a7d0cf17cf8175ef7b3644e35f043896602f165c01a9e17401d4b6fb",
            "success": true,
            "description": "Swap using 1inch router",
            "desc": {
                "action": "Swap"
            }
        },
        {
            "timestamp": 1688508104000,
            "chainName": "POLYGON",
            "txnHash": "0x524d98abf8c510dc9c7b4a6c94c924a354f2731c139fb8dec8748e8163a7da7c",
            "from": {
                "address": "0x1de58d46d05a379e020b1cbed0db98a2f55831b2",
                "name": "test@tria"
            },
            "to": {
                "address": "0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31",
                "name": null
            },
            "feesInUsd": 0.018822257404913355,
            "viewInExplorer": "https://polygonscan.com/tx/0x524d98abf8c510dc9c7b4a6c94c924a354f2731c139fb8dec8748e8163a7da7c",
            "success": true,
            "description": "Swap",
            "desc": {}
        }
    ],
    "success": true
}

Get Asset Details

getAssetDetails(
    chainName: string, 
    tokenAddress?: string,
    triaName?: string,
    type?: "EOA" | "AA"
): Promise<{
    success: boolean,
    data: Asset[]
}>
Example response
{
    "data": {
        "name": "USD Coin (PoS)",
        "symbol": "USDC",
        "assetLogo": null,
        "chainName": "POLYGON",
        "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
        "rate": 1,
        "percentChangeIn24hr": 0.05185714432571469,
        "totalBalanceInUSD": 0.689882,
        "balance": 0.689882,
        "balanceInUnits": "689882",
        "decimals": 6,
        "isFavroutie": false
    },
    "success": true
}

Get NFTs

async getNFTs(
    sort: 'A-Z' | 'Z-A' | 'Ascending buy date' | 'Descending buy date' = 'Descending buy date',
    filter?: 'all' | 'favorites',
    filterByCollectionId?: string, // pass the collectionId received from getNFTCollections
    filterChainNames?: string[],
    triaName?: string
  );

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
{
  data: [
    {
      changedAt: 1669202807000,
      amount: '1',
      nftInfo: {
        contract_address: '0x44d4e3fA6CC7A292382e166F99Ae7807949519D6',
        token_id: '1356938545749799165119972480570561420155507632800475359837393562592731988021',
        name: 'Nucleus',
        interface: 'ERC721',
        content: {
          preview: {
            url: 'https://lh3.googleusercontent.com/6bIyNvVhz8PzkeMN4n2Y2FGJwnPYqo73i6yJa1ca4Z3S0uPDe2y4IVnZ5Ie3yqb8W7RS0qP6lBSAEvq9po-p9NLRZPSIv8mSCoE=s250',
          },
          detail: {
            url: 'https://lh3.googleusercontent.com/6bIyNvVhz8PzkeMN4n2Y2FGJwnPYqo73i6yJa1ca4Z3S0uPDe2y4IVnZ5Ie3yqb8W7RS0qP6lBSAEvq9po-p9NLRZPSIv8mSCoE',
          },
          video: {
            url: 'https://cdn.simplehash.com/assets/71f4450a1c4812a4338222689c1ed39683910d3936728a5e37cf70923ac06314.mp4',
          },
        },
      },
      collectionInfo: {
        name: 'GudSouls Genesis',
        description:
          'Join the Gud Souls membership, together we can build a more transparent, conscious, impactful, & empowering future with web3 🌎🌱❤️\n' +
          '\n' +
          'The Future of Decentralized Impact is coming ❤️\n' +
          '\n' +
          'Website: https://doingud.com/membership\n' +
          '\n' +
          'Note: Gud Souls is a non-transferable membership (Soulbound Token) to the DoinGud community. Read more: https://blog.doingud.com/doingud-membership-explained/',
        content: {
          icon: {
            url: 'https://lh3.googleusercontent.com/7HDKewczFd3uF2SeDgyop-Uf0ypkVPU8xQ0gRres9ymImu_rODuRwjP79PFVgFPJMphXBzBoXcERcD7d-auDJP6u9xwCJPFKb1Y',
          },
          banner: {
            url: 'https://lh3.googleusercontent.com/a5evzmKw8cLLO6v89vr5qbtQzjCwFLUQvr1oOCjQ58tXAenNRMHOX4vJpXbNFk1FtTy_vkYTK9J8HJqehtohED0Bp6ONbkEX=w2500',
          },
        },
      },
      chainName: 'ETH',
      chainLogo: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png',
      isFavorite: false,
    },
  ],
  success: true,
};
{
    "success": true,
    "data": [
        {
            "changedAt": 1691702024000,
            "amount": "1",
            "nftInfo": {
                "contract_address": "0xAB444445f1c54172A2517cF5924128A324cFFbBd",
                "token_id": "10367",
                "name": "1000$ AirDrop:rewards-1000.xyz",
                "interface": "ERC1155",
                "content": {
                    "preview": {
                        "url": "https://lh3.googleusercontent.com/EcjJBK5trXg8n7tfZ9rkPiQ968dxLGQ4rDtyJJ8iFyE7bZb6xRL6iw5umIqxKaF4KNSjLkjrz_H_y1usj_IsN9ArOThR_hl5Kg=s250"
                    },
                    "detail": {
                        "url": "https://lh3.googleusercontent.com/EcjJBK5trXg8n7tfZ9rkPiQ968dxLGQ4rDtyJJ8iFyE7bZb6xRL6iw5umIqxKaF4KNSjLkjrz_H_y1usj_IsN9ArOThR_hl5Kg"
                    }
                }
            },
            "collectionInfo": {
                "name": "1000$ AirDrop",
                "description": "",
                "content": {
                    "icon": {
                        "url": "https://lh3.googleusercontent.com/EcjJBK5trXg8n7tfZ9rkPiQ968dxLGQ4rDtyJJ8iFyE7bZb6xRL6iw5umIqxKaF4KNSjLkjrz_H_y1usj_IsN9ArOThR_hl5Kg"
                    }
                }
            },
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "isFavorite": false
        },
        {
            "changedAt": 1690411093000,
            "amount": "1",
            "nftInfo": {
                "contract_address": "0x77e12ae5f35d4aeb56a47f792a5d9ff6631f3248",
                "token_id": "0",
                "name": "$1250 USDC",
                "interface": "ERC1155",
                "content": {
                    "preview": {
                        "url": "https://lh3.googleusercontent.com/hF6NfkGlLPMN-Sc_3goL3uyYXXe8aJpiR9bwgljs1vJR5WaHKXM0Fxu-tOrnjXrnz_tOZeY-5_kP-7C-VwSd1vJRua9JsI94krU=s250"
                    },
                    "detail": {
                        "url": "https://lh3.googleusercontent.com/hF6NfkGlLPMN-Sc_3goL3uyYXXe8aJpiR9bwgljs1vJR5WaHKXM0Fxu-tOrnjXrnz_tOZeY-5_kP-7C-VwSd1vJRua9JsI94krU"
                    }
                }
            },
            "collectionInfo": {
                "name": "$1250 USDC",
                "description": ""
            },
            "chainName": "POLYGON",
            "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
            "isFavorite": false
        }
    ]
}

Get NFT Collections

UseCase - filterByCollectionId in getNFTs

async getNFTCollections(filterChainNames?: string[], triaName?: string);
Example response
{
    success: true,
    data: [
      {
          collectionInfo: {
              name: 'Zo World Founders', // display this name in UI
              description: "World's first dedicated Club that helps incubate, curate, and launch NFT artists in the Web3 space. Join the Zo Membership, Zo House, and Zo Studio to become a part of the ecosystem and create and sell art using NFTs.\n" +
                '\n' +
                'Zo Houses are coming to TOP Web3 cities globally! BLRxZo already vibing hard \\z/\n' +        
                '\n' +
                'Join our discord & find out more!\n' +
                'Visit [Zo World](https://zo.xyz/)',
               content: {
                  icon: {
                    url: 'https://lh3.googleusercontent.com/cJ9nYnuADH832MPVKda5QLfgUlVqcmwP_C5a0p-Zxu-_KD2vE5dvwN20my4l1g9CHne9h37Qy03pTRGcdSKXGXdhNmaH-gwQpUlb'
                  },
                  banner: {
                    url: 'https://lh3.googleusercontent.com/uFBez4ZcOkkWX1rvF_LeLKsW8NREQ8v1Sy-LpVY3AOyv2jQF7za7TCh-64-_qJFnwGmonTLQ0f8bdYOlUfKviVLggRnMVo7XsUxm=w2500'
                  }
                },
          },
          collectionId: '9743331' // pass this to filterByCollectionId
      },
      ...   
    ]
}

Get NFT Details

async getNFTDetails(
    chainName: string, 
    tokenAddress: string, 
    tokenId: string,
    triaName?: string
);

"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
{
    "data": {
        "amount": 1,
        "nftInfo": {
            "contract_address": "0xF9e631014Ce1759d9B76Ce074D496c3da633BA12",
            "token_id": "601",
            "interface": "ERC721",
            "market_data": {
                "prices": {
                    "floor": 822.514981
                }
            },
            "external_links": [
                {
                    "type": "opensea",
                    "name": "Opensea",
                    "url": "https://opensea.io/assets/ethereum/0xf9e631014ce1759d9b76ce074d496c3da633ba12/601"
                }
            ],
            "name": "Founder #601",
            "tags": [],
            "content": {
                "preview": {
                    "url": "https://lh3.googleusercontent.com/A7if9bDLLC3hRgJC54-pbsLVXFa7vmXRv_kRAa2VcNMOuTTIUVb7wb0x-7xEjpHQtc32dHwqWezgdvlO5NsTYAYxmQmKVcJpY_s=s250"
                },
                "detail": {
                    "url": "https://lh3.googleusercontent.com/A7if9bDLLC3hRgJC54-pbsLVXFa7vmXRv_kRAa2VcNMOuTTIUVb7wb0x-7xEjpHQtc32dHwqWezgdvlO5NsTYAYxmQmKVcJpY_s"
                },
                "video": {
                    "url": "https://cdn.simplehash.com/assets/377d35cab92a7e0b818a7dd503676cd3759b01d718ed64a2eb70e7d2a466521a.mp4"
                }
            },
            "attributes": [
                {
                    "key": "Culture",
                    "value": "Design"
                },
                {
                    "key": "Destination",
                    "value": "Sint Eustatius"
                },
                {
                    "key": "Time",
                    "value": "June"
                },
                {
                    "key": "Weather",
                    "value": "Sunny"
                },
                {
                    "key": "Journey",
                    "value": "Bus"
                },
                {
                    "key": "Zo",
                    "value": "Bronze"
                }
            ]
        },
        "collectionInfo": {
            "name": "Zo World Founders",
            "description": "World's first dedicated Club that helps incubate, curate, and launch NFT artists in the Web3 space. Join the Zo Membership, Zo House, and Zo Studio to become a part of the ecosystem and create and sell art using NFTs.\n\nZo Houses are coming to TOP Web3 cities globally! BLRxZo already vibing hard \\z/\n\nJoin our discord & find out more!\nVisit [Zo World](https://zo.xyz/)",
            "content": {
                "icon": {
                    "url": "https://lh3.googleusercontent.com/cJ9nYnuADH832MPVKda5QLfgUlVqcmwP_C5a0p-Zxu-_KD2vE5dvwN20my4l1g9CHne9h37Qy03pTRGcdSKXGXdhNmaH-gwQpUlb"
                },
                "banner": {
                    "url": "https://lh3.googleusercontent.com/uFBez4ZcOkkWX1rvF_LeLKsW8NREQ8v1Sy-LpVY3AOyv2jQF7za7TCh-64-_qJFnwGmonTLQ0f8bdYOlUfKviVLggRnMVo7XsUxm=w2500"
                }
            }
        },
        "chainName": "ETH",
        "chainLogo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
        "isFavorite": false,
        "contractExplorerUrl": "https://etherscan.io/address/0xF9e631014Ce1759d9B76Ce074D496c3da633BA12",
        "blurUrl": "https://blur.io/asset/0xF9e631014Ce1759d9B76Ce074D496c3da633BA12/601",
        "openseaUrl": "https://opensea.io/assets/ethereum/0xf9e631014ce1759d9b76ce074d496c3da633ba12/601"
    },
    "success": true
}

Get All Networks

getAllNetworks(type: "EOA" | "AA"): Promise<{
    success: boolean,
    networks: Chain[],
    chainNameToLogo: Object, // colored logo maps
    chainNameToLogoBlack: Object, // black&white logo maps
}>;

interface Chain {
    chainName: string,
    logo: string,
}
Example response
{
    "success": true,
    "networks": [
        {
            "chainName": "ETH",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Ethereum.svg"
        },
        {
            "chainName": "BINANCE",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/binance.svg"
        },
        {
            "chainName": "FANTOM",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Fantom.svg"
        },
        {
            "chainName": "POLYGON",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Polygon.svg"
        },
        {
            "chainName": "AVALANCHE",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Avalanche.svg"
        },
        {
            "chainName": "OPTIMISM",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Optimism.svg"
        },
        {
            "chainName": "ARBITRUM",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/Arbitrum.svg"
        },
        {
            "chainName": "FUSE",
            "logo": "https://triaimage.s3.amazonaws.com/chain-logo-w/fuse.svg"
        }
    ],
    "chainNameToLogo": {
        "ETH": "https://triaimage.s3.amazonaws.com/chain-logo-w/Ethereum.svg",
        "BINANCE": "https://triaimage.s3.amazonaws.com/chain-logo-w/binance.svg",
        "FANTOM": "https://triaimage.s3.amazonaws.com/chain-logo-w/Fantom.svg",
        "POLYGON": "https://triaimage.s3.amazonaws.com/chain-logo-w/Polygon.svg",
        "AVALANCHE": "https://triaimage.s3.amazonaws.com/chain-logo-w/Avalanche.svg",
        "OPTIMISM": "https://triaimage.s3.amazonaws.com/chain-logo-w/Optimism.svg",
        "ARBITRUM": "https://triaimage.s3.amazonaws.com/chain-logo-w/Arbitrum.svg",
        "FUSE": "https://triaimage.s3.amazonaws.com/chain-logo-w/fuse.svg",
        "LINEA": "https://triaimage.s3.amazonaws.com/chain-logo-w/Linea.svg",
        "SOLANA": "https://triaimage.s3.amazonaws.com/chain-logo-w/Solana.svg"
    },
    "chainNameToLogoBlack": {
        "ETH": "https://triaimage.s3.amazonaws.com/chain-logo-b/Ethereum.svg",
        "BINANCE": "https://triaimage.s3.amazonaws.com/chain-logo-b/binance.svg",
        "FANTOM": "https://triaimage.s3.amazonaws.com/chain-logo-b/Fantom.svg",
        "POLYGON": "https://triaimage.s3.amazonaws.com/chain-logo-b/Polygon.svg",
        "AVALANCHE": "https://triaimage.s3.amazonaws.com/chain-logo-b/Avalanche.svg",
        "OPTIMISM": "https://triaimage.s3.amazonaws.com/chain-logo-b/Optimism.svg",
        "ARBITRUM": "https://triaimage.s3.amazonaws.com/chain-logo-b/Arbitrum.svg",
        "FUSE": "https://triaimage.s3.amazonaws.com/chain-logo-b/fuse.svg",
        "LINEA": "https://triaimage.s3.amazonaws.com/chain-logo-b/Linea.svg",
        "SOLANA": "https://triaimage.s3.amazonaws.com/chain-logo-b/Solana.svg"
    }
}

Get Total Balance

getTotalBalance(triaName?: string): Promise<GetTotalBalanceResponse>

export interface GetTotalBalanceResponse {
  success: boolean;
  data?: {
    balance: number;
    balance1dBefore: number;
    percentChangeIn24hr: number;
  };
  message?: string;
}

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

Example response
{
    "success": true,
    "data": {
        "balance": 88.67282912678257,
        "balance1dBefore": 87.32774273900438,
        "percentChangeIn24hr": 1.5402738529475597
    }
}

Get Native Token Price

getNativeTokenPrice(chainName: string): Promise<{
    success: boolean;
    data: {
        usd: number;
    };
    message?: string;
}>

Get Enabled Gas Tokens for a chain

getEnabledGasTokens(
    chainName: string,
    triaName: string,
    selectedWallet: "EOA" | "AA"
): Promise<GasTokens[]>;

type GasTokens = {
    "name": string;
    "tokenAddress": string,
    "quoteRate": number,
    "balanceInTokens": number,
    "balanceInUSD": number
}

Convert Token

convertToken(
    chainName: string,
    fromToken: string, // tokenAddress
    fromAmount: number,
    toToken: string, // tokenAddress
): Promise<{ success: boolean, toAmount: number }>

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

Get Twitter Feed

async getTwitterFeed(accessToken: string): Promise<TwitterFeed | ControllerError>
Example response
{
    "tweets": [
        {
            "created_at": "2024-04-13T11:27:55.000Z",
            "author_id": "1022556475850256384",
            "edit_history_tweet_ids": [
                "1779109254944751878"
            ],
            "id": "1779109254944751878",
            "text": "hey anon, join us at the only real summit on April 20th – Narratives Fest in Marina, Dubai.\n\nStirring panels by the founders of @monad_xyz, @AvailProject, @0G_labs, @ionet, @hack_vc, @SaharaLabsAI, @oceanprotocol, @SingularityNET, ours truly @Eljaboom and many others.\n\nHosted by… https://t.co/YJygDLC3ld https://t.co/NNpQRp0aKO",
            "attachments": {
                "media_keys": [
                    "7_1779079509469233153"
                ]
            },
            "media": [
                {
                    "media_key": "7_1779079509469233153",
                    "width": 1920,
                    "variants": [
                        {
                            "bit_rate": 1664000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/hevc/1280x720/i4iryW8zQtTyA0Rg.mp4?tag=18"
                        },
                        {
                            "bit_rate": 10368000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/avc1/1920x1080/hoMBdP8UO3BgnnQ6.mp4?tag=18"
                        },
                        {
                            "bit_rate": 832000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/avc1/640x360/UOpj-0l3MeyOunmD.mp4?tag=18"
                        },
                        {
                            "bit_rate": 678400,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/hevc/640x360/cTFNHMSHFWKM5ZZx.mp4?tag=18"
                        },
                        {
                            "bit_rate": 2176000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/avc1/1280x720/pNA9rgEpTzKQz2hX.mp4?tag=18"
                        },
                        {
                            "content_type": "application/x-mpegURL",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/pl/G8f1jl0B_DCkVRdN.m3u8?tag=18&container=cmaf"
                        },
                        {
                            "bit_rate": 211200,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/hevc/480x270/13REQdVQJVUgjmCM.mp4?tag=18"
                        },
                        {
                            "bit_rate": 7296000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/hevc/1920x1080/HarH9Nix18vYMpxJ.mp4?tag=18"
                        },
                        {
                            "bit_rate": 256000,
                            "content_type": "video/mp4",
                            "url": "https://video.twimg.com/ext_tw_video/1779079509469233153/pu/vid/avc1/480x270/Lhx55a_-u8ghuLMs.mp4?tag=18"
                        }
                    ],
                    "type": "video",
                    "height": 1080,
                    "duration_ms": 24520,
                    "preview_image_url": "https://pbs.twimg.com/ext_tw_video_thumb/1779079509469233153/pu/img/_9kJjwloFsQK-pLt.jpg",
                    "public_metrics": {
                        "view_count": 9082
                    }
                }
            ],
            "user": {
                "name": "Tria",
                "profile_image_url": "https://pbs.twimg.com/profile_images/1775041135133548546/rsP_iy0__normal.jpg",
                "username": "useTria",
                "id": "1022556475850256384"
            }
        },
        {
            "id": "1788431044418629877",
            "edit_history_tweet_ids": [
                "1788431044418629877"
            ],
            "text": "https://t.co/cjq7Z7gVS8",
            "author_id": "1326658439527936000",
            "created_at": "2024-05-09T04:49:23.000Z",
            "attachments": {
                "media_keys": [
                    "3_1788431035224756224"
                ]
            },
            "media": [
                {
                    "type": "photo",
                    "width": 1024,
                    "url": "https://pbs.twimg.com/media/GNHIjQ_bEAAWyoh.jpg",
                    "media_key": "3_1788431035224756224",
                    "height": 576
                }
            ],
            "user": {
                "username": "MantaNetwork",
                "profile_image_url": "https://pbs.twimg.com/profile_images/1490773577930584069/uoeUkeKe_normal.jpg",
                "name": "Manta Network (🔱,🔱) #MantaRenewParadigm",
                "id": "1326658439527936000"
            }
        }
    ],
    "success": true
}

Get Enabled Gas Tokens [For AA infra]

curl --location 'https://dev.tria.so/api/v2/user/getEnabledGasTokens?chainName=SEPOLIA&selectedWallet=AA&triaName=admin%40tria'
Example Response
[
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3BDC87233Cf9CC1b2a0e2E3D42097c653444B069",
            "type": "AA"
        },
        "name": "USDC",
        "tokenAddress": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
        "quoteRate": 0,
        "balanceInTokens": 0,
        "balanceInUSD": 0,
        "chainName": "SEPOLIA",
        "crossChain": false
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3BDC87233Cf9CC1b2a0e2E3D42097c653444B069",
            "type": "AA"
        },
        "name": "TST",
        "tokenAddress": "0xe2fDF4b113552A7bFaD5492D7E68F7479D7DFaCF",
        "quoteRate": 0,
        "balanceInTokens": 0,
        "balanceInUSD": 0,
        "chainName": "SEPOLIA",
        "crossChain": false
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3bdc87233cf9cc1b2a0e2e3d42097c653444b069",
            "type": "EOA"
        },
        "name": "ETH",
        "tokenAddress": null,
        "quoteRate": 0,
        "balanceInTokens": 0.07947039464661772,
        "balanceInUSD": 0,
        "chainName": "SEPOLIA",
        "crossChain": false
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3BDC87233Cf9CC1b2a0e2E3D42097c653444B069",
            "type": "AA"
        },
        "name": "ETH",
        "tokenAddress": null,
        "quoteRate": 0,
        "balanceInTokens": 0.07947039464661772,
        "balanceInUSD": 0,
        "chainName": "SEPOLIA",
        "crossChain": false
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3bdc87233cf9cc1b2a0e2e3d42097c653444b069",
            "type": "EOA"
        },
        "name": "MATIC",
        "tokenAddress": null,
        "quoteRate": 0,
        "balanceInTokens": 0,
        "balanceInUSD": 0,
        "chainName": "AMOY",
        "crossChain": true
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3BDC87233Cf9CC1b2a0e2E3D42097c653444B069",
            "type": "AA"
        },
        "name": "USDC",
        "tokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
        "quoteRate": 0.9990214338,
        "balanceInTokens": 0,
        "balanceInUSD": 0,
        "chainName": "POLYGON",
        "crossChain": true
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3bdc87233cf9cc1b2a0e2e3d42097c653444b069",
            "type": "EOA"
        },
        "name": "MATIC",
        "tokenAddress": null,
        "quoteRate": 0.683586939,
        "balanceInTokens": 0.1445213536005967,
        "balanceInUSD": 0.09879290972796853,
        "chainName": "POLYGON",
        "crossChain": true
    },
    {
        "wallet": {
            "name": "admin@tria",
            "address": "0x3BDC87233Cf9CC1b2a0e2E3D42097c653444B069",
            "type": "AA"
        },
        "name": "MATIC",
        "tokenAddress": null,
        "quoteRate": 0.683586939,
        "balanceInTokens": 0.1445213536005967,
        "balanceInUSD": 0.09879290972796853,
        "chainName": "POLYGON",
        "crossChain": true
    }
]

Get Solana Gas Enabled Tokens [For Old Infra]

curl --location 'https://staging.tria.so/api/v2/user/getEnabledGasTokens?chainName=SOLANA&triaName=4KMwvyGmUoN7ht5SWwacMQYP4fbmyDX2VyNHPtK36dJU'
Example Response
[
    {
        "name": "USDC",
        "tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "quoteRate": 0.99989,
        "balanceInTokens": 8.305551,
        "balanceInUSD": 8.304637389389999
    },
    {
        "name": "SOL",
        "tokenAddress": "",
        "quoteRate": 178.24,
        "balanceInTokens": 1.658704141,
        "balanceInUSD": 295.64742609184003
    }
]

Get User Prefs

getUserPrefs(accessToken: string): Promise<UserPrefResponse>;
Types
export type UserPrefResponse = {
  customChains: CustomChainData[];
  customTokens: CustomTokenData[];
};
Example Response
{
    "customChains": [
        {
            "type": "EVM",
            "_id": "666f430a9807602880cf4c70",
            "chainId": 122,
            "userId": "3e1d6550-961e-49da-a030-507d3194c4a3",
            "rpcUrl": "https://rpc.fuse.io",
            "chainName": "fuse-custom",
            "chainLogo": "https://fuse.io",
            "currencyName": "Fuse token",
            "currencySymbol": "FUSE",
            "createdAt": "2024-06-16T19:54:50.317Z",
            "updatedAt": "2024-06-16T19:54:50.331Z",
            "__v": 0,
            "explorerUrl": "https://explorer.fuse.io"
        },
        {
            "_id": "666f50f561281ecbe0278ec1",
            "type": "EVM",
            "chainId": 123,
            "userId": "3e1d6550-961e-49da-a030-507d3194c4a3",
            "rpcUrl": "https://rpc.fusespark.io",
            "chainName": "fuse-testnet",
            "chainLogo": "https://fusespark.io",
            "explorerUrl": "https://explorer.fusespark.io",
            "currencyName": "Fusespark token",
            "currencySymbol": "FUSESPARK",
            "createdAt": "2024-06-16T20:54:13.357Z",
            "updatedAt": "2024-06-16T20:54:13.358Z",
            "__v": 0
        }
    ],
    "customTokens": [
        {
            "_id": "666f511361281ecbe0278ec7",
            "userId": "3e1d6550-961e-49da-a030-507d3194c4a3",
            "chainId": 122,
            "tokenAddress": "0x9cd9...",
            "decimals": 6,
            "tokenName": "",
            "tokenSymbol": "USDC",
            "createdAt": "2024-06-16T20:54:43.629Z",
            "updatedAt": "2024-06-16T20:54:43.630Z",
            "__v": 0
        },
        {
            "_id": "666f513761281ecbe0278ed0",
            "userId": "3e1d6550-961e-49da-a030-507d3194c4a3",
            "chainId": 122,
            "tokenAddress": "0x6g7d...",
            "decimals": 6,
            "tokenName": "",
            "tokenSymbol": "USDT",
            "createdAt": "2024-06-16T20:55:19.007Z",
            "updatedAt": "2024-06-16T20:55:19.008Z",
            "__v": 0
        },
        {
            "_id": "666f514661281ecbe0278ed4",
            "userId": "3e1d6550-961e-49da-a030-507d3194c4a3",
            "chainId": 123,
            "tokenAddress": "0x7dhg...",
            "decimals": 18,
            "tokenName": "",
            "tokenSymbol": "WETH",
            "createdAt": "2024-06-16T20:55:34.801Z",
            "updatedAt": "2024-06-16T20:55:34.802Z",
            "__v": 0
        }
    ]
}

Get Suggested Dapps

async getSuggestedDapps() : Promise<Dapp[]> 
Type
type DApp = {
  name: string;
  description: string;
  iconUrl: string;
  dappUrl: string;
};

Get Notification Prefrences

async getNotificationPreference() : Promise<NotificationPreferences> 
Type
type NotificationPreferences = {
  securityAlerts: boolean;
  priceAlerts: boolean;
  transactionMessages: boolean;
}

Update Notification Prefrences

async updateNotificationPreference(updatedNotificationPreferences: NotificationPreferences) : Promise<NotificationPreferences> 
Type
type NotificationPreferences = {
  securityAlerts: boolean;
  priceAlerts: boolean;
  transactionMessages: boolean;
}

Add Custom Chain

async addCustomChain({
  accessToken,
  customChain,
}: {
  accessToken: string;
  customChain: CustomChainData;
});
Types
export type CustomChainData = {
  type: "EVM";
  chainId: number;
  rpcUrl: string;
  currencySymbol: string;
  currencyName?: string;
  chainName?: string;
  chainLogo?: string;
  explorerUrl?: string;
};

Update Custom Chain

async updateCustomChain({
  accessToken,
  customChain,
}: {
  accessToken: string;
  customChain: CustomChainData;
})

Delete Custom Chain

async deleteCustomChain({
  accessToken,
  customChain,
}: {
  accessToken: string;
  customChain: { chainId: string };
})

Add Custom Token

async addCustomToken({
  accessToken,
  customToken,
}: {
  accessToken: string;
  customToken: CustomTokenData;
}) 
Types
export type CustomTokenData = {
  chainId: number;
  tokenName?: string;
  tokenSymbol: string;
  tokenAddress: string;
  decimals: number;
};

Update Custom Token

async updateCustomToken({
  accessToken,
  customToken,
}: {
  accessToken: string;
  customToken: CustomTokenData;
})

Delete Custom Token

async deleteCustomToken({
  accessToken,
  customToken,
}: {
  accessToken: string;
  customToken: { chainId: number; tokenAddress: string };
}) 

Last updated