[chore] regroup ts files

@types
neeboo 6 years ago
parent b1ca749fb7
commit 75a238a425
  1. 0
      packages/harmony-network/src/blockchain/net.ts
  2. 0
      packages/harmony-network/src/blockchain/rpc.ts
  3. 2
      packages/harmony-network/src/blockchain/rpcBuilder.ts
  4. 20
      packages/harmony-network/src/index.ts
  5. 8
      packages/harmony-network/src/messenger/messenger.ts
  6. 2
      packages/harmony-network/src/messenger/responseMiddleware.ts
  7. 4
      packages/harmony-network/src/providers/baseProvider.ts
  8. 2
      packages/harmony-network/src/providers/defaultFetcher.ts
  9. 4
      packages/harmony-network/src/providers/http.ts
  10. 2
      packages/harmony-network/src/types.ts

@ -1,4 +1,4 @@
import { RPCRequestPayload } from './types'; import { RPCRequestPayload } from '../types';
import { RPCMethod } from './rpc'; import { RPCMethod } from './rpc';
/** /**
* @class JsonRpc * @class JsonRpc

@ -1,9 +1,15 @@
export * from './baseProvider'; // provider related
export * from './defaultFetcher'; export * from './providers/baseProvider';
export * from './messenger'; export * from './providers/defaultFetcher';
export * from './rpcBuilder'; export * from './providers/http';
// messenger and middlewares
export * from './messenger/messenger';
export * from './messenger/responseMiddleware';
// rpc builder and blockchain method
export * from './blockchain/rpcBuilder';
export * from './blockchain/net';
export * from './blockchain/rpc';
// utils
export * from './util'; export * from './util';
export * from './http'; // types
export * from './net';
export * from './rpc';
export * from './types'; export * from './types';

@ -1,8 +1,8 @@
import { JsonRpc } from './rpcbuilder'; import { JsonRpc } from '../blockchain/rpcbuilder';
import { ResponseMiddleware } from './responseMiddleware'; import { ResponseMiddleware } from './responseMiddleware';
import { HttpProvider } from './http'; import { HttpProvider } from '../providers/http';
import { getResultForData } from './util'; import { getResultForData } from '../util';
import { RPCMethod } from './rpc'; import { RPCMethod } from '../blockchain/rpc';
const defaultConfig = { const defaultConfig = {
Default: { Default: {

@ -1,4 +1,4 @@
import { RPCResponseBody } from './types'; import { RPCResponseBody } from '../types';
/** /**
* @class ResponseMiddleware * @class ResponseMiddleware
* @description Response middleware of RPC * @description Response middleware of RPC

@ -1,5 +1,5 @@
import { ReqMiddleware, ResMiddleware, MiddlewareType } from './types'; import { ReqMiddleware, ResMiddleware, MiddlewareType } from '../types';
import { RPCMethod } from './rpc'; import { RPCMethod } from '../blockchain/rpc';
class BaseProvider { class BaseProvider {
middlewares = { middlewares = {

@ -1,5 +1,5 @@
import fetch from 'cross-fetch'; import fetch from 'cross-fetch';
import { RPCRequest, RPCResponseBody, RPCError, RPCResult } from './types'; import { RPCRequest, RPCResponseBody, RPCError, RPCResult } from '../types';
export const fetchRPC = { export const fetchRPC = {
requestHandler: (request: RPCRequest<any[]>, headers: any) => requestHandler: (request: RPCRequest<any[]>, headers: any) =>

@ -5,9 +5,9 @@ import {
performRPC, performRPC,
DEFAULT_TIMEOUT, DEFAULT_TIMEOUT,
DEFAULT_HEADERS, DEFAULT_HEADERS,
} from './net'; } from '../blockchain/net';
import { RPCRequestPayload } from './types'; import { RPCRequestPayload } from '../types';
const defaultOptions = { const defaultOptions = {
method: 'POST', method: 'POST',

@ -1,4 +1,4 @@
import { RPCMethod, RPCErrorCode } from './rpc'; import { RPCMethod, RPCErrorCode } from './blockchain/rpc';
export type ReqMiddleware = Map<string | RPCMethod | RegExp, any[]>; export type ReqMiddleware = Map<string | RPCMethod | RegExp, any[]>;
export type ResMiddleware = Map<string | RPCMethod | RegExp, any[]>; export type ResMiddleware = Map<string | RPCMethod | RegExp, any[]>;

Loading…
Cancel
Save