Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Coinbase Pro Deposit USD from Linked Bank Account
import json
import cbpro
my_key = ''
my_secret = ''
my_passphrase = ''
bank_id = ''
def _depositBTC(deposit_amount, cb_key, cb_secret, cb_password, bank_id):
auth_client = cbpro.AuthenticatedClient(cb_key, cb_secret, cb_password)
deposit = auth_client.deposit(deposit_amount, 'USD', bank_id)
print(deposit)
return deposit_amount
def lambda_handler(event, context):
deposit_amount = 20
message = _depositBTC(deposit_amount, my_key,my_secret,my_passphrase,bank_id)
return {
'statusCode': 200,
'body': json.dumps(f'You deposited ${message} to Coinbase!')
}
@rhettre
Copy link
Author

rhettre commented Jul 28, 2022

deposit-bitcoin lambda_function.py deposits $20 USD into your Coinbase Pro account from your linked bank account once you fill in your API key, secret, and password from Coinbase Pro. You will also need to run the function below to determine what your linked bank_id that you want to deposit from is. Get linked bank info here: https://gist.github.com/rhettre/ed1837ff66b1f00226f545a18550dae6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment