@@ -530,6 +530,16 @@ export class FlrERC20Token extends ContractAddressDefinedToken {
530530 }
531531}
532532
533+ /**
534+ * The XDC network supports tokens
535+ * XDC Tokens are ERC20 tokens
536+ */
537+ export class XdcERC20Token extends ContractAddressDefinedToken {
538+ constructor ( options : Erc20ConstructorOptions ) {
539+ super ( options ) ;
540+ }
541+ }
542+
533543/**
534544 * The Xrp network supports tokens
535545 * Xrp tokens are identified by their issuer address
@@ -2856,6 +2866,96 @@ export function tflrErc20(
28562866 ) ;
28572867}
28582868
2869+ /**
2870+ * Factory function for XdcErc20 token instances.
2871+ *
2872+ * @param id uuid v4
2873+ * @param name unique identifier of the token
2874+ * @param fullName Complete human-readable name of the token
2875+ * @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
2876+ * @param contractAddress Contract address of this token
2877+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2878+ * @param prefix? Optional token prefix. Defaults to empty string
2879+ * @param suffix? Optional token suffix. Defaults to token name.
2880+ * @param network? Optional token network. Defaults to XDC mainnet network.
2881+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
2882+ * @param primaryKeyCurve The elliptic curve for this chain/token
2883+ */
2884+ export function xdcErc20 (
2885+ id : string ,
2886+ name : string ,
2887+ fullName : string ,
2888+ decimalPlaces : number ,
2889+ contractAddress : string ,
2890+ asset : UnderlyingAsset ,
2891+ features : CoinFeature [ ] = [ ...AccountCoin . DEFAULT_FEATURES , CoinFeature . EIP1559 ] ,
2892+ prefix = '' ,
2893+ suffix : string = name . toUpperCase ( ) ,
2894+ network : AccountNetwork = Networks . main . xdc ,
2895+ primaryKeyCurve : KeyCurve = KeyCurve . Secp256k1
2896+ ) {
2897+ return Object . freeze (
2898+ new XdcERC20Token ( {
2899+ id,
2900+ name,
2901+ fullName,
2902+ network,
2903+ contractAddress,
2904+ prefix,
2905+ suffix,
2906+ features,
2907+ decimalPlaces,
2908+ asset,
2909+ isToken : true ,
2910+ primaryKeyCurve,
2911+ baseUnit : BaseUnit . ETH ,
2912+ } )
2913+ ) ;
2914+ }
2915+
2916+ /**
2917+ * Factory function for XDC testnet XdcErc20 token instances.
2918+ *
2919+ * @param id uuid v4
2920+ * @param name unique identifier of the token
2921+ * @param fullName Complete human-readable name of the token
2922+ * @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
2923+ * @param contractAddress Contract address of this token
2924+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2925+ * @param prefix? Optional token prefix. Defaults to empty string
2926+ * @param suffix? Optional token suffix. Defaults to token name.
2927+ * @param network? Optional token network. Defaults to the XDC test network.
2928+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
2929+ * @param primaryKeyCurve The elliptic curve for this chain/token
2930+ */
2931+ export function txdcErc20 (
2932+ id : string ,
2933+ name : string ,
2934+ fullName : string ,
2935+ decimalPlaces : number ,
2936+ contractAddress : string ,
2937+ asset : UnderlyingAsset ,
2938+ features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
2939+ prefix = '' ,
2940+ suffix : string = name . toUpperCase ( ) ,
2941+ network : AccountNetwork = Networks . test . xdc ,
2942+ primaryKeyCurve : KeyCurve = KeyCurve . Secp256k1
2943+ ) {
2944+ return xdcErc20 (
2945+ id ,
2946+ name ,
2947+ fullName ,
2948+ decimalPlaces ,
2949+ contractAddress ,
2950+ asset ,
2951+ features ,
2952+ prefix ,
2953+ suffix ,
2954+ network ,
2955+ primaryKeyCurve
2956+ ) ;
2957+ }
2958+
28592959/**
28602960 * Factory function for xrp token instances.
28612961 *
0 commit comments