Skip to content

Commit

Permalink
Merge pull request #5401 from BitGo/COPS-3277
Browse files Browse the repository at this point in the history
feat(bitgo): add bitgo mena fze entity
  • Loading branch information
Mustafiz04 authored Jan 21, 2025
2 parents 225c0de + 76670a2 commit 7187bf9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/statics/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class AccountCoin extends BaseCoin {
CoinFeature.TRANSACTION_DATA,
CoinFeature.CUSTODY,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
CoinFeature.CUSTODY_BITGO_KOREA,
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
Expand Down
1 change: 1 addition & 0 deletions modules/statics/src/ada.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class Ada extends BaseCoin {
CoinFeature.TRANSACTION_DATA,
CoinFeature.REQUIRES_BIG_NUMBER,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
CoinFeature.STAKING,
CoinFeature.BULK_TRANSACTION,
];
Expand Down
1 change: 1 addition & 0 deletions modules/statics/src/avaxp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class AVAXPCoin extends BaseCoin {
public static readonly DEFAULT_FEATURES = [
CoinFeature.UNSPENT_MODEL,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.MULTISIG_COLD,
Expand Down
4 changes: 4 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ export enum CoinFeature {
* This coin supports custody in BitGo Europe ApS entities
*/
CUSTODY_BITGO_EUROPE_APS = 'custody-bitgo-europe-aps',
/**
* This coin supports custody in BitGo MENA FZE entities
*/
CUSTODY_BITGO_MENA_FZE = 'custody-bitgo-mena-fze',
/*
* This coin has transactions that expire after a certain amount of time.
*/
Expand Down
7 changes: 6 additions & 1 deletion modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ const XTZ_FEATURES = [
...AccountCoin.DEFAULT_FEATURES,
CoinFeature.MULTISIG_COLD,
CoinFeature.ENTERPRISE_PAYS_FEES,
].filter((feature) => feature !== CoinFeature.CUSTODY && feature !== CoinFeature.CUSTODY_BITGO_TRUST);
].filter(
(feature) =>
feature !== CoinFeature.CUSTODY &&
feature !== CoinFeature.CUSTODY_BITGO_TRUST &&
feature !== CoinFeature.CUSTODY_BITGO_MENA_FZE
);

const XRP_FEATURES = [
...AccountCoin.DEFAULT_FEATURES,
Expand Down
1 change: 1 addition & 0 deletions modules/statics/src/ofc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class OfcCoin extends BaseCoin {
CoinFeature.REQUIRES_BIG_NUMBER,
CoinFeature.CUSTODY,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
];

// If set, this coin is the native address format for this token.
Expand Down
1 change: 1 addition & 0 deletions modules/statics/src/utxo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class UtxoCoin extends BaseCoin {
CoinFeature.CHILD_PAYS_FOR_PARENT,
CoinFeature.CUSTODY,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
CoinFeature.MULTISIG_COLD,
CoinFeature.PAYGO,
];
Expand Down
6 changes: 6 additions & 0 deletions modules/statics/test/unit/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,15 @@ coins.forEach((coin, coinName) => {
it(`should return true for CUSTODY_BITGO_TRUST ${coin.family} coin feature`, () => {
coin.features.includes(CoinFeature.CUSTODY_BITGO_TRUST).should.eql(true);
});

it(`should return true for CUSTODY_BITGO_MENA_FZE ${coin.family} coin feature`, () => {
coin.features.includes(CoinFeature.CUSTODY_BITGO_MENA_FZE).should.eql(true);
});
} else if (coin.family === CoinFamily.XTZ || coin.features.includes(CoinFeature.GENERIC_TOKEN)) {
it(`should return false for all custody ${coin.family} coin feature`, () => {
coin.features.includes(CoinFeature.CUSTODY).should.eql(false);
coin.features.includes(CoinFeature.CUSTODY_BITGO_TRUST).should.eql(false);
coin.features.includes(CoinFeature.CUSTODY_BITGO_MENA_FZE).should.eql(false);
coin.features.includes(CoinFeature.CUSTODY_BITGO_NEW_YORK).should.eql(false);
coin.features.includes(CoinFeature.CUSTODY_BITGO_GERMANY).should.eql(false);
coin.features.includes(CoinFeature.CUSTODY_BITGO_SWITZERLAND).should.eql(false);
Expand All @@ -629,6 +634,7 @@ coins.forEach((coin, coinName) => {
const coinSupportsCustody = coin.family !== CoinFamily.LNBTC;
coin.features.includes(CoinFeature.CUSTODY).should.eql(coinSupportsCustody);
coin.features.includes(CoinFeature.CUSTODY_BITGO_TRUST).should.eql(coinSupportsCustody);
coin.features.includes(CoinFeature.CUSTODY_BITGO_MENA_FZE).should.eql(coinSupportsCustody);
});

it('should return false for all non-SD coin feature', () => {
Expand Down

0 comments on commit 7187bf9

Please sign in to comment.