Skip to content

Commit

Permalink
deploy: 59ec96e
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase committed Oct 1, 2024
1 parent c22f7bf commit 9a19980
Show file tree
Hide file tree
Showing 18 changed files with 4,901 additions and 1,476 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a41a7d0e17897b9e539366cd1c48a5de
config: bf8541481986c27f33f0c7f04672c2f3
tags: 645f666f9bcd5a90fca523b33c5a78b7
21 changes: 16 additions & 5 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>CDP Python SDK &#8212; CDP SDK 0.0.3 documentation</title>
<title>CDP Python SDK &#8212; CDP SDK 0.0.4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
<link rel="stylesheet" type="text/css" href="_static/basic.css?v=c058f7c8" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
<script src="_static/documentation_options.js?v=47de8214"></script>
<script src="_static/documentation_options.js?v=8c5712d9"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
Expand Down Expand Up @@ -80,7 +80,7 @@ <h2>Creating a Wallet<a class="headerlink" href="#creating-a-wallet" title="Link
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">cdp</span> <span class="kn">import</span> <span class="o">*</span>

<span class="n">api_key_name</span> <span class="o">=</span> <span class="s2">&quot;Copy your API key name here.&quot;</span>
<span class="c1"># Ensure that you are using double-quotes here.</span>

<span class="n">api_key_private_key</span> <span class="o">=</span> <span class="s2">&quot;Copy your API key&#39;s private key here.&quot;</span>

<span class="n">Cdp</span><span class="o">.</span><span class="n">configure</span><span class="p">(</span><span class="n">api_key_name</span><span class="p">,</span> <span class="n">api_key_private_key</span><span class="p">)</span>
Expand All @@ -103,6 +103,8 @@ <h2>Creating a Wallet<a class="headerlink" href="#creating-a-wallet" title="Link
<p>Now create a wallet. Wallets are created with a single default address.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Create a wallet with one address by default.</span>
<span class="n">wallet1</span> <span class="o">=</span> <span class="n">Wallet</span><span class="o">.</span><span class="n">create</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Wallet successfully created: </span><span class="si">{</span><span class="n">wallet1</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>Wallets come with a single default address, accessible via <code class="docutils literal notranslate"><span class="pre">default_address</span></code>:</p>
Expand Down Expand Up @@ -146,6 +148,11 @@ <h3>Gasless USDC Transfers<a class="headerlink" href="#gasless-usdc-transfers" t

<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Wallet successfully created: </span><span class="si">{</span><span class="n">wallet3</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="c1"># Fund the wallet with USDC with a faucet transaction.</span>
<span class="n">usdc_faucet_tx</span> <span class="o">=</span> <span class="n">wallet1</span><span class="o">.</span><span class="n">faucet</span><span class="p">(</span><span class="s2">&quot;usdc&quot;</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Faucet transaction successfully completed: </span><span class="si">{</span><span class="n">usdc_faucet_tx</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="n">transfer</span> <span class="o">=</span> <span class="n">wallet1</span><span class="o">.</span><span class="n">transfer</span><span class="p">(</span><span class="mf">0.00001</span><span class="p">,</span> <span class="s2">&quot;usdc&quot;</span><span class="p">,</span> <span class="n">wallet3</span><span class="p">,</span> <span class="n">gasless</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span><span class="o">.</span><span class="n">wait</span><span class="p">()</span>
</pre></div>
</div>
Expand All @@ -154,7 +161,7 @@ <h3>Gasless USDC Transfers<a class="headerlink" href="#gasless-usdc-transfers" t
<section id="listing-transfers">
<h2>Listing Transfers<a class="headerlink" href="#listing-transfers" title="Link to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Return list of all transfers. This will paginate and fetch all transfers for the address.</span>
<span class="n">address</span><span class="o">.</span><span class="n">transfers</span><span class="p">()</span>
<span class="nb">list</span><span class="p">(</span><span class="n">address</span><span class="o">.</span><span class="n">transfers</span><span class="p">())</span>
</pre></div>
</div>
</section>
Expand All @@ -175,10 +182,14 @@ <h2>Trading Funds<a class="headerlink" href="#trading-funds" title="Link to this
<section id="listing-trades">
<h2>Listing Trades<a class="headerlink" href="#listing-trades" title="Link to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Return list of all trades. This will paginate and fetch all trades for the address.</span>
<span class="n">address</span><span class="o">.</span><span class="n">trades</span><span class="p">()</span>
<span class="nb">list</span><span class="p">(</span><span class="n">address</span><span class="o">.</span><span class="n">trades</span><span class="p">())</span>
</pre></div>
</div>
</section>
<section id="contributing">
<h2>Contributing<a class="headerlink" href="#contributing" title="Link to this heading"></a></h2>
<p>See <a class="reference internal" href="#CONTRIBUTING.md"><span class="xref myst">CONTRIBUTING.md</span></a> for more information.</p>
</section>
</section>


Expand Down
16 changes: 13 additions & 3 deletions _sources/README.md.txt
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,9 @@ 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())
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
8 changes: 8 additions & 0 deletions _sources/cdp.client.api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ cdp.client.api.trades\_api module
:undoc-members:
:show-inheritance:

cdp.client.api.transaction\_history\_api module
-----------------------------------------------

.. automodule:: cdp.client.api.transaction_history_api
:members:
:undoc-members:
:show-inheritance:

cdp.client.api.transfers\_api module
------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions _sources/cdp.client.models.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ cdp.client.models.create\_wallet\_request\_wallet module
:undoc-members:
:show-inheritance:

cdp.client.models.create\_wallet\_webhook\_request module
---------------------------------------------------------

.. automodule:: cdp.client.models.create_wallet_webhook_request
:members:
:undoc-members:
:show-inheritance:

cdp.client.models.create\_webhook\_request module
-------------------------------------------------

Expand Down Expand Up @@ -348,6 +356,14 @@ cdp.client.models.historical\_balance module
:undoc-members:
:show-inheritance:

cdp.client.models.multi\_token\_contract\_options module
--------------------------------------------------------

.. automodule:: cdp.client.models.multi_token_contract_options
:members:
:undoc-members:
:show-inheritance:

cdp.client.models.network module
--------------------------------

Expand Down
32 changes: 32 additions & 0 deletions _sources/cdp.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ cdp.cdp\_api\_client module
:undoc-members:
:show-inheritance:

cdp.contract\_invocation module
-------------------------------

.. automodule:: cdp.contract_invocation
:members:
:undoc-members:
:show-inheritance:

cdp.errors module
-----------------

Expand All @@ -84,6 +92,30 @@ cdp.faucet\_transaction module
:undoc-members:
:show-inheritance:

cdp.hash\_utils module
----------------------

.. automodule:: cdp.hash_utils
:members:
:undoc-members:
:show-inheritance:

cdp.payload\_signature module
-----------------------------

.. automodule:: cdp.payload_signature
:members:
:undoc-members:
:show-inheritance:

cdp.smart\_contract module
--------------------------

.. automodule:: cdp.smart_contract
:members:
:undoc-members:
:show-inheritance:

cdp.sponsored\_send module
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion _static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.0.3',
VERSION: '0.0.4',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
Loading

0 comments on commit 9a19980

Please sign in to comment.