Skip to content

Commit

Permalink
feat: support legacy tx (#11467)
Browse files Browse the repository at this point in the history
* feat: support legacy tx

* Update packages/web3-shared/evm/src/types/index.ts

Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com>

---------

Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com>
  • Loading branch information
Jack-Works and guanbinrui committed Feb 29, 2024
1 parent b7f40a4 commit 128b2cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/web3-providers/src/Web3/EVM/translators/Base.ts
Expand Up @@ -33,7 +33,10 @@ export abstract class BaseTranslator implements Translator<ConnectionContext> {
})
const { [GasOptionType.SLOW]: slowOption, [GasOptionType.NORMAL]: normalOption } = options ?? {}

if (EVMChainResolver.isFeatureSupported(context.chainId, 'EIP1559')) {
// TODO: this field seems like not documented anywhere. should we just stop changing gasPrice?
const legacyTransactionUsed = config.type === '0x0'

if (!legacyTransactionUsed && EVMChainResolver.isFeatureSupported(context.chainId, 'EIP1559')) {
delete config.gasPrice

if (
Expand Down
1 change: 1 addition & 0 deletions packages/web3-shared/evm/src/types/index.ts
Expand Up @@ -385,6 +385,7 @@ export interface Transaction {
data?: string
nonce?: number
chainId?: number
type?: '0x0' | '0x1' | '0x2'

// CELO
feeCurrency?: string // address of the ERC20 contract to use to pay for gas and the gateway fee
Expand Down

0 comments on commit 128b2cb

Please sign in to comment.