@@ -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
@@ -987,12 +977,11 @@ export function erc20CompatibleAccountCoin(
987
977
* @param fullName Complete human-readable name of the token
988
978
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
989
979
* @param contractAddress Contract address of this 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 CELO main network.
994
- * @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
995
- * @param primaryKeyCurve The elliptic curve for this chain/token
980
+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin
981
+ * @param prefix ? Optional token prefix. Defaults to empty string
982
+ * @param suffix ? Optional token suffix. Defaults to token name.
983
+ * @param network ? Optional token network. Defaults to the testnet CELO network.
984
+ * @param features ? Features of this coin. Defaults to the CELO_FEATURES
996
985
*/
997
986
export function celoToken (
998
987
id : string ,
@@ -1001,7 +990,7 @@ export function celoToken(
1001
990
decimalPlaces : number ,
1002
991
contractAddress : string ,
1003
992
asset : UnderlyingAsset ,
1004
- features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
993
+ features : CoinFeature [ ] = CELO_FEATURES ,
1005
994
prefix = '' ,
1006
995
suffix : string = name . toUpperCase ( ) ,
1007
996
network : EthereumNetwork = Networks . main . celo ,
@@ -1035,10 +1024,10 @@ export function celoToken(
1035
1024
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
1036
1025
* @param contractAddress Contract address of this token
1037
1026
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
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 .
1041
- * @param features? Features of this coin . Defaults to the DEFAULT_FEATURES defined in `AccountCoin`
1027
+ * @param features ? Features of this coin . Defaults to the CELO_FEATURES excluding CUSTODY feature
1028
+ * @param prefix ? Optional token prefix . Defaults to empty string
1029
+ * @param suffix ? Optional token suffix . Defaults to token name .
1030
+ * @param network ? Optional token network . Defaults to the testnet CELO network.
1042
1031
*/
1043
1032
export function tceloToken (
1044
1033
id : string ,
@@ -1047,7 +1036,7 @@ export function tceloToken(
1047
1036
decimalPlaces : number ,
1048
1037
contractAddress : string ,
1049
1038
asset : UnderlyingAsset ,
1050
- features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
1039
+ features : CoinFeature [ ] = CELO_FEATURES ,
1051
1040
prefix = '' ,
1052
1041
suffix : string = name . toUpperCase ( ) ,
1053
1042
network : EthereumNetwork = Networks . test . celo
0 commit comments