File tree Expand file tree Collapse file tree 4 files changed +44
-0
lines changed
Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Address format constants for Polyx networks
3+ */
4+
5+ /**
6+ * Polyx mainnet address format
7+ */
8+ export const POLYX_ADDRESS_FORMAT = 12 ;
9+
10+ /**
11+ * Tpolyx testnet address format
12+ */
13+ export const TPOLYX_ADDRESS_FORMAT = 42 ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics';
33import { SubstrateCoin } from '@bitgo/abstract-substrate' ;
44import { BatchStakingBuilder } from './lib/batchStakingBuilder' ;
55import { BondExtraBuilder } from './lib/bondExtraBuilder' ;
6+ import { POLYX_ADDRESS_FORMAT } from './lib/constants' ;
67
78export class Polyx extends SubstrateCoin {
89 protected readonly _staticsCoin : Readonly < StaticsBaseCoin > ;
@@ -47,4 +48,14 @@ export class Polyx extends SubstrateCoin {
4748 bondExtra ( ) : BondExtraBuilder {
4849 return this . getBuilder ( ) . getBondExtraBuilder ( ) ;
4950 }
51+
52+ /**
53+ * Retrieves the address format for Polyx.
54+ *
55+ * @returns {number } The address format as a number for Polyx.
56+ * @override
57+ */
58+ protected getAddressFormat ( ) : number {
59+ return POLYX_ADDRESS_FORMAT ;
60+ }
5061}
Original file line number Diff line number Diff line change 11import { BaseCoin , BitGoBase } from '@bitgo/sdk-core' ;
22import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics' ;
33import { Polyx } from './polyx' ;
4+ import { TPOLYX_ADDRESS_FORMAT } from './lib/constants' ;
45
56export class Tpolyx extends Polyx {
67 protected readonly _staticsCoin : Readonly < StaticsBaseCoin > ;
@@ -31,4 +32,14 @@ export class Tpolyx extends Polyx {
3132 public getFullName ( ) : string {
3233 return 'Testnet Polymesh' ;
3334 }
35+
36+ /**
37+ * Retrieves the address format for Testnet Polyx.
38+ *
39+ * @returns {number } The address format as a number for Testnet Polyx.
40+ * @override
41+ */
42+ protected getAddressFormat ( ) : number {
43+ return TPOLYX_ADDRESS_FORMAT ;
44+ }
3445}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import 'should';
22import { TestBitGo , TestBitGoAPI } from '@bitgo/sdk-test' ;
33import { BitGoAPI } from '@bitgo/sdk-api' ;
44import { Polyx , Tpolyx } from '../../src' ;
5+ import { POLYX_ADDRESS_FORMAT , TPOLYX_ADDRESS_FORMAT } from '../../src/lib/constants' ;
56
67describe ( 'Polyx:' , function ( ) {
78 let bitgo : TestBitGoAPI ;
@@ -12,4 +13,12 @@ describe('Polyx:', function () {
1213 bitgo . safeRegister ( 'tpolyx' , Tpolyx . createInstance ) ;
1314 bitgo . initializeTestVars ( ) ;
1415 } ) ;
16+
17+ describe ( 'Address Format Constants' , function ( ) {
18+ it ( 'should have the correct address format constants' , function ( ) {
19+ // Verify the constants are defined correctly
20+ POLYX_ADDRESS_FORMAT . should . equal ( 12 ) ;
21+ TPOLYX_ADDRESS_FORMAT . should . equal ( 42 ) ;
22+ } ) ;
23+ } ) ;
1524} ) ;
You can’t perform that action at this time.
0 commit comments