Skip to content

Commit b84a7e7

Browse files
committed
feat(statics): scope wtgxx tokens to BitGo Trust only
Ticket: SCAAS-11102
1 parent 9f11793 commit b84a7e7

5 files changed

Lines changed: 100 additions & 5 deletions

File tree

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7496,7 +7496,7 @@ export const allCoinsAndTokens = [
74967496
18,
74977497
'0xfeb26f0943c3885b2cb85a9f933975356c81c33d',
74987498
UnderlyingAsset['arbeth:wtgxx'],
7499-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
7499+
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY
75007500
),
75017501
arbethErc20(
75027502
'54f5fdda-954e-4296-994b-a89247ad311f',
@@ -7890,7 +7890,7 @@ export const allCoinsAndTokens = [
78907890
18,
78917891
'0x870fd36b3bf7f5abeeea2c8d4abdf1dc4e33109d',
78927892
UnderlyingAsset['opeth:wtgxx'],
7893-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
7893+
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY
78947894
),
78957895
opethErc20(
78967896
'42729d3e-e010-43a9-91ea-378565b0aa51',

modules/statics/src/coinFeatures.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ export const SOL_TOKEN_FEATURES = [
325325
export const SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE = SOL_TOKEN_FEATURES.filter(
326326
(feature) => feature !== CoinFeature.CUSTODY_BITGO_SINGAPORE
327327
);
328+
export const SOL_TOKEN_FEATURES_TRUST_ONLY = SOL_TOKEN_FEATURES.filter(
329+
(feature) => feature === CoinFeature.CUSTODY_BITGO_TRUST || !BITGO_CUSTODY_JURISDICTIONS.includes(feature)
330+
);
328331
export const SOL_OFC_TOKEN_FEATURES = [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD];
329332
export const APT_OFC_TOKEN_FEATURES = [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD];
330333

modules/statics/src/coins/erc20Coins.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
ZETA_EVM_FEATURES,
2626
ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE_AND_MENA_FZE,
2727
ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE,
28+
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY,
2829
} from '../coinFeatures';
2930

3031
export const erc20Coins = [
@@ -7064,7 +7065,7 @@ export const erc20Coins = [
70647065
18,
70657066
'0x1fecf3d9d4fee7f2c02917a66028a48c6706c179',
70667067
UnderlyingAsset.WTGXX,
7067-
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
7068+
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY
70687069
),
70697070
erc20(
70707071
'acf1b526-75e0-47f8-b812-32893f85b180',
@@ -15199,7 +15200,7 @@ export const erc20Coins = [
1519915200
18,
1520015201
'0x0b2517eef907389f36fd87add36e9118d364bd67',
1520115202
UnderlyingAsset['sepeth:wtgxx'],
15202-
[...ACCOUNT_COIN_DEFAULT_FEATURES_EXCLUDE_SINGAPORE],
15203+
[...ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY],
1520315204
undefined,
1520415205
undefined,
1520515206
Networks.test.sepolia

modules/statics/src/coins/solTokens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
SOL_TOKEN_FEATURES,
55
SOL_TOKEN_FEATURES_EXCLUDE_EUROPE,
66
SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE,
7+
SOL_TOKEN_FEATURES_TRUST_ONLY,
78
SOL_TOKEN_FEATURES_WITH_FRANKFURT,
89
SOL_TOKEN_FEATURES_WITH_FRANKFURT_GERMANY,
910
} from '../coinFeatures';
@@ -4292,7 +4293,7 @@ export const solTokens = [
42924293
'Em46fxxwgY2RRoUbBMSbEjJwY62x3ESMNdhnsGpEKewm',
42934294
'Em46fxxwgY2RRoUbBMSbEjJwY62x3ESMNdhnsGpEKewm',
42944295
UnderlyingAsset['sol:wtgxx'],
4295-
SOL_TOKEN_FEATURES,
4296+
SOL_TOKEN_FEATURES_TRUST_ONLY,
42964297
ProgramID.Token2022ProgramId
42974298
),
42984299
solToken(

modules/statics/test/unit/coins.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,59 @@ const coinsWithExcludedFeatures: Record<string, { features: CoinFeature[] }> = {
734734
CoinFeature.CUSTODY_BITGO_INDIA,
735735
],
736736
},
737+
wtgxx: {
738+
features: [
739+
CoinFeature.ACCOUNT_MODEL,
740+
CoinFeature.REQUIRES_BIG_NUMBER,
741+
CoinFeature.VALUELESS_TRANSFER,
742+
CoinFeature.TRANSACTION_DATA,
743+
CoinFeature.CUSTODY,
744+
CoinFeature.CUSTODY_BITGO_TRUST,
745+
],
746+
},
747+
'arbeth:wtgxx': {
748+
features: [
749+
CoinFeature.ACCOUNT_MODEL,
750+
CoinFeature.REQUIRES_BIG_NUMBER,
751+
CoinFeature.VALUELESS_TRANSFER,
752+
CoinFeature.TRANSACTION_DATA,
753+
CoinFeature.CUSTODY,
754+
CoinFeature.CUSTODY_BITGO_TRUST,
755+
],
756+
},
757+
'opeth:wtgxx': {
758+
features: [
759+
CoinFeature.ACCOUNT_MODEL,
760+
CoinFeature.REQUIRES_BIG_NUMBER,
761+
CoinFeature.VALUELESS_TRANSFER,
762+
CoinFeature.TRANSACTION_DATA,
763+
CoinFeature.CUSTODY,
764+
CoinFeature.CUSTODY_BITGO_TRUST,
765+
],
766+
},
767+
'sepeth:wtgxx': {
768+
features: [
769+
CoinFeature.ACCOUNT_MODEL,
770+
CoinFeature.REQUIRES_BIG_NUMBER,
771+
CoinFeature.VALUELESS_TRANSFER,
772+
CoinFeature.TRANSACTION_DATA,
773+
CoinFeature.CUSTODY,
774+
CoinFeature.CUSTODY_BITGO_TRUST,
775+
],
776+
},
777+
'sol:wtgxx': {
778+
features: [
779+
CoinFeature.ACCOUNT_MODEL,
780+
CoinFeature.REQUIRES_BIG_NUMBER,
781+
CoinFeature.VALUELESS_TRANSFER,
782+
CoinFeature.TRANSACTION_DATA,
783+
CoinFeature.CUSTODY,
784+
CoinFeature.CUSTODY_BITGO_TRUST,
785+
CoinFeature.TSS,
786+
CoinFeature.TSS_COLD,
787+
CoinFeature.BULK_TRANSACTION,
788+
],
789+
},
737790
};
738791

739792
describe('CoinMap', function () {
@@ -1028,6 +1081,43 @@ coins.forEach((coin, coinName) => {
10281081
});
10291082
});
10301083

1084+
describe('WTGXX Trust-only custody', () => {
1085+
const nonTrustCustodyFeatures = [
1086+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
1087+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
1088+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
1089+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
1090+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
1091+
CoinFeature.CUSTODY_BITGO_INDIA,
1092+
CoinFeature.CUSTODY_BITGO_KOREA,
1093+
CoinFeature.CUSTODY_BITGO_GERMANY,
1094+
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
1095+
CoinFeature.CUSTODY_BITGO_NEW_YORK,
1096+
CoinFeature.CUSTODY_BITGO_SISTER_TRUST_ONE,
1097+
];
1098+
1099+
[
1100+
'wtgxx',
1101+
'arbeth:wtgxx',
1102+
'opeth:wtgxx',
1103+
'sepeth:wtgxx',
1104+
'sol:wtgxx',
1105+
'ofcwtgxx',
1106+
'ofcarbeth:wtgxx',
1107+
'ofcopeth:wtgxx',
1108+
'ofcsol:wtgxx',
1109+
'ofcsepeth:wtgxx',
1110+
].forEach((name) => {
1111+
it(`${name} is licensed only for BitGo Trust`, function () {
1112+
const coin = coins.get(name);
1113+
coin.features.includes(CoinFeature.CUSTODY_BITGO_TRUST).should.eql(true);
1114+
nonTrustCustodyFeatures.forEach((feature) => {
1115+
coin.features.includes(feature).should.eql(false);
1116+
});
1117+
});
1118+
});
1119+
});
1120+
10311121
describe('ERC20 Coins', () => {
10321122
it('should have no duplicate contract addresses', () => {
10331123
coins

0 commit comments

Comments
 (0)