UNPKG

beckn-typescript

Version:

Beckn Protocol Client & Server Tools for Typescript

105 lines (103 loc) 3 kB
/** * Fetch metadata from the API. * * @example * const { data, error } = await fetchMeta("/some-endpoint", { * baseUrl: "https://myapi.dev/v1/", * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const fetchMeta: import("openapi-fetch").ClientMethod<typeof import("../type/meta"), "post", `${string}/${string}`>; /** * Fetch registry data from the API. * * @example * const { data, error } = await fetchRegistry("/some-endpoint", { * baseUrl: "https://myapi.dev/v1/", * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const fetchRegistry: import("openapi-fetch").ClientMethod<typeof import("../type/registry"), "post", `${string}/${string}`>; /** * Fetch transaction data from the API. * * @example * const { data, error } = await fetchTransaction("/search", { * baseUrl: "https://myapi.dev/v1/", * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const fetchTransaction: import("openapi-fetch").ClientMethod<typeof import("../type/transaction"), "post", `${string}/${string}`>; /** * Create a client for fetching metadata. * * @example * const clientMeta = createClientMeta({ baseUrl: "https://myapi.dev/v1/" }); * const { data, error } = await clientMeta.POST("/some-endpoint", { * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const createClientMeta: (clientOptions?: import("openapi-fetch").ClientOptions) => import("openapi-fetch").Client<typeof import("../type/meta"), `${string}/${string}`>; /** * Create a client for fetching registry data. * * @example * const clientRegistry = createClientRegistry({ baseUrl: "https://myapi.dev/v1/" }); * const { data, error } = await clientRegistry.POST("/some-endpoint", { * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const createClientRegistry: (clientOptions?: import("openapi-fetch").ClientOptions) => import("openapi-fetch").Client<typeof import("../type/registry"), `${string}/${string}`>; /** * Create a client for fetching transaction data. * * @example * const clientTransaction = createClientTransaction({ baseUrl: "https://myapi.dev/v1/" }); * const { data, error } = await clientTransaction.POST("/search", { * body: { * context: { * // context fields * }, * message: { * // message fields * }, * }, * }); */ export declare const createClientTransaction: (clientOptions?: import("openapi-fetch").ClientOptions) => import("openapi-fetch").Client<typeof import("../type/transaction"), `${string}/${string}`>; export {};