Skip to content

Commit

Permalink
feat(auth1): add getDepositAddress method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Nov 28, 2019
1 parent 49fc817 commit 994bdaa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/auth1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { PublicClient1, PublicClient1Params } from "./public1";
import { Signer } from "./signer";

export type DepositParams = {
method: string;
wallet_name: "trading" | "exchange" | "deposit";
renew?: 0 | 1;
};

export type AccountInfo = [
{
leo_fee_disc_c2c: string;
Expand Down Expand Up @@ -37,6 +43,13 @@ export type Summary = {
deriv_taker_fee: number;
};

export type DepositAddress = {
result: string;
method: string;
currency: string;
address: string;
};

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

/**
* Returns your deposit address to make a new deposit.
*/
getDepositAddress(body: DepositParams): Promise<DepositAddress> {
return this.post({ body, uri: "/v1/deposit/new" });
}

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

0 comments on commit 994bdaa

Please sign in to comment.