[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';
/**
* @class JsonRpc

@ -1,9 +1,15 @@
export * from './baseProvider';
export * from './defaultFetcher';
export * from './messenger';
export * from './rpcBuilder';
// provider related
export * from './providers/baseProvider';
export * from './providers/defaultFetcher';
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 './http';
export * from './net';
export * from './rpc';
// types
export * from './types';

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

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

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

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

@ -5,9 +5,9 @@ import {
performRPC,
DEFAULT_TIMEOUT,
DEFAULT_HEADERS,
} from './net';
} from '../blockchain/net';
import { RPCRequestPayload } from './types';
import { RPCRequestPayload } from '../types';
const defaultOptions = {
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 ResMiddleware = Map<string | RPCMethod | RegExp, any[]>;

Loading…
Cancel
Save