Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ This library currently supports the following cryptocurrencies and address forma
- NEM(XEM) (base32)
- NEO (base58check)
- NMC (base58check)
- NODL (ss58)
- NRG (checksummed-hex)
- NULS (base58)
- ONE (bech32)
Expand Down
7 changes: 7 additions & 0 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,13 @@ const vectors: Array<TestVector> = [
{ text: '0x1001EEc06f2aDff074fC2A9492e132c33d6bd54d', hex: '1001eec06f2adff074fc2a9492e132c33d6bd54d' },
],
},
{
name: 'NODL',
coinType: 1003,
passingVectors: [
{ text: '4k5Am7GnRscesBAG7NEuibjdstLTwBhwtYW1of2FC79DYkqF', hex: '823c7f65123aa9e1fdcfcd146590e7f058a348f282781eebbecc82d20852c627' },
],
},
{
name: 'FTM_LEGACY',
coinType: 1007,
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ function ksmAddrDecoder(data: string): Buffer {
return Buffer.from(ss58Decode(data));
}

function nodlAddrEncoder(data: Buffer): string {
return ss58Encode(Uint8Array.from(data), 37);
}

function ontAddrEncoder(data: Buffer): string {
return bs58Encode(Buffer.concat([Buffer.from([0x17]), data]))
}
Expand Down Expand Up @@ -1522,6 +1526,7 @@ export const formats: IFormat[] = [
bech32Chain('RUNE', 931, 'thor'),
bitcoinChain('BCD', 999, 'bcd', [[0x00]], [[0x05]]),
hexChecksumChain('TT_LEGACY', 1001),
getConfig('NODL', 1003, nodlAddrEncoder, ksmAddrDecoder),
hexChecksumChain('FTM_LEGACY', 1007),
bech32Chain('ONE', 1023, 'one'),
getConfig('ONT', 1024, ontAddrEncoder, ontAddrDecoder),
Expand Down