Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing any overrides to builduseroperation, returns the fields as Bignumber and not Hex. #1200

Open
HatimPatwa opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@HatimPatwa
Copy link

Thanks for filling out this bug report. Please provide as much detail as possible.

If your issue is with our RPC APIs and not the SDK please report your issue on (discord)[https://alchemy.com/discord].

[REQUIRED] Environment

  • Browser version: Node 20
  • AA SDK version: 4.3.1
  • Package: npm

[REQUIRED] Describe the problem

when we pass any field for overrride lets say, preVerificationGas override in buildUserOperation, that specific field response type changes from hex to bignumber

How to reproduce:

Pass key "preVerificationGas" in the overrides object of buildUserOperation. and compare the before and after the same field will have different response type.

Relevant code or sample repro:

code snippet :

uoEstimate = await smartAccountClient.buildUserOperation({
      //@ts-ignore
      uo: uoData,
      overrides: { //todo set multipliers fetched from db
        // paymasterAndData: "0x"
        maxFeePerGas: {
          multiplier: maxFeePerGasMultiplier,
        },
        maxPriorityFeePerGas: {
          multiplier: maxPriorityFeePerGasMultiplier,
        },
        // preVerificationGas: {
        //   multiplier: GAS_MULTIPLIER.Economy //for now set to economy
        // }
      }
      //@ts-ignore
    }, "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789");

Before preVerificationGas override

image

After preVerificationGas override

image

@HatimPatwa HatimPatwa added the bug Something isn't working label Dec 10, 2024
@moldy530
Copy link
Collaborator

Hey! this is expected behaviour as the type buildUserOperation returns is UserOperationStruct which has BigNumberish for those fields. If you then want all fields to be Hex for sending over the wire, you can call deepHexlify which is exported from @aa-sdk/core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants