-
Notifications
You must be signed in to change notification settings - Fork 2
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: add more address types #119
feat: add more address types #119
Conversation
…more-address-types
…more-address-types
- Upgrading the @ensdomains/address-encoder to v1.1.2; - Adding new address fields (BTC, OPT, ARB1, MATIC); - Editing setAddr parameters to decode all addresses, including BTC; - Adding new coins in the getEnsDomainsData function(BTC, OPT, ARB1, MATIC);
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…more-address-types
lib/utils/blockchain-txs.ts
Outdated
|
||
const [cryptocurrencyName, address] = Object.entries(addresses)[i]; | ||
const cryptocurrencyToCoinTypeEntry: | ||
| [coinName: string, coinType: string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this type be defined elsewhere?
lib/utils/blockchain-txs.ts
Outdated
console.error(`coinType code for ${cryptocurrencyName} not found`); | ||
continue; | ||
} | ||
const coinType = cryptocurrencyToCoinTypeEntry[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be a key-value pair?
lib/utils/blockchain-txs.ts
Outdated
} | ||
const coinType = cryptocurrencyToCoinTypeEntry[1]; | ||
const coder = getCoderByCoinName(cryptocurrencyName.toLocaleLowerCase()); | ||
let addressEncoded = fromBytes(coder.decode(address), "hex"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a var or a const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a const
lib/utils/ensData.ts
Outdated
[DomainAddressesSupportedCryptocurrencies.DOGE]: "3", | ||
[DomainAddressesSupportedCryptocurrencies.ETH]: "60", | ||
[DomainAddressesSupportedCryptocurrencies.BNB]: "714", | ||
BTC: "0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the way the redefine multiple times, the word BTC, LTC, etc. across this file.
We should rely to a single definition of these that would be reused across our app.
Can you please provide a solution that achieves this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the enum to avoid double remapping(when you need to access an enum by its value, and then an object by its enum key), that can make the code very dirt, I'll try to find a more concise and sophisticated solution that can avoid double remapping and also make the coin names singular across the codebase. Thanks for the observation
Co-authored-by: frankind.eth <[email protected]>
Co-authored-by: frankind.eth <[email protected]>
Co-authored-by: frankind.eth <[email protected]>
…e more concise; refactor: Moving blockchain-txs.ts types to a different types.ts file; refactor: Cleaning the setDomainRecords function;
76cf4b4
into
91-feat-show-current-records-when-editing
feat: Adding new address types;