Skip to content

authorizationList structure compatibility with eth_estimateGas #5007

Open
@EthanBlockson

Description

@EthanBlockson

Describe the Feature

Make it easier to pass authorizationList directly to RPC call without additional preparation.

Code Example

Heres example how authorization object look like after wallet.authorize().

{
  address: '0x186dDEA073ebceCBF845D5AEabB742902316C777',
  nonce: 6n,
  chainId: 11155111n,
  yParity: 1,
  r: '0x686dba08151c21c076967366fadfda3a281c56b0adf8a310e4a367bd75583e97',
  s: '0x48bf566e32cd6ff375e8667f893eb1676cfe52d94633064bb8c55751e17a8063'
}

This object can't be passed directly as authorizationList to call provider.send('eth_estimateGas') leading to an serialisation error:

TypeError: Do not know how to serialize a BigInt

Maybe theres a solutions to serialize it automatically on ethers side. Just an idea.

e.g.

  const modifiedAuthorization = {
    address: authorization.address,
    nonce: toQuantity(authorization.nonce),
    chainId: toQuantity(authorization.chainId),
    r: authorization.signature.r,
    s: authorization.signature.s,
    yParity: toQuantity(authorization.signature.yParity),
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions