Skip to content

Commit

Permalink
Add IMPLX Network (#246)
Browse files Browse the repository at this point in the history
Co-authored-by: yuriy.bulah <yuriy.bulah@gmail.com>
  • Loading branch information
shtah and yuriibulakh committed Sep 25, 2022
1 parent 7ea0887 commit 1454032
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
12 changes: 11 additions & 1 deletion angular/src/app/services/address-validation.service.spec.ts
@@ -1,6 +1,6 @@
import { EnvironmentService } from './environment.service';
import { AddressValidationService } from './address-validation.service';
import { BTC44, BTC84, CITY, CRS, STRAX } from 'src/shared/networks';
import { BTC44, BTC84, CITY, CRS, STRAX, IMPLX } from 'src/shared/networks';

describe('AddressValidationService', () => {
let service: AddressValidationService;
Expand Down Expand Up @@ -53,4 +53,14 @@ describe('AddressValidationService', () => {

expect(service.validate('XReyTxFTRQKomq8x74aNNHmR6ZKE3Uquwg').networks.find((n: { id: string; }) => n.id == 'STRAX')).toBeDefined();
});

it('Validate Impleum Base58 address', () => {
const network = new IMPLX();
expect(service.validateByNetwork('implx1q3pk7w924s72jy8amzptnwyn0509xvy3nrn2gff', network)).toBeTrue();
expect(service.validateByNetwork('XxKEYMx47uZY9uyam3LK3bECS9gvX9ojJF', network)).toBeTrue();
expect(service.validateByNetwork('implx1q6r3zyaap5dmatzcddq8363cr5hd49jy4r4vxez', network)).toBeTrue();
expect(service.validateByNetwork('Xhh9Cb3u8MHdEkTDsiMnQ1GVE654Hr56Wm', network)).toBeTrue();

expect(service.validate('Xr9UFDUhpz3Wq8kSV3h8kAwK31fhumDWLU').networks.find((n: { id: string; }) => n.id == 'IMPLX')).toBeDefined();
});
});
16 changes: 15 additions & 1 deletion angular/src/shared/defaults.ts
@@ -1,5 +1,5 @@
import { Account } from './interfaces';
import { BTC, CITY, CRS, CY, IDENTITY, NOSTR, RSC, SBC, STRAX, TCRS, TSTRAX, X42 } from './networks';
import { BTC, CITY, CRS, CY, IDENTITY, NOSTR, RSC, SBC, STRAX, TCRS, TSTRAX, X42 , IMPLX} from './networks';
const { v4: uuidv4 } = require('uuid');

export class Defaults {
Expand All @@ -17,6 +17,7 @@ export class Defaults {
networks.push(new TCRS());
networks.push(new TSTRAX());
networks.push(new X42());
networks.push(new IMPLX());
return networks;
}

Expand Down Expand Up @@ -78,6 +79,19 @@ export class Defaults {
purposeAddress: 44,
icon: 'paid',
},
{
identifier: uuidv4(),
selected: false,
networkType: 'IMPLX',
mode: 'normal',
index: 0,
name: 'Impleum',
type: 'coin',
network: 701,
purpose: 44,
purposeAddress: 44,
icon: 'paid',
},
{
identifier: uuidv4(),
index: 0,
Expand Down
24 changes: 24 additions & 0 deletions angular/src/shared/networks/IMPLX.ts
@@ -0,0 +1,24 @@
import { Network } from './network';

export class IMPLX implements Network {
id = 'IMPLX';
name = 'ImpleumX';
symbol = 'IMPLX';
network = 701;
purpose = 44;
messagePrefix = '\x18Bitcoin Signed Message:\n';
bech32 = 'implx';
bip32 = {
public: 0x0488b21e,
private: 0x0488ade4,
};
pubKeyHash = 76;
scriptHash = 141;
wif = 0x08;
feeRate = 10000;
minFeeRate = 10000;
testnet = false;
isProofOfStake = true;
smartContractSupport = false;
type = 'coin';
}
1 change: 1 addition & 0 deletions angular/src/shared/networks/index.ts
Expand Up @@ -11,3 +11,4 @@ export * from './SBC';
export * from './RSC';
export * from './CY';
export * from './X42';
export * from './IMPLX';

0 comments on commit 1454032

Please sign in to comment.