Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuga-cb committed Apr 16, 2024
1 parent 718295d commit 17a3f47
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 96 deletions.
2 changes: 1 addition & 1 deletion docs/Coinbase.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ <h3 class="signature " id="init-class_method">
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/Coinbase/Address.html
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ <h3 class="signature " id="transfer-instance_method">
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/Coinbase/Network.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ <h3 class="signature first" id="chain_id-instance_method">
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/Coinbase/Transfer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ <h3 class="signature " id="wait!-instance_method">
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/Coinbase/Transfer/Status.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2>
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
172 changes: 102 additions & 70 deletions docs/Coinbase/Wallet.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<h2>Overview</h2><div class="docstring">
<div class="discussion">

<p>A crypto wallet.</p>
<p>A representation of a Wallet. Wallets have a set of addresses, each of which can hold a balance of one or more Assets. Wallets can create new addresses, list their addresses, list their balances, and transfer Assets to other addresses.</p>


</div>
Expand Down Expand Up @@ -287,7 +287,7 @@ <h2>
<li class="public ">
<span class="summary_signature">

<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; Wallet </a>
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(seed: nil) &#x21d2; Wallet </a>



Expand Down Expand Up @@ -391,7 +391,7 @@ <h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">

#<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Coinbase::Wallet (class)">Wallet</a></span></tt>
#<strong>initialize</strong>(seed: nil) &#x21d2; <tt><span class='object_link'><a href="" title="Coinbase::Wallet (class)">Wallet</a></span></tt>



Expand All @@ -406,18 +406,36 @@ <h3 class="signature first" id="initialize-instance_method">
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">

<li>

<span class='name'>seed</span>


<span class='type'>(<tt>Integer</tt>)</span>


<em class="default">(defaults to: <tt>nil</tt>)</em>


&mdash;
<div class='inline'>
<p>(Optional) The seed to use for the Wallet. Expects a 32-byte hexadecimal. If not provided, a new seed will be generated.</p>
</div>

</li>

</ul>


</div><table class="source_code">
<tr>
<td>
<pre class="lines">


12
13
14
15
16
17
18
Expand All @@ -426,14 +444,28 @@ <h3 class="signature first" id="initialize-instance_method">
21
22
23
24</pre>
24
25
26
27
28
29
30
31
32
33</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 12</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 16</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>seed:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_seed'>seed</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_seed'>seed</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>!=</span> <span class='int'>64</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Seed must be 32 bytes</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>end</span>

<span class='ivar'>@master</span> <span class='op'>=</span> <span class='id identifier rubyid_seed'>seed</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='const'>MoneyTree</span><span class='op'>::</span><span class='const'>Master</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='op'>:</span> <span class='const'>MoneyTree</span><span class='op'>::</span><span class='const'>Master</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>seed_hex:</span> <span class='id identifier rubyid_seed'>seed</span><span class='rparen'>)</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
<span class='ivar'>@wallet_id</span> <span class='op'>=</span> <span class='const'>SecureRandom</span><span class='period'>.</span><span class='id identifier rubyid_uuid'>uuid</span>
<span class='ivar'>@master</span> <span class='op'>=</span> <span class='const'>MoneyTree</span><span class='op'>::</span><span class='const'>Master</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='comment'># TODO: Make Network an argument to the constructor.
</span> <span class='ivar'>@network_id</span> <span class='op'>=</span> <span class='symbol'>:base_sepolia</span>
<span class='ivar'>@addresses</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
Expand Down Expand Up @@ -482,12 +514,12 @@ <h3 class="signature first" id="network_id-instance_method">
<pre class="lines">


9
10
11</pre>
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 9</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 11</span>

<span class='kw'>def</span> <span class='id identifier rubyid_network_id'>network_id</span>
<span class='ivar'>@network_id</span>
Expand Down Expand Up @@ -525,12 +557,12 @@ <h3 class="signature " id="wallet_id-instance_method">
<pre class="lines">


9
10
11</pre>
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 9</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 11</span>

<span class='kw'>def</span> <span class='id identifier rubyid_wallet_id'>wallet_id</span>
<span class='ivar'>@wallet_id</span>
Expand Down Expand Up @@ -591,19 +623,19 @@ <h3 class="signature first" id="create_address-instance_method">
<pre class="lines">


28
29
30
31
32
33
34
35
36
37</pre>
37
38
39
40
41
42
43
44
45
46</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 28</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 37</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create_address'>create_address</span>
<span class='comment'># TODO: Register with server.
Expand Down Expand Up @@ -664,12 +696,12 @@ <h3 class="signature " id="default_address-instance_method">
<pre class="lines">


41
42
43</pre>
50
51
52</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 41</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 50</span>

