Skip to content

Commit

Permalink
Merge pull request #75 from orcaprotocol/willkim/batch-mint-burn
Browse files Browse the repository at this point in the history
feat: add batch mint/burn
  • Loading branch information
Will Kim authored Aug 19, 2022
2 parents 492a581 + a0a8b5c commit c54dc62
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 61 deletions.
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions docs/classes/Pod.html

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions docs/classes/Proposal.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ <h1>orca-sdk</h1>
<h2>Getting Started</h2>
</a>
<p>Initialize the SDK with the init function on startup:</p>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">init</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&quot;@orcaprotocol/orca-sdk&quot;</span><span class="hl-0">;</span><br/><br/><span class="hl-3">// Any ethers provider works.</span><br/><span class="hl-3">// 1 for mainnet, 4 for rinkeby.</span><br/><span class="hl-3">// Make sure that the provider is instantiated before the SDK</span><br/><span class="hl-6">init</span><span class="hl-0">({ </span><span class="hl-1">provider:</span><span class="hl-0"> </span><span class="hl-1">ethers</span><span class="hl-0">.</span><span class="hl-6">getDefaultProvider</span><span class="hl-0">(), </span><span class="hl-1">network:</span><span class="hl-0"> </span><span class="hl-4">1</span><span class="hl-0"> });</span>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">init</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&#39;@orcaprotocol/orca-sdk&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-3">// Any ethers provider works.</span><br/><span class="hl-3">// 1 for mainnet, 4 for rinkeby.</span><br/><span class="hl-3">// Make sure that the provider is instantiated before the SDK</span><br/><span class="hl-6">init</span><span class="hl-0">({ </span><span class="hl-1">provider:</span><span class="hl-0"> </span><span class="hl-1">ethers</span><span class="hl-0">.</span><span class="hl-6">getDefaultProvider</span><span class="hl-0">(), </span><span class="hl-1">network:</span><span class="hl-0"> </span><span class="hl-4">1</span><span class="hl-0"> });</span>
</code></pre>
<p>Once you init the SDK, you can call <code>getPod()</code>, <code>getUserPods()</code>, or <code>getAdminPods()</code> anywhere to
fetch Pod objects.</p>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">getPod</span><span class="hl-0">, </span><span class="hl-1">getUserPods</span><span class="hl-0">, </span><span class="hl-1">getAdminPods</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&quot;@orcaprotocol/orca-sdk&quot;</span><span class="hl-0">;</span><br/><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromEnsName</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&quot;mypod.pod.xyz&quot;</span><span class="hl-0">);</span><br/><span class="hl-3">// ENS names also work for the below.</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromAddress</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&quot;0x123...456&quot;</span><span class="hl-0">);</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromId</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-4">1</span><span class="hl-0">);</span><br/><span class="hl-3">// Returns null</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">notAPod</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&quot;not a pod&quot;</span><span class="hl-0">);</span><br/><br/><span class="hl-3">// Fetches all Pods that a user is a member of</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">userPods</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getUserPods</span><span class="hl-0">(</span><span class="hl-1">userAddress</span><span class="hl-0">);</span><br/><br/><span class="hl-3">// Fetches all Pods that a user is an admin of</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">adminPods</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getAdminPods</span><span class="hl-0">(</span><span class="hl-1">adminAddress</span><span class="hl-0">);</span>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">getPod</span><span class="hl-0">, </span><span class="hl-1">getUserPods</span><span class="hl-0">, </span><span class="hl-1">getAdminPods</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&#39;@orcaprotocol/orca-sdk&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromEnsName</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&#39;mypod.pod.xyz&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">// ENS names also work for the below.</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromAddress</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&#39;0x123...456&#39;</span><span class="hl-0">);</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">podFromId</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-4">1</span><span class="hl-0">);</span><br/><span class="hl-3">// Returns null</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">notAPod</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getPod</span><span class="hl-0">(</span><span class="hl-2">&#39;not a pod&#39;</span><span class="hl-0">);</span><br/><br/><span class="hl-3">// Fetches all Pods that a user is a member of</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">userPods</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getUserPods</span><span class="hl-0">(</span><span class="hl-1">userAddress</span><span class="hl-0">);</span><br/><br/><span class="hl-3">// Fetches all Pods that a user is an admin of</span><br/><span class="hl-7">const</span><span class="hl-0"> </span><span class="hl-8">adminPods</span><span class="hl-0"> = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-6">getAdminPods</span><span class="hl-0">(</span><span class="hl-1">adminAddress</span><span class="hl-0">);</span>
</code></pre>

<a href="#types" id="types" style="color: inherit; text-decoration: none;">
<h3>Types</h3>
</a>
<p>Types can be imported as such:</p>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">Pod</span><span class="hl-0">, </span><span class="hl-1">Proposal</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&quot;@orcaprotocol/orca-sdk&quot;</span><span class="hl-0">;</span>
<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-1">Pod</span><span class="hl-0">, </span><span class="hl-1">Proposal</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-2">&#39;@orcaprotocol/orca-sdk&#39;</span><span class="hl-0">;</span>
</code></pre>

<a href="#additional-documentation" id="additional-documentation" style="color: inherit; text-decoration: none;">
Expand Down
Loading

0 comments on commit c54dc62

Please sign in to comment.