Skip to content

Commit

Permalink
feat(auth1): add transfer method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Nov 28, 2019
1 parent 0901edb commit b9e0923
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/auth1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ export type DepositParams = {
renew?: 0 | 1;
};

export type TransferParams = {
amount: string;
currency: string;
walletfrom: "trading" | "deposit" | "exchange";
walletto: "trading" | "deposit" | "exchange";
};

export type AccountInfo = [
{
leo_fee_disc_c2c: string;
Expand Down Expand Up @@ -87,6 +94,10 @@ export type WalletBalance = {
available: string;
};

export type TransferResponse = [
{ status: "error" | "success"; message: string }
];

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

/**
* Move available balances between your wallets.
*/
transfer(body: TransferParams): Promise<TransferResponse> {
return this.post({ body, uri: "/v1/transfer" });
}

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

0 comments on commit b9e0923

Please sign in to comment.