@@ -2,6 +2,11 @@ import { BaseCoin, BaseUnit, CoinFeature, CoinKind, KeyCurve, UnderlyingAsset }
2
2
import { DOMAIN_PATTERN , HEDERA_NODE_ACCCOUNT_ID } from './constants' ;
3
3
import { InvalidContractAddressError , InvalidDomainError } from './errors' ;
4
4
import { AccountNetwork , BaseNetwork , EthereumNetwork , Networks , TronNetwork } from './networks' ;
5
+ import {
6
+ ACCOUNT_COIN_DEFAULT_FEATURES ,
7
+ ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE ,
8
+ CELO_FEATURES ,
9
+ } from './coinFeatures' ;
5
10
6
11
export interface AccountConstructorOptions {
7
12
id : string ;
@@ -27,25 +32,10 @@ export interface AccountConstructorOptions {
27
32
* "pieces" of coin which belong to an address.
28
33
*/
29
34
export class AccountCoin extends BaseCoin {
30
- public static readonly DEFAULT_FEATURES = [
31
- CoinFeature . ACCOUNT_MODEL ,
32
- CoinFeature . REQUIRES_BIG_NUMBER ,
33
- CoinFeature . VALUELESS_TRANSFER ,
34
- CoinFeature . TRANSACTION_DATA ,
35
- CoinFeature . CUSTODY ,
36
- CoinFeature . CUSTODY_BITGO_TRUST ,
37
- CoinFeature . CUSTODY_BITGO_MENA_FZE ,
38
- CoinFeature . CUSTODY_BITGO_CUSTODY_MENA_FZE ,
39
- CoinFeature . CUSTODY_BITGO_SINGAPORE ,
40
- CoinFeature . CUSTODY_BITGO_KOREA ,
41
- CoinFeature . CUSTODY_BITGO_EUROPE_APS ,
42
- CoinFeature . CUSTODY_BITGO_FRANKFURT ,
43
- ] ;
35
+ public static readonly DEFAULT_FEATURES = ACCOUNT_COIN_DEFAULT_FEATURES ;
44
36
45
37
// Need to gate some high risk coin from SINGAPORE trust
46
- public static readonly DEFAULT_FEATURES_EXCLUDE_SINGAPORE = AccountCoin . DEFAULT_FEATURES . filter (
47
- ( feature ) => feature !== CoinFeature . CUSTODY_BITGO_SINGAPORE
48
- ) ;
38
+ public static readonly DEFAULT_FEATURES_EXCLUDE_SINGAPORE = ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE ;
49
39
50
40
public readonly network : AccountNetwork ;
51
41
@@ -997,12 +987,11 @@ export function erc20CompatibleAccountCoin(
997
987
* @param fullName Complete human-readable name of the token
998
988
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
999
989
* @param contractAddress Contract address of this token
1000
- * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1001
- * @param prefix? Optional token prefix. Defaults to empty string
1002
- * @param suffix? Optional token suffix. Defaults to token name.
1003
- * @param network? Optional token network. Defaults to CELO main network.
1004
- * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
1005
- * @param primaryKeyCurve The elliptic curve for this chain/token
990
+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin
991
+ * @param prefix ? Optional token prefix. Defaults to empty string
992
+ * @param suffix ? Optional token suffix. Defaults to token name.
993
+ * @param network ? Optional token network. Defaults to the testnet CELO network.
994
+ * @param features ? Features of this coin. Defaults to the CELO_FEATURES
1006
995
*/
1007
996
export function celoToken (
1008
997
id : string ,
@@ -1011,7 +1000,7 @@ export function celoToken(
1011
1000
decimalPlaces : number ,
1012
1001
contractAddress : string ,
1013
1002
asset : UnderlyingAsset ,
1014
- features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
1003
+ features : CoinFeature [ ] = CELO_FEATURES ,
1015
1004
prefix = '' ,
1016
1005
suffix : string = name . toUpperCase ( ) ,
1017
1006
network : EthereumNetwork = Networks . main . celo ,
@@ -1045,10 +1034,10 @@ export function celoToken(
1045
1034
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
1046
1035
* @param contractAddress Contract address of this token
1047
1036
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1048
- * @param prefix? Optional token prefix . Defaults to empty string
1049
- * @param suffix ? Optional token suffix . Defaults to token name.
1050
- * @param network ? Optional token network . Defaults to the testnet CELO network .
1051
- * @param features? Features of this coin . Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
1037
+ * @param features ? Features of this coin . Defaults to the CELO_FEATURES excluding CUSTODY feature
1038
+ * @param prefix ? Optional token prefix . Defaults to empty string
1039
+ * @param suffix ? Optional token suffix . Defaults to token name .
1040
+ * @param network ? Optional token network . Defaults to the testnet CELO network.
1052
1041
*/
1053
1042
export function tceloToken (
1054
1043
id : string ,
@@ -1057,7 +1046,7 @@ export function tceloToken(
1057
1046
decimalPlaces : number ,
1058
1047
contractAddress : string ,
1059
1048
asset : UnderlyingAsset ,
1060
- features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
1049
+ features : CoinFeature [ ] = CELO_FEATURES ,
1061
1050
prefix = '' ,
1062
1051
suffix : string = name . toUpperCase ( ) ,
1063
1052
network : EthereumNetwork = Networks . test . celo
0 commit comments