File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Gteth } from './gteth';
55import { Hteth } from './hteth' ;
66import { Teth } from './teth' ;
77import { Erc721Token } from './erc721Token' ;
8+ import { type CoinMap , getFormattedErc20Tokens } from '@bitgo/statics' ;
89
910export const register = ( sdk : BitGoBase ) : void => {
1011 sdk . register ( 'eth' , Eth . createInstance ) ;
@@ -18,3 +19,9 @@ export const register = (sdk: BitGoBase): void => {
1819 sdk . register ( name , coinConstructor ) ;
1920 } ) ;
2021} ;
22+
23+ export const registerWithCoinMap = ( sdk : BitGoBase , coinMap : CoinMap ) : void => {
24+ Erc20Token . createTokenConstructors ( getFormattedErc20Tokens ( coinMap ) ) . forEach ( ( { name, coinConstructor } ) => {
25+ sdk . register ( name , coinConstructor ) ;
26+ } ) ;
27+ } ;
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ function getErc20TokenConfig(coin: Erc20Coin): Erc20TokenConfig {
327327}
328328
329329// Get the list of ERC-20 tokens from statics and format it properly
330- const getFormattedErc20Tokens = ( customCoinMap = coins ) =>
330+ export const getFormattedErc20Tokens = ( customCoinMap = coins ) =>
331331 customCoinMap . reduce ( ( acc : Erc20TokenConfig [ ] , coin ) => {
332332 if ( coin instanceof Erc20Coin ) {
333333 acc . push ( getErc20TokenConfig ( coin ) ) ;
You can’t perform that action at this time.
0 commit comments