feat: wrap public key in a class

This commit is contained in:
Michael Vines
2018-09-30 18:42:45 -07:00
parent 2c3208090c
commit ca6965f8c2
15 changed files with 180 additions and 95 deletions

View File

@ -13,11 +13,20 @@
declare module '@solana/web3.js' {
declare export type PublicKey = string;
// === src/publickey.js ===
declare export class PublicKey {
constructor(number: string | Buffer | Array<number>): PublicKey;
static isPublicKey(o: Object): boolean;
equals(publickey: PublicKey): boolean;
toBase58(): string;
toBuffer(): Buffer;
}
// === src/account.js ===
declare export class Account {
constructor(secretKey: ?Buffer): Account;
publicKey: PublicKey;
secretKey: PublicKey;
secretKey: Buffer;
}
// === src/budget-program.js ===
@ -84,6 +93,5 @@ declare module '@solana/web3.js' {
constructor(opts?: TransactionCtorFields): Transaction;
sign(from: Account): void;
serialize(): Buffer;
static serializePublicKey(key: PublicKey): Buffer;
}
}