Skip to content

Commit 08156d3

Browse files
fix(bankr): submit minimal transaction schema (#7)
1 parent 9d3d9e2 commit 08156d3

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixed
6+
7+
- Bankr signer now sends the minimal `/agent/submit` transaction schema and omits gas/nonce/fee fields for compatibility.
8+
59
## 0.2.2 - 2026-02-27
610

711
### Added

src/signer-runtime.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ describe("signer runtime", () => {
154154
const body = JSON.parse(String(init?.body));
155155
expect(body.waitForConfirmation).toBe(false);
156156
expect(body.transaction.to).toBe("0x0000000000000000000000000000000000000001");
157+
expect(body.transaction.gas).toBeUndefined();
158+
expect(body.transaction.nonce).toBeUndefined();
159+
expect(body.transaction.maxFeePerGas).toBeUndefined();
160+
expect(body.transaction.maxPriorityFeePerGas).toBeUndefined();
161+
expect(body.transaction.from).toBeUndefined();
162+
expect(body.description).toBeUndefined();
157163
return {
158164
ok: true,
159165
text: async () => JSON.stringify({ transactionHash: "0x" + "e".repeat(64) }),
@@ -187,6 +193,13 @@ describe("signer runtime", () => {
187193
const fetchMock = vi.fn(async (url: string, init?: RequestInit) => {
188194
expect(url).toBe("https://api.bankr.bot/agent/submit");
189195
expect((init?.headers as Record<string, string>)["x-api-key"]).toBe("bankr-token");
196+
const body = JSON.parse(String(init?.body));
197+
expect(body.transaction.chainId).toBe(base.id);
198+
expect(body.transaction.gas).toBeUndefined();
199+
expect(body.transaction.nonce).toBeUndefined();
200+
expect(body.transaction.maxFeePerGas).toBeUndefined();
201+
expect(body.transaction.maxPriorityFeePerGas).toBeUndefined();
202+
expect(body.transaction.from).toBeUndefined();
190203
return {
191204
ok: true,
192205
text: async () => JSON.stringify({ txHash: "0x" + "f".repeat(64) }),

src/signer.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,20 +621,15 @@ export async function resolveSignerRuntime(
621621
return {
622622
summary,
623623
sendTransaction: async (request) => {
624+
// Bankr expects a minimal transaction schema for /agent/submit.
624625
const payload = {
625626
transaction: {
626627
chainId: request.chain.id,
627-
from: address,
628628
to: request.to,
629629
data: request.data,
630630
value: request.value?.toString() || "0",
631-
gas: request.gas.toString(),
632-
nonce: request.nonce,
633-
maxFeePerGas: request.maxFeePerGas?.toString(),
634-
maxPriorityFeePerGas: request.maxPriorityFeePerGas?.toString(),
635631
},
636632
waitForConfirmation: false,
637-
description: "Submitted via aavegotchi-cli",
638633
};
639634

640635
const response = await fetchBankrJson(addDefaultPaths(apiUrl, BANKR_AGENT_SUBMIT_PATH), {

0 commit comments

Comments
 (0)