Skip to content

Commit

Permalink
Merge pull request #3958 from BitGo/WIN-458-cosmos-2-statics
Browse files Browse the repository at this point in the history
feat(statics): add Berachain & Haqq
  • Loading branch information
hitansh-madan authored Oct 6, 2023
2 parents 7c442dd + 988cfd4 commit 854a29e
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/bitgo/test/v2/unit/keychains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ describe('V2 Keychains', function () {
n.asset !== UnderlyingAsset.ETHW &&
n.asset !== UnderlyingAsset.KAVA &&
n.asset !== UnderlyingAsset.CORE &&
n.asset !== UnderlyingAsset.BERA &&
n.asset !== UnderlyingAsset.ISLM &&
coinFamilyValues.includes(n.name)
);

Expand Down
6 changes: 6 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export enum CoinFamily {
AVAXP = 'avaxp',
BCH = 'bch',
BCHA = 'bcha',
BERA = 'bera',
BLD = 'bld', // Agoric
BSC = 'bsc',
BSV = 'bsv',
Expand All @@ -47,6 +48,7 @@ export enum CoinFamily {
HASH = 'hash', // Provenance
HBAR = 'hbar',
INJECTIVE = 'injective',
ISLM = 'islm',
KAVA = 'kava',
LTC = 'ltc',
POLYGON = 'polygon',
Expand Down Expand Up @@ -252,6 +254,7 @@ export enum UnderlyingAsset {
AXLV2 = 'axlv2',
BCH = 'bch',
BCHA = 'bcha',
BERA = 'bera',
BLD = 'bld', // Agoric
BSC = 'bsc',
BSV = 'bsv',
Expand All @@ -276,6 +279,7 @@ export enum UnderlyingAsset {
HASH = 'hash', // Provenance
HBAR = 'hbar', // Hedera main coin
INJECTIVE = 'injective',
ISLM = 'islm',
KAVA = 'kava',
LTC = 'ltc',
NEAR = 'near',
Expand Down Expand Up @@ -1380,6 +1384,8 @@ export enum BaseUnit {
KAVA = 'ukava',
CORE = 'ucore',
TESTCORE = 'utestcore', // Coreum testnet uses different name for native coin
BERA = 'abera',
ISLM = 'aISLM',
}

export interface BaseCoinConstructorOptions {
Expand Down
40 changes: 40 additions & 0 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,46 @@ export const coins = CoinMap.fromCoins([
BaseUnit.TESTCORE,
COSMOS_SIDECHAIN_FEATURES
),
account(
'd367b226-5b38-4aa4-918c-df1859647d6d',
'bera',
'Bera',
Networks.main.bera,
0,
UnderlyingAsset.BERA,
BaseUnit.BERA,
COSMOS_SIDECHAIN_FEATURES
),
account(
'6d262f34-b21b-4b35-9a5d-94103ff1f168',
'tbera',
'Testnet Bera',
Networks.test.bera,
0,
UnderlyingAsset.BERA,
BaseUnit.BERA,
COSMOS_SIDECHAIN_FEATURES
),
account(
'b473d5f0-1590-4edf-bc9f-813aff515a23',
'islm',
'Islamic Coin',
Networks.main.islm,
18,
UnderlyingAsset.ISLM,
BaseUnit.ISLM,
COSMOS_SIDECHAIN_FEATURES.filter((f) => f !== CoinFeature.SHA256_WITH_ECDSA_TSS)
),
account(
'02eced2c-cf1d-4660-832c-858685ae7107',
'tislm',
'Testnet Islamic Coin',
Networks.test.islm,
18,
UnderlyingAsset.ISLM,
BaseUnit.ISLM,
COSMOS_SIDECHAIN_FEATURES.filter((f) => f !== CoinFeature.SHA256_WITH_ECDSA_TSS)
),
account(
'e48baabf-5cc9-4011-b67e-6f6425753df2',
'near',
Expand Down
28 changes: 28 additions & 0 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,30 @@ class CoreTestnet extends Testnet implements AccountNetwork {
explorerUrl = 'https://explorer.testnet-1.coreum.dev/coreum/transactions/';
}

class Bera extends Mainnet implements AccountNetwork {
name = 'Berachain';
family = CoinFamily.BERA;
explorerUrl = undefined;
}

class BeraTestnet extends Testnet implements AccountNetwork {
name = 'BerachainTestnet';
family = CoinFamily.BERA;
explorerUrl = undefined;
}

class Islm extends Mainnet implements AccountNetwork {
name = 'Haqq';
family = CoinFamily.ISLM;
explorerUrl = 'https://ping.pub/haqq/tx/';
}

class IslmTestnet extends Testnet implements AccountNetwork {
name = 'HaqqTestnet';
family = CoinFamily.ISLM;
explorerUrl = 'https://testnet.ping.pub/haqq/tx/';
}

class Stx extends Mainnet implements StacksNetwork {
name = 'Stx';
family = CoinFamily.STX;
Expand Down Expand Up @@ -840,6 +864,7 @@ export const Networks = {
bitcoinCash: Object.freeze(new BitcoinCash()),
bitcoinGold: Object.freeze(new BitcoinGold()),
bitcoinSV: Object.freeze(new BitcoinSV()),
bera: Object.freeze(new Bera()),
bld: Object.freeze(new Bld()),
bsc: Object.freeze(new BinanceSmartChain()),
casper: Object.freeze(new Casper()),
Expand All @@ -858,6 +883,7 @@ export const Networks = {
hash: Object.freeze(new Hash()),
hedera: Object.freeze(new Hedera()),
injective: Object.freeze(new Injective()),
islm: Object.freeze(new Islm()),
kava: Object.freeze(new Kava()),
litecoin: Object.freeze(new Litecoin()),
polygon: Object.freeze(new Polygon()),
Expand Down Expand Up @@ -889,6 +915,7 @@ export const Networks = {
bitcoinCash: Object.freeze(new BitcoinCashTestnet()),
bitcoinGold: Object.freeze(new BitcoinGoldTestnet()),
bitcoinSV: Object.freeze(new BitcoinSVTestnet()),
bera: Object.freeze(new BeraTestnet()),
bld: Object.freeze(new BldTestnet()),
bsc: Object.freeze(new BinanceSmartChainTestnet()),
casper: Object.freeze(new CasperTestnet()),
Expand All @@ -904,6 +931,7 @@ export const Networks = {
hash: Object.freeze(new HashTestnet()),
hedera: Object.freeze(new HederaTestnet()),
injective: Object.freeze(new InjectiveTestnet()),
islm: Object.freeze(new IslmTestnet()),
kava: Object.freeze(new KavaTestnet()),
kovan: Object.freeze(new Kovan()),
goerli: Object.freeze(new Goerli()),
Expand Down
4 changes: 4 additions & 0 deletions modules/statics/test/unit/fixtures/expectedColdFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ export const expectedColdFeatures = {
justTSS: [
'ada',
'atom',
'bera',
'bld',
'bsc',
'core',
'dot',
'hash',
'islm',
'injective',
'kava',
'near',
Expand All @@ -65,12 +67,14 @@ export const expectedColdFeatures = {
'zeta',
'tada',
'tatom',
'tbera',
'tbld',
'tbsc',
'tcore',
'tdot',
'thash',
'tia',
'tislm',
'tinjective',
'tkava',
'tnear',
Expand Down

0 comments on commit 854a29e

Please sign in to comment.