From 619c0fc68beaa30c59cf1f4f047e1bd7a0cfded0 Mon Sep 17 00:00:00 2001 From: Coderdan Date: Fri, 27 Feb 2026 15:45:09 +0800 Subject: [PATCH] fix(bankr): submit minimal transaction schema --- CHANGELOG.md | 4 ++++ src/signer-runtime.test.ts | 13 +++++++++++++ src/signer.ts | 7 +------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53e2d35..5f39250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixed + +- Bankr signer now sends the minimal `/agent/submit` transaction schema and omits gas/nonce/fee fields for compatibility. + ## 0.2.2 - 2026-02-27 ### Added diff --git a/src/signer-runtime.test.ts b/src/signer-runtime.test.ts index 570c304..579b9ae 100644 --- a/src/signer-runtime.test.ts +++ b/src/signer-runtime.test.ts @@ -154,6 +154,12 @@ describe("signer runtime", () => { const body = JSON.parse(String(init?.body)); expect(body.waitForConfirmation).toBe(false); expect(body.transaction.to).toBe("0x0000000000000000000000000000000000000001"); + expect(body.transaction.gas).toBeUndefined(); + expect(body.transaction.nonce).toBeUndefined(); + expect(body.transaction.maxFeePerGas).toBeUndefined(); + expect(body.transaction.maxPriorityFeePerGas).toBeUndefined(); + expect(body.transaction.from).toBeUndefined(); + expect(body.description).toBeUndefined(); return { ok: true, text: async () => JSON.stringify({ transactionHash: "0x" + "e".repeat(64) }), @@ -187,6 +193,13 @@ describe("signer runtime", () => { const fetchMock = vi.fn(async (url: string, init?: RequestInit) => { expect(url).toBe("https://api.bankr.bot/agent/submit"); expect((init?.headers as Record)["x-api-key"]).toBe("bankr-token"); + const body = JSON.parse(String(init?.body)); + expect(body.transaction.chainId).toBe(base.id); + expect(body.transaction.gas).toBeUndefined(); + expect(body.transaction.nonce).toBeUndefined(); + expect(body.transaction.maxFeePerGas).toBeUndefined(); + expect(body.transaction.maxPriorityFeePerGas).toBeUndefined(); + expect(body.transaction.from).toBeUndefined(); return { ok: true, text: async () => JSON.stringify({ txHash: "0x" + "f".repeat(64) }), diff --git a/src/signer.ts b/src/signer.ts index bff69a7..46699db 100644 --- a/src/signer.ts +++ b/src/signer.ts @@ -621,20 +621,15 @@ export async function resolveSignerRuntime( return { summary, sendTransaction: async (request) => { + // Bankr expects a minimal transaction schema for /agent/submit. const payload = { transaction: { chainId: request.chain.id, - from: address, to: request.to, data: request.data, value: request.value?.toString() || "0", - gas: request.gas.toString(), - nonce: request.nonce, - maxFeePerGas: request.maxFeePerGas?.toString(), - maxPriorityFeePerGas: request.maxPriorityFeePerGas?.toString(), }, waitForConfirmation: false, - description: "Submitted via aavegotchi-cli", }; const response = await fetchBankrJson(addDefaultPaths(apiUrl, BANKR_AGENT_SUBMIT_PATH), {