diff --git a/src/cli/config/bundler.ts b/src/cli/config/bundler.ts index 85d46819..0a98c49d 100644 --- a/src/cli/config/bundler.ts +++ b/src/cli/config/bundler.ts @@ -128,7 +128,8 @@ export const compatibilityArgsSchema = z.object({ "op-stack", "arbitrum", "hedera", - "mantle" + "mantle", + "skale" ]), "legacy-transactions": z.boolean(), "api-version": z diff --git a/src/cli/config/options.ts b/src/cli/config/options.ts index 405bfdbf..e52781bc 100644 --- a/src/cli/config/options.ts +++ b/src/cli/config/options.ts @@ -259,9 +259,16 @@ export const compatibilityOptions: CliCommandOptions = { "chain-type": { description: - "Indicates weather the chain is a OP stack chain, arbitrum chain, or default EVM chain", + "Indicates what type of chain the bundler is running on", type: "string", - choices: ["default", "op-stack", "arbitrum", "hedera", "mantle"], + choices: [ + "default", + "op-stack", + "arbitrum", + "hedera", + "mantle", + "skale" + ], default: "default" }, "legacy-transactions": { diff --git a/src/cli/handler.ts b/src/cli/handler.ts index c2de4af5..cab73dd7 100644 --- a/src/cli/handler.ts +++ b/src/cli/handler.ts @@ -11,7 +11,9 @@ import { createPublicClient, createWalletClient, formatEther, - fallback + fallback, + CallParameters, + publicActions } from "viem" import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor" import type { IOptionsInput } from "./config" @@ -92,7 +94,7 @@ export async function bundlerHandler(args_: IOptionsInput): Promise { } } - const publicClient = createPublicClient({ + let publicClient = createPublicClient({ transport: customTransport(args.rpcUrl, { logger: logger.child( { module: "public_client" }, @@ -104,6 +106,18 @@ export async function bundlerHandler(args_: IOptionsInput): Promise { chain }) + if (args.chainType === "skale") { + // SKALE only allows white listed addresses to deploy contracts. + publicClient = publicClient + .extend((client) => ({ + async call(args: CallParameters) { + args.account = "0x4337000c2828F5260d8921fD25829F606b9E8680" + return await client.call(args) + } + })) + .extend(publicActions) + } + const createWalletTransport = (url: string) => customTransport(url, { logger: logger.child( diff --git a/src/types/utils.ts b/src/types/utils.ts index 91f479cd..58495466 100644 --- a/src/types/utils.ts +++ b/src/types/utils.ts @@ -38,3 +38,4 @@ export type ChainType = | "arbitrum" | "hedera" | "mantle" + | "skale"