Skip to content

Commit

Permalink
[chore] Clean up README Code Snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase committed Sep 29, 2024
1 parent 105bc8c commit 1fd5d96
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To start, [create a CDP API key](https://portal.cdp.coinbase.com/access/api). Th
from cdp import *

api_key_name = "Copy your API key name here."
# Ensure that you are using double-quotes here.

api_key_private_key = "Copy your API key's private key here."

Cdp.configure(api_key_name, api_key_private_key)
Expand Down Expand Up @@ -80,6 +80,8 @@ Now create a wallet. Wallets are created with a single default address.
```python
# Create a wallet with one address by default.
wallet1 = Wallet.create()

print(f"Wallet successfully created: {wallet1}")
```

Wallets come with a single default address, accessible via `default_address`:
Expand Down Expand Up @@ -130,14 +132,19 @@ wallet3 = Wallet.create()

print(f"Wallet successfully created: {wallet3}")

# Fund the wallet with USDC with a faucet transaction.
usdc_faucet_tx = wallet1.faucet("usdc")

print(f"Faucet transaction successfully completed: {usdc_faucet_tx}")

transfer = wallet1.transfer(0.00001, "usdc", wallet3, gasless=True).wait()
```

## Listing Transfers

```python
# Return list of all transfers. This will paginate and fetch all transfers for the address.
address.transfers()
list(address.transfers())
```

## Trading Funds
Expand All @@ -159,6 +166,6 @@ print(f"Trade successfully completed: {trade}")

```python
# Return list of all trades. This will paginate and fetch all trades for the address.
address.trades()
list(address.trades())
```

0 comments on commit 1fd5d96

Please sign in to comment.