Merge pull request #4648 from mempool/natsoni/search-bar-confidential-addresses
Search bar: add Liquid confidential addresses to addresses regex
This commit is contained in:
commit
01066eae64
@ -104,7 +104,7 @@ export class AddressComponent implements OnInit, OnDestroy {
|
|||||||
.pipe(
|
.pipe(
|
||||||
filter((address) => !!address),
|
filter((address) => !!address),
|
||||||
tap((address: Address) => {
|
tap((address: Address) => {
|
||||||
if ((this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet') && /^([m-zA-HJ-NP-Z1-9]{26,35}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,100}|[a-km-zA-HJ-NP-Z1-9]{80})$/.test(address.address)) {
|
if ((this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet') && /^([a-zA-HJ-NP-Z1-9]{26,35}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,100}|[a-km-zA-HJ-NP-Z1-9]{80})$/.test(address.address)) {
|
||||||
this.apiService.validateAddress$(address.address)
|
this.apiService.validateAddress$(address.address)
|
||||||
.subscribe((addressInfo) => {
|
.subscribe((addressInfo) => {
|
||||||
this.addressInfo = addressInfo;
|
this.addressInfo = addressInfo;
|
||||||
|
@ -77,11 +77,15 @@ const ADDRESS_CHARS: {
|
|||||||
+ `)`,
|
+ `)`,
|
||||||
},
|
},
|
||||||
liquid: {
|
liquid: {
|
||||||
base58: `[GHPQ]` // G|H is P2PKH, P|Q is P2SH
|
base58: `[GHPQ]` // PQ is P2PKH, GH is P2SH
|
||||||
+ BASE58_CHARS
|
+ BASE58_CHARS
|
||||||
+ `{33}`, // All min-max lengths are 34
|
+ `{33}` // All min-max lengths are 34
|
||||||
|
+ `|`
|
||||||
|
+ `[V][TJ]` // Confidential P2PKH or P2SH starts with VT or VJ
|
||||||
|
+ BASE58_CHARS
|
||||||
|
+ `{78}`,
|
||||||
bech32: `(?:`
|
bech32: `(?:`
|
||||||
+ `(?:` // bech32 liquid starts with ex1 or lq1
|
+ `(?:` // bech32 liquid starts with ex1 (unconfidential) or lq1 (confidential)
|
||||||
+ `ex1`
|
+ `ex1`
|
||||||
+ `|`
|
+ `|`
|
||||||
+ `lq1`
|
+ `lq1`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user