Reference for building on the Trust Wallet developer platform: deep links, browser extension detection, WalletConnect integration, and APIs.
Portal: developer.trustwallet.com
Support: developer.trustwallet.com/developer/get-support
Trust Wallet supports deep links for launching the app directly into specific flows. Useful for mobile dApps and marketing campaigns.
https://link.trustwallet.com/open_url?coin_id=60&url=https%3A%2F%2Fyourdapp.com
coin_id— SLIP44 coin ID (60 = Ethereum, 714 = BNB, 501 = Solana)url— URL-encoded dApp URL
trust://send?asset=c60&address=0xRecipient&amount=0.1&memo=optional
asset— asset ID (c<coinId>for native,c<coinId>_t<contractAddress>for tokens)address— recipient addressamount— amount in display units
https://link.trustwallet.com/buy?asset=c60
https://link.trustwallet.com/wc?uri=<url-encoded-wc-uri>
Detect Trust Wallet browser extension in dApps:
// Check for Trust Wallet specifically
function isTrustWallet(): boolean {
const { ethereum } = window as any;
if (!ethereum) return false;
if (ethereum.isTrust || ethereum.isTrustWallet) return true;
// Multi-provider array (EIP-5749)
if (ethereum.providers?.some((p: any) => p.isTrust || p.isTrustWallet)) return true;
return false;
}
// Get Trust Wallet provider from multi-provider array
function getTrustProvider() {
const { ethereum } = window as any;
if (!ethereum) return null;
if (ethereum.isTrust) return ethereum;
return ethereum.providers?.find((p: any) => p.isTrust) ?? null;
}Trust Wallet extension sets:
window.ethereum.isTrust = truewindow.ethereum.isTrustWallet = true
For Solana:
const isTrustSolana = window.solana?.isTrust === true;
const isTrustSolana2 = window.trustwallet?.solana != null;Trust Wallet fully supports WalletConnect v2. Recommended for dApps targeting mobile.
import { EthereumProvider } from '@walletconnect/ethereum-provider';
const provider = await EthereumProvider.init({
projectId: 'YOUR_WC_PROJECT_ID', // https://cloud.walletconnect.com
chains: [1], // Ethereum mainnet
optionalChains: [56, 137], // BNB, Polygon
showQrModal: true,
});
await provider.connect();
const accounts = provider.accounts;
// Trust Wallet will appear in the WalletConnect modal automaticallyFor mobile: use the deep link https://link.trustwallet.com/wc?uri=<wc-uri> to open directly in Trust Wallet.
Query token holdings and balances across chains.
Base URL: https://api.trustwallet.com
GET /v1/portfolio/holdings/{address}?coins={coinIds}
address— wallet addresscoins— comma-separated SLIP44 coin IDs
Response:
{
"assets": [
{
"id": "c60_t0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"decimals": 6,
"balance": "1000000000"
}
]
}- Native coin:
c{coinId}(e.g.,c60= ETH,c20000714= BNB) - Token:
c{coinId}_t{contractAddress}(e.g.,c60_t0xA0b86991...= USDC on Ethereum)
GET https://api.trustwallet.com/prices?ids={assetIds}¤cy=USD
Response:
{
"currency": "USD",
"docs": [
{ "id": "c60", "price": 3200.00, "percent_change_24h": 2.5 }
]
}GET https://api.trustwallet.com/v1/transactions/{address}?coin={coinId}&limit=20
To appear in the Trust Wallet dApp browser, submit your dApp to the official DApp list:
github.com/trustwallet/dapp-list
Required manifest.json fields:
{
"name": "Your dApp",
"iconUrl": "https://yourdapp.com/icon.png",
"url": "https://yourdapp.com",
"categories": ["defi", "nft"],
"chains": ["ethereum", "binance"]
}// On mobile, if Trust Wallet is installed, deep-link directly
const isMobile = /iPhone|Android/i.test(navigator.userAgent);
const dappUrl = encodeURIComponent('https://yourdapp.com');
if (isMobile && !window.ethereum) {
window.location.href =
`https://link.trustwallet.com/open_url?coin_id=60&url=${dappUrl}`;
}const provider = getTrustProvider();
if (!provider) throw new Error('Trust Wallet not found');
const accounts = await provider.request({ method: 'eth_requestAccounts' });await provider.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0x38' }], // BNB Chain
});
// If chain not known by wallet:
await provider.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0x38',
chainName: 'BNB Smart Chain',
rpcUrls: ['https://bsc-dataseed.binance.org'],
nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18 },
blockExplorerUrls: ['https://bscscan.com'],
}],
});