import { Type, Static } from "@sinclair/typebox"; import { TAddress, TChainId, TIntegerString, TBytes32 } from "./basic"; export const ApproveParamsSchema = Type.Object({ amount: TIntegerString, assetId: TAddress, signer: TAddress, fromProvider: Type.String({ format: "uri" }), toProvider: Type.String({ format: "uri" }), fromChainId: TChainId, toChainId: TChainId, }); export type ApproveParams = Static; export const ApproveResponseSchema = { 200: Type.Object({ allowance: Type.String(), transaction: Type.Optional( Type.Object({ to: Type.String(), data: Type.String(), }), ), }), }; export type ApproveResponse = Static; export const ExecuteParamsSchema = ApproveParamsSchema; export type ExecuteParams = Static; export const ExecuteResponseSchema = { 200: Type.Object({ transaction: Type.Optional( Type.Object({ to: Type.String(), data: Type.String(), }), ), }), }; export type ExecuteResponse = Static; export const CheckStatusParamsSchema = Type.Object({ txHash: TBytes32, fromProvider: Type.String({ format: "uri" }), toProvider: Type.String({ format: "uri" }), fromChainId: TChainId, toChainId: TChainId, signer: TAddress, }); export type CheckStatusParams = Static; export const CheckStatusResponseSchema = { 200: Type.Object({ status: Type.Object({ completed: Type.Boolean() }), transaction: Type.Optional( Type.Object({ to: Type.String(), data: Type.String(), }), ), }), }; export type CheckStatusResponse = Static;