@@ -2618,3 +2618,111 @@ export function tofcTempoToken(
26182618 } )
26192619 ) ;
26202620}
2621+
2622+ /**
2623+ * Factory function for ofc ada token instances.
2624+ *
2625+ * @param id uuid v4
2626+ * @param name unique identifier of the coin
2627+ * @param fullName Complete human-readable name of the coin
2628+ * @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2629+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2630+ * @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2631+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2632+ * @param prefix? Optional coin prefix. Defaults to empty string
2633+ * @param suffix? Optional coin suffix. Defaults to coin name.
2634+ * @param isToken? Whether or not this account coin is a token of another coin
2635+ * @param primaryKeyCurve The elliptic curve for this chain/token
2636+ */
2637+ export function ofcAdaToken (
2638+ id : string ,
2639+ name : string ,
2640+ fullName : string ,
2641+ decimalPlaces : number ,
2642+ asset : UnderlyingAsset ,
2643+ kind : CoinKind = CoinKind . CRYPTO ,
2644+ features : CoinFeature [ ] = [ ...OfcCoin . DEFAULT_FEATURES , CoinFeature . REQUIRES_RESERVE ] ,
2645+ prefix = '' ,
2646+ suffix : string = name . replace ( / ^ o f c / , '' ) . toUpperCase ( ) ,
2647+ network : OfcNetwork = Networks . main . ofc ,
2648+ isToken = true ,
2649+ addressCoin = 'ada' ,
2650+ primaryKeyCurve : KeyCurve = KeyCurve . Ed25519
2651+ ) {
2652+ const filteredFeatures = getFilteredFeatures ( suffix ) ;
2653+ if ( filteredFeatures . length > 0 ) {
2654+ features = filteredFeatures ;
2655+ }
2656+ return Object . freeze (
2657+ new OfcCoin ( {
2658+ id,
2659+ name,
2660+ fullName,
2661+ network,
2662+ prefix,
2663+ suffix,
2664+ features,
2665+ decimalPlaces,
2666+ isToken,
2667+ asset,
2668+ kind,
2669+ addressCoin,
2670+ primaryKeyCurve,
2671+ baseUnit : BaseUnit . ADA ,
2672+ } )
2673+ ) ;
2674+ }
2675+
2676+ /**
2677+ * Factory function for testnet ofc ada token instances.
2678+ *
2679+ * @param id uuid v4
2680+ * @param name unique identifier of the coin
2681+ * @param fullName Complete human-readable name of the coin
2682+ * @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2683+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2684+ * @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2685+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2686+ * @param prefix? Optional coin prefix. Defaults to empty string
2687+ * @param suffix? Optional coin suffix. Defaults to coin name.
2688+ * @param isToken? Whether or not this account coin is a token of another coin
2689+ * @param primaryKeyCurve The elliptic curve for this chain/token
2690+ */
2691+ export function tofcAdaToken (
2692+ id : string ,
2693+ name : string ,
2694+ fullName : string ,
2695+ decimalPlaces : number ,
2696+ asset : UnderlyingAsset ,
2697+ kind : CoinKind = CoinKind . CRYPTO ,
2698+ features : CoinFeature [ ] = [ ...OfcCoin . DEFAULT_FEATURES , CoinFeature . REQUIRES_RESERVE ] ,
2699+ prefix = '' ,
2700+ suffix : string = name . replace ( / ^ o f c / , '' ) . toUpperCase ( ) ,
2701+ network : OfcNetwork = Networks . test . ofc ,
2702+ isToken = true ,
2703+ addressCoin = 'tada' ,
2704+ primaryKeyCurve : KeyCurve = KeyCurve . Ed25519
2705+ ) {
2706+ const filteredFeatures = getFilteredFeatures ( suffix ) ;
2707+ if ( filteredFeatures . length > 0 ) {
2708+ features = filteredFeatures ;
2709+ }
2710+ return Object . freeze (
2711+ new OfcCoin ( {
2712+ id,
2713+ name,
2714+ fullName,
2715+ network,
2716+ prefix,
2717+ suffix,
2718+ features,
2719+ decimalPlaces,
2720+ isToken,
2721+ asset,
2722+ kind,
2723+ addressCoin,
2724+ primaryKeyCurve,
2725+ baseUnit : BaseUnit . ADA ,
2726+ } )
2727+ ) ;
2728+ }
0 commit comments