-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: no buffer req. rewrite #389
Conversation
@TateB 2 cents from an almost bystander. The code becomes much-much easier to leverage https://github.com/paulmillr/scure-base and |
completely forgot about that, thanks! will use it edit: looks like the lib is quite slow, might not use it |
@TateB Is this library used for high-performance processing? IMO, its main use case is on UI where speed is not that important. Size is quite important though. Anyhow, that's what pissed me off about the current state of the library. I was disappointed enough to do a rewrite myself. Considering how PRs are merged here, it's a separate repo: https://github.com/ukstv/ens-address-encoder maybe you'll find it useful. |
Rooting for this to land in prod, anyway. |
not internally, but in the future it's definitely possible. performance isn't really a focus as much as it is a nice to have, but using the your rewrite looks great! if you add a |
I can't decode a BTC address: import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { getCoderByCoinType } from '@ensdomains/address-encoder'
const td = new TextDecoder()
const publicClient = createPublicClient({
transport: http('https://rpc.ankr.com/eth'),
chain: mainnet,
})
for (const coinType of resolver.coinTypes) {
const hexAddress = await publicClient.getEnsAddress({
coinType: parseInt(coinType),
name,
})
const coin = getCoderByCoinType(parseInt(coinType))
if (hexAddress) {
data.coins.push({
type: coin.name,
address:
coin.coinType === 60
? hexAddress
: td.decode(coin.decode(hexAddress.slice(2))), // <- the error happens here
})
}
} it parses ethereum fine but on btc this happens:
the hex address (returned by viem) is (it should decode to |
remove evm chains + fix incorrect coinTypes
No description provided.