SuperAPI AI 工具集

trust-developer

编程与开发

查看项目

更新于 10-16 05:42

技能介绍

用途:为在 Trust Wallet 开发者平台上构建 dApp 提供集成参考,涉及深度链接、扩展检测与 WalletConnect(官方门户 developer.trustwallet.com)。 主要能力与用法:

  1. 深度链接。可在 Trust Wallet 内置浏览器打开 dApp:https://link.trustwallet.com/open_url?coin_id=60&url=https%3A%2F%2Fyourdapp.com,其中 coin_id 为 SLIP44 币种 ID(60 以太坊、714 BNB、501 Solana),url 需 URL 编码。发送交易用 trust://send?asset=c60&address=0xRecipient&amount=0.1&memo=optional,asset 中 c<coinId> 为原生币、c<coinId>_t<contractAddress> 为代币。买币链接为 https://link.trustwallet.com/buy?asset=c60;WalletConnect 配对链为 https://link.trustwallet.com/wc?uri=<url-encoded-wc-uri>。
  2. 扩展检测。注入的 provider 会设置 window.ethereum.isTrust 与 isTrustWallet 为 true,可通过其判断,并按 EIP-5749 在多 provider 数组中查找;Solana 侧可检查 window.solana?.isTrust 或 window.trustwallet?.solana。
  3. WalletConnect。支持 WalletConnect v2,使用 @walletconnect/ethereum-provider 初始化 EthereumProvider(projectId、chains、optionalChains、showQrModal),调用 connect() 后读取 accounts;移动端可用 wc 深度链接直达。
  4. 清单与收录。要出现在 Trust Wallet dApp 浏览器,可提交至 github.com/trustwallet/dapp-list,manifest.json 需含 name、iconUrl、url、categories、chains 等字段。 适用场景:移动 dApp、营销活动、扩展与钱包连接等集成。限制:部分参数与支持渠道以官方文档为准;资料未提供收费、价格及完整平台支持范围。