Skip to content

Commit

Permalink
feat(statics): add flr,sgb config
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshwar-bitgo committed Jan 16, 2025
1 parent b2d29ea commit 833e8a0
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 2 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 @@ -77,6 +77,8 @@ describe('V2 Keychains', function () {
n.asset !== UnderlyingAsset.ZKETH && // TODO(WIN-1427): remove this once coin-specific module for zketh is added
n.asset !== UnderlyingAsset.OAS && // TODO(WIN-3696): remove this once coin-specific module for oas is added
n.asset !== UnderlyingAsset.COREDAO && // TODO(WIN-3696): remove this once coin-specific module for coredao is added
n.asset !== UnderlyingAsset.FLR && // TODO(WIN-4215): remove this once coin-specific module for FLR is added
n.asset !== UnderlyingAsset.SGB && // TODO(WIN-4216): remove this once coin-specific module for SGB is added
n.asset !== UnderlyingAsset.RUNE &&
n.asset !== UnderlyingAsset.BABY &&
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 @@ -50,6 +50,7 @@ export enum CoinFamily {
ETC = 'etc',
EOS = 'eos',
FIAT = 'fiat',
FLR = 'flr',
HASH = 'hash', // Provenance
HBAR = 'hbar',
ICP = 'icp',
Expand All @@ -65,6 +66,7 @@ export enum CoinFamily {
OPETH = 'opeth',
OSMO = 'osmo',
RBTC = 'rbtc',
SGB = 'sgb',
SEI = 'sei',
SOL = 'sol',
SUI = 'sui',
Expand Down Expand Up @@ -359,6 +361,7 @@ export enum UnderlyingAsset {
EURCV = 'eurcv',
EUROC = 'euroc',
EURR = 'eurr',
FLR = 'flr',
GBP = 'gbp',
GTC = 'gtc',
HASH = 'hash', // Provenance
Expand All @@ -376,6 +379,7 @@ export enum UnderlyingAsset {
POLYGON = 'polygon',
RBTC = 'rbtc', // RSK main coin
SEI = 'sei',
SGB = 'sgb',
SOL = 'sol',
SUI = 'sui',
STX = 'stx',
Expand Down Expand Up @@ -2464,6 +2468,8 @@ export enum BaseUnit {
RUNE = 'rune',
TAO = 'rao',
ICP = 'e8s',
SGB = 'sgb',
FLR = 'flr',
}

export interface BaseCoinConstructorOptions {
Expand Down
32 changes: 31 additions & 1 deletion modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@ const ETC_FEATURES = [
CoinFeature.CUSTODY_BITGO_NEW_YORK,
CoinFeature.MULTISIG_COLD,
];

const EVM_FEATURES = [
...ETH_FEATURES,
CoinFeature.TSS,
CoinFeature.TSS_COLD,
CoinFeature.EVM_WALLET,
CoinFeature.MPCV2,
CoinFeature.EVM_WALLET,
CoinFeature.BULK_TRANSACTION,
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
CoinFeature.EIP1559,
];
const AVAXC_FEATURES = [
...ETH_FEATURES_WITH_MMI,
CoinFeature.CUSTODY_BITGO_GERMANY,
Expand Down Expand Up @@ -1429,6 +1439,26 @@ export const coins = CoinMap.fromCoins([
BaseUnit.ETH,
COREDAO_FEATURES
),
account(
'202caf8f-4d43-4208-b206-8231f555c518',
'flr',
'flare',
Networks.main.flr,
18,
UnderlyingAsset.FLR,
BaseUnit.FLR,
EVM_FEATURES
),
account(
'c6b8f90b-1f89-4d26-b296-4097927f6b30',
'sgb',
'Songbird Testnet Flare',
Networks.test.sgb,
18,
UnderlyingAsset.SGB,
BaseUnit.SGB,
EVM_FEATURES
),
account(
'75a71e9c-e3a0-4852-8e4b-9613ffed2a4c',
'apt',
Expand Down
49 changes: 48 additions & 1 deletion modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,50 @@ class CoredaoTestnet extends Testnet implements EthereumNetwork {
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}

class Flare extends Mainnet implements EthereumNetwork {
name = 'Flarechain';
family = CoinFamily.FLR;
explorerUrl = 'https://flare-explorer.flare.network/tx';
accountExplorerUrl = 'https://flare-explorer.flare.network/address';
chainId = 14;
nativeCoinOperationHashPrefix = '14';
batcherContractAddress = '0xedf1a0016d9c41d2ad0c275e1ba708361a90c0d1';
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}
class FlareTestnet extends Testnet implements EthereumNetwork {
name = 'FlarechainTestnet';
family = CoinFamily.FLR;
explorerUrl = 'https://coston2-explorer.flare.network/tx';
accountExplorerUrl = 'https://coston2-explorer.flare.network/address';
chainId = 114;
nativeCoinOperationHashPrefix = '114';
batcherContractAddress = '0xad7a34aa9c0c7cb2c4d1f07ce8d1d0530b07fe27';
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}
class Songbird extends Mainnet implements EthereumNetwork {
name = 'Songbirdchain';
family = CoinFamily.SGB;
explorerUrl = 'https://songbird-explorer.flare.network/tx';
accountExplorerUrl = 'https://songbird-explorer.flare.network/address';
chainId = 19;
nativeCoinOperationHashPrefix = '19';
batcherContractAddress = '0xedf1a0016d9c41d2ad0c275e1ba708361a90c0d1';
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}
class SongbirdTestnet extends Testnet implements EthereumNetwork {
name = 'SongbirdchainTestnet';
family = CoinFamily.SGB;
explorerUrl = 'https://coston-explorer.flare.network/tx';
accountExplorerUrl = 'https://coston-explorer.flare.network/address';
chainId = 16;
nativeCoinOperationHashPrefix = '16';
batcherContractAddress = '0xad7a34aa9c0c7cb2c4d1f07ce8d1d0530b07fe27';
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}
class BaseChainTestnet extends Testnet implements EthereumNetwork {
name = 'BaseChainTestnet';
family = CoinFamily.BASEETH;
Expand Down Expand Up @@ -1210,6 +1253,7 @@ export const Networks = {
ethereumClassic: Object.freeze(new EthereumClassic()),
ethereumW: Object.freeze(new EthereumW()),
fiat: Object.freeze(new Fiat()),
flr: Object.freeze(new Flare()),
hash: Object.freeze(new Hash()),
hedera: Object.freeze(new Hedera()),
icp: Object.freeze(new Icp()),
Expand All @@ -1227,6 +1271,7 @@ export const Networks = {
rune: Object.freeze(new Rune()),
stellar: Object.freeze(new Stellar()),
sei: Object.freeze(new Sei()),
sgb: Object.freeze(new Songbird()),
sol: Object.freeze(new Sol()),
sui: Object.freeze(new Sui()),
near: Object.freeze(new Near()),
Expand Down Expand Up @@ -1271,6 +1316,7 @@ export const Networks = {
eCash: Object.freeze(new ECashTestnet()),
eos: Object.freeze(new EosTestnet()),
fiat: Object.freeze(new FiatTestnet()),
flr: Object.freeze(new FlareTestnet()),
pyrmont: Object.freeze(new Pyrmont()),
ethereumClassicTestnet: Object.freeze(new EthereumClassicTestnet()),
hash: Object.freeze(new HashTestnet()),
Expand All @@ -1291,6 +1337,7 @@ export const Networks = {
osmo: Object.freeze(new OsmoTestnet()),
rbtc: Object.freeze(new RbtcTestnet()),
rune: Object.freeze(new RuneTestNet()),
sgb: Object.freeze(new SongbirdTestnet()),
stellar: Object.freeze(new StellarTestnet()),
sei: Object.freeze(new SeiTestnet()),
sol: Object.freeze(new SolTestnet()),
Expand Down
2 changes: 2 additions & 0 deletions modules/statics/test/unit/fixtures/expectedColdFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ export const expectedColdFeatures = {
'thorchain:rune',
'tia',
'ticp',
'tflr',
'tislm',
'tinjective',
'tkava',
'tnear',
'tosmo',
'tsei',
'tsgb',
'tsol',
'tsui',
'ttao',
Expand Down

0 comments on commit 833e8a0

Please sign in to comment.