Expose toTx function and rerun docs (#6)

- expose helper fn toTx function to help convert ix to transaction-builder
This commit is contained in:
meep 2022-05-12 10:47:00 -07:00 committed by GitHub
parent 4ed3036586
commit 5e800f24fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 208 additions and 166 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ParsableEntity | @orca-so/whirlpools-sdk</title><meta name="description" content="Documentation for @orca-so/whirlpools-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@orca-so/whirlpools-sdk</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@orca-so/whirlpools-sdk</a></li><li><a href="ParsableEntity.html">ParsableEntity</a></li></ul><h1>Interface ParsableEntity&lt;T&gt; </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Static abstract class definition to parse entities.</p>
</div></div></section><section class="tsd-panel tsd-type-parameters"><h3>Type parameters</h3><ul class="tsd-type-parameters"><li><h4>T</h4></li></ul></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ParsableEntity</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="ParsableEntity.html#parse" class="tsd-kind-icon">parse</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="parse" class="tsd-anchor"></a><h3 class="tsd-anchor-link">parse<a href="#parse" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">parse<span class="tsd-signature-symbol">(</span>accountData<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/network/public/parsing.ts#L26">network/public/parsing.ts:26</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-type-parameters"><h3>Type parameters</h3><ul class="tsd-type-parameters"><li><h4>T</h4></li></ul></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">ParsableEntity</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="ParsableEntity.html#parse" class="tsd-kind-icon">parse</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="parse" class="tsd-anchor"></a><h3 class="tsd-anchor-link">parse<a href="#parse" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">parse<span class="tsd-signature-symbol">(</span>accountData<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/network/public/parsing.ts#L26">network/public/parsing.ts:26</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Parse account data</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>accountData: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Buffer</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Buffer data for the entity</p>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Position | @orca-so/whirlpools-sdk</title><meta name="description" content="Documentation for @orca-so/whirlpools-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@orca-so/whirlpools-sdk</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@orca-so/whirlpools-sdk</a></li><li><a href="Position.html">Position</a></li></ul><h1>Interface Position </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Helper class to interact with a Position account and build complex transactions.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Position</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#decreaseLiquidity" class="tsd-kind-icon">decrease<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getData" class="tsd-kind-icon">get<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#increaseLiquidity" class="tsd-kind-icon">increase<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#refreshData" class="tsd-kind-icon">refresh<wbr/>Data</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="decreaseLiquidity" class="tsd-anchor"></a><h3 class="tsd-anchor-link">decrease<wbr/>Liquidity<a href="#decreaseLiquidity" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">decrease<wbr/>Liquidity<span class="tsd-signature-symbol">(</span>liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#DecreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">DecreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L212">whirlpool-client.ts:212</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Position</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#decreaseLiquidity" class="tsd-kind-icon">decrease<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getData" class="tsd-kind-icon">get<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#increaseLiquidity" class="tsd-kind-icon">increase<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#refreshData" class="tsd-kind-icon">refresh<wbr/>Data</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="decreaseLiquidity" class="tsd-anchor"></a><h3 class="tsd-anchor-link">decrease<wbr/>Liquidity<a href="#decreaseLiquidity" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">decrease<wbr/>Liquidity<span class="tsd-signature-symbol">(</span>liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#DecreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">DecreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L212">whirlpool-client.ts:212</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Withdraw liquidity from this position.</p>
</div><div><p>If <code>positionWallet</code> is provided, the wallet owners have to sign this transaction.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>liquidityInput: <a href="../modules.html#DecreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">DecreaseLiquidityInput</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -10,10 +10,10 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> positionWallet: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>the transaction that will deposit the tokens into the position when executed.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Data<a href="#getData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L178">whirlpool-client.ts:178</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Data<a href="#getData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L178">whirlpool-client.ts:178</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the most recently fetched Position account data.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a></h4><div><p>most recently fetched PositionData for this address.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="increaseLiquidity" class="tsd-anchor"></a><h3 class="tsd-anchor-link">increase<wbr/>Liquidity<a href="#increaseLiquidity" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">increase<wbr/>Liquidity<span class="tsd-signature-symbol">(</span>liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L196">whirlpool-client.ts:196</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="increaseLiquidity" class="tsd-anchor"></a><h3 class="tsd-anchor-link">increase<wbr/>Liquidity<a href="#increaseLiquidity" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">increase<wbr/>Liquidity<span class="tsd-signature-symbol">(</span>liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L196">whirlpool-client.ts:196</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Deposit additional tokens into this postiion.</p>
</div><div><p>If <code>sourceWallet</code>, <code>positionWallet</code> is provided, the wallet owners have to sign this transaction.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>liquidityInput: <a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -23,7 +23,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> positionWallet: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>the transaction that will deposit the tokens into the position when executed.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="refreshData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">refresh<wbr/>Data<a href="#refreshData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">refresh<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L184">whirlpool-client.ts:184</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="refreshData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">refresh<wbr/>Data<a href="#refreshData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">refresh<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L184">whirlpool-client.ts:184</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch and return the most recently fetched Position account data.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#PositionData" class="tsd-signature-type" data-tsd-kind="Type alias">PositionData</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>the most up to date PositionData for this address.</p>
</div></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="Position.html" class="tsd-kind-icon">Position</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#decreaseLiquidity" class="tsd-kind-icon">decrease<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getData" class="tsd-kind-icon">get<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#increaseLiquidity" class="tsd-kind-icon">increase<wbr/>Liquidity</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#refreshData" class="tsd-kind-icon">refresh<wbr/>Data</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Whirlpool | @orca-so/whirlpools-sdk</title><meta name="description" content="Documentation for @orca-so/whirlpools-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@orca-so/whirlpools-sdk</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@orca-so/whirlpools-sdk</a></li><li><a href="Whirlpool.html">Whirlpool</a></li></ul><h1>Interface Whirlpool </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Helper class to interact with a Whirlpool account and build complex transactions.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Whirlpool</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#closePosition" class="tsd-kind-icon">close<wbr/>Position</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getData" class="tsd-kind-icon">get<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenAInfo" class="tsd-kind-icon">get<wbr/>TokenAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenBInfo" class="tsd-kind-icon">get<wbr/>TokenBInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#initTickArrayForTicks" class="tsd-kind-icon">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#openPosition" class="tsd-kind-icon">open<wbr/>Position</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#openPositionWithMetadata" class="tsd-kind-icon">open<wbr/>Position<wbr/>With<wbr/>Metadata</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#refreshData" class="tsd-kind-icon">refresh<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swap" class="tsd-kind-icon">swap</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="closePosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">close<wbr/>Position<a href="#closePosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">close<wbr/>Position<span class="tsd-signature-symbol">(</span>positionAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, slippageTolerance<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Percentage</span>, destinationWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L152">whirlpool-client.ts:152</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Whirlpool</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#closePosition" class="tsd-kind-icon">close<wbr/>Position</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getData" class="tsd-kind-icon">get<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenAInfo" class="tsd-kind-icon">get<wbr/>TokenAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenBInfo" class="tsd-kind-icon">get<wbr/>TokenBInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#initTickArrayForTicks" class="tsd-kind-icon">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#openPosition" class="tsd-kind-icon">open<wbr/>Position</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#openPositionWithMetadata" class="tsd-kind-icon">open<wbr/>Position<wbr/>With<wbr/>Metadata</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#refreshData" class="tsd-kind-icon">refresh<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swap" class="tsd-kind-icon">swap</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="closePosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">close<wbr/>Position<a href="#closePosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">close<wbr/>Position<span class="tsd-signature-symbol">(</span>positionAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, slippageTolerance<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Percentage</span>, destinationWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L152">whirlpool-client.ts:152</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Withdraw all tokens from a position, close the account and burn the position token.</p>
</div><div><p>Users have to collect all fees and rewards from this position prior to closing the account.</p>
<p>If <code>positionWallet</code> is provided, the wallet owner has to sign this transaction.</p>
@ -12,16 +12,16 @@
<p>optional - The wallet that the tokens withdrawn will be sent to. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> positionWallet: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - The wallet that houses the position token that corresponds to this position address. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Data<a href="#getData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L58">whirlpool-client.ts:58</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Data<a href="#getData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L58">whirlpool-client.ts:58</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the most recently fetched Whirlpool account data.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a></h4><div><p>most recently fetched WhirlpoolData for this address.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTokenAInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>TokenAInfo<a href="#getTokenAInfo" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>TokenAInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L70">whirlpool-client.ts:70</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTokenAInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>TokenAInfo<a href="#getTokenAInfo" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>TokenAInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L70">whirlpool-client.ts:70</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get the TokenInfo for token A of this pool.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></h4><div><p>TokenInfo for token A</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTokenBInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>TokenBInfo<a href="#getTokenBInfo" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>TokenBInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L76">whirlpool-client.ts:76</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTokenBInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>TokenBInfo<a href="#getTokenBInfo" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>TokenBInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L76">whirlpool-client.ts:76</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get the TokenInfo for token B of this pool.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#TokenInfo" class="tsd-signature-type" data-tsd-kind="Type alias">TokenInfo</a></h4><div><p>TokenInfo for token B</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="initTickArrayForTicks" class="tsd-anchor"></a><h3 class="tsd-anchor-link">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks<a href="#initTickArrayForTicks" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks<span class="tsd-signature-symbol">(</span>ticks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L90">whirlpool-client.ts:90</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="initTickArrayForTicks" class="tsd-anchor"></a><h3 class="tsd-anchor-link">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks<a href="#initTickArrayForTicks" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">init<wbr/>Tick<wbr/>Array<wbr/>For<wbr/>Ticks<span class="tsd-signature-symbol">(</span>ticks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L90">whirlpool-client.ts:90</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Initialize a set of tick-arrays to support the provided ticks.</p>
</div><div><p>This function does not ensure the provided tick index are within range and not initialized.</p>
<p>If <code>funder</code> is provided, the funder wallet has to sign this transaction.</p>
@ -30,7 +30,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> funder: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">TransactionBuilder</span></h4><div><p>a transaction that will initialize the defined tick-arrays if executed.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="openPosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">open<wbr/>Position<a href="#openPosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">open<wbr/>Position<span class="tsd-signature-symbol">(</span>tickLower<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, tickUpper<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L107">whirlpool-client.ts:107</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="openPosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">open<wbr/>Position<a href="#openPosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">open<wbr/>Position<span class="tsd-signature-symbol">(</span>tickLower<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, tickUpper<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L107">whirlpool-client.ts:107</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Open and fund a position on this Whirlpool.</p>
</div><div><p>User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.</p>
<p>If <code>funder</code> is provided, the funder wallet has to sign this transaction.</p>
@ -47,7 +47,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> funder: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p><code>positionMint</code> - the position to be created. <code>tx</code> - The transaction containing the instructions to perform the operation on chain.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="openPositionWithMetadata" class="tsd-anchor"></a><h3 class="tsd-anchor-link">open<wbr/>Position<wbr/>With<wbr/>Metadata<a href="#openPositionWithMetadata" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">open<wbr/>Position<wbr/>With<wbr/>Metadata<span class="tsd-signature-symbol">(</span>tickLower<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, tickUpper<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L131">whirlpool-client.ts:131</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="openPositionWithMetadata" class="tsd-anchor"></a><h3 class="tsd-anchor-link">open<wbr/>Position<wbr/>With<wbr/>Metadata<a href="#openPositionWithMetadata" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">open<wbr/>Position<wbr/>With<wbr/>Metadata<span class="tsd-signature-symbol">(</span>tickLower<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, tickUpper<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, liquidityInput<span class="tsd-signature-symbol">: </span><a href="../modules.html#IncreaseLiquidityInput" class="tsd-signature-type" data-tsd-kind="Type alias">IncreaseLiquidityInput</a>, sourceWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, positionWallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, funder<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L131">whirlpool-client.ts:131</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Open and fund a position with meta-data on this Whirlpool.</p>
</div><div><p>User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.</p>
<p>If <code>sourceWallet</code>, <code>positionWallet</code> or <code>funder</code> is provided, the wallet owners have to sign this transaction.</p>
@ -64,10 +64,10 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> funder: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>optional - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span>positionMint<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">; </span>tx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p><code>positionMint</code> - the position to be created. <code>tx</code> - The transaction containing the instructions to perform the operation on chain.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="refreshData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">refresh<wbr/>Data<a href="#refreshData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">refresh<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L64">whirlpool-client.ts:64</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="refreshData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">refresh<wbr/>Data<a href="#refreshData" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">refresh<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L64">whirlpool-client.ts:64</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch and return the most recently fetched Whirlpool account data.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../modules.html#WhirlpoolData" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolData</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>the most up to date WhirlpoolData for this address.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="swap" class="tsd-anchor"></a><h3 class="tsd-anchor-link">swap<a href="#swap" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">swap<span class="tsd-signature-symbol">(</span>quote<span class="tsd-signature-symbol">: </span><a href="../modules.html#SwapQuote" class="tsd-signature-type" data-tsd-kind="Type alias">SwapQuote</a>, wallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L166">whirlpool-client.ts:166</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="swap" class="tsd-anchor"></a><h3 class="tsd-anchor-link">swap<a href="#swap" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">swap<span class="tsd-signature-symbol">(</span>quote<span class="tsd-signature-symbol">: </span><a href="../modules.html#SwapQuote" class="tsd-signature-type" data-tsd-kind="Type alias">SwapQuote</a>, wallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L166">whirlpool-client.ts:166</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Perform a swap between tokenA and tokenB on this pool.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>quote: <a href="../modules.html#SwapQuote" class="tsd-signature-type" data-tsd-kind="Type alias">SwapQuote</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>A quote on the desired tokenIn and tokenOut for this swap. Use @link {swapQuote} to generate this object.</p>

View File

@ -1,11 +1,11 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WhirlpoolClient | @orca-so/whirlpools-sdk</title><meta name="description" content="Documentation for @orca-so/whirlpools-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@orca-so/whirlpools-sdk</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@orca-so/whirlpools-sdk</a></li><li><a href="WhirlpoolClient.html">WhirlpoolClient</a></li></ul><h1>Interface WhirlpoolClient </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Helper class to help interact with Whirlpool Accounts with a simpler interface.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">WhirlpoolClient</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPool" class="tsd-kind-icon">get<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPosition" class="tsd-kind-icon">get<wbr/>Position</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getPool" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Pool<a href="#getPool" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Pool<span class="tsd-signature-symbol">(</span>poolAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="Whirlpool.html" class="tsd-signature-type" data-tsd-kind="Interface">Whirlpool</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L27">whirlpool-client.ts:27</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">WhirlpoolClient</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPool" class="tsd-kind-icon">get<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPosition" class="tsd-kind-icon">get<wbr/>Position</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getPool" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Pool<a href="#getPool" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Pool<span class="tsd-signature-symbol">(</span>poolAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="Whirlpool.html" class="tsd-signature-type" data-tsd-kind="Interface">Whirlpool</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L27">whirlpool-client.ts:27</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get a Whirlpool object to interact with the Whirlpool account at the given address.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>poolAddress: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the address of the Whirlpool account</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="Whirlpool.html" class="tsd-signature-type" data-tsd-kind="Interface">Whirlpool</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>a Whirlpool object to interact with</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getPosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Position<a href="#getPosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Position<span class="tsd-signature-symbol">(</span>positionAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/2c9366a/sdk/src/whirlpool-client.ts#L34">whirlpool-client.ts:34</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getPosition" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Position<a href="#getPosition" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">get<wbr/>Position<span class="tsd-signature-symbol">(</span>positionAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/97bc505/sdk/src/whirlpool-client.ts#L34">whirlpool-client.ts:34</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get a Position object to interact with the Position account at the given address.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>positionAddress: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the address of the Position account</p>

File diff suppressed because one or more lines are too long

View File

@ -9,10 +9,9 @@ import {
} from "../instructions";
import { PositionData } from "../types/public";
import { Position } from "../whirlpool-client";
import { PublicKey, Signer } from "@solana/web3.js";
import { PublicKey } from "@solana/web3.js";
import { AccountFetcher } from "../network/public";
import { PDAUtil, TickUtil } from "../utils/public";
import { toTx } from "../utils/instructions-util";
import { PDAUtil, TickUtil, toTx } from "../utils/public";
export class PositionImpl implements Position {
private data: PositionData;

View File

@ -2,12 +2,6 @@ import { TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from "@solana/spl-token
import { OpenPositionParams } from "../instructions";
import * as anchor from "@project-serum/anchor";
import { SystemProgram } from "@solana/web3.js";
import { WhirlpoolContext } from "../context";
import { Instruction, TransactionBuilder } from "@orca-so/common-sdk";
export function toTx(ctx: WhirlpoolContext, ix: Instruction): TransactionBuilder {
return new TransactionBuilder(ctx.provider).addInstruction(ix);
}
export function openPositionAccounts(params: OpenPositionParams) {
const {

View File

@ -2,3 +2,4 @@ export * from "./pda-utils";
export * from "./price-math";
export * from "./tick-utils";
export * from "./pool-utils";
export * from "./ix-utils";

View File

@ -0,0 +1,6 @@
import { TransactionBuilder, Instruction } from "@orca-so/common-sdk";
import { WhirlpoolContext } from "../../context";
export function toTx(ctx: WhirlpoolContext, ix: Instruction): TransactionBuilder {
return new TransactionBuilder(ctx.provider).addInstruction(ix);
}

View File

@ -12,8 +12,7 @@ import {
ZERO_BN,
} from "../utils";
import { WhirlpoolTestFixture } from "../utils/fixture";
import { WhirlpoolIx } from "../../src";
import { toTx } from "../../src/utils/instructions-util";
import { toTx, WhirlpoolIx } from "../../src";
describe("close_position", () => {
const provider = anchor.Provider.local();

View File

@ -8,7 +8,7 @@ import {
PositionData,
collectFeesQuote,
TickArrayData,
TickUtil,
toTx,
WhirlpoolData,
WhirlpoolIx,
PDAUtil,
@ -25,7 +25,6 @@ import {
import { WhirlpoolTestFixture } from "../utils/fixture";
import { initTestPool } from "../utils/init-utils";
import { MathUtil } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("collect_fees", () => {
const provider = anchor.Provider.local();

View File

@ -2,12 +2,18 @@ import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { u64 } from "@solana/spl-token";
import Decimal from "decimal.js";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, PDAUtil } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
WhirlpoolData,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing, ZERO_BN, createTokenAccount, getTokenBalance } from "../utils";
import { WhirlpoolTestFixture } from "../utils/fixture";
import { initTestPool } from "../utils/init-utils";
import { MathUtil } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("collect_protocol_fees", () => {
const provider = anchor.Provider.local();

View File

@ -10,9 +10,9 @@ import {
WhirlpoolData,
PositionData,
TickArrayData,
TickUtil,
WhirlpoolIx,
TickArrayUtil,
toTx,
} from "../../src";
import {
TickSpacing,
@ -28,7 +28,6 @@ import {
import { WhirlpoolTestFixture } from "../utils/fixture";
import { initTestPool } from "../utils/init-utils";
import { MathUtil } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("collect_reward", () => {
const provider = anchor.Provider.local();

View File

@ -9,6 +9,7 @@ import {
TickArrayData,
PositionData,
WhirlpoolIx,
toTx,
} from "../../src";
import {
TickSpacing,
@ -24,7 +25,6 @@ import { WhirlpoolTestFixture } from "../utils/fixture";
import { initTestPool, openPosition, initTickArray } from "../utils/init-utils";
import { decreaseLiquidityQuoteByLiquidityWithParams } from "../../src/quotes/public/decrease-liquidity-quote";
import { MathUtil, Percentage } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("decrease_liquidity", () => {
const provider = anchor.Provider.local();

View File

@ -12,6 +12,7 @@ import {
PriceMath,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import {
TickSpacing,
@ -33,7 +34,6 @@ import {
} from "../utils/test-builders";
import { PoolUtil, toTokenAmount } from "../../src/utils/public/pool-utils";
import { MathUtil, TransactionBuilder } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("increase_liquidity", () => {
const provider = anchor.Provider.local();

View File

@ -6,10 +6,10 @@ import {
WhirlpoolsConfigData,
WhirlpoolIx,
InitConfigParams,
toTx,
} from "../../src";
import { systemTransferTx, ONE_SOL } from "../utils";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("initialize_config", () => {
const provider = anchor.Provider.local();

View File

@ -1,13 +1,19 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, FeeTierData, WhirlpoolIx, PDAUtil } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
FeeTierData,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing, systemTransferTx, ONE_SOL } from "../utils";
import { initFeeTier } from "../utils/init-utils";
import {
generateDefaultConfigParams,
generateDefaultInitFeeTierParams,
} from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("initialize_fee_tier", () => {
const provider = anchor.Provider.local();

View File

@ -11,6 +11,7 @@ import {
PriceMath,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import {
TickSpacing,
@ -22,7 +23,6 @@ import {
} from "../utils";
import { initTestPool, buildTestPoolParams } from "../utils/init-utils";
import { MathUtil } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("initialize_pool", () => {
const provider = anchor.Provider.local();

View File

@ -1,9 +1,8 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx } from "../../src";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, toTx } from "../../src";
import { TickSpacing, systemTransferTx, ONE_SOL, createMint } from "../utils";
import { initTestPool, initializeReward } from "../utils/init-utils";
import { toTx } from "../../src/utils/instructions-util";
describe("initialize_reward", () => {
const provider = anchor.Provider.local();

View File

@ -8,8 +8,8 @@ import {
InitPoolParams,
TickArrayData,
WhirlpoolIx,
toTx,
} from "../../src";
import { toTx } from "../../src/utils/instructions-util";
import { TickSpacing, systemTransferTx, ONE_SOL } from "../utils";
import { initTestPool, initTickArray } from "../utils/init-utils";
import { generateDefaultInitTickArrayParams } from "../utils/test-builders";

View File

@ -14,6 +14,7 @@ import {
MIN_TICK_INDEX,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import {
TickSpacing,
@ -27,7 +28,6 @@ import {
import { initTestPool, openPosition } from "../utils/init-utils";
import { generateDefaultOpenPositionParams } from "../utils/test-builders";
import { PDA } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("open_position", () => {
const provider = anchor.Provider.local();

View File

@ -17,6 +17,7 @@ import {
METADATA_PROGRAM_ADDRESS,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import {
TickSpacing,
@ -29,7 +30,7 @@ import {
} from "../utils";
import { initTestPool, openPositionWithMetadata } from "../utils/init-utils";
import { generateDefaultOpenPositionParams } from "../utils/test-builders";
import { openPositionAccounts, toTx } from "../../src/utils/instructions-util";
import { openPositionAccounts } from "../../src/utils/instructions-util";
import { PDA, TransactionBuilder } from "@orca-so/common-sdk";
describe("open_position_with_metadata", () => {

View File

@ -1,8 +1,13 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolsConfigData, WhirlpoolIx } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
WhirlpoolsConfigData,
WhirlpoolIx,
toTx,
} from "../../src";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_collect_protocol_fee_authority", () => {
const provider = anchor.Provider.local();

View File

@ -7,11 +7,11 @@ import {
InitPoolParams,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { createInOrderMints, generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_default_fee_rate", () => {
const provider = anchor.Provider.local();

View File

@ -7,11 +7,11 @@ import {
InitPoolParams,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { createInOrderMints } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_default_protocol_fee_rate", () => {
const provider = anchor.Provider.local();

View File

@ -1,8 +1,13 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolsConfigData, WhirlpoolIx } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
WhirlpoolsConfigData,
WhirlpoolIx,
toTx,
} from "../../src";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_fee_authority", () => {
const provider = anchor.Provider.local();

View File

@ -1,10 +1,9 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx } from "../../src";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, toTx } from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_fee_rate", () => {
const provider = anchor.Provider.local();

View File

@ -1,10 +1,9 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx } from "../../src";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, toTx } from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_protocol_fee_rate", () => {
const provider = anchor.Provider.local();

View File

@ -6,11 +6,11 @@ import {
NUM_REWARDS,
WhirlpoolData,
WhirlpoolIx,
toTx,
} from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { TransactionBuilder } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("set_reward_authority", () => {
const provider = anchor.Provider.local();

View File

@ -1,9 +1,8 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx } from "../../src";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, toTx } from "../../src";
import { TickSpacing } from "../utils";
import { initTestPool } from "../utils/init-utils";
import { toTx } from "../../src/utils/instructions-util";
describe("set_reward_authority_by_super_authority", () => {
const provider = anchor.Provider.local();

View File

@ -1,7 +1,6 @@
import * as anchor from "@project-serum/anchor";
import * as assert from "assert";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx } from "../../src";
import { toTx } from "../../src/utils/instructions-util";
import { WhirlpoolContext, AccountFetcher, WhirlpoolData, WhirlpoolIx, toTx } from "../../src";
import { TickSpacing, mintToByAuthority, ZERO_BN, createAndMintToTokenAccount } from "../utils";
import { initTestPool, initializeReward } from "../utils/init-utils";

View File

@ -1,8 +1,13 @@
import * as assert from "assert";
import * as anchor from "@project-serum/anchor";
import { WhirlpoolContext, AccountFetcher, WhirlpoolsConfigData, WhirlpoolIx } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
WhirlpoolsConfigData,
WhirlpoolIx,
toTx,
} from "../../src";
import { generateDefaultConfigParams } from "../utils/test-builders";
import { toTx } from "../../src/utils/instructions-util";
describe("set_reward_emissions_super_authority", () => {
const provider = anchor.Provider.local();

View File

@ -16,6 +16,7 @@ import {
PriceMath,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing, ZERO_BN, getTokenBalance, MAX_U64 } from "../utils";
import {
@ -28,7 +29,6 @@ import {
withdrawPositions,
} from "../utils/init-utils";
import { MathUtil, Percentage } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("swap", () => {
const provider = anchor.Provider.local();

View File

@ -2,12 +2,18 @@ import * as anchor from "@project-serum/anchor";
import * as assert from "assert";
import { u64 } from "@solana/spl-token";
import Decimal from "decimal.js";
import { WhirlpoolContext, AccountFetcher, PositionData, WhirlpoolIx, PDAUtil } from "../../src";
import {
WhirlpoolContext,
AccountFetcher,
PositionData,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import { TickSpacing, ZERO_BN, sleep } from "../utils";
import { WhirlpoolTestFixture } from "../utils/fixture";
import { initTestPool } from "../utils/init-utils";
import { MathUtil } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
describe("update_fees_and_rewards", () => {
const provider = anchor.Provider.local();

View File

@ -12,6 +12,7 @@ import {
PriceMath,
WhirlpoolIx,
PDAUtil,
toTx,
} from "../../src";
import {
generateDefaultConfigParams,
@ -31,7 +32,6 @@ import {
import { u64 } from "@solana/spl-token";
import { PoolUtil } from "../../src/utils/public/pool-utils";
import { MathUtil, PDA } from "@orca-so/common-sdk";
import { toTx } from "../../src/utils/instructions-util";
const defaultInitSqrtPrice = MathUtil.toX64_BN(new u64(5));