Skip to content

Commit 88ba6bb

Browse files
authored
Merge pull request #5300 from BitGo/WP-1219/add-eip1559-statics
feat(sdk): added eip1559 property to statics
2 parents 390f655 + a336f67 commit 88ba6bb

File tree

4 files changed

+59
-8
lines changed

4 files changed

+59
-8
lines changed

modules/statics/src/account.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ export function polygonErc20(
16781678
decimalPlaces: number,
16791679
contractAddress: string,
16801680
asset: UnderlyingAsset,
1681-
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
1681+
features: CoinFeature[] = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.EIP1559],
16821682
prefix = '',
16831683
suffix: string = name.toUpperCase(),
16841684
network: AccountNetwork = Networks.main.polygon,
@@ -1768,7 +1768,7 @@ export function arbethErc20(
17681768
decimalPlaces: number,
17691769
contractAddress: string,
17701770
asset: UnderlyingAsset,
1771-
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
1771+
features: CoinFeature[] = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.EIP1559],
17721772
prefix = '',
17731773
suffix: string = name.toUpperCase(),
17741774
network: AccountNetwork = Networks.main.arbitrum,
@@ -1858,7 +1858,7 @@ export function opethErc20(
18581858
decimalPlaces: number,
18591859
contractAddress: string,
18601860
asset: UnderlyingAsset,
1861-
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
1861+
features: CoinFeature[] = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.EIP1559],
18621862
prefix = '',
18631863
suffix: string = name.toUpperCase(),
18641864
network: AccountNetwork = Networks.main.optimism,
@@ -2038,7 +2038,7 @@ export function beraErc20(
20382038
decimalPlaces: number,
20392039
contractAddress: string,
20402040
asset: UnderlyingAsset,
2041-
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
2041+
features: CoinFeature[] = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.EIP1559],
20422042
prefix = '',
20432043
suffix: string = name.toUpperCase(),
20442044
network: AccountNetwork = Networks.main.bera,

modules/statics/src/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ export enum CoinFeature {
304304
* This coin is onboarded on etheruem rollup chain
305305
*/
306306
ETH_ROLLUP_CHAIN = 'eth-rollup-chain',
307+
308+
/**
309+
* This coin supports EIP1559 proposal for transaction fee
310+
*/
311+
EIP1559 = 'EIP1559',
307312
}
308313

