Wallet Integration Guide
Because there is no native token on Tempo and transaction fees are paid directly in stablecoins, wallets need specific UI and logic adjustments to support the network. Follow this guide if your wallet logic and/or interfaces are dependent on the existence of a native token.
As part of supporting Tempo in your wallet, you can also deliver an enhanced experience for your users by integrating Tempo Transactions. Common use cases include enabling a gasless transactions for your users, letting your users decide what token to use for fees, and more.
Steps
Handle the absence of a native token
If you use eth_getBalance to validate a user's balance, you should instead check the user's account fee token balance on Tempo. Additionally, you should not display any "native balance" in your UI for Tempo users.
import { client } from './viem.config'
const userFeeToken = await client.fee.getUserToken({
account: '0x...'
})
const balance = await client.token.getBalance({
account: '0x...',
token: userFeeToken.address
})Configure native currency symbol
If you need to display a native token symbol, such as showing how much gas a transaction requires, you can set the currency symbol to USD for Tempo as fees are denominated in USD.
Use fee token preferences to quote gas prices
On Tempo, users can pay fees in any supported stablecoin. You should quote gas/fee prices in your UI based on a transaction's fee token.
Display token and network assets
Tempo provides a public tokenlist service that hosts token and network assets. You can pull these assets from our public tokenlist service to display in your UI.
- GitHub: tempoxyz/tempo-apps/apps/tokenlist
- Tokenlist JSON: tempoxyz.github.io/tempo-apps/42429/tokenlist.json
Integrate Tempo Transactions
We strongly recommend using Tempo Transactions if you control transaction submission. We have SDKs and guides available to get you integrated in less than an hour!
Recipes
Get user's fee token
Retrieve the user's configured fee token preference:
import { getUserToken } from 'viem/tempo'
const feeToken = await client.fee.getUserToken({
account: userAddress
})See getUserToken for full documentation.
Get token balance
Check a user's balance for a specific token:
import { getBalance } from 'viem/tempo'
const balance = await client.token.getBalance({
account: userAddress,
token: tokenAddress
})See getBalance for full documentation.
Set user fee token
Set the user's default fee token preference. This will be used for all transactions unless a different fee token is specified at the transaction level.
import { setUserToken } from 'viem/tempo'
await client.fee.setUserTokenSync({
token: '0x20c0000000000000000000000000000000000001',
})See setUserToken for full documentation.
Checklist
Before launching Tempo support, ensure your wallet:
- Checks fee token balance instead of native balance
- Hides or removes native balance display for Tempo
- Displays
USDas the currency symbol for gas - Quotes gas prices in the user's fee token
- Pulls token/network assets from Tempo's tokenlist
- (Recommended) Integrates Tempo Transactions for enhanced UX