Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions modules/abstract-eth/src/abstractEthLikeNewCoins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3109,9 +3109,15 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
txParams.prebuildTx?.consolidateId ||
txPrebuild?.consolidateId ||
(txParams.type &&
['acceleration', 'fillNonce', 'transferToken', 'tokenApproval', 'consolidate', 'bridgeFunds'].includes(
txParams.type
))
[
'acceleration',
'fillNonce',
'transferToken',
'tokenApproval',
'consolidate',
'bridgeFunds',
'enabletoken',
].includes(txParams.type))
)
) {
throw new Error('missing txParams');
Expand Down
10 changes: 1 addition & 9 deletions modules/sdk-coin-eth/src/erc7984Token.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @prettier
*/
import { BitGoBase, CoinConstructor, MPCAlgorithm, NamedCoinConstructor, TokenEnablementConfig } from '@bitgo/sdk-core';
import { BitGoBase, CoinConstructor, MPCAlgorithm, NamedCoinConstructor } from '@bitgo/sdk-core';

import { coins, Erc7984TokenConfig, EthereumNetwork, tokens } from '@bitgo/statics';
import {
Expand Down Expand Up @@ -121,14 +121,6 @@ export class Erc7984Token extends Eth {
return new TransactionBuilder(coins.get(this.getBaseChain()));
}

/** @inheritDoc */
getTokenEnablementConfig(): TokenEnablementConfig {
return {
requiresTokenEnablement: true,
supportsMultipleTokenEnablements: true,
};
}

/** @inheritDoc */
async verifyTransaction(params: VerifyEthTransactionOptions): Promise<boolean> {
if (params.txParams?.type === 'enabletoken') {
Expand Down
9 changes: 9 additions & 0 deletions modules/sdk-coin-eth/src/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
multisigTypes,
Recipient,
Util,
TokenEnablementConfig,
} from '@bitgo/sdk-core';
import {
AbstractEthLikeNewCoins,
Expand Down Expand Up @@ -92,6 +93,14 @@ export class Eth extends AbstractEthLikeNewCoins {
return 'ecdsa';
}

/** @inheritDoc */
getTokenEnablementConfig(): TokenEnablementConfig {
return {
requiresTokenEnablement: true,
supportsMultipleTokenEnablements: true,
};
}

/**
* Gets correct Eth Common object based on params from either recovery or tx building
* @param eip1559 {EIP1559} configs that specify whether we should construct an eip1559 tx
Expand Down
7 changes: 7 additions & 0 deletions modules/sdk-core/src/bitgo/utils/mpcUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ export abstract class MpcUtils {
feeToken: params.feeToken,
nonce: params.nonce,
};
case 'enableToken':
return {
...baseIntent,
enableTokens: params.enableTokens,
feeOptions: params.feeOptions,
feeToken: params.feeToken,
};
default:
throw new Error(`Unsupported intent type ${params.intentType}`);
}
Expand Down
Loading