Skip to content

Commit 8cef176

Browse files
Merge pull request #5983 from BitGo/COIN-3843
feat(statics): add coin feature for erc20 batching
2 parents 96b4860 + c756ecd commit 8cef176

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

modules/statics/src/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ export enum CoinFeature {
288288
*/
289289
BULK_TRANSACTION = 'bulk-transaction',
290290

291+
/**
292+
* This coin supports bulk ERC20 token transactions (token batching)
293+
*/
294+
ERC20_BULK_TRANSACTION = 'erc20-bulk-transaction',
295+
291296
/**
292297
* This coin supports distributed custody wallets
293298
*/

modules/statics/src/coinFeatures.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ export const OPETH_FEATURES = [
357357
CoinFeature.EIP1559,
358358
CoinFeature.WALLET_CONNECT_DEFI,
359359
CoinFeature.BULK_TRANSACTION,
360+
CoinFeature.ERC20_BULK_TRANSACTION,
360361
];
361362
export const ZKETH_FEATURES = [
362363
...ETH_FEATURES,

modules/statics/src/coins.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export const coins = CoinMap.fromCoins([
264264
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_ONCHAIN,
265265
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
266266
CoinFeature.EIP1559,
267+
CoinFeature.ERC20_BULK_TRANSACTION,
267268
]
268269
), // we should probably refactor this into a eth() method
269270
account(
@@ -323,6 +324,7 @@ export const coins = CoinMap.fromCoins([
323324
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_ONCHAIN,
324325
CoinFeature.STUCK_TRANSACTION_MANAGEMENT_TSS,
325326
CoinFeature.EIP1559,
327+
CoinFeature.ERC20_BULK_TRANSACTION,
326328
]
327329
),
328330
account(

modules/statics/test/unit/coins.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,21 @@ describe('Bulk Transaction Features', () => {
876876
});
877877
});
878878

879+
describe('ERC20 Bulk Transaction Feature', () => {
880+
it('should have ERC20_BULK_TRANSACTION feature for appropriate coins', () => {
881+
const erc20BulkTransactionCoins = ['eth', 'hteth', 'opeth', 'topeth'];
882+
erc20BulkTransactionCoins.forEach((coinName) => {
883+
const coin = coins.get(coinName);
884+
coin.features.includes(CoinFeature.ERC20_BULK_TRANSACTION).should.eql(true);
885+
});
886+
});
887+
888+
it('should not have ERC20_BULK_TRANSACTION feature for Polygon', () => {
889+
const coin = coins.get('polygon');
890+
coin.features.includes(CoinFeature.ERC20_BULK_TRANSACTION).should.eql(false);
891+
});
892+
});
893+
879894
describe('Eip1559 coins', () => {
880895
const eip1559Coins = [
881896
'avaxc',

0 commit comments

Comments
 (0)