1 | import { JsonRpcMiddleware } from 'json-rpc-engine';
|
2 | import type { Payload, Block } from './types';
|
3 | export interface PayloadWithOrigin extends Payload {
|
4 | origin?: string;
|
5 | }
|
6 | interface Request {
|
7 | method: string;
|
8 | headers: Record<string, string>;
|
9 | body: string;
|
10 | }
|
11 | interface FetchConfig {
|
12 | fetchUrl: string;
|
13 | fetchParams: Request;
|
14 | }
|
15 | interface FetchMiddlewareOptions {
|
16 | rpcUrl: string;
|
17 | originHttpHeaderKey?: string;
|
18 | }
|
19 | interface FetchMiddlewareFromReqOptions extends FetchMiddlewareOptions {
|
20 | req: PayloadWithOrigin;
|
21 | }
|
22 | export declare function createFetchMiddleware({ rpcUrl, originHttpHeaderKey, }: FetchMiddlewareOptions): JsonRpcMiddleware<string[], Block>;
|
23 | export declare function createFetchConfigFromReq({ req, rpcUrl, originHttpHeaderKey, }: FetchMiddlewareFromReqOptions): FetchConfig;
|
24 | export {};
|