|
1 | 1 | import { CosmosUtils } from '@bitgo/abstract-cosmos'; |
| 2 | +import { Networks } from '@bitgo/statics'; |
2 | 3 |
|
3 | 4 | const cosmosUtils = new CosmosUtils(); |
| 5 | +const MAINNET_HRP = Networks.main.coreum.addressPrefix; |
| 6 | +const TESTNET_HRP = Networks.test.coreum.addressPrefix; |
4 | 7 | export const validDenoms = ['ucore', 'utestcore', ...cosmosUtils.getTokenDenomsUsingCoinFamily('coreum')]; |
5 | | -export const mainnetAccountAddressRegex = |
6 | | - /^(core)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}|['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58})$/; |
7 | | -export const mainnetValidatorAddressRegex = /^(corevaloper)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38})$/; |
8 | | -export const MAINNET_ADDRESS_PREFIX = 'core'; |
9 | | -export const testnetAccountAddressRegex = |
10 | | - /^(testcore)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}|['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58})$/; |
11 | | -export const testnetValidatorAddressRegex = /^(testcorevaloper)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38})$/; |
12 | | -export const TESTNET_ADDRESS_PREFIX = 'testcore'; |
| 8 | +export const mainnetAccountAddressRegex = new RegExp( |
| 9 | + `^(${MAINNET_HRP})1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}|['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58})$` |
| 10 | +); |
| 11 | +export const mainnetValidatorAddressRegex = new RegExp( |
| 12 | + `^(${MAINNET_HRP}valoper)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38})$` |
| 13 | +); |
| 14 | +export const testnetAccountAddressRegex = new RegExp( |
| 15 | + `^(${TESTNET_HRP})1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}|['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58})$` |
| 16 | +); |
| 17 | +export const testnetValidatorAddressRegex = new RegExp( |
| 18 | + `^(${TESTNET_HRP}valoper)1(['qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38})$` |
| 19 | +); |
| 20 | +/** @deprecated Use `Networks.main.coreum.addressPrefix` from `@bitgo/statics` instead. */ |
| 21 | +export const MAINNET_ADDRESS_PREFIX = MAINNET_HRP; |
| 22 | +/** @deprecated Use `Networks.test.coreum.addressPrefix` from `@bitgo/statics` instead. */ |
| 23 | +export const TESTNET_ADDRESS_PREFIX = TESTNET_HRP; |
13 | 24 |
|
14 | 25 | export const GAS_LIMIT = 200000; |
15 | 26 | export const GAS_AMOUNT = '6250'; |
0 commit comments