11import { erc20 , erc20Token , terc20 } from '../account' ;
22import { BaseCoin , CoinFeature , UnderlyingAsset } from '../base' ;
33import { AccountNetwork , EthereumNetwork , Networks } from '../networks' ;
4- import { ofcerc20 , tofcerc20 } from '../ofc' ;
4+ import { getFilteredFeatures , ofcerc20 , tofcerc20 } from '../ofc' ;
55
66// --- Shared config interfaces ---
77
@@ -20,6 +20,7 @@ interface BaseErc20Config {
2020interface Erc20WithOfcConfig extends BaseErc20Config {
2121 ofcId : string ;
2222 ofcName : string ;
23+ ofcFeatures : CoinFeature [ ] ;
2324 ofcAddressCoin ?: string ;
2425 skipOfc ?: false ;
2526}
@@ -35,7 +36,7 @@ type Erc20TokenConfig = Erc20Config & { network: AccountNetwork };
3536
3637function createOfcCoin (
3738 config : Erc20WithOfcConfig ,
38- onchainFeatures : CoinFeature [ ] ,
39+ features : CoinFeature [ ] ,
3940 defaultAddressCoin : string ,
4041 isTestnet : boolean
4142) {
@@ -48,7 +49,7 @@ function createOfcCoin(
4849 config . decimalPlaces ,
4950 config . asset ,
5051 undefined , // kind
51- undefined ,
52+ getFilteredFeatures ( features ) ,
5253 undefined , // prefix
5354 undefined , // suffix
5455 undefined , // network
@@ -75,7 +76,7 @@ export function generateErc20Coin(config: Erc20CoinConfig): Readonly<BaseCoin>[]
7576
7677 if ( config . skipOfc ) return [ onChain ] ;
7778
78- return [ onChain , createOfcCoin ( config , onChain . features , 'eth' , false ) ] ;
79+ return [ onChain , createOfcCoin ( config , config . ofcFeatures ?? onChain . features , 'eth' , false ) ] ;
7980}
8081
8182export function generateTestErc20Coin ( config : Erc20CoinConfig ) : Readonly < BaseCoin > [ ] {
@@ -94,7 +95,7 @@ export function generateTestErc20Coin(config: Erc20CoinConfig): Readonly<BaseCoi
9495
9596 if ( config . skipOfc ) return [ onChain ] ;
9697
97- return [ onChain , createOfcCoin ( config , onChain . features , 'teth' , true ) ] ;
98+ return [ onChain , createOfcCoin ( config , config . ofcFeatures ?? onChain . features , 'teth' , true ) ] ;
9899}
99100
100101// --- ERC20 Token generators (erc20Token for non-Ethereum EVM chains) ---
0 commit comments