77 NetworkIdRequestParamsSchema ,
88 // PresentationRequestParamsSchema, // TODO update these in mina-js and import again
99 RequestAccountsRequestParamsSchema ,
10+ RequestWithContext ,
1011 SendTransactionRequestParamsSchema ,
1112 SetStateRequestParamsSchema ,
1213 SignFieldsRequestParamsSchema ,
@@ -15,10 +16,7 @@ import {
1516 // StorePrivateCredentialRequestParamsSchema,
1617 SwitchChainRequestParamsSchema ,
1718} from "@mina-js/providers"
18- import {
19- SignFieldsWithPassphraseRequestParams ,
20- createMinaProvider ,
21- } from "@palladco/web-provider"
19+ import { createMinaProvider } from "@palladco/web-provider"
2220import { serializeError } from "serialize-error"
2321import { z } from "zod"
2422import type { Handler } from "."
@@ -158,12 +156,15 @@ export const minaSignFields: Handler = async ({ data }) => {
158156export const minaSignFieldsWithPassphrase : Handler = async ( { data } ) => {
159157 try {
160158 const provider = await createMinaProvider ( )
161- const payload = SignFieldsWithPassphraseRequestParams . parse ( {
159+ const payload = RequestWithContext . extend ( {
160+ method : z . literal ( "mina_signFieldsWithPassphrase" ) ,
161+ params : z . any ( ) ,
162+ } ) . parse ( {
162163 method : "mina_signFieldsWithPassphrase" ,
163164 params : data . params ,
164165 context : data . context ,
165166 } )
166- const response = await provider . request ( payload )
167+ const response = await provider . request ( payload as any )
167168 return response
168169 } catch ( error : unknown ) {
169170 return { error : serializeError ( error ) }
0 commit comments