File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import {
3838 TaoTokenConfig ,
3939 PolyxTokenConfig ,
4040 JettonTokenConfig ,
41+ NetworkType ,
4142} from '@bitgo/statics' ;
4243import {
4344 Ada ,
@@ -903,8 +904,24 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
903904 }
904905}
905906
907+ export const buildEthLikeChainToTestnetMap = ( ) : Record < string , string > => {
908+ const map : Record < string , string > = { } ;
909+
910+ // TODO: remove ip coin here and remove other evm coins from switch block, once changes are tested (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
911+ coins . forEach ( ( coin ) => {
912+ if ( coin . network . type === NetworkType . TESTNET && ! coin . isToken && coin . family === 'ip' ) {
913+ if ( coins . get ( coin . family ) ?. features . includes ( CoinFeature . SUPPORTS_ERC20 ) ) {
914+ map [ coin . family ] = `${ coin . name } ` ;
915+ }
916+ }
917+ } ) ;
918+
919+ return map ;
920+ } ;
921+
906922// TODO: add IP token here and test changes (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
907- const ethLikeChainToTestnetMap : Record < string , string > = { } ;
923+ const ethLikeChainToTestnetMap : Record < string , string > = buildEthLikeChainToTestnetMap ( ) ;
924+
908925export function getTokenConstructor ( tokenConfig : TokenConfig ) : CoinConstructor | undefined {
909926 if ( tokenConfig . coin in ethLikeChainToTestnetMap ) {
910927 return EthLikeErc20Token . createTokenConstructor ( tokenConfig as EthLikeTokenConfig , {
You can’t perform that action at this time.
0 commit comments