Skip to content

Commit

Permalink
feat(auth1): add getWalletBalances method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Nov 28, 2019
1 parent 138342d commit 9608552
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/auth1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ export type MarginInformation = {
message: string;
};

export type WalletBalance = {
type: "trading" | "deposit" | "exchange";
currency: string;
amount: string;
available: string;
};

export type AuthenticatedClient1Options = PublicClient1Params & {
key: string;
secret: string;
Expand Down Expand Up @@ -143,6 +150,13 @@ export class AuthenticatedClient1 extends PublicClient1 {
return this.post({ uri: "/v1/margin_infos" });
}

/**
* Returns your balances.
*/
getWalletBalances(): Promise<WalletBalance[]> {
return this.post({ uri: "/v1/balances" });
}

get nonce(): string {
return Date.now().toString();
}
Expand Down

0 comments on commit 9608552

Please sign in to comment.