<span class='kw'>def</span> <span class='id identifier rubyid_default_address'>default_address</span>
<span class='ivar'>@addresses</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
Expand Down Expand Up @@ -743,12 +775,12 @@ <h3 class="signature " id="get_address-instance_method">
<pre class="lines">


48
49
50</pre>
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 48</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 57</span>

<span class='kw'>def</span> <span class='id identifier rubyid_get_address'>get_address</span><span class='lparen'>(</span><span class='id identifier rubyid_address_id'>address_id</span><span class='rparen'>)</span>
<span class='ivar'>@addresses</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_address'>address</span><span class='op'>|</span> <span class='id identifier rubyid_address'>address</span><span class='period'>.</span><span class='id identifier rubyid_address_id'>address_id</span> <span class='op'>==</span> <span class='id identifier rubyid_address_id'>address_id</span> <span class='rbrace'>}</span>
Expand Down Expand Up @@ -822,12 +854,12 @@ <h3 class="signature " id="get_balance-instance_method">
<pre class="lines">


79
80
81</pre>
88
89
90</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 79</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 88</span>

<span class='kw'>def</span> <span class='id identifier rubyid_get_balance'>get_balance</span><span class='lparen'>(</span><span class='id identifier rubyid_asset_id'>asset_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_balances'>list_balances</span><span class='lbracket'>[</span><span class='id identifier rubyid_asset_id'>asset_id</span><span class='rbracket'>]</span>
Expand Down Expand Up @@ -881,13 +913,13 @@ <h3 class="signature " id="list_addresses-instance_method">
<pre class="lines">


54
55
56
57</pre>
63
64
65
66</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 54</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 63</span>

<span class='kw'>def</span> <span class='id identifier rubyid_list_addresses'>list_addresses</span>
<span class='comment'># TODO: Register with server.
Expand Down Expand Up @@ -942,23 +974,23 @@ <h3 class="signature " id="list_balances-instance_method">
<pre class="lines">


61
62
63
64
65
66
67
68
69
70
71
72
73
74</pre>
74
75
76
77
78
79
80
81
82
83</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 61</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 70</span>

<span class='kw'>def</span> <span class='id identifier rubyid_list_balances'>list_balances</span>
<span class='id identifier rubyid_balance_map'>balance_map</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
Expand Down Expand Up @@ -1075,22 +1107,22 @@ <h3 class="signature " id="transfer-instance_method">
<pre class="lines">


92
93
94
95
96
97
98
99
100
101
102
103
104</pre>
104
105
106
107
108
109
110
111
112
113</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 92</span>
<pre class="code"><span class="info file"># File 'lib/coinbase/wallet.rb', line 101</span>

<span class='kw'>def</span> <span class='id identifier rubyid_transfer'>transfer</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='comma'>,</span> <span class='id identifier rubyid_asset_id'>asset_id</span><span class='comma'>,</span> <span class='id identifier rubyid_destination'>destination</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_destination'>destination</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Coinbase::Wallet (class)">Wallet</a></span></span><span class='rparen'>)</span>
Expand All @@ -1115,7 +1147,7 @@ <h3 class="signature " id="transfer-instance_method">
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:27 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ <h2>Namespace Listing A-Z</h2>
</div>

<div id="footer">
Generated on Mon Apr 15 18:46:26 2024 by
Generated on Tue Apr 16 08:42:21 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
10 changes: 2 additions & 8 deletions docs/file.README.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ <h1 id="label-Coinbase+Ruby+SDK">Coinbase Ruby SDK</h1>

<h2 id="label-Documentation">Documentation</h2>

<blockquote>
<p>TODO</p>
</blockquote>
<p><a href="https://super-barnacle-n8zkznw.pages.github.io/">Click here for full SDK documentation</a></p>

<h2 id="label-Installation">Installation</h2>

Expand Down Expand Up @@ -100,10 +98,6 @@ <h3 id="label-Requirements">Requirements</h3>

<h2 id="label-Usage">Usage</h2>

<blockquote>
<p>TODO</p>
</blockquote>

<h3 id="label-Sample+Code+Snippet">Sample Code Snippet</h3>

<p>The following creates an in-memory self-custodial wallet. After the wallet is funded with ETH, it transfers some 100 Wei to a different wallet.</p>
Expand Down Expand Up @@ -195,7 +189,7 @@ <h3 id="label-Generating+Documentation">Generating Documentation</h3>
</div></div>

<div id="footer">
Generated on Mon Apr 15 18:46:26 2024 by
Generated on Tue Apr 16 08:42:22 2024 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.36 (ruby-2.7.0).
</div>
Expand Down
Loading

0 comments on commit 17a3f47

Please sign in to comment.