bitcoincashwallet/scripts/floEthereum.min.js
void-57 b9d76ea9f0 feat(bch-wallet): complete Bitcoin Cash wallet migration
Implemented full wallet functionality for Bitcoin Cash:
- Balance Checking: Real-time balance fetching via redundant APIs (Blockchain.com, Blockcypher, FullStack.cash).
- Address Compatibility: Full support for both CashAddr (Bech32) and Legacy formats with automatic bidirectional conversion.
- Transaction Signing: Implemented BIP-143 signature hashing with SIGHASH_FORKID (0x41) for replay protection.
- Transaction History: Robust fetching from multi-provider APIs with detailed transaction formatting.
- Sending Functionality: Secure BCH transfers with dynamic fee estimation and manual ECDSA signing.
- UI Integration: Updated currency selectors and address management modals for Bitcoin Cash specifics.
2026-01-31 03:46:07 +05:30

1 line
1.2 KiB
JavaScript

!function(EXPORTS){"use strict";const floEthereum="object"===typeof module?module.exports:window.floEthereum={};floEthereum.ethPrivateKeyFromWif=function(privateKey){return coinjs.wif2privkey(privateKey).privkey},floEthereum.ethAddressFromPrivateKey=function(privateKey,onlyEvenY=!1){var t1,t1_x,t1_y,t1_y_BigInt,t2,t3,groupOrder=BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F");return t1_x=(t1=bitjs.newPubkey(privateKey)).slice(2,66),t1_y=t1.slice(-64),onlyEvenY&&(t1_y_BigInt=BigInt("0x"+t1_y))%2n!==0n&&(t1_y=(t1_y_BigInt=(groupOrder-t1_y_BigInt)%groupOrder).toString(16)),t2=t1_x.toString(16)+t1_y.toString(16),t3=keccak.keccak_256(Crypto.util.hexToBytes(t2)),"0x"+keccak.extractLast20Bytes(t3)},floEthereum.ethAddressFromCompressedPublicKey=function(compressedPublicKey){var t2,t3;return t2=coinjs.compressedToUncompressed(compressedPublicKey).slice(2),t3=keccak.keccak_256(Crypto.util.hexToBytes(t2)),"0x"+keccak.extractLast20Bytes(t3)},floEthereum.ethAddressFromUncompressedPublicKey=function(unCompressedPublicKey){var t2,t3;return t2=unCompressedPublicKey.slice(2),t3=keccak.keccak_256(Crypto.util.hexToBytes(t2)),"0x"+keccak.extractLast20Bytes(t3)}}();