Skip to content

Commit 9d116c3

Browse files
Merge pull request #6851 from BitGo/WIN-6805
feat: gating some assets for BitGo Germany/BitGo Europe ApS/Frankfurt DE Trust
2 parents 7189dcc + 569bbb4 commit 9d116c3

File tree

7 files changed

+575
-166
lines changed

7 files changed

+575
-166
lines changed

modules/statics/src/account.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ export class AccountCoin extends BaseCoin {
6868
public static getFeaturesExcluding(excludedFeatures: CoinFeature[]): CoinFeature[] {
6969
return AccountCoin.DEFAULT_FEATURES.filter((feature) => !excludedFeatures.includes(feature));
7070
}
71+
72+
public static getFeaturesByTypeExcluding(
73+
excludedFeatures: CoinFeature[],
74+
baseFeatures: CoinFeature[] = AccountCoin.DEFAULT_FEATURES
75+
): CoinFeature[] {
76+
return baseFeatures.filter((feature) => !excludedFeatures.includes(feature));
77+
}
7178
}
7279

7380
export interface GasTankAccountConstructorOptions extends AccountConstructorOptions {

modules/statics/src/coins/avaxTokens.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ export const avaxTokens = [
6565
18,
6666
'0x48f88a3fe843ccb0b5003e70b4192c1d7448bef0',
6767
UnderlyingAsset['avaxc:cai'],
68-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
68+
AccountCoin.getFeaturesByTypeExcluding([
69+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
70+
CoinFeature.CUSTODY_BITGO_GERMANY,
71+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
72+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
73+
])
6974
),
7075
avaxErc20(
7176
'55d38f23-ed66-43b8-838c-e9df316c0140',
@@ -275,7 +280,12 @@ export const avaxTokens = [
275280
18,
276281
'0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be',
277282
UnderlyingAsset['avaxc:savax'],
278-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
283+
AccountCoin.getFeaturesByTypeExcluding([
284+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
285+
CoinFeature.CUSTODY_BITGO_GERMANY,
286+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
287+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
288+
])
279289
),
280290
avaxErc20(
281291
'772a2498-2bef-4da8-9bce-f1a89e6f4536',
@@ -604,15 +614,26 @@ export const avaxTokens = [
604614
8,
605615
'0x7c6a937943f135283a2561938de2200994a8f7a7',
606616
UnderlyingAsset['avaxc:note'],
607-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
617+
AccountCoin.getFeaturesByTypeExcluding([
618+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
619+
CoinFeature.CUSTODY_BITGO_GERMANY,
620+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
621+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
622+
])
608623
),
609624
avaxErc20(
610625
'929c8d8c-fff3-4702-9dc1-477c70400024',
611626
'avaxc:wrose',
612627
'Wrapped ROSE',
613628
18,
614629
'0x12af5c1a232675f62f405b5812a80e7a6f75d746',
615-
UnderlyingAsset['avaxc:wrose']
630+
UnderlyingAsset['avaxc:wrose'],
631+
AccountCoin.getFeaturesByTypeExcluding([
632+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
633+
CoinFeature.CUSTODY_BITGO_GERMANY,
634+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
635+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
636+
])
616637
),
617638
avaxErc20(
618639
'2511b910-85fb-4660-a8a5-bb137b237054',
@@ -645,7 +666,10 @@ export const avaxTokens = [
645666
18,
646667
'0x5e0e90e268bc247cc850c789a0db0d5c7621fb59',
647668
UnderlyingAsset['avaxc:nxpc'],
648-
AccountCoin.getFeaturesExcluding([CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE, CoinFeature.CUSTODY_BITGO_MENA_FZE])
669+
AccountCoin.getFeaturesByTypeExcluding([
670+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
671+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
672+
])
649673
),
650674
avaxErc20(
651675
'45e27c49-3064-41b4-ae5f-d0620cfbdd9d',

modules/statics/src/coins/bscTokens.ts

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ export const bscTokens = [
145145
18,
146146
'0xcebef3df1f3c5bfd90fde603e71f31a53b11944d',
147147
UnderlyingAsset['bsc:litt'],
148-
BSC_TOKEN_FEATURES
148+
AccountCoin.getFeaturesByTypeExcluding(
149+
[CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_EUROPE_APS, CoinFeature.CUSTODY_BITGO_FRANKFURT],
150+
BSC_TOKEN_FEATURES
151+
)
149152
),
150153
bscToken(
151154
'dd57bbfd-39c8-43a0-8094-c9d4d4843f2c',
@@ -244,7 +247,10 @@ export const bscTokens = [
244247
8,
245248
'0x8cd6e29d3686d24d3c2018cee54621ea0f89313b',
246249
UnderlyingAsset['bsc:nuls'],
247-
BSC_TOKEN_FEATURES
250+
AccountCoin.getFeaturesByTypeExcluding(
251+
[CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_EUROPE_APS, CoinFeature.CUSTODY_BITGO_FRANKFURT],
252+
BSC_TOKEN_FEATURES
253+
)
248254
),
249255
bscToken(
250256
'c465ea9e-de0b-4981-8024-f4b131d3093e',
@@ -361,11 +367,14 @@ export const bscTokens = [
361367
18,
362368
'0x2a459dd33f05ed8ea9584505cf04698be5654e6d',
363369
UnderlyingAsset['bsc:wrx'],
364-
AccountCoin.getFeaturesExcluding([
365-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
366-
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
367-
CoinFeature.CUSTODY_BITGO_MENA_FZE,
368-
])
370+
AccountCoin.getFeaturesByTypeExcluding(
371+
[
372+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
373+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
374+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
375+
],
376+
BSC_TOKEN_FEATURES
377+
)
369378
),
370379
bscToken(
371380
'1a26f668-9cde-4768-be8c-1fdcdf8e39e9',
@@ -644,7 +653,15 @@ export const bscTokens = [
644653
18,
645654
'0x5d5c5c1d14faf8ff704295b2f502daa9d06799a0',
646655
UnderlyingAsset['bsc:nnn'],
647-
BSC_TOKEN_FEATURES_EXCLUDE_SINGAPORE
656+
AccountCoin.getFeaturesByTypeExcluding(
657+
[
658+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
659+
CoinFeature.CUSTODY_BITGO_GERMANY,
660+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
661+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
662+
],
663+
BSC_TOKEN_FEATURES
664+
)
648665
),
649666
bscToken(
650667
'9b2925ed-7e66-4f60-b1bb-edae3931e9cd',
@@ -707,7 +724,10 @@ export const bscTokens = [
707724
18,
708725
'0xf00600ebc7633462bc4f9c61ea2ce99f5aaebd4a',
709726
UnderlyingAsset['bsc:wrose'],
710-
BSC_TOKEN_FEATURES
727+
AccountCoin.getFeaturesByTypeExcluding(
728+
[CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_EUROPE_APS, CoinFeature.CUSTODY_BITGO_FRANKFURT],
729+
BSC_TOKEN_FEATURES
730+
)
711731
),
712732
bscToken(
713733
'7c86c5bf-7952-4e25-a54b-d91f6d06782f',
@@ -1031,7 +1051,10 @@ export const bscTokens = [
10311051
8,
10321052
'0xd5d0322b6bab6a762c79f8c81a0b674778e13aed',
10331053
UnderlyingAsset['bsc:firo'],
1034-
BSC_TOKEN_FEATURES
1054+
AccountCoin.getFeaturesByTypeExcluding(
1055+
[CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_EUROPE_APS, CoinFeature.CUSTODY_BITGO_FRANKFURT],
1056+
BSC_TOKEN_FEATURES
1057+
)
10351058
),
10361059
bscToken(
10371060
'74b382c0-611a-4abf-ad2e-fedec28eb5e7',
@@ -1040,7 +1063,10 @@ export const bscTokens = [
10401063
18,
10411064
'0xc5f0f7b66764f6ec8c8dff7ba683102295e16409',
10421065
UnderlyingAsset['bsc:fdusd'],
1043-
BSC_TOKEN_FEATURES
1066+
AccountCoin.getFeaturesByTypeExcluding(
1067+
[CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_EUROPE_APS, CoinFeature.CUSTODY_BITGO_FRANKFURT],
1068+
BSC_TOKEN_FEATURES
1069+
)
10441070
),
10451071
bscToken(
10461072
'99f9276a-b2b7-471f-8e70-979559acd932',
@@ -1192,11 +1218,14 @@ export const bscTokens = [
11921218
18,
11931219
'0x9fb9a33956351cf4fa040f65a13b835a3c8764e3',
11941220
UnderlyingAsset['bsc:multi'],
1195-
AccountCoin.getFeaturesExcluding([
1196-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
1197-
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
1198-
CoinFeature.CUSTODY_BITGO_MENA_FZE,
1199-
])
1221+
AccountCoin.getFeaturesByTypeExcluding(
1222+
[
1223+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
1224+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
1225+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
1226+
],
1227+
BSC_TOKEN_FEATURES
1228+
)
12001229
),
12011230
bscToken(
12021231
'ec186a0f-8e7c-4844-92b0-630d4bce7eef',

0 commit comments

Comments
 (0)