File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
apps/extension/src/background/handlers Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ import {
1616 // StorePrivateCredentialRequestParamsSchema,
1717 SwitchChainRequestParamsSchema ,
1818} from "@mina-js/providers"
19+ import {
20+ type TransactionOrZkAppCommandProperties ,
21+ toNodeApiFormat ,
22+ } from "@mina-js/utils"
1923import { createMinaProvider } from "@palladco/web-provider"
2024import { serializeError } from "serialize-error"
2125import { z } from "zod"
@@ -176,7 +180,24 @@ export const minaSignTransaction: Handler = async ({ data }) => {
176180 const provider = await createMinaProvider ( )
177181 const payload = SignTransactionRequestParamsSchema . parse ( {
178182 method : "mina_signTransaction" ,
179- params : data . params ,
183+ params : data . params . map (
184+ (
185+ txData :
186+ | TransactionOrZkAppCommandProperties
187+ | {
188+ command : Parameters < typeof toNodeApiFormat > [ 0 ]
189+ } ,
190+ ) => {
191+ // backward compatibility with the old feePayer input schema
192+ if ( "command" in txData && "feePayer" in txData . command . feePayer ) {
193+ return {
194+ ...txData ,
195+ command : toNodeApiFormat ( txData . command ) ,
196+ }
197+ }
198+ return txData
199+ } ,
200+ ) ,
180201 context : data . context ,
181202 } )
182203 return await provider . request ( payload )
You can’t perform that action at this time.
0 commit comments