Add Connection class

This commit is contained in:
Michael Vines
2018-08-23 10:52:48 -07:00
parent 79ab826678
commit 4df189513e
12 changed files with 526 additions and 70 deletions

4
web3.js/flow-typed/jayson.js vendored Normal file
View File

@ -0,0 +1,4 @@
declare module 'jayson/lib/client/browser' {
declare module.exports: any;
}

27
web3.js/flow-typed/node-fetch.js vendored Normal file
View File

@ -0,0 +1,27 @@
declare module 'node-fetch' {
declare export type Config = {
method?: string;
headers?: {[key: string]: string};
compress?: bool;
body?: Buffer|string;
size?: number;
}
declare export class Headers {
get(name: string): ?string;
set(name: string, value: string): void;
}
declare export class Response {
url: string;
status: string;
statusText: string;
headers: Headers;
ok: bool;
json(): Promise<Object>;
text(): Promise<string>;
}
declare export default (url: string, config?: Config) => Promise<Response>;
}

5
web3.js/flow-typed/superstruct.js vendored Normal file
View File

@ -0,0 +1,5 @@
declare module 'superstruct' {
declare module.exports: {
struct(schema: any): any;
}
}

View File

@ -7,6 +7,7 @@ declare module "tweetnacl" {
declare module.exports: {
sign: {
keyPair(): KeyPair;
detached(text: Buffer, secretKey: Buffer): Buffer;
};
};
}