eth-infinitism/bundler

Change the type of index on the SimpleAccountApiParams interface to BigNumberish

naddison36 opened this issue · 2 comments

The index property on the SimpleAccountApiParams interface is the salt used by the SimpleAccountFactory contract when it creates a new account. This is of type uint256 so can be way larger than JS's number type. I'd suggest changing this type to BigNumberish.

export interface SimpleAccountApiParams extends BaseApiParams {
  owner: Signer
  factoryAddress?: string
  index?: number
}

The constructor on the SimpleAccountAPI class would then look like

constructor (params: SimpleAccountApiParams) {
    super(params)
    this.factoryAddress = params.factoryAddress
    this.owner = params.owner
    this.index = BigNumber.from(params.index ?? 0)
  }

can you convert to PR ?

I've added this change to PR #73