Commit 8ff8717
authored
feat(chain-adapter): EVM 和 BIP39 链适配器 (#132)
* feat(chain-adapter): add EVM and BIP39 adapters
- Add EVM adapter for Ethereum/BSC chains
- IdentityService, AssetService, TransactionService, ChainService
- Balance queries via walletapi
- Transaction signing placeholder (not yet implemented)
- Add BIP39 adapter for Bitcoin/Tron chains
- Similar structure to EVM adapter
- Chain-specific fee estimates and confirmations
- Update use-send.ts error messages
- Show chain type name for unsupported chains
- Prepare for future EVM/BIP39 transfer implementation
- Register all adapters in setupAdapters()
* docs: add testnet integration guide
- Add new chapter: 08-测试篇/06-测试网络
- Document public testnets: Sepolia, BSC Testnet, Nile, Signet
- Include RPC endpoints, faucets, and explorer links
- Add testnet-chains.json config file
- Update white-book index
* feat(chain-adapter): complete EVM transaction signing with PublicNode RPC
- Use standard Ethereum JSON-RPC instead of custom REST API
- Implement proper secp256k1 signature parsing with recovery bit
- Add PublicNode as unified RPC provider for all chains (ETH/BSC/Tron/BTC)
- Update testnet documentation with PublicNode endpoints
* feat(chain-adapter): add Tron adapter with PublicNode API
- Add dedicated Tron chain type and adapter
- Implement TronIdentityService with address derivation and signing
- Implement TronAssetService for TRX balance queries
- Implement TronChainService for block info and health checks
- Implement TronTransactionService for transaction building/signing/broadcasting
- Update ChainConfigTypeSchema to include 'tron' type
- Update schema.test.ts for new chain type distribution
* feat(chain-adapter): add Bitcoin adapter with mempool.space API
- Add BitcoinIdentityService with BIP84 address derivation (P2WPKH)
- Add BitcoinAssetService for balance and UTXO queries
- Add BitcoinChainService for block info and fee estimates
- Add BitcoinTransactionService for transaction building
- Implement custom bech32 encoding/decoding
- Note: Full transaction signing requires specialized library
* refactor(bitcoin): use @scure/base and viem standard libraries
- Replace custom bech32/base58 implementation with @scure/base
- Add viem for future EVM improvements
- Simplify Bitcoin address validation using standard library
* feat(use-send): integrate Web3 chain adapters for EVM/Tron/Bitcoin
- Add use-send.web3.ts with transfer/fee/validation functions
- Update use-send.ts to route EVM/Tron/Bitcoin transfers through adapters
- Support address validation using chain adapter identity service
- Support fee estimation using chain adapter transaction service
* docs/test: add Web3 adapter documentation and unit tests
- Add white-book documentation explaining API choices (mempool.space vs PublicNode for Bitcoin)
- Add unit tests for EVM, Bitcoin, and Tron adapters
- Update testnet documentation with Bitcoin API comparison table1 parent 7aef4e8 commit 8ff8717
File tree
46 files changed
+3859
-14
lines changed- docs/white-book
- 04-服务篇/02-链服务/实现规范
- 08-测试篇
- 06-测试网络
- public/configs
- src
- hooks
- services
- chain-adapter
- __tests__
- bip39
- bitcoin
- evm
- tron
- chain-config
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
46 files changed
+3859
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
0 commit comments