Skip to content

Commit

Permalink
update ts type definination (#116)
Browse files Browse the repository at this point in the history
Co-authored-by: PanaW <[email protected]>
  • Loading branch information
Pana and PanaW authored Mar 23, 2021
1 parent 3688c8a commit e8022e4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-conflux-sdk",
"description": "JavaScript Conflux Software Development Kit",
"version": "1.5.14",
"version": "1.5.15",
"license": "LGPL-3.0",
"author": "[email protected]",
"repository": "https://github.com/Conflux-Chain/js-conflux-sdk.git",
Expand Down
56 changes: 56 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class Conflux {
defaultGasRatio: number;
defaultStorageRatio: number;

static create(options: ConfluxOption): Conflux;

Contract(options: ContractOption): object;

InternalContract(name: string): object;
Expand Down Expand Up @@ -197,3 +199,57 @@ export class Contract {
abi: any;
address: Address;
}

export class Drip {
constructor(value: number);

static fromCFX(value: string): Drip;

static fromGDrip(value: string): Drip;

toCFX(): string;

toGDrip(): string;
}

export class Message {
static sign(privateKey: string, messageHash: string): string;

static recover(signature: string, messageHash: string): string;

constructor(message: string);

get hash(): string;

get from(): string;

get r(): string;

get s(): string;

get v(): number;

sign(privateKey: string, networkId: number): Message;
}

export class PrivateKeyAccount {
static random(entropy: Buffer, networkId: number): PrivateKeyAccount;

static decrypt(keystore: object, password: string, networkId: number): PrivateKeyAccount;

constructor(privateKey: string, networkId: number);

encrypt(password: string): object;

signTransaction(options: object): Transaction;

signMessage(options: object): Message;
}

export declare let sign: object;

export declare let address: object; // address utilities

export declare let format: any;

export declare let providerWrapper: any;

0 comments on commit e8022e4

Please sign in to comment.