mantlewallet/scripts/floEthereum.min.js
void-57 72351dd5b8 feat(mantle-wallet): complete Mantle wallet
Implemented full wallet functionality for Mantle:
- Balance Checking: Real-time balance fetching for MNT, WMNT, USDC, and USDT.
- Transaction History: Robust fetching via Mobula API with support for pagination and filtering.
- Transaction Details: Detailed view for individual transactions, including status, hash, and value.
- Sending Functionality: Secure MNT and token transfers using Type 0 (Legacy) transactions and L1 fee estimation.
- Key Management: Derivation of Mantle addresses and FLO IDs from private keys (WIF/Hex).
- Navigation Enhancements:
    - Clickable addresses in history and details for seamless navigation.
2026-01-20 15:23:51 +05:30

1 line
1.4 KiB
JavaScript

!function(EXPORTS){"use strict";const floEthereum="object"===typeof module?module.exports:window.floEthereum={},ethAddressFromPrivateKey=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)},ethAddressFromCompressedPublicKey=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.ethPrivateKeyFromUntweakedPrivateKey=function(untweakedPrivateKey){return hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey)))},floEthereum.ethAddressFromUntweakedPrivateKey=function(untweakedPrivateKey){var t1;return t1=hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey))),ethAddressFromPrivateKey(t1)},floEthereum.ethAddressFromTaprootAddress=function(taprootAddress){var t2;return t2=coinjs.addressDecode(taprootAddress).outstring.slice(4),ethAddressFromCompressedPublicKey("02"+t2)}}();