Create ethers-typescript-typings
This commit is contained in:
parent
a5ef1db0c5
commit
34c1134b55
29
packages/0x.js/src/globals.d.ts
vendored
29
packages/0x.js/src/globals.d.ts
vendored
@ -41,32 +41,3 @@ declare module 'truffle-hdwallet-provider' {
|
||||
}
|
||||
export = HDWalletProvider;
|
||||
}
|
||||
|
||||
declare module 'ethers-contracts' {
|
||||
export interface TransactionDescription {
|
||||
name: string;
|
||||
signature: string;
|
||||
sighash: string;
|
||||
data: string;
|
||||
}
|
||||
export interface CallDescription extends TransactionDescription {
|
||||
parse: (...args: any[]) => any;
|
||||
}
|
||||
export interface FunctionDescription {
|
||||
(...params: any[]): TransactionDescription | CallDescription;
|
||||
inputs: { names: string[]; types: string[] };
|
||||
outputs: { names: string[]; types: string[] };
|
||||
}
|
||||
export interface EventDescription {
|
||||
inputs: { names: string[]; types: string[] };
|
||||
signature: string;
|
||||
topic: string;
|
||||
}
|
||||
// tslint:disable-next-line:max-classes-per-file
|
||||
export class Interface {
|
||||
public functions: { [functionName: string]: FunctionDescription };
|
||||
public events: { [eventName: string]: EventDescription };
|
||||
public static decodeParams(types: string[], data: string): any[];
|
||||
constructor(abi: any);
|
||||
}
|
||||
}
|
||||
|
29
packages/contracts/globals.d.ts
vendored
29
packages/contracts/globals.d.ts
vendored
@ -32,32 +32,3 @@ declare module 'ethereumjs-abi' {
|
||||
const soliditySHA3: (argTypes: string[], args: any[]) => Buffer;
|
||||
const methodID: (name: string, types: string[]) => Buffer;
|
||||
}
|
||||
|
||||
declare module 'ethers-contracts' {
|
||||
export interface TransactionDescription {
|
||||
name: string;
|
||||
signature: string;
|
||||
sighash: string;
|
||||
data: string;
|
||||
}
|
||||
export interface CallDescription extends TransactionDescription {
|
||||
parse: (...args: any[]) => any;
|
||||
}
|
||||
export interface FunctionDescription {
|
||||
(...params: any[]): TransactionDescription | CallDescription;
|
||||
inputs: { names: string[]; types: string[] };
|
||||
outputs: { names: string[]; types: string[] };
|
||||
}
|
||||
export interface EventDescription {
|
||||
inputs: { names: string[]; types: string[] };
|
||||
signature: string;
|
||||
topic: string;
|
||||
}
|
||||
// tslint:disable-next-line:max-classes-per-file
|
||||
export class Interface {
|
||||
public functions: { [functionName: string]: FunctionDescription };
|
||||
public events: { [eventName: string]: EventDescription };
|
||||
public static decodeParams(types: string[], data: string): any[];
|
||||
constructor(abi: any);
|
||||
}
|
||||
}
|
||||
|
3
packages/ethers-typescript-typings/.npmignore
Normal file
3
packages/ethers-typescript-typings/.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
.*
|
||||
yarn-error.log
|
||||
/scripts/
|
5
packages/ethers-typescript-typings/CHANGELOG.md
Normal file
5
packages/ethers-typescript-typings/CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.0.1 - _TBD, 2018_
|
||||
|
||||
* Initial types (#413)
|
49
packages/ethers-typescript-typings/README.md
Normal file
49
packages/ethers-typescript-typings/README.md
Normal file
@ -0,0 +1,49 @@
|
||||
## ethers-typescript-typings
|
||||
|
||||
There currently isn't an official [Ethers][ethers]
|
||||
type definition included in the [DefinitelyTyped][definitelytyped] project.
|
||||
Until that happens, we will continue to improve our own type definition.
|
||||
If it get's close to comprehensive, we'll add it to [DefinitelyTyped][definitelytyped].
|
||||
|
||||
[ethers]: https://github.com/ethers-io/ethers.js
|
||||
[definitelytyped]: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add -D ethers-typescript-typings
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Add the following line within an `include` section of your `tsconfig.json`
|
||||
|
||||
```json
|
||||
"./node_modules/ethers-typescript-typings/index.d.ts"
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
|
||||
|
||||
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
|
||||
|
||||
```bash
|
||||
yarn config set workspaces-experimental true
|
||||
```
|
||||
|
||||
Then install dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
@ -23,6 +23,7 @@ declare module 'ethers-contracts' {
|
||||
export class Interface {
|
||||
public functions: { [functionName: string]: FunctionDescription };
|
||||
public events: { [eventName: string]: EventDescription };
|
||||
public static decodeParams(types: string[], data: string): any[];
|
||||
constructor(abi: any);
|
||||
}
|
||||
}
|
28
packages/ethers-typescript-typings/package.json
Normal file
28
packages/ethers-typescript-typings/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "ethers-typescript-typings",
|
||||
"version": "0.0.1",
|
||||
"description": "Typescript type definitions for ethers.js",
|
||||
"main": "index.d.ts",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"lint": "tslint index.d.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/0xProject/0x.js.git"
|
||||
},
|
||||
"author": "Fabio Berger",
|
||||
"contributors": [
|
||||
"Leonid Logvinov <logvinov.leon@gmail.com>"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/0xProject/0x.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x.js/packages/ethers-typescript-typings#readme",
|
||||
"devDependencies": {
|
||||
"tslint": "5.8.0",
|
||||
"tslint-config-0xproject": "^0.0.2",
|
||||
"typescript": "2.7.1"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
const postpublish_utils = require('../../../scripts/postpublish_utils');
|
||||
const packageJSON = require('../package.json');
|
||||
|
||||
const subPackageName = packageJSON.name;
|
||||
postpublish_utils.standardPostPublishAsync(subPackageName);
|
3
packages/ethers-typescript-typings/tslint.json
Normal file
3
packages/ethers-typescript-typings/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["tslint-config-0xproject"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user