Skip to content

fix: IsBtcAddress not working with testnet addresses #639

@CamposBruno

Description

@CamposBruno

Description

IsBtcAddress decorator not working with bitcoin testnet addresses.
As described in this link
Testnet address are different from the mainet ones.

  • eg testnet address: mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn
  • eg mainet address: 17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem

Reproduction

validation this example address mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn returns :

"isBtcAddress": "receiver must be a BTC address"

import { IsBtcAddress } from 'class-validator';

export class SendBtcTransactionDto {
    @IsBtcAddress()
    receiver: string;
}


Environment

  • node v12.16.1
  • nestjs
  • class-validator: ^0.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions