From 11727f9d8241f45baa91bc2e9d86f310ee147ac0 Mon Sep 17 00:00:00 2001 From: Adarsh Ravichandran Date: Mon, 30 Sep 2024 11:37:30 +0530 Subject: [PATCH] feat(sdk-coin-bera): add bera token support Ticket: WIN-3493 --- modules/sdk-coin-bera/src/register.ts | 4 ++++ modules/sdk-coin-bera/test/unit/beraToken.ts | 2 +- modules/statics/src/coins.ts | 4 ++-- modules/statics/src/tokenConfig.ts | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/sdk-coin-bera/src/register.ts b/modules/sdk-coin-bera/src/register.ts index d3e21c4f2c..4b6c2400ca 100644 --- a/modules/sdk-coin-bera/src/register.ts +++ b/modules/sdk-coin-bera/src/register.ts @@ -1,8 +1,12 @@ import { BitGoBase } from '@bitgo/sdk-core'; import { Bera } from './bera'; import { Tbera } from './tbera'; +import { BeraToken } from './beraToken'; export const register = (sdk: BitGoBase): void => { sdk.register('bera', Bera.createInstance); sdk.register('tbera', Tbera.createInstance); + BeraToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { + sdk.register(name, coinConstructor); + }); }; diff --git a/modules/sdk-coin-bera/test/unit/beraToken.ts b/modules/sdk-coin-bera/test/unit/beraToken.ts index 979c574ae8..a30721f959 100644 --- a/modules/sdk-coin-bera/test/unit/beraToken.ts +++ b/modules/sdk-coin-bera/test/unit/beraToken.ts @@ -23,7 +23,7 @@ describe('Bera Token:', function () { bgtTokenCoin.getFullName().should.equal('Bera Token'); bgtTokenCoin.getBaseFactor().should.equal(1e18); bgtTokenCoin.type.should.equal(tokenName); - bgtTokenCoin.name.should.equal('Bera Test BGT'); + bgtTokenCoin.name.should.equal('Bera Testnet BGT'); bgtTokenCoin.coin.should.equal('tarbeth'); bgtTokenCoin.network.should.equal('Testnet'); bgtTokenCoin.decimalPlaces.should.equal(18); diff --git a/modules/statics/src/coins.ts b/modules/statics/src/coins.ts index e3f44ebfeb..295d17775c 100644 --- a/modules/statics/src/coins.ts +++ b/modules/statics/src/coins.ts @@ -17973,14 +17973,14 @@ export const coins = CoinMap.fromCoins([ 'bera:bgt', 'BGT Token', 18, - // TODO: the mainnet contract address is still not available, adding placeholder her + // TODO: the mainnet contract address is still not available, adding placeholder here '0xbda130737bdd9618301681329bf2e46a016ff9aa', UnderlyingAsset['bera:bgt'] ), tberaErc20( '24af5e18-ab4b-43e5-80db-0ddb9beb01b3', 'tbera:bgt', - 'bera Test BGT', + 'Bera Testnet BGT', 18, '0xbda130737bdd9618301681329bf2e46a016ff9ad', UnderlyingAsset['tbera:bgt'] diff --git a/modules/statics/src/tokenConfig.ts b/modules/statics/src/tokenConfig.ts index bf118f8740..3e5a0a893b 100644 --- a/modules/statics/src/tokenConfig.ts +++ b/modules/statics/src/tokenConfig.ts @@ -623,7 +623,7 @@ export const tokens: Tokens = { tokens: formattedSuiTokens.filter((token) => token.network === 'Testnet'), }, bera: { - tokens: formattedArbethTokens.filter((token) => token.network === 'Testnet'), + tokens: formattedBeraTokens.filter((token) => token.network === 'Testnet'), }, }, };