-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.php
More file actions
57 lines (39 loc) · 1.7 KB
/
example.php
File metadata and controls
57 lines (39 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
include('itbit.php');
$itbit = new itbit('your-itbit-api-secret','your-itbit-api-client-id','your-ibit-user-id');
// Get all wallets
echo '<h2>Get all wallets</h2><pre>';
print_r($itbit->wallet());
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Get a single wallet</h2><pre>';
print_r($itbit->wallet('ab09412e-4129-4d6a-bca4-eff5e22cad96a'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Get a balance</h2><pre>';
print_r($itbit->balance('ab09412e-4129-4d6a-bca4-eff5e22cad96a','USD'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Get gets orders for a wallet</h2><pre>';
print_r($itbit->orders('ab09412e-4129-4d6a-bca4-eff5e22cad96a'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Get gets trades for a wallet</h2><pre>';
print_r($itbit->trades('ab09412e-4129-4d6a-bca4-eff5e22cad96a'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Cancel an open order</h2><pre>';
print_r($itbit->cancel('ab09412e-4129-4d6a-bca4-eff5e22cad96a','abe1124214-1424-1f42-dfe1-142415512'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Create an order</h2><pre>';
// Create an order to sell 1.0042 BTC at a price of $259.92
print_r($itbit->create_order('ab09412e-4129-4d6a-bca4-eff5e22cad96a','sell', 1.0042, 259.92));
echo '</pre>';
echo '<h2>Withdrawl some BTC</h2><pre>';
print_r($itbit->withdraw('ab09412e-4129-4d6a-bca4-eff5e22cad96a',1.492,'1FqfWC3oX2jybUvtsggNtct7MciKJpM6yh'));
echo '</pre>';
sleep(1); // Wait so that we can get new nonce
echo '<h2>Get a deposit address</h2><pre>';
print_r($itbit->deposit('ab09412e-4129-4d6a-bca4-eff5e22cad96a'));
echo '</pre>';