diff --git a/.changeset/cyan-sheep-explode.md b/.changeset/cyan-sheep-explode.md new file mode 100644 index 00000000..d032c264 --- /dev/null +++ b/.changeset/cyan-sheep-explode.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixes the `unknown` state type by passing type arguments to `transaction` route. diff --git a/src/routes/transaction.ts b/src/routes/transaction.ts index dac76c40..90222360 100644 --- a/src/routes/transaction.ts +++ b/src/routes/transaction.ts @@ -8,18 +8,18 @@ import { getTransactionContext } from '../utils/getTransactionContext.js' import { parsePath } from '../utils/parsePath.js' import { requestToContext } from '../utils/requestToContext.js' -export function transaction( +export function transaction( this: FrogBase, - path: string, + path: path, handler: ( - context: TransactionContext, + context: TransactionContext, ) => HandlerResponse, options: RouteOptions = {}, ) { const { verify = this.verify } = options this.hono.post(parsePath(path), async (c) => { - const transactionContext = getTransactionContext({ + const transactionContext = getTransactionContext({ context: await requestToContext(c.req, { hub: this.hub || (this.hubApiUrl ? { apiUrl: this.hubApiUrl } : undefined), diff --git a/src/utils/getTransactionContext.ts b/src/utils/getTransactionContext.ts index d58f0000..87bf06de 100644 --- a/src/utils/getTransactionContext.ts +++ b/src/utils/getTransactionContext.ts @@ -16,9 +16,9 @@ type GetTransactionContextParameters = { req: HonoRequest } -export function getTransactionContext( +export function getTransactionContext( parameters: GetTransactionContextParameters, -): TransactionContext { +): TransactionContext { const { context, req } = parameters const { frameData,