309314
/**

modules/statics/src/coins.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ const AVAXC_FEATURES = [
9797
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
9898
CoinFeature.CUSTODY_BITGO_SINGAPORE,
9999
CoinFeature.MULTISIG_COLD,
100+
CoinFeature.EIP1559,
100101
];
101102
const CELO_FEATURES = [
102103
...ETH_FEATURES,
103104
CoinFeature.CUSTODY_BITGO_GERMANY,
104105
CoinFeature.CUSTODY_BITGO_FRANKFURT,
105106
CoinFeature.CUSTODY_BITGO_SINGAPORE,
106107
CoinFeature.MULTISIG_COLD,
108+
CoinFeature.EIP1559,
107109
];
108110
const ETH2_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS];
109111
const RBTC_FEATURES = [
@@ -162,7 +164,7 @@ const ALGO_FEATURES = [
162164
CoinFeature.MULTISIG_COLD,
163165
CoinFeature.BULK_TRANSACTION,
164166
];
165-
const HTETH_TOKEN_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.BULK_TRANSACTION];
167+
const HTETH_TOKEN_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.BULK_TRANSACTION, CoinFeature.EIP1559];
166168
const ADA_FEATURES = [...Ada.DEFAULT_FEATURES, CoinFeature.BULK_TRANSACTION];
167169
const ADA_FEATURES_WITH_FRANKFURT = [...ADA_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
168170
const DOT_FEATURES = [
@@ -368,6 +370,7 @@ const ARBETH_FEATURES = [
368370
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
369371
CoinFeature.ETH_ROLLUP_CHAIN,
370372
CoinFeature.CUSTODY_BITGO_FRANKFURT,
373+
CoinFeature.EIP1559,
371374
];
372375
const OPETH_FEATURES = [
373376
...ETH_FEATURES,
@@ -376,13 +379,15 @@ const OPETH_FEATURES = [
376379
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
377380
CoinFeature.ETH_ROLLUP_CHAIN,
378381
CoinFeature.CUSTODY_BITGO_FRANKFURT,
382+
CoinFeature.EIP1559,
379383
];
380384
const ZKETH_FEATURES = [
381385
...ETH_FEATURES,
382386
CoinFeature.MULTISIG_COLD,
383387
CoinFeature.EVM_WALLET,
384388
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
385389
CoinFeature.ETH_ROLLUP_CHAIN,
390+
CoinFeature.EIP1559,
386391
];
387392
const BERA_FEATURES = [
388393
...ETH_FEATURES,
@@ -392,6 +397,7 @@ const BERA_FEATURES = [
392397
CoinFeature.EVM_WALLET,
393398
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
394399
CoinFeature.BULK_TRANSACTION,
400+
CoinFeature.EIP1559,
395401
];
396402
const OAS_FEATURES = [
397403
...ETH_FEATURES,
@@ -401,6 +407,7 @@ const OAS_FEATURES = [
401407
CoinFeature.EVM_WALLET,
402408
CoinFeature.BULK_TRANSACTION,
403409
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
410+
CoinFeature.EIP1559,
404411
];
405412
const COREDAO_FEATURES = [
406413
...ETH_FEATURES,
@@ -410,7 +417,9 @@ const COREDAO_FEATURES = [
410417
CoinFeature.EVM_WALLET,
411418
CoinFeature.BULK_TRANSACTION,
412419
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
420+
CoinFeature.EIP1559,
413421
CoinFeature.STAKING,
422+
CoinFeature.EIP1559,
414423
];
415424
const APT_FEATURES = [
416425
...AccountCoin.DEFAULT_FEATURES,
@@ -586,6 +595,7 @@ export const coins = CoinMap.fromCoins([
586595
CoinFeature.BULK_TRANSACTION,
587596
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_ONCHAIN,
588597
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
598+
CoinFeature.EIP1559,
589599
]
590600
), // we should probably refactor this into a eth() method
591601
account(
@@ -596,7 +606,7 @@ export const coins = CoinMap.fromCoins([
596606
18,
597607
UnderlyingAsset.ETH,
598608
BaseUnit.ETH,
599-
[...ETH_FEATURES, CoinFeature.DEPRECATED]
609+
[...ETH_FEATURES, CoinFeature.DEPRECATED, CoinFeature.EIP1559]
600610
),
601611
account(
602612
'41b75ac4-46d6-4dac-b741-bf11406b142f',
@@ -617,6 +627,7 @@ export const coins = CoinMap.fromCoins([
617627
CoinFeature.CUSTODY_BITGO_SWITZERLAND,
618628
CoinFeature.CUSTODY_BITGO_FRANKFURT,
619629
CoinFeature.CUSTODY_BITGO_SINGAPORE,
630+
CoinFeature.EIP1559,
620631
]
621632
),
622633
account(
@@ -642,6 +653,7 @@ export const coins = CoinMap.fromCoins([
642653
CoinFeature.BULK_TRANSACTION,
643654
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_ONCHAIN,
644655
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
656+
CoinFeature.EIP1559,
645657
]
646658
),
647659
account(
@@ -1230,7 +1242,7 @@ export const coins = CoinMap.fromCoins([
12301242
18,
12311243
UnderlyingAsset.POLYGON,
12321244
BaseUnit.ETH,
1233-
POLYGON_FEATURES
1245+
[...POLYGON_FEATURES, CoinFeature.EIP1559]
12341246
),
12351247
account(
12361248
'aa7b72d1-9197-492d-b2ca-2c9c9732115d',
@@ -1240,7 +1252,7 @@ export const coins = CoinMap.fromCoins([
12401252
18,
12411253
UnderlyingAsset.POLYGON,
12421254
BaseUnit.ETH,
1243-
POLYGON_FEATURES
1255+
[...POLYGON_FEATURES, CoinFeature.EIP1559]
12441256
),
12451257
account(
12461258
'b5ba2fc6-706b-433f-9bcf-4ea4aaa09281',

modules/statics/test/unit/coins.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,37 @@ describe('Bulk Transaction Features', () => {
682682
});
683683
});
684684
});
685+
686+
describe('Eip1559 coins', () => {
687+
const eip1559Coins = [
688+
'avaxc',
689+
'tavaxc',
690+
'eth',
691+
'teth',
692+
'gteth',
693+
'hteth',
694+
'hteth:bgerchv2',
695+
'celo',
696+
'tcelo',
697+
'arbeth',
698+
'tarbeth',
699+
'opeth',
700+
'topeth',
701+
'polygon',
702+
'tpolygon',
703+
'zketh',
704+
'tzketh',
705+
'bera',
706+
'tbera',
707+
'oas',
708+
'toas',
709+
'coredao',
710+
'tcoredao',
711+
];
712+
it('should have EIP1559 feature', () => {
713+
eip1559Coins.forEach((coinName) => {
714+
const coin = coins.get(coinName);
715+
coin.features.includes(CoinFeature.EIP1559).should.eql(true);
716+
});
717+
});
718+
});

0 commit comments

Comments
 (0)