Skip to content

Commit

Permalink
Merge pull request #5014 from BitGo/COIN-1900-except-arbeth
Browse files Browse the repository at this point in the history
feat(statics): add token and coin ungating for trusts
  • Loading branch information
davidkaplanbitgo authored Oct 9, 2024
2 parents f2887c1 + 04ea06c commit b99fe3f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
17 changes: 12 additions & 5 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const SOL_FEATURES = [
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
];
const TSOL_FEATURES = [...SOL_FEATURES, CoinFeature.CUSTODY_BITGO_SINGAPORE];
const SOL_TOKEN_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD];
const STX_FEATURES = [
...AccountCoin.DEFAULT_FEATURES,
Expand Down Expand Up @@ -313,6 +314,7 @@ const TON_FEATURES = [
CoinFeature.TSS_COLD,
CoinFeature.STAKING,
CoinFeature.REBUILD_ON_CUSTODY_SIGNING,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
];
const ARBETH_FEATURES = [
...ETH_FEATURES,
Expand All @@ -339,6 +341,7 @@ const BERA_FEATURES = [
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
CoinFeature.BULK_TRANSACTION,
];
const ETH_FEATURES_WITH_FRANKFURT = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
export const coins = CoinMap.fromCoins([
...lightningCoins,
...utxoCoins,
Expand Down Expand Up @@ -773,7 +776,7 @@ export const coins = CoinMap.fromCoins([
9,
UnderlyingAsset.SOL,
BaseUnit.SOL,
SOL_FEATURES,
TSOL_FEATURES,
KeyCurve.Ed25519
),
account(
Expand Down Expand Up @@ -4982,7 +4985,8 @@ export const coins = CoinMap.fromCoins([
'Decentraland',
18,
'0x0f5d2fb29fb7d3cfee444a200298f468908cc942',
UnderlyingAsset.MANA
UnderlyingAsset.MANA,
ETH_FEATURES_WITH_FRANKFURT
),
erc20(
'8b9991bf-e8f2-4e9a-a07f-8243529b6d25',
Expand Down Expand Up @@ -5256,7 +5260,8 @@ export const coins = CoinMap.fromCoins([
'Moca',
18,
'0xf944e35f95e819e752f3ccb5faf40957d311e8c5',
UnderlyingAsset.MOCA
UnderlyingAsset.MOCA,
ETH_FEATURES_WITH_FRANKFURT
),
erc20(
'f1654a22-81cc-4798-b815-c9faa5ad5cd0',
Expand Down Expand Up @@ -7042,7 +7047,8 @@ export const coins = CoinMap.fromCoins([
'Tokenize',
8,
'0x667102bd3413bfeaa3dffb48fa8288819e480a88',
UnderlyingAsset.TKX
UnderlyingAsset.TKX,
ETH_FEATURES_WITH_FRANKFURT
),
erc20(
'ed5b27a1-eaab-4a02-a1d1-a07ad736c5fd',
Expand Down Expand Up @@ -7636,7 +7642,8 @@ export const coins = CoinMap.fromCoins([
'Wrapped Bitcoin',
8,
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
UnderlyingAsset.WBTC
UnderlyingAsset.WBTC,
ETH_FEATURES_WITH_FRANKFURT
),
erc20(
'f8a56e2b-55ae-4dc2-9fbc-2b1b162536a2',
Expand Down
12 changes: 10 additions & 2 deletions modules/statics/src/utxo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const DOGE_FEATURES = [
CoinFeature.CUSTODY_BITGO_SINGAPORE,
CoinFeature.CUSTODY_BITGO_NEW_YORK,
];

const DASH_FEATURES = [...UtxoCoin.DEFAULT_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
export const utxoCoins: Readonly<BaseCoin>[] = [
utxo(
'8d6e08d5-399f-414f-8430-6ceca1798cbf',
Expand Down Expand Up @@ -266,7 +266,15 @@ export const utxoCoins: Readonly<BaseCoin>[] = [
BaseUnit.LTC,
LTC_FEATURES
),
utxo('0739be6a-c72e-468d-9464-ca5601965708', 'dash', 'Dash', Networks.main.dash, UnderlyingAsset.DASH, BaseUnit.DASH),
utxo(
'0739be6a-c72e-468d-9464-ca5601965708',
'dash',
'Dash',
Networks.main.dash,
UnderlyingAsset.DASH,
BaseUnit.DASH,
DASH_FEATURES
),
utxo(
'5950d78f-e8dd-457a-ab5d-310e6b476bb1',
'tdash',
Expand Down
15 changes: 14 additions & 1 deletion modules/statics/test/unit/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
CoinFeature.CUSTODY_BITGO_SINGAPORE,
],
},
dash: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
matic: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
weth: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
eigen: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
Expand Down Expand Up @@ -130,6 +131,7 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
rbtc: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
sol: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
stx: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
ton: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
xlm: {
features: [
CoinFeature.CUSTODY_BITGO_GERMANY,
Expand All @@ -142,6 +144,10 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
usdc: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND, CoinFeature.CUSTODY_BITGO_NEW_YORK] },
shib: { features: [CoinFeature.CUSTODY_BITGO_NEW_YORK] },
injv2: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
moca: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
wbtc: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
tkx: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
mana: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
// Test Coins
talgo: {
features: [
Expand Down Expand Up @@ -275,7 +281,13 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
],
},
trbtc: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
tsol: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
tsol: {
features: [
CoinFeature.CUSTODY_BITGO_GERMANY,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.CUSTODY_BITGO_SINGAPORE,
],
},
tstx: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
txlm: {
features: [
Expand All @@ -287,6 +299,7 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
ttrx: { features: [CoinFeature.CUSTODY_BITGO_GERMANY, CoinFeature.CUSTODY_BITGO_FRANKFURT] },
tia: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
ttia: { features: [CoinFeature.CUSTODY_BITGO_SWITZERLAND] },
tton: { features: [CoinFeature.CUSTODY_BITGO_FRANKFURT] },
};

describe('CoinMap', function () {
Expand Down

0 comments on commit b99fe3f

Please sign in to comment.