def test_request_money(self):
     client = Client(api_key, api_secret)
     # Start with none of the required arguments, and slowly make requests with
     # an additional required argument, expecting failure until all arguments
     # are present.
     send_kwargs = {}
     required_kwargs = {'to': 'bar', 'amount': '1.0', 'currency': 'USD'}
     while required_kwargs:
         with self.assertRaises(ValueError):
             transaction = client.request_money('foo', **send_kwargs)
         for key in required_kwargs:
             send_kwargs[key] = required_kwargs.pop(key)
             break
     transaction = client.request_money('foo', **send_kwargs)
     self.assertIsInstance(transaction, Transaction)
     self.assertEqual(transaction, mock_item)
 def test_request_money(self):
   client = Client(api_key, api_secret)
   # Start with none of the required arguments, and slowly make requests with
   # an additional required argument, expecting failure until all arguments
   # are present.
   send_kwargs = {}
   required_kwargs = {'to': 'bar', 'amount': '1.0', 'currency': 'USD'}
   while required_kwargs:
     with self.assertRaises(ValueError):
       transaction = client.request_money('foo', **send_kwargs)
     for key in required_kwargs:
       send_kwargs[key] = required_kwargs.pop(key)
       break
   transaction = client.request_money('foo', **send_kwargs)
   self.assertIsInstance(transaction, Transaction)
   self.assertEqual(transaction, mock_item)
Exemple #3
0

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')