@@ -2398,3 +2398,113 @@ export function tofcTonToken(
23982398 } )
23992399 ) ;
24002400}
2401+
2402+ /**
2403+ * Factory function for testnet ofc ton token instances.
2404+ *
2405+ * @param id uuid v4
2406+ * @param name unique identifier of the coin
2407+ * @param fullName Complete human-readable name of the coin
2408+ * @param network Network object for this coin
2409+ * @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2410+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2411+ * @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2412+ * @param prefix? Optional coin prefix. Defaults to empty string
2413+ * @param suffix? Optional coin suffix. Defaults to coin name.
2414+ * @param isToken? Whether or not this account coin is a token of another coin
2415+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2416+ * @param primaryKeyCurve The elliptic curve for this chain/token
2417+ */
2418+ export function ofcSuiToken (
2419+ id : string ,
2420+ name : string ,
2421+ fullName : string ,
2422+ decimalPlaces : number ,
2423+ asset : UnderlyingAsset ,
2424+ kind : CoinKind = CoinKind . CRYPTO ,
2425+ features : CoinFeature [ ] = OfcCoin . DEFAULT_FEATURES ,
2426+ prefix = '' ,
2427+ suffix : string = name . replace ( / ^ o f c / , '' ) . toUpperCase ( ) ,
2428+ network : OfcNetwork = Networks . main . ofc ,
2429+ isToken = true ,
2430+ addressCoin = 'sui' ,
2431+ primaryKeyCurve : KeyCurve = KeyCurve . Secp256k1
2432+ ) {
2433+ const filteredFeatures = getFilteredFeatures ( suffix ) ;
2434+ if ( filteredFeatures . length > 0 ) {
2435+ features = filteredFeatures ;
2436+ }
2437+ return Object . freeze (
2438+ new OfcCoin ( {
2439+ id,
2440+ name,
2441+ fullName,
2442+ network,
2443+ prefix,
2444+ suffix,
2445+ features,
2446+ decimalPlaces,
2447+ isToken,
2448+ asset,
2449+ kind,
2450+ addressCoin,
2451+ primaryKeyCurve,
2452+ baseUnit : BaseUnit . SUI ,
2453+ } )
2454+ ) ;
2455+ }
2456+
2457+ /**
2458+ * Factory function for testnet ofc ton token instances.
2459+ *
2460+ * @param id uuid v4
2461+ * @param name unique identifier of the coin
2462+ * @param fullName Complete human-readable name of the coin
2463+ * @param network Network object for this coin
2464+ * @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2465+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2466+ * @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2467+ * @param prefix? Optional coin prefix. Defaults to empty string
2468+ * @param suffix? Optional coin suffix. Defaults to coin name.
2469+ * @param isToken? Whether or not this account coin is a token of another coin
2470+ * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2471+ * @param primaryKeyCurve The elliptic curve for this chain/token
2472+ */
2473+ export function tofcSuiToken (
2474+ id : string ,
2475+ name : string ,
2476+ fullName : string ,
2477+ decimalPlaces : number ,
2478+ asset : UnderlyingAsset ,
2479+ kind : CoinKind = CoinKind . CRYPTO ,
2480+ features : CoinFeature [ ] = OfcCoin . DEFAULT_FEATURES ,
2481+ prefix = '' ,
2482+ suffix : string = name . replace ( / ^ o f c / , '' ) . toUpperCase ( ) ,
2483+ network : OfcNetwork = Networks . test . ofc ,
2484+ isToken = true ,
2485+ addressCoin = 'tsui' ,
2486+ primaryKeyCurve : KeyCurve = KeyCurve . Secp256k1
2487+ ) {
2488+ const filteredFeatures = getFilteredFeatures ( suffix ) ;
2489+ if ( filteredFeatures . length > 0 ) {
2490+ features = filteredFeatures ;
2491+ }
2492+ return Object . freeze (
2493+ new OfcCoin ( {
2494+ id,
2495+ name,
2496+ fullName,
2497+ network,
2498+ prefix,
2499+ suffix,
2500+ features,
2501+ decimalPlaces,
2502+ isToken,
2503+ asset,
2504+ kind,
2505+ addressCoin,
2506+ primaryKeyCurve,
2507+ baseUnit : BaseUnit . SUI ,
2508+ } )
2509+ ) ;
2510+ }
0 commit comments