diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 79e386f9..7c5490b4 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -170,6 +170,13 @@ const vectors: Array = [ { text: 'TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW', hex: '415a523b449890854c8fc460ab602df9f31fe4293f'}, ], }, + { + name: 'DOT', + coinType: 354, + passingVectors: [ + { text: '1FRMM8PEiWXYax7rpS6X4XZX1aAAxSWx1CrKTyrVYhV24fg', hex: '0aff6865635ae11013a83835c019d44ec3f865145943f487ae82a8e7bed3a66b' }, + ], + }, { name: 'KSM', coinType: 434, diff --git a/src/index.ts b/src/index.ts index a15d59a5..1c70dec5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -241,6 +241,10 @@ function ksmAddrEncoder(data: Buffer): string { return ss58Encode(Uint8Array.from(data), 2) } +function dotAddrEncoder(data: Buffer): string { + return ss58Encode(Uint8Array.from(data), 0) +} + function ksmAddrDecoder(data: string): Buffer { return new Buffer(ss58Decode(data)) } @@ -278,6 +282,7 @@ const formats: IFormat[] = [ getConfig('XLM', 148, strEncoder, strDecoder), getConfig('EOS', 194, eosAddrEncoder, eosAddrDecoder), getConfig('TRX', 195, bs58Encode, bs58Decode), + getConfig('DOT', 354, dotAddrEncoder, ksmAddrDecoder), getConfig('KSM', 434, ksmAddrEncoder, ksmAddrDecoder), hexChecksumChain('XDAI', 700), bech32Chain('BNB', 714, 'bnb'),