Skip to content

Commit

Permalink
Got withdrawHistory working which uses a GET instead of a POST. The m…
Browse files Browse the repository at this point in the history
…essage signature is also different
  • Loading branch information
Nicholas Addison committed Feb 4, 2018
1 parent 6100c26 commit 1cf70b9
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 37 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const orderBook = await client.getOrderBook("BTC", "AUD");
// get market trades since 728992317
const trades = await client.getTrades("BTC", "AUD", 728992317);

// limit buy order for of 0.001 ETH at 1000 AUD
// limit buy order for of 0.001 ETH at 500 AUD
const limitOrder = await client.createOrder("ETH", "AUD", 500 * BTCMarkets.numberConverter, 0.001 * BTCMarkets.numberConverter, 'Bid', 'Limit', "10001");

//market sell for 0.001 BTC
Expand Down Expand Up @@ -105,6 +105,6 @@ const openOrders = await client.getOpenOrders('BTC', 'AUD', 10, null);
// withdrawal 0.05 ETH
const cryptoWithdrawal = await client.withdrawCrypto(0.05 * BTCMarkets.numberConverter, "0x775053A6125cB51e618Eb132f00E93d6033934AD", "ETH");

// withdrawal 0.05 ETH
const withdrawHistory = await client.withdrawHistory(null, null, null);
// withdrawal history
const withdrawHistory = await client.withdrawHistory(10, 0, true);
```
9 changes: 6 additions & 3 deletions examples.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function tests(): Promise<void>
const trades = await client.getTrades("BTC", "AUD", 728992317);
console.log(`Trades: ${JSON.stringify(trades)}`);

// limit buy order for of 0.001 ETH at 1000 AUD
// limit buy order for of 0.001 ETH at 500 AUD
const limitOrder = await client.createOrder("ETH", "AUD", 500 * BTCMarkets.numberConverter, 0.001 * BTCMarkets.numberConverter, 'Bid', 'Limit', "10001");
console.log(`Limit order: ${JSON.stringify(limitOrder)}`);

Expand Down Expand Up @@ -70,8 +70,12 @@ async function tests(): Promise<void>
const cryptoWithdrawal = await client.withdrawCrypto(0.05 * BTCMarkets.numberConverter, "0x775053A6125cB51e618Eb132f00E93d6033934AD", "ETH");
console.log(`Crypto withdrawal: ${JSON.stringify(cryptoWithdrawal)}`);

// withdrawal 0.05 ETH
const withdrawHistory = await client.withdrawHistory(null, null, null);
// withdrawal history with default params
const defaultWithdrawHistory = await client.withdrawHistory(null, null, null);
console.log(`Withdrawal history: ${JSON.stringify(defaultWithdrawHistory)}`);

// withdrawal history with params
const withdrawHistory = await client.withdrawHistory(10, 0, true);
console.log(`Withdrawal history: ${JSON.stringify(withdrawHistory)}`);
}
catch (err)
Expand Down
31 changes: 21 additions & 10 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1cf70b9

Please sign in to comment.