Skip to content

Commit

Permalink
Merge pull request #63 from simpleledgerinc/master
Browse files Browse the repository at this point in the history
typings update for address/utxo response
  • Loading branch information
cgcardona authored Jan 31, 2019
2 parents bb81868 + 480afde commit 7d40d7f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
27 changes: 15 additions & 12 deletions lib/Address.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export declare interface Address {
export interface Address {
restURL: string;
//constructor(restURL: string);
toLegacyAddress(address: string): string;
Expand All @@ -19,11 +19,11 @@ export declare interface Address {
fromXPub(xpub: string, path?: string): string;
fromOutputScript(scriptPubKey:string, network?: string): string;
details(address: string[]): Promise<AddressDetailsResult[]>;
utxo(address: string[]): Promise<AddressUtxoResult[][]>;
utxo(address: string[]): Promise<AddressUtxoResult[]>;
unconfirmed(address: string[]): Promise<AddressUnconfirmedResult[][]>;
}

export declare interface AddressDetailsResult {
export interface AddressDetailsResult {
balance: number;
balanceSat: number;
totalReceived: number;
Expand All @@ -39,19 +39,22 @@ export declare interface AddressDetailsResult {
cashAddress: string;
}

export declare interface AddressUtxoResult {
txid: string;
vout: number;
scriptPubKey: string;
amount: number;
satoshis: number;
height: number;
confirmations: number;
export interface AddressUtxoResult {
legacyAddress: string;
cashAddress: string;
scriptPubKey: string;
utxos:
[{
txid: string;
vout: number;
amount: number;
satoshis: number;
height: number;
confirmations: number;
}]
}

export declare interface AddressUnconfirmedResult {
export interface AddressUnconfirmedResult {
txid: string;
vout: number;
scriptPubKey: string;
Expand Down
27 changes: 15 additions & 12 deletions typings/Address.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export declare interface Address {
export interface Address {
restURL: string;
//constructor(restURL: string);
toLegacyAddress(address: string): string;
Expand All @@ -19,11 +19,11 @@ export declare interface Address {
fromXPub(xpub: string, path?: string): string;
fromOutputScript(scriptPubKey:string, network?: string): string;
details(address: string[]): Promise<AddressDetailsResult[]>;
utxo(address: string[]): Promise<AddressUtxoResult[][]>;
utxo(address: string[]): Promise<AddressUtxoResult[]>;
unconfirmed(address: string[]): Promise<AddressUnconfirmedResult[][]>;
}

export declare interface AddressDetailsResult {
export interface AddressDetailsResult {
balance: number;
balanceSat: number;
totalReceived: number;
Expand All @@ -39,19 +39,22 @@ export declare interface AddressDetailsResult {
cashAddress: string;
}

export declare interface AddressUtxoResult {
txid: string;
vout: number;
scriptPubKey: string;
amount: number;
satoshis: number;
height: number;
confirmations: number;
export interface AddressUtxoResult {
legacyAddress: string;
cashAddress: string;
scriptPubKey: string;
utxos:
[{
txid: string;
vout: number;
amount: number;
satoshis: number;
height: number;
confirmations: number;
}]
}

export declare interface AddressUnconfirmedResult {
export interface AddressUnconfirmedResult {
txid: string;
vout: number;
scriptPubKey: string;
Expand Down

0 comments on commit 7d40d7f

Please sign in to comment.