diff --git a/.changeset/ninety-coats-pick.md b/.changeset/ninety-coats-pick.md new file mode 100644 index 00000000000..0e2d8a6dc87 --- /dev/null +++ b/.changeset/ninety-coats-pick.md @@ -0,0 +1,6 @@ +--- +"thirdweb": patch +"@thirdweb-dev/engine": patch +--- + +Support EOA Execution Options for Server Wallets diff --git a/packages/thirdweb/src/engine/server-wallet.test.ts b/packages/thirdweb/src/engine/server-wallet.test.ts index ebed81b59b9..8123e560f21 100644 --- a/packages/thirdweb/src/engine/server-wallet.test.ts +++ b/packages/thirdweb/src/engine/server-wallet.test.ts @@ -1,3 +1,4 @@ +import { verifyTypedData } from "src/auth/verify-typed-data.js"; import { beforeAll, describe, expect, it } from "vitest"; import { TEST_CLIENT } from "../../test/src/test-clients.js"; import { TEST_ACCOUNT_B } from "../../test/src/test-wallets.js"; @@ -78,6 +79,36 @@ describe.runIf( expect(signature).toBeDefined(); }); + it("should sign typed data for EOA execution options", async () => { + const eoaServerWallet = Engine.serverWallet({ + address: process.env.ENGINE_CLOUD_WALLET_ADDRESS as string, + chain: arbitrumSepolia, + client: TEST_CLIENT, + executionOptions: { + address: process.env.ENGINE_CLOUD_WALLET_ADDRESS_EOA as string, + type: "eoa", + }, + vaultAccessToken: process.env.VAULT_TOKEN as string, + }); + + const signature = await eoaServerWallet.signTypedData({ + ...typedData.basic, + }); + + expect(signature).toBeDefined(); + + const is_valid = await verifyTypedData({ + address: process.env.ENGINE_CLOUD_WALLET_ADDRESS_EOA as string, + chain: arbitrumSepolia, + client: TEST_CLIENT, + ...typedData.basic, + + signature, + }); + + expect(is_valid).toBe(true); + }); + it("should send a tx with regular API", async () => { const tx = await sendTransaction({ account: serverWallet,