OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet commits / 860b9d6

Fix USDT token contract property name mismatch
Changed getTokenInfo() to return 'contractAddress' instead of 'contract' to match the property name used throughout wallet-server.cjs. This fixes USDT and other ERC-20 token balance queries. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
860b9d65f9ef04e135d0cee9c82e386ba21f7317
by plankatron <fleeky@gmail.com> · 2026-01-28T23:46:00.000Z

Changed files (1) +3 -3

lib/wdk-integration.cjs +3 -3
……@@ -180,7 +180,7 @@ function getBaseChain(chain) {
180180 * Get token contract information
181181 * @param {string} chain - Token chain identifier (e.g., 'ethereum-usdt')
182182 * @param {boolean} isTestnet - Whether to use testnet contracts
183 * @returns {Object} - Token info { contract, symbol, decimals }
183 * @returns {Object} - Token info { contractAddress, symbol, decimals }
184184 */
185185function getTokenInfo(chain, isTestnet = true) {
186186 const tokenContracts = TOKEN_CONTRACTS[chain]
……@@ -188,13 +188,13 @@ function getTokenInfo(chain, isTestnet = true) {
188188 throw new Error(`Unsupported token: ${chain}`)
189189 }
190190
191 const contract = isTestnet ? tokenContracts.testnet : tokenContracts.mainnet
191 const contractAddress = isTestnet ? tokenContracts.testnet : tokenContracts.mainnet
192192
193193 // Extract token symbol from chain (ethereum-usdt -> USDT)
194194 const symbol = chain.split('-')[1]?.toUpperCase() || 'TOKEN'
195195
196196 return {
197 contract,
197 contractAddress, // Changed from 'contract' to match usage in wallet-server.cjs
198198 symbol,
199199 decimals: 6 // USDT/USDC use 6 decimals
200200 }