Skip to content

Instantly share code, notes, and snippets.

Created July 28, 2022 03:14
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)
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!')
Copy link

rhettre commented Jul 28, 2022

deposit-bitcoin 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:

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