Skip to content
Alchemy Logo

PrepareCallsParams

type PrepareCallsParams = {
  account?: AccountParam | undefined;
  chainId?: number | undefined;
  calls?:
    | {
        to: `0x${string}`;
        data?: `0x${string}` | undefined;
        value?: bigint | undefined;
      }[]
    | undefined;
  paymasterPermitSignature?:
    | {
        type: "secp256k1";
        data:
          | `0x${string}`
          | {
              r: `0x${string}`;
              s: `0x${string}`;
              yParity: `0x${string}`;
            }
          | {
              r: `0x${string}`;
              s: `0x${string}`;
              v: `0x${string}`;
            };
      }
    | {
        type: "ecdsa";
        data:
          | `0x${string}`
          | {
              r: `0x${string}`;
              s: `0x${string}`;
              yParity: `0x${string}`;
            }
          | {
              r: `0x${string}`;
              s: `0x${string}`;
              v: `0x${string}`;
            };
      }
    | undefined;
  capabilities?:
    | (Omit<
        {
          permissions?:
            | {
                context: `0x${string}`;
              }
            | {
                sessionId: `0x${string}`;
                signature: `0x${string}`;
              }
            | undefined;
          paymasterService?:
            | ((
                | {
                    policyId: string;
                  }
                | {
                    policyIds: string[];
                  }
              ) & {
                onlyEstimation?: boolean | undefined;
                erc20?:
                  | {
                      preOpSettings: {
                        autoPermit: {
                          below: bigint;
                          amount: bigint;
                          durationSeconds?: number | undefined;
                        };
                      };
                      tokenAddress: `0x${string}`;
                      maxTokenAmount?: bigint | undefined;
                    }
                  | {
                      preOpSettings: {
                        permitDetails: {
                          deadline: number;
                          value: bigint;
                        };
                      };
                      tokenAddress: `0x${string}`;
                      maxTokenAmount?: bigint | undefined;
                    }
                  | {
                      postOpSettings: {
                        autoApprove?:
                          | true
                          | {
                              below: bigint;
                              amount: bigint;
                            }
                          | undefined;
                        balanceCheck?: false | undefined;
                      };
                      tokenAddress: `0x${string}`;
                      maxTokenAmount?: bigint | undefined;
                    }
                  | {
                      tokenAddress: `0x${string}`;
                      maxTokenAmount?: bigint | undefined;
                    }
                  | undefined;
                webhookData?: string | undefined;
              })
            | undefined;
          gasParamsOverride?:
            | {
                preVerificationGas?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                verificationGasLimit?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                callGasLimit?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                paymasterVerificationGasLimit?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                paymasterPostOpGasLimit?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                maxFeePerGas?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
                maxPriorityFeePerGas?:
                  | bigint
                  | {
                      multiplier: number;
                    }
                  | undefined;
              }
            | undefined;
          eip7702Auth?:
            | true
            | {
                delegation:
                  | "ModularAccountV2"
                  | "0x69007702764179f14F51cdce752f4f775d74E139"
                  | "0x0000000000000000000000000000000000000000";
                account?: `0x${string}` | undefined;
              }
            | undefined;
          nonceOverride?:
            | {
                nonceKey: bigint | `0x${string}`;
              }
            | undefined;
          stateOverride?:
            | Record<
                `0x${string}`,
                | {
                    state: Record<`0x${string}`, `0x${string}`>;
                    balance?: bigint | undefined;
                    nonce?: number | undefined;
                    code?: `0x${string}` | undefined;
                  }
                | {
                    stateDiff: Record<`0x${string}`, `0x${string}`>;
                    balance?: bigint | undefined;
                    nonce?: number | undefined;
                    code?: `0x${string}` | undefined;
                  }
                | {
                    balance?: bigint | undefined;
                    nonce?: number | undefined;
                    code?: `0x${string}` | undefined;
                  }
              >
            | undefined;
          experimental_dataSuffix?:
            | {
                value: `0x${string}`;
              }
            | undefined;
        },
        "paymasterService"
      > & {
        paymaster?:
          | ({
              policyId: string;
            } & {
              onlyEstimation?: boolean | undefined;
              erc20?:
                | {
                    preOpSettings: {
                      autoPermit: {
                        below: bigint;
                        amount: bigint;
                        durationSeconds?: number | undefined;
                      };
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    preOpSettings: {
                      permitDetails: {
                        deadline: number;
                        value: bigint;
                      };
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    postOpSettings: {
                      autoApprove?:
                        | true
                        | {
                            below: bigint;
                            amount: bigint;
                          }
                        | undefined;
                      balanceCheck?: false | undefined;
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | undefined;
              webhookData?: string | undefined;
            })
          | ({
              policyIds: string[];
            } & {
              onlyEstimation?: boolean | undefined;
              erc20?:
                | {
                    preOpSettings: {
                      autoPermit: {
                        below: bigint;
                        amount: bigint;
                        durationSeconds?: number | undefined;
                      };
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    preOpSettings: {
                      permitDetails: {
                        deadline: number;
                        value: bigint;
                      };
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    postOpSettings: {
                      autoApprove?:
                        | true
                        | {
                            below: bigint;
                            amount: bigint;
                          }
                        | undefined;
                      balanceCheck?: false | undefined;
                    };
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | {
                    tokenAddress: `0x${string}`;
                    maxTokenAmount?: bigint | undefined;
                  }
                | undefined;
              webhookData?: string | undefined;
            })
          | undefined;
      })
    | undefined;
};

Defined in: packages/wallet-apis/src/actions/prepareCalls.ts:37

Was this page helpful?