def test_get_addresses(self): client = Client(api_key, api_secret) addresses = client.get_addresses('foo') self.assertIsInstance(addresses, APIObject) self.assertEqual(addresses.data, mock_collection) for address in addresses.data: self.assertIsInstance(address, Address)
def test_get_addresses(self): client = Client(api_key, api_secret) addresses = client.get_addresses('foo') self.assertIsInstance(addresses, APIObject) self.assertEqual(addresses.data, mock_collection) for address in addresses.data: self.assertIsInstance(address, Address)
def CoinBaseBalance(): print "Connecting To CoinBase..." client = CB_Client(CB_API_KEY, CB_API_SECRET, api_version="2017-05-19") accounts = client.get_accounts() wallets = {} for account in accounts.data: address_data = client.get_addresses(account.id).data x = int(random.random() * len(address_data)) #; x = 0 wallet_address = address_data[x].address print "\tRetrieving %s Wallet Data" % account.currency.name wallets.update({ account.balance.currency: { "AccountId": account.id, "Address": wallet_address, "Available": account.balance.amount, "Name": account.currency.name, "NativeBalance": account.native_balance.amount, "NativeCurrency": account.native_balance.currency, "Symbol": account.balance.currency, "TotalAmount": account.balance.amount } }) wallets.update({"ExchangeName": "CoinBase.com"}) print return wallets
from coinbase.wallet.client import Client api_key = 'bMX4e4Jwtpae3kH6' api_secret = 'Q005dyJjhNU6oYQh9Ut0zbCDwWKzjYhY' client = Client(api_key, api_secret) account_id='71c2f280-db2c-583e-89c2-d314915f19d0' #print client.get_addresses(account_id) #client.create_address(account_id) #print client.get_addresses(account_id) address_id = '1FT1JVmCgqX7MHv6HsTuknhwu9C3EkV3ms' #print client.get_address_transactions(account_id, address_id) #client.create_address(account_id,name="hi#123123") print client.get_addresses(account_id) #list(filter(lambda x:x.name=="hi#123123",alist.data)) txs = client.get_address_transactions(account_id,address_id) txs = client.get_transactions(account_id) tx = client.request_money(account_id, to='*****@*****.**', amount='1', currency='BTC')