Add types for ethereumjs-tx (#26118)

This commit is contained in:
Leonid Logvinov
2018-05-29 15:42:43 -07:00
committed by Mohamed Hegazy
parent 00f9711ca2
commit 2a260edbdb
4 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import EthereumjsTx = require('ethereumjs-tx');
const txParams = {};
const tx = new EthereumjsTx(txParams);

19
types/ethereumjs-tx/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for ethereumjs-tx 1.0
// Project: https://github.com/ethereumjs/ethereumjs-tx
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
declare class EthereumTx {
raw: Buffer[];
r: Buffer;
s: Buffer;
v: Buffer;
nonce: Buffer;
serialize(): Buffer;
sign(buffer: Buffer): void;
getSenderAddress(): Buffer;
constructor(txParams: any);
}
export = EthereumTx;

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "ethereumjs-tx-tests.ts"]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }