Add PoolGraph API and AdjacencyListGraph implementation (#90)

- Add PoolGraph API to allow trade route path finding with max hop of 2
- Add tests to verify behavior
- Update docs for PoolGraph API
- bump common-sdk to v0.1.12
This commit is contained in:
meep 2023-03-21 11:28:40 +08:00 committed by GitHub
parent 9a46642433
commit 3fe9cad66e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 1565 additions and 2498 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ test-ledger/
sdk/dist/
sdk/node_modules
.vscode/
.yalc/
yalc.lock

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

@ -0,0 +1,17 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PoolGraphBuilder | @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="PoolGraphBuilder.html">PoolGraphBuilder</a></li></ul><h1>Class PoolGraphBuilder </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>A builder class for creating a <a href="../modules.html#PoolGraph">PoolGraph</a></p>
</div><div><p>Note: we use an adjacency list as a representation of our pool graph,
since we assume that most token pairings don&#39;t exist as pools</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">PoolGraphBuilder</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>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="PoolGraphBuilder.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PoolGraphBuilder.html#buildPoolGraph" class="tsd-kind-icon">build<wbr/>Pool<wbr/>Graph</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PoolGraphBuilder.html#buildPoolGraphWithFetch" class="tsd-kind-icon">build<wbr/>Pool<wbr/>Graph<wbr/>With<wbr/>Fetch</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">constructor<a href="#constructor" 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-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Pool<wbr/>Graph<wbr/>Builder<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolGraphBuilder.html" class="tsd-signature-type" data-tsd-kind="Class">PoolGraphBuilder</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="PoolGraphBuilder.html" class="tsd-signature-type" data-tsd-kind="Class">PoolGraphBuilder</a></h4></li></ul></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-class tsd-is-static"><a id="buildPoolGraph" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> build<wbr/>Pool<wbr/>Graph<a href="#buildPoolGraph" 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-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">build<wbr/>Pool<wbr/>Graph<span class="tsd-signature-symbol">(</span>poolTokenPairs<span class="tsd-signature-symbol">: </span><a href="../interfaces/PoolTokenPair.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolTokenPair</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#PoolGraph" class="tsd-signature-type" data-tsd-kind="Type alias">PoolGraph</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/24e7de4/sdk/src/utils/graphs/public/pool-graph-builder.ts#L51">utils/graphs/public/pool-graph-builder.ts:51</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Build a <a href="../modules.html#PoolGraph">PoolGraph</a> from a list of pools in the format of <a href="../interfaces/PoolTokenPair.html">PoolTokenPair</a></p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>poolTokenPairs: <a href="../interfaces/PoolTokenPair.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolTokenPair</a><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>a list of <a href="../interfaces/PoolTokenPair.html">PoolTokenPair</a> to generate this pool graph</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="../modules.html#PoolGraph" class="tsd-signature-type" data-tsd-kind="Type alias">PoolGraph</a></h4><div><p>A <a href="../modules.html#PoolGraph">PoolGraph</a> with the provided pools</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static"><a id="buildPoolGraphWithFetch" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> build<wbr/>Pool<wbr/>Graph<wbr/>With<wbr/>Fetch<a href="#buildPoolGraphWithFetch" 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-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">build<wbr/>Pool<wbr/>Graph<wbr/>With<wbr/>Fetch<span class="tsd-signature-symbol">(</span>pools<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, fetcher<span class="tsd-signature-symbol">: </span><a href="AccountFetcher.html" class="tsd-signature-type" data-tsd-kind="Class">AccountFetcher</a><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#PoolGraph" class="tsd-signature-type" data-tsd-kind="Type alias">PoolGraph</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/24e7de4/sdk/src/utils/graphs/public/pool-graph-builder.ts#L22">utils/graphs/public/pool-graph-builder.ts:22</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch data and build a <a href="../modules.html#PoolGraph">PoolGraph</a> from a list of pools addresses</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>pools: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>a list of pool addresses to generate this pool graph</p>
</div></div></li><li><h5>fetcher: <a href="AccountFetcher.html" class="tsd-signature-type" data-tsd-kind="Class">AccountFetcher</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="AccountFetcher.html">AccountFetcher</a> to use for fetching pool data</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="../modules.html#PoolGraph" class="tsd-signature-type" data-tsd-kind="Type alias">PoolGraph</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A <a href="../modules.html#PoolGraph">PoolGraph</a> with the provided pools</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-class"><a href="PoolGraphBuilder.html" class="tsd-kind-icon">Pool<wbr/>Graph<wbr/>Builder</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="PoolGraphBuilder.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PoolGraphBuilder.html#buildPoolGraph" class="tsd-kind-icon">build<wbr/>Pool<wbr/>Graph</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PoolGraphBuilder.html#buildPoolGraphWithFetch" class="tsd-kind-icon">build<wbr/>Pool<wbr/>Graph<wbr/>With<wbr/>Fetch</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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>

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

@ -0,0 +1,35 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PriceModuleUtils | @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="PriceModuleUtils.html">PriceModuleUtils</a></li></ul><h1>Class PriceModuleUtils </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>A list of utility functions for the price module.</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">PriceModuleUtils</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>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="PriceModuleUtils.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchDecimalsForMints" class="tsd-kind-icon">fetch<wbr/>Decimals<wbr/>For<wbr/>Mints</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchPoolDataFromMints" class="tsd-kind-icon">fetch<wbr/>Pool<wbr/>Data<wbr/>From<wbr/>Mints</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchTickArraysForPools" class="tsd-kind-icon">fetch<wbr/>Tick<wbr/>Arrays<wbr/>For<wbr/>Pools</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">constructor<a href="#constructor" 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-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Price<wbr/>Module<wbr/>Utils<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PriceModuleUtils.html" class="tsd-signature-type" data-tsd-kind="Class">PriceModuleUtils</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="PriceModuleUtils.html" class="tsd-signature-type" data-tsd-kind="Class">PriceModuleUtils</a></h4></li></ul></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-class tsd-is-static"><a id="fetchDecimalsForMints" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> fetch<wbr/>Decimals<wbr/>For<wbr/>Mints<a href="#fetchDecimalsForMints" 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-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">fetch<wbr/>Decimals<wbr/>For<wbr/>Mints<span class="tsd-signature-symbol">(</span>ctx<span class="tsd-signature-symbol">: </span><a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a>, mints<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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#DecimalsMap" class="tsd-signature-type" data-tsd-kind="Type alias">DecimalsMap</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/24e7de4/sdk/src/prices/price-module.ts#L327">prices/price-module.ts:327</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch the decimals to token mapping for the given mints.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ctx: <a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="WhirlpoolContext.html">WhirlpoolContext</a></p>
</div></div></li><li><h5>mints: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The mints to fetch decimals for.</p>
</div></div></li><li><h5>refresh: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether to refresh the cache.</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="../modules.html#DecimalsMap" class="tsd-signature-type" data-tsd-kind="Type alias">DecimalsMap</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A <a href="../modules.html#DecimalsMap">DecimalsMap</a> of mint addresses to decimals.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static"><a id="fetchPoolDataFromMints" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> fetch<wbr/>Pool<wbr/>Data<wbr/>From<wbr/>Mints<a href="#fetchPoolDataFromMints" 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-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">fetch<wbr/>Pool<wbr/>Data<wbr/>From<wbr/>Mints<span class="tsd-signature-symbol">(</span>ctx<span class="tsd-signature-symbol">: </span><a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a>, mints<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, config<span class="tsd-signature-symbol">?: </span><a href="../modules.html#GetPricesConfig" class="tsd-signature-type" data-tsd-kind="Type alias">GetPricesConfig</a>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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#PoolMap" class="tsd-signature-type" data-tsd-kind="Type alias">PoolMap</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/24e7de4/sdk/src/prices/price-module.ts#L235">prices/price-module.ts:235</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch pool data for the given mints by deriving the PDA from all combinations of mints &amp; tick-arrays.
Note that this method can be slow.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ctx: <a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="WhirlpoolContext.html">WhirlpoolContext</a></p>
</div></div></li><li><h5>mints: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The mints to fetch pool data for.</p>
</div></div></li><li><h5>config: <a href="../modules.html#GetPricesConfig" class="tsd-signature-type" data-tsd-kind="Type alias">GetPricesConfig</a><span class="tsd-signature-symbol"> = defaultGetPricesConfig</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The configuration for the price calculation.</p>
</div></div></li><li><h5>refresh: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether to refresh the cache.</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="../modules.html#PoolMap" class="tsd-signature-type" data-tsd-kind="Type alias">PoolMap</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A <a href="../modules.html#PoolMap">PoolMap</a> of pool addresses to pool data.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static"><a id="fetchTickArraysForPools" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagStatic">Static</span> fetch<wbr/>Tick<wbr/>Arrays<wbr/>For<wbr/>Pools<a href="#fetchTickArraysForPools" 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-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">fetch<wbr/>Tick<wbr/>Arrays<wbr/>For<wbr/>Pools<span class="tsd-signature-symbol">(</span>ctx<span class="tsd-signature-symbol">: </span><a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a>, pools<span class="tsd-signature-symbol">: </span><a href="../modules.html#PoolMap" class="tsd-signature-type" data-tsd-kind="Type alias">PoolMap</a>, config<span class="tsd-signature-symbol">?: </span><a href="../modules.html#GetPricesConfig" class="tsd-signature-type" data-tsd-kind="Type alias">GetPricesConfig</a>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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#TickArrayMap" class="tsd-signature-type" data-tsd-kind="Type alias">TickArrayMap</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/24e7de4/sdk/src/prices/price-module.ts#L276">prices/price-module.ts:276</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Fetch tick-array data for the given pools</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ctx: <a href="WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="../modules.html#WhirlpoolData">WhirlpoolData</a></p>
</div></div></li><li><h5>pools: <a href="../modules.html#PoolMap" class="tsd-signature-type" data-tsd-kind="Type alias">PoolMap</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The pools to fetch tick-array data for.</p>
</div></div></li><li><h5>config: <a href="../modules.html#GetPricesConfig" class="tsd-signature-type" data-tsd-kind="Type alias">GetPricesConfig</a><span class="tsd-signature-symbol"> = defaultGetPricesConfig</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The configuration for the price calculation.</p>
</div></div></li><li><h5>refresh: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether to refresh the cache.</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="../modules.html#TickArrayMap" class="tsd-signature-type" data-tsd-kind="Type alias">TickArrayMap</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A <a href="../modules.html#TickArrayMap">TickArrayMap</a> of tick-array addresses to tick-array data.</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-class"><a href="PriceModuleUtils.html" class="tsd-kind-icon">Price<wbr/>Module<wbr/>Utils</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="PriceModuleUtils.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchDecimalsForMints" class="tsd-kind-icon">fetch<wbr/>Decimals<wbr/>For<wbr/>Mints</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchPoolDataFromMints" class="tsd-kind-icon">fetch<wbr/>Pool<wbr/>Data<wbr/>From<wbr/>Mints</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="PriceModuleUtils.html#fetchTickArraysForPools" class="tsd-kind-icon">fetch<wbr/>Tick<wbr/>Arrays<wbr/>For<wbr/>Pools</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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>

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,3 +1,3 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SwapDirection | @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="SwapDirection.html">SwapDirection</a></li></ul><h1>Enumeration SwapDirection </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>An enum for the direction of a swap.</p>
</div></div></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>Enumeration Members</h3><ul class="tsd-index-list"><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#AtoB" class="tsd-kind-icon">AtoB</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#BtoA" class="tsd-kind-icon">BtoA</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Enumeration Members</h2><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="AtoB" class="tsd-anchor"></a><h3 class="tsd-anchor-link">AtoB<a href="#AtoB" 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><div class="tsd-signature tsd-kind-icon">AtoB<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;aToB&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/bdb267e/sdk/src/utils/public/types.ts#L6">utils/public/types.ts:6</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="BtoA" class="tsd-anchor"></a><h3 class="tsd-anchor-link">BtoA<a href="#BtoA" 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><div class="tsd-signature tsd-kind-icon">BtoA<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;bToA&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/bdb267e/sdk/src/utils/public/types.ts#L7">utils/public/types.ts:7</a></li></ul></aside></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-enum"><a href="SwapDirection.html" class="tsd-kind-icon">Swap<wbr/>Direction</a><ul><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#AtoB" class="tsd-kind-icon">AtoB</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#BtoA" class="tsd-kind-icon">BtoA</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>
</div></div></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>Enumeration Members</h3><ul class="tsd-index-list"><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#AtoB" class="tsd-kind-icon">AtoB</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#BtoA" class="tsd-kind-icon">BtoA</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Enumeration Members</h2><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="AtoB" class="tsd-anchor"></a><h3 class="tsd-anchor-link">AtoB<a href="#AtoB" 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><div class="tsd-signature tsd-kind-icon">AtoB<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;aToB&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/24e7de4/sdk/src/utils/public/types.ts#L6">utils/public/types.ts:6</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="BtoA" class="tsd-anchor"></a><h3 class="tsd-anchor-link">BtoA<a href="#BtoA" 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><div class="tsd-signature tsd-kind-icon">BtoA<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;bToA&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/24e7de4/sdk/src/utils/public/types.ts#L7">utils/public/types.ts:7</a></li></ul></aside></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-enum"><a href="SwapDirection.html" class="tsd-kind-icon">Swap<wbr/>Direction</a><ul><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#AtoB" class="tsd-kind-icon">AtoB</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="SwapDirection.html#BtoA" class="tsd-kind-icon">BtoA</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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,3 +1,3 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>TokenType | @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="TokenType.html">TokenType</a></li></ul><h1>Enumeration TokenType </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>An enum for the token type in a Whirlpool.</p>
</div></div></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>Enumeration Members</h3><ul class="tsd-index-list"><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenA" class="tsd-kind-icon">TokenA</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenB" class="tsd-kind-icon">TokenB</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Enumeration Members</h2><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="TokenA" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TokenA<a href="#TokenA" 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><div class="tsd-signature tsd-kind-icon">TokenA<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">1</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/bdb267e/sdk/src/utils/public/types.ts#L15">utils/public/types.ts:15</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="TokenB" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TokenB<a href="#TokenB" 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><div class="tsd-signature tsd-kind-icon">TokenB<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">2</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/bdb267e/sdk/src/utils/public/types.ts#L16">utils/public/types.ts:16</a></li></ul></aside></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-enum"><a href="TokenType.html" class="tsd-kind-icon">Token<wbr/>Type</a><ul><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenA" class="tsd-kind-icon">TokenA</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenB" class="tsd-kind-icon">TokenB</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>
</div></div></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>Enumeration Members</h3><ul class="tsd-index-list"><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenA" class="tsd-kind-icon">TokenA</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenB" class="tsd-kind-icon">TokenB</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Enumeration Members</h2><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="TokenA" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TokenA<a href="#TokenA" 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><div class="tsd-signature tsd-kind-icon">TokenA<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">1</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/24e7de4/sdk/src/utils/public/types.ts#L15">utils/public/types.ts:15</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="TokenB" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TokenB<a href="#TokenB" 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><div class="tsd-signature tsd-kind-icon">TokenB<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">2</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/orca-so/whirlpools/blob/24e7de4/sdk/src/utils/public/types.ts#L16">utils/public/types.ts:16</a></li></ul></aside></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-enum"><a href="TokenType.html" class="tsd-kind-icon">Token<wbr/>Type</a><ul><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenA" class="tsd-kind-icon">TokenA</a></li><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="TokenType.html#TokenB" class="tsd-kind-icon">TokenB</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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>

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
<!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/bdb267e/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/24e7de4/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>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <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></h4><div><p>Parsed entity</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 tsd-has-type-parameter"><a href="ParsableEntity.html" class="tsd-kind-icon">Parsable<wbr/>Entity</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="ParsableEntity.html#parse" class="tsd-kind-icon">parse</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>
</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 tsd-has-type-parameter"><a href="ParsableEntity.html" class="tsd-kind-icon">Parsable<wbr/>Entity</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="ParsableEntity.html#parse" class="tsd-kind-icon">parse</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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>

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>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#collectFees" class="tsd-kind-icon">collect<wbr/>Fees</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#collectRewards" class="tsd-kind-icon">collect<wbr/>Rewards</a></li><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getLowerTickData" class="tsd-kind-icon">get<wbr/>Lower<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getUpperTickData" class="tsd-kind-icon">get<wbr/>Upper<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getWhirlpoolData" class="tsd-kind-icon">get<wbr/>Whirlpool<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="collectFees" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Fees<a href="#collectFees" 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">collect<wbr/>Fees<span class="tsd-signature-symbol">(</span>updateFeesAndRewards<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, ownerTokenAccountMap<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</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>, ataPayer<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/bdb267e/sdk/src/whirlpool-client.ts#L377">whirlpool-client.ts:377</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#collectFees" class="tsd-kind-icon">collect<wbr/>Fees</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#collectRewards" class="tsd-kind-icon">collect<wbr/>Rewards</a></li><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getLowerTickData" class="tsd-kind-icon">get<wbr/>Lower<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getUpperTickData" class="tsd-kind-icon">get<wbr/>Upper<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getWhirlpoolData" class="tsd-kind-icon">get<wbr/>Whirlpool<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="collectFees" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Fees<a href="#collectFees" 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">collect<wbr/>Fees<span class="tsd-signature-symbol">(</span>updateFeesAndRewards<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, ownerTokenAccountMap<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</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>, ataPayer<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/24e7de4/sdk/src/whirlpool-client.ts#L376">whirlpool-client.ts:376</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Collect fees 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><span class="tsd-flag ts-flagOptional">Optional</span> updateFeesAndRewards: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -16,7 +16,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>set to true to bypass cached on-chain data</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 collect fees from the position</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="collectRewards" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Rewards<a href="#collectRewards" 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">collect<wbr/>Rewards<span class="tsd-signature-symbol">(</span>rewardsToCollect<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, updateFeesAndRewards<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, ownerTokenAccountMap<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</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>, ataPayer<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/bdb267e/sdk/src/whirlpool-client.ts#L400">whirlpool-client.ts:400</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="collectRewards" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Rewards<a href="#collectRewards" 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">collect<wbr/>Rewards<span class="tsd-signature-symbol">(</span>rewardsToCollect<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, updateFeesAndRewards<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, ownerTokenAccountMap<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</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>, ataPayer<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Address</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/24e7de4/sdk/src/whirlpool-client.ts#L399">whirlpool-client.ts:399</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Collect rewards 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><span class="tsd-flag ts-flagOptional">Optional</span> rewardsToCollect: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -34,7 +34,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>set to true to bypass cached on-chain data</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 collect fees from the position</p>
</div></li></ul></section><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>, resolveATA<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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>, ataPayer<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/bdb267e/sdk/src/whirlpool-client.ts#L356">whirlpool-client.ts:356</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="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>, resolveATA<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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>, ataPayer<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/24e7de4/sdk/src/whirlpool-client.ts#L355">whirlpool-client.ts:355</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">
@ -48,22 +48,22 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> ataPayer: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>wallet that will fund the creation of the new associated token accounts</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="getAddress" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Address<a href="#getAddress" 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/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</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/bdb267e/sdk/src/whirlpool-client.ts#L292">whirlpool-client.ts:292</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="getAddress" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Address<a href="#getAddress" 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/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</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/24e7de4/sdk/src/whirlpool-client.ts#L291">whirlpool-client.ts:291</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the address for this Whirlpool instance.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">PublicKey</span></h4><div><p>the PublicKey for this Whirlpool instance.</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/bdb267e/sdk/src/whirlpool-client.ts#L298">whirlpool-client.ts:298</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/24e7de4/sdk/src/whirlpool-client.ts#L297">whirlpool-client.ts:297</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="getLowerTickData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Lower<wbr/>Tick<wbr/>Data<a href="#getLowerTickData" 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/>Lower<wbr/>Tick<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</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/bdb267e/sdk/src/whirlpool-client.ts#L310">whirlpool-client.ts:310</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="getLowerTickData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Lower<wbr/>Tick<wbr/>Data<a href="#getLowerTickData" 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/>Lower<wbr/>Tick<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</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/24e7de4/sdk/src/whirlpool-client.ts#L309">whirlpool-client.ts:309</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the most recently fetched TickData account data for this position&#39;s lower tick.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</a></h4><div><p>most recently fetched TickData for this position&#39;s lower tick.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getUpperTickData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Upper<wbr/>Tick<wbr/>Data<a href="#getUpperTickData" 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/>Upper<wbr/>Tick<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</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/bdb267e/sdk/src/whirlpool-client.ts#L316">whirlpool-client.ts:316</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="getUpperTickData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Upper<wbr/>Tick<wbr/>Data<a href="#getUpperTickData" 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/>Upper<wbr/>Tick<wbr/>Data<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</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/24e7de4/sdk/src/whirlpool-client.ts#L315">whirlpool-client.ts:315</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the most recently fetched TickData account data for this position&#39;s upper tick.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#TickData" class="tsd-signature-type" data-tsd-kind="Type alias">TickData</a></h4><div><p>most recently fetched TickData for this position&#39;s upper tick.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getWhirlpoolData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Whirlpool<wbr/>Data<a href="#getWhirlpoolData" 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/>Whirlpool<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/bdb267e/sdk/src/whirlpool-client.ts#L304">whirlpool-client.ts:304</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="getWhirlpoolData" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Whirlpool<wbr/>Data<a href="#getWhirlpoolData" 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/>Whirlpool<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/24e7de4/sdk/src/whirlpool-client.ts#L303">whirlpool-client.ts:303</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the most recently fetched Whirlpool account data for this position.</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 position.</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>, resolveATA<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, wallet<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>, ataPayer<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/bdb267e/sdk/src/whirlpool-client.ts#L336">whirlpool-client.ts:336</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>, resolveATA<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, wallet<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>, ataPayer<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/24e7de4/sdk/src/whirlpool-client.ts#L335">whirlpool-client.ts:335</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Deposit additional tokens into this postiion.
The wallet must contain the position token and the necessary token A &amp; B to complete the deposit.
If <code>positionWallet</code> and <code>wallet</code> is provided, the wallet owners have to sign this transaction.</p>
@ -78,7 +78,7 @@ If <code>positionWallet</code> and <code>wallet</code> is provided, the wallet
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> ataPayer: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>wallet that will fund the creation of the new associated token accounts</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/bdb267e/sdk/src/whirlpool-client.ts#L322">whirlpool-client.ts:322</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/24e7de4/sdk/src/whirlpool-client.ts#L321">whirlpool-client.ts:321</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#collectFees" class="tsd-kind-icon">collect<wbr/>Fees</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#collectRewards" class="tsd-kind-icon">collect<wbr/>Rewards</a></li><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getLowerTickData" class="tsd-kind-icon">get<wbr/>Lower<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getUpperTickData" class="tsd-kind-icon">get<wbr/>Upper<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getWhirlpoolData" class="tsd-kind-icon">get<wbr/>Whirlpool<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>
</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#collectFees" class="tsd-kind-icon">collect<wbr/>Fees</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#collectRewards" class="tsd-kind-icon">collect<wbr/>Rewards</a></li><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getLowerTickData" class="tsd-kind-icon">get<wbr/>Lower<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getUpperTickData" class="tsd-kind-icon">get<wbr/>Upper<wbr/>Tick<wbr/>Data</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Position.html#getWhirlpoolData" class="tsd-kind-icon">get<wbr/>Whirlpool<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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getRewardInfos" class="tsd-kind-icon">get<wbr/>Reward<wbr/>Infos</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#getTokenVaultAInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenVaultBInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultBInfo</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swapWithDevFees" class="tsd-kind-icon">swap<wbr/>With<wbr/>Dev<wbr/>Fees</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>, payer<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">[]</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/bdb267e/sdk/src/whirlpool-client.ts#L249">whirlpool-client.ts:249</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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getRewardInfos" class="tsd-kind-icon">get<wbr/>Reward<wbr/>Infos</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#getTokenVaultAInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenVaultBInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultBInfo</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swapWithDevFees" class="tsd-kind-icon">swap<wbr/>With<wbr/>Dev<wbr/>Fees</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>, payer<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">[]</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/24e7de4/sdk/src/whirlpool-client.ts#L248">whirlpool-client.ts:248</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>, <code>payer</code> is provided, the wallet owner has to sign this transaction.</p>
@ -14,28 +14,28 @@
<p>The wallet that houses the position token that corresponds to this position address. If null, the WhirlpoolContext wallet is used.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> payer: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the wallet that will fund the cost needed to initialize the token ATA accounts. 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">[]</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="getAddress" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Address<a href="#getAddress" 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/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</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/bdb267e/sdk/src/whirlpool-client.ts#L132">whirlpool-client.ts:132</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">[]</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="getAddress" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Address<a href="#getAddress" 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/>Address<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</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/24e7de4/sdk/src/whirlpool-client.ts#L131">whirlpool-client.ts:131</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Return the address for this Whirlpool instance.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">PublicKey</span></h4><div><p>the PublicKey for this Whirlpool instance.</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#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/bdb267e/sdk/src/whirlpool-client.ts#L138">whirlpool-client.ts:138</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#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/24e7de4/sdk/src/whirlpool-client.ts#L137">whirlpool-client.ts:137</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="getRewardInfos" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Reward<wbr/>Infos<a href="#getRewardInfos" 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/>Reward<wbr/>Infos<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#WhirlpoolRewardInfo" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolRewardInfo</a><span class="tsd-signature-symbol">[]</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/bdb267e/sdk/src/whirlpool-client.ts#L174">whirlpool-client.ts:174</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="getRewardInfos" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Reward<wbr/>Infos<a href="#getRewardInfos" 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/>Reward<wbr/>Infos<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#WhirlpoolRewardInfo" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolRewardInfo</a><span class="tsd-signature-symbol">[]</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/24e7de4/sdk/src/whirlpool-client.ts#L173">whirlpool-client.ts:173</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get the WhirlpoolRewardInfos for this pool.</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../modules.html#WhirlpoolRewardInfo" class="tsd-signature-type" data-tsd-kind="Type alias">WhirlpoolRewardInfo</a><span class="tsd-signature-symbol">[]</span></h4><div><p>Array of 3 WhirlpoolRewardInfos. However, not all of them may be initialized. Use the initialized field on WhirlpoolRewardInfo to check if the reward is active.</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/bdb267e/sdk/src/whirlpool-client.ts#L150">whirlpool-client.ts:150</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/24e7de4/sdk/src/whirlpool-client.ts#L149">whirlpool-client.ts:149</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/bdb267e/sdk/src/whirlpool-client.ts#L156">whirlpool-client.ts:156</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/24e7de4/sdk/src/whirlpool-client.ts#L155">whirlpool-client.ts:155</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="getTokenVaultAInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Token<wbr/>VaultAInfo<a href="#getTokenVaultAInfo" 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/>Token<wbr/>VaultAInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AccountInfo</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/bdb267e/sdk/src/whirlpool-client.ts#L162">whirlpool-client.ts:162</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="getTokenVaultAInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Token<wbr/>VaultAInfo<a href="#getTokenVaultAInfo" 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/>Token<wbr/>VaultAInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AccountInfo</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/24e7de4/sdk/src/whirlpool-client.ts#L161">whirlpool-client.ts:161</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get the TokenAccountInfo for token vault A of this pool.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AccountInfo</span></h4><div><p>TokenAccountInfo for token vault A</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getTokenVaultBInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Token<wbr/>VaultBInfo<a href="#getTokenVaultBInfo" 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/>Token<wbr/>VaultBInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AccountInfo</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/bdb267e/sdk/src/whirlpool-client.ts#L168">whirlpool-client.ts:168</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="getTokenVaultBInfo" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Token<wbr/>VaultBInfo<a href="#getTokenVaultBInfo" 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/>Token<wbr/>VaultBInfo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AccountInfo</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/24e7de4/sdk/src/whirlpool-client.ts#L167">whirlpool-client.ts:167</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get the TokenAccountInfo for token vault B of this pool.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AccountInfo</span></h4><div><p>TokenAccountInfo for token vault 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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">null</span><span class="tsd-signature-symbol"> | </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/bdb267e/sdk/src/whirlpool-client.ts#L186">whirlpool-client.ts:186</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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">null</span><span class="tsd-signature-symbol"> | </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/24e7de4/sdk/src/whirlpool-client.ts#L185">whirlpool-client.ts:185</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Initialize a set of tick-arrays that encompasses the provided ticks.</p>
</div><div><p>If <code>funder</code> is provided, the funder wallet has to sign this transaction.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>ticks: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -45,7 +45,7 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>whether this operation will fetch for the latest accounts if a cache version is available.</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">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">TransactionBuilder</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>a transaction that will initialize the defined tick-arrays if executed. Return null if all of the tick&#39;s arrays are initialized.</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>, wallet<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/bdb267e/sdk/src/whirlpool-client.ts#L206">whirlpool-client.ts:206</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>, wallet<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/24e7de4/sdk/src/whirlpool-client.ts#L205">whirlpool-client.ts:205</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>wallet</code> or <code>funder</code> is provided, those wallets have to sign this transaction.</p>
@ -60,7 +60,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>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>, wallet<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/bdb267e/sdk/src/whirlpool-client.ts#L228">whirlpool-client.ts:228</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>, wallet<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/24e7de4/sdk/src/whirlpool-client.ts#L227">whirlpool-client.ts:227</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>wallet</code> or <code>funder</code> is provided, the wallet owners have to sign this transaction.</p>
@ -75,17 +75,17 @@
</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>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/bdb267e/sdk/src/whirlpool-client.ts#L144">whirlpool-client.ts:144</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/24e7de4/sdk/src/whirlpool-client.ts#L143">whirlpool-client.ts:143</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>input<span class="tsd-signature-symbol">: </span><a href="../modules.html#SwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">SwapInput</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/bdb267e/sdk/src/whirlpool-client.ts#L264">whirlpool-client.ts:264</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>input<span class="tsd-signature-symbol">: </span><a href="../modules.html#SwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">SwapInput</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/24e7de4/sdk/src/whirlpool-client.ts#L263">whirlpool-client.ts:263</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>input: <a href="../modules.html#SwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">SwapInput</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>A quote on the desired tokenIn and tokenOut for this swap. Use <a href="../modules.html#swapQuoteWithParams">swapQuoteWithParams</a> or other swap quote functions to generate this object.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> wallet: <span class="tsd-signature-type">PublicKey</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The wallet that tokens will be withdrawn and deposit into. 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>a transaction that will perform the swap once executed.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="swapWithDevFees" class="tsd-anchor"></a><h3 class="tsd-anchor-link">swap<wbr/>With<wbr/>Dev<wbr/>Fees<a href="#swapWithDevFees" 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<wbr/>With<wbr/>Dev<wbr/>Fees<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><a href="../modules.html#DevFeeSwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">DevFeeSwapInput</a>, devFeeWallet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span>, wallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">PublicKey</span>, payer<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/bdb267e/sdk/src/whirlpool-client.ts#L275">whirlpool-client.ts:275</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="swapWithDevFees" class="tsd-anchor"></a><h3 class="tsd-anchor-link">swap<wbr/>With<wbr/>Dev<wbr/>Fees<a href="#swapWithDevFees" 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<wbr/>With<wbr/>Dev<wbr/>Fees<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><a href="../modules.html#DevFeeSwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">DevFeeSwapInput</a>, devFeeWallet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PublicKey</span>, wallet<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">PublicKey</span>, payer<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/24e7de4/sdk/src/whirlpool-client.ts#L274">whirlpool-client.ts:274</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Collect a developer fee and 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>input: <a href="../modules.html#DevFeeSwapInput" class="tsd-signature-type" data-tsd-kind="Type alias">DevFeeSwapInput</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>A quote on the desired tokenIn and tokenOut for this swap. Use <a href="../modules.html#swapQuoteByInputTokenWithDevFees">swapQuoteByInputTokenWithDevFees</a> to generate this object.</p>
@ -96,4 +96,4 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> payer: <span class="tsd-signature-type">PublicKey</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The wallet that will fund the cost needed to initialize the dev wallet token ATA accounts. 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>a transaction that will perform the swap once executed.</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="Whirlpool.html" class="tsd-kind-icon">Whirlpool</a><ul><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getRewardInfos" class="tsd-kind-icon">get<wbr/>Reward<wbr/>Infos</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#getTokenVaultAInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenVaultBInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultBInfo</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swapWithDevFees" class="tsd-kind-icon">swap<wbr/>With<wbr/>Dev<wbr/>Fees</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>
</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="Whirlpool.html" class="tsd-kind-icon">Whirlpool</a><ul><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#getAddress" class="tsd-kind-icon">get<wbr/>Address</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#getRewardInfos" class="tsd-kind-icon">get<wbr/>Reward<wbr/>Infos</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#getTokenVaultAInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultAInfo</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#getTokenVaultBInfo" class="tsd-kind-icon">get<wbr/>Token<wbr/>VaultBInfo</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="Whirlpool.html#swapWithDevFees" class="tsd-kind-icon">swap<wbr/>With<wbr/>Dev<wbr/>Fees</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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,17 +1,16 @@
<!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#collectFeesAndRewardsForPositions" class="tsd-kind-icon">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectProtocolFeesForPools" class="tsd-kind-icon">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#createPool" class="tsd-kind-icon">create<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getContext" class="tsd-kind-icon">get<wbr/>Context</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getFetcher" class="tsd-kind-icon">get<wbr/>Fetcher</a></li><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#getPools" class="tsd-kind-icon">get<wbr/>Pools</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPositions" class="tsd-kind-icon">get<wbr/>Positions</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="collectFeesAndRewardsForPositions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions<a href="#collectFeesAndRewardsForPositions" 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">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions<span class="tsd-signature-symbol">(</span>positionAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">[]</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/bdb267e/sdk/src/whirlpool-client.ts#L79">whirlpool-client.ts:79</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#collectFeesAndRewardsForPositions" class="tsd-kind-icon">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectProtocolFeesForPools" class="tsd-kind-icon">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#createPool" class="tsd-kind-icon">create<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getContext" class="tsd-kind-icon">get<wbr/>Context</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getFetcher" class="tsd-kind-icon">get<wbr/>Fetcher</a></li><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#getPools" class="tsd-kind-icon">get<wbr/>Pools</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPositions" class="tsd-kind-icon">get<wbr/>Positions</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="collectFeesAndRewardsForPositions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions<a href="#collectFeesAndRewardsForPositions" 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">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions<span class="tsd-signature-symbol">(</span>positionAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">[]</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/24e7de4/sdk/src/whirlpool-client.ts#L78">whirlpool-client.ts:78</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Collect all fees and rewards from a list of positions.</p>
</div><dl class="tsd-comment-tags"><dt>experimental</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>positionAddresses: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>true to always request newest data from chain with this request</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">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A set of transaction-builders to resolve ATA for affliated tokens, collect fee &amp; rewards for all positions.
The first transaction should always be processed as it contains all the resolve ATA instructions to receive tokens.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="collectProtocolFeesForPools" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools<a href="#collectProtocolFeesForPools" 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">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools<span class="tsd-signature-symbol">(</span>poolAddresses<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-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/bdb267e/sdk/src/whirlpool-client.ts#L109">whirlpool-client.ts:109</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">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>A set of transaction-builders to resolve ATA for affliated tokens, collect fee &amp; rewards for all positions.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="collectProtocolFeesForPools" class="tsd-anchor"></a><h3 class="tsd-anchor-link">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools<a href="#collectProtocolFeesForPools" 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">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools<span class="tsd-signature-symbol">(</span>poolAddresses<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-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/24e7de4/sdk/src/whirlpool-client.ts#L108">whirlpool-client.ts:108</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Collect protocol fees from a list of pools</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>poolAddresses: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the addresses of the Whirlpool accounts to collect protocol fees from</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>A transaction builder to resolve ATA for tokenA and tokenB if needed, and collect protocol fees for all pools</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="createPool" class="tsd-anchor"></a><h3 class="tsd-anchor-link">create<wbr/>Pool<a href="#createPool" 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">create<wbr/>Pool<span class="tsd-signature-symbol">(</span>whirlpoolsConfig<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tokenMintA<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tokenMintB<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tickSpacing<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, initialTick<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</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>poolKey<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/bdb267e/sdk/src/whirlpool-client.ts#L95">whirlpool-client.ts:95</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="createPool" class="tsd-anchor"></a><h3 class="tsd-anchor-link">create<wbr/>Pool<a href="#createPool" 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">create<wbr/>Pool<span class="tsd-signature-symbol">(</span>whirlpoolsConfig<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tokenMintA<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tokenMintB<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span>, tickSpacing<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, initialTick<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</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>poolKey<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/24e7de4/sdk/src/whirlpool-client.ts#L94">whirlpool-client.ts:94</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Create a Whirlpool account for a group of token A, token B and tick spacing</p>
</div><dl class="tsd-comment-tags"><dt>throws</dt><dd><p>error when the tokens are not in the canonical byte-based ordering. To resolve this, invert the token order and the initialTick (see <code>TickUtil.invertTick()</code>, <code>PriceMath.invertSqrtPriceX64()</code>, or <code>PriceMath.invertPrice()</code>).</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>whirlpoolsConfig: <span class="tsd-signature-type">Address</span></h5></li><li><h5>tokenMintA: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
@ -25,27 +24,27 @@
</div></div></li><li><h5>funder: <span class="tsd-signature-type">Address</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the account to debit SOL from to fund the creation of the account(s)</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>poolKey<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>poolKey</code>: The public key of the newly created whirlpool account. <code>tx</code>: The transaction containing instructions for the on-chain operations.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getContext" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Context<a href="#getContext" 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/>Context<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</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/bdb267e/sdk/src/whirlpool-client.ts#L27">whirlpool-client.ts:27</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="getContext" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Context<a href="#getContext" 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/>Context<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</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/24e7de4/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 this client&#39;s WhirlpoolContext object</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../classes/WhirlpoolContext.html" class="tsd-signature-type" data-tsd-kind="Class">WhirlpoolContext</a></h4><div><p>a WhirlpoolContext object</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getFetcher" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Fetcher<a href="#getFetcher" 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/>Fetcher<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/AccountFetcher.html" class="tsd-signature-type" data-tsd-kind="Class">AccountFetcher</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/bdb267e/sdk/src/whirlpool-client.ts#L33">whirlpool-client.ts:33</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="getFetcher" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Fetcher<a href="#getFetcher" 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/>Fetcher<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/AccountFetcher.html" class="tsd-signature-type" data-tsd-kind="Class">AccountFetcher</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/24e7de4/sdk/src/whirlpool-client.ts#L33">whirlpool-client.ts:33</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get an AccountFetcher to fetch Whirlpool accounts</p>
</div></div><h4 class="tsd-returns-title">Returns <a href="../classes/AccountFetcher.html" class="tsd-signature-type" data-tsd-kind="Class">AccountFetcher</a></h4><div><p>an AccountFetcher instance</p>
</div></li></ul></section><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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/bdb267e/sdk/src/whirlpool-client.ts#L41">whirlpool-client.ts:41</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="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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/24e7de4/sdk/src/whirlpool-client.ts#L41">whirlpool-client.ts:41</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><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>true to always request newest data from chain with this request</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="getPools" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Pools<a href="#getPools" 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/>Pools<span class="tsd-signature-symbol">(</span>poolAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">[]</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/bdb267e/sdk/src/whirlpool-client.ts#L49">whirlpool-client.ts:49</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="getPools" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Pools<a href="#getPools" 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/>Pools<span class="tsd-signature-symbol">(</span>poolAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">[]</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/24e7de4/sdk/src/whirlpool-client.ts#L49">whirlpool-client.ts:49</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get a list of Whirlpool objects matching the provided list of addresses.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>poolAddresses: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the addresses of the Whirlpool accounts</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>true to always request newest data from chain with this request</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">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>a list of Whirlpool objects 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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/bdb267e/sdk/src/whirlpool-client.ts#L58">whirlpool-client.ts:58</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>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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/24e7de4/sdk/src/whirlpool-client.ts#L58">whirlpool-client.ts:58</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><dl class="tsd-comment-tags"><dt>throws</dt><dd><p>error when address does not return a Position account.</p>
</dd></dl></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">
@ -53,9 +52,9 @@
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>true to always request newest data from chain with this request</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="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</span></h4><div><p>a Position object to interact with.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="getPositions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Positions<a href="#getPositions" 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/>Positions<span class="tsd-signature-symbol">(</span>positionAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</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/bdb267e/sdk/src/whirlpool-client.ts#L66">whirlpool-client.ts:66</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="getPositions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">get<wbr/>Positions<a href="#getPositions" 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/>Positions<span class="tsd-signature-symbol">(</span>positionAddresses<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span>, refresh<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</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/24e7de4/sdk/src/whirlpool-client.ts#L66">whirlpool-client.ts:66</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Get a list of Position objects to interact with the Position account at the given addresses.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>positionAddresses: <span class="tsd-signature-type">Address</span><span class="tsd-signature-symbol">[]</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> refresh: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>true to always request newest data from chain with this request</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">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Position.html" class="tsd-signature-type" data-tsd-kind="Interface">Position</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4><div><p>a Record object between account address and Position. If an address is not a Position account, it will be null.</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="WhirlpoolClient.html" class="tsd-kind-icon">Whirlpool<wbr/>Client</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectFeesAndRewardsForPositions" class="tsd-kind-icon">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectProtocolFeesForPools" class="tsd-kind-icon">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#createPool" class="tsd-kind-icon">create<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getContext" class="tsd-kind-icon">get<wbr/>Context</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getFetcher" class="tsd-kind-icon">get<wbr/>Fetcher</a></li><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#getPools" class="tsd-kind-icon">get<wbr/>Pools</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPositions" class="tsd-kind-icon">get<wbr/>Positions</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>
</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="WhirlpoolClient.html" class="tsd-kind-icon">Whirlpool<wbr/>Client</a><ul><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectFeesAndRewardsForPositions" class="tsd-kind-icon">collect<wbr/>Fees<wbr/>And<wbr/>Rewards<wbr/>For<wbr/>Positions</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#collectProtocolFeesForPools" class="tsd-kind-icon">collect<wbr/>Protocol<wbr/>Fees<wbr/>For<wbr/>Pools</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#createPool" class="tsd-kind-icon">create<wbr/>Pool</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getContext" class="tsd-kind-icon">get<wbr/>Context</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getFetcher" class="tsd-kind-icon">get<wbr/>Fetcher</a></li><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#getPools" class="tsd-kind-icon">get<wbr/>Pools</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><li class="tsd-kind-method tsd-parent-kind-interface"><a href="WhirlpoolClient.html#getPositions" class="tsd-kind-icon">get<wbr/>Positions</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-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><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-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><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>

File diff suppressed because one or more lines are too long

View File

@ -16,19 +16,18 @@
},
"devDependencies": {
"@types/bn.js": "~5.1.0",
"@types/jest": "^26.0.24",
"@types/mocha": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"chai": "^4.3.4",
"eslint-config-prettier": "^8.3.0",
"jest": "^27.0.6",
"mocha": "^9.0.3",
"prettier": "^2.3.2",
"process": "^0.11.10",
"ts-jest": "^27.0.3",
"typedoc": "~0.22.18",
"typescript": "^4.5.5"
"typescript": "^4.5.5",
"ts-mocha": "^9.0.0",
"ts-node": "^10.9.1"
},
"scripts": {
"build": "tsc -p src",

View File

@ -7,7 +7,10 @@ import { PositionData, WhirlpoolContext } from "../..";
import { WhirlpoolIx } from "../../ix";
import { WhirlpoolData } from "../../types/public";
import { PDAUtil, PoolUtil, TickUtil } from "../../utils/public";
import { getAssociatedTokenAddressSync, createWSOLAccountInstructions } from "../../utils/spl-token-utils";
import {
getAssociatedTokenAddressSync,
createWSOLAccountInstructions,
} from "../../utils/spl-token-utils";
import { convertListToMap, checkMergedTransactionSizeIsValid } from "../../utils/txn-utils";
import { getTokenMintsFromWhirlpools } from "../../utils/whirlpool-ata-utils";
import { updateFeesAndRewardsIx } from "../update-fees-and-rewards-ix";
@ -144,7 +147,7 @@ export async function collectAllForPositionsTxns(
resolvedAtas[NATIVE_MINT.toBase58()] = createWSOLAccountInstructions(
receiverKey,
ZERO,
accountExemption,
accountExemption
);
}
@ -158,7 +161,7 @@ export async function collectAllForPositionsTxns(
positionOwnerKey,
positionAuthorityKey,
resolvedAtas,
touchedMints,
touchedMints
);
const positionTxBuilder = new TransactionBuilder(ctx.connection, ctx.wallet);
positionTxBuilder.addInstructions(collectIxForPosition);
@ -169,7 +172,7 @@ export async function collectAllForPositionsTxns(
const mergeable = await checkMergedTransactionSizeIsValid(
ctx,
[pendingTxBuilder, positionTxBuilder],
latestBlockhash,
latestBlockhash
);
if (mergeable) {
pendingTxBuilder.addInstruction(positionTxBuilder.compressIx(false));
@ -204,7 +207,7 @@ const constructCollectIxForPosition = (
positionOwner: PublicKey,
positionAuthority: PublicKey,
resolvedAtas: Record<string, ResolvedTokenAddressInstruction>,
touchedMints: Set<string>,
touchedMints: Set<string>
) => {
const ixForPosition: Instruction[] = [];
const {

View File

@ -88,7 +88,7 @@ export type TwoHopSwapInput = {
* - `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0.
* - `InvalidIntermediaryMint` - Error if the intermediary mint between hop one and two do not equal.
* - `DuplicateTwoHopPool` - Error if whirlpool one & two are the same pool.
*
*
* ### Parameters
* @category Instructions
* @param context - Context object containing services required to generate the instruction
@ -122,7 +122,7 @@ export function twoHopSwapIx(program: Program<Whirlpool>, params: TwoHopSwapPara
tickArrayTwo1,
tickArrayTwo2,
oracleOne,
oracleTwo
oracleTwo,
} = params;
const ix = program.instruction.twoHopSwap(
@ -154,7 +154,7 @@ export function twoHopSwapIx(program: Program<Whirlpool>, params: TwoHopSwapPara
tickArrayTwo1,
tickArrayTwo2,
oracleOne,
oracleTwo
oracleTwo,
},
}
);

View File

@ -209,9 +209,9 @@ export class WhirlpoolIx {
* @param params - TwoHopSwapParams object
* @returns - Instruction to perform the action.
*/
public static twoHopSwapIx(program: Program<Whirlpool>, params: ix.TwoHopSwapParams) {
return ix.twoHopSwapIx(program, params);
}
public static twoHopSwapIx(program: Program<Whirlpool>, params: ix.TwoHopSwapParams) {
return ix.twoHopSwapIx(program, params);
}
/**
* Update the accrued fees and rewards for a position.

View File

@ -10,7 +10,7 @@ import {
GetPricesThresholdConfig,
PoolMap,
PriceMap,
TickArrayMap
TickArrayMap,
} from ".";
import { swapQuoteWithParams } from "../quotes/public/swap-quote";
import { TickArray, WhirlpoolData } from "../types/public";

View File

@ -6,7 +6,7 @@ import {
ORCA_WHIRLPOOLS_CONFIG,
ORCA_WHIRLPOOL_PROGRAM_ID,
TickArrayData,
WhirlpoolData
WhirlpoolData,
} from "../types/public";
import { TOKEN_MINTS } from "../utils/constants";

View File

@ -8,7 +8,7 @@ import {
PoolMap,
PriceCalculationData,
PriceMap,
TickArrayMap
TickArrayMap,
} from ".";
import { WhirlpoolContext } from "../context";
import { PDAUtil, PoolUtil, SwapUtils } from "../utils/public";

View File

@ -5,7 +5,7 @@ import invariant from "tiny-invariant";
import { SwapInput } from "../../instructions";
import { AccountFetcher } from "../../network/public";
import { TickArray, WhirlpoolData } from "../../types/public";
import { PoolUtil, SwapDirection, TokenType } from "../../utils/public";
import { PoolUtil, SwapDirection } from "../../utils/public";
import { SwapUtils } from "../../utils/public/swap-utils";
import { Whirlpool } from "../../whirlpool-client";
import { simulateSwap } from "../swap/swap-quote-impl";
@ -55,8 +55,12 @@ export type SwapEstimates = {
estimatedEndTickIndex: number;
estimatedEndSqrtPrice: BN;
estimatedFeeAmount: u64;
}
};
/**
* A collection of estimated values from quoting a swap. Object can be directly used in a swap transaction.
* @category Quotes
*/
export type NormalSwapQuote = SwapInput & SwapEstimates;
/**
@ -172,7 +176,9 @@ async function swapQuoteByToken(
const swapTokenType = PoolUtil.getTokenType(whirlpoolData, swapMintKey);
invariant(!!swapTokenType, "swapTokenMint does not match any tokens on this pool");
const aToB = SwapUtils.getSwapDirection(whirlpoolData, swapMintKey, amountSpecifiedIsInput) === SwapDirection.AtoB;
const aToB =
SwapUtils.getSwapDirection(whirlpoolData, swapMintKey, amountSpecifiedIsInput) ===
SwapDirection.AtoB;
const tickArrays = await SwapUtils.getTickArrays(
whirlpoolData.tickCurrentIndex,

View File

@ -17,8 +17,8 @@ export type TwoHopSwapQuote = NormalTwoHopSwapQuote; // TODO dev swap
* @experimental Not yet ready for use
*/
export type NormalTwoHopSwapQuote = {
swapOneEstimates: SwapEstimates,
swapTwoEstimates: SwapEstimates,
swapOneEstimates: SwapEstimates;
swapTwoEstimates: SwapEstimates;
} & TwoHopSwapInput;
/**
@ -28,12 +28,12 @@ export type NormalTwoHopSwapQuote = {
*/
export function twoHopSwapQuoteFromSwapQuotes(
swapQuoteOne: SwapQuote,
swapQuoteTwo: SwapQuote,
swapQuoteTwo: SwapQuote
): TwoHopSwapQuote {
const amountSpecifiedIsInput = swapQuoteOne.amountSpecifiedIsInput;
// If amount specified is input, then we care about input of the first swap
// otherwise we care about output of the second swap
let [amount, otherAmountThreshold] = amountSpecifiedIsInput
let [amount, otherAmountThreshold] = amountSpecifiedIsInput
? [swapQuoteOne.amount, swapQuoteTwo.otherAmountThreshold]
: [swapQuoteTwo.amount, swapQuoteOne.otherAmountThreshold];
@ -54,4 +54,4 @@ export function twoHopSwapQuoteFromSwapQuotes(
swapOneEstimates: { ...swapQuoteOne },
swapTwoEstimates: { ...swapQuoteTwo },
};
}
}

View File

@ -5,4 +5,4 @@ export const TOKEN_MINTS = {
USDH: "USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX",
mSOL: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
stSOL: "7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",
};
};

View File

@ -0,0 +1,194 @@
import { AddressUtil } from "@orca-so/common-sdk";
import { Address } from "@project-serum/anchor";
import { PublicKey } from "@solana/web3.js";
import {
Hop,
PoolGraph,
PoolTokenPair,
Route,
RouteSearchEntries,
RouteSearchOptions
} from "./public/pool-graph";
import { PoolGraphUtils } from "./public/pool-graph-utils";
/**
* A pool graph implementation using an adjacency list.
*
* Whirlpools (Pools (edges) & Tokens (nodes)) are sparse graphs concentrated on popular pairs such as SOL, USDC etc.
* Therefore this implementation is more efficient in memory consumption & building than a matrix.
*
* TODO: This implementation does not support 2-hop routes between identical tokens.
*/
export class AdjacencyListPoolGraph implements PoolGraph {
readonly graph: Readonly<AdjacencyPoolGraphMap>;
constructor(pools: PoolTokenPair[]) {
this.graph = buildPoolGraph(pools);
}
getRoute(startMint: Address, endMint: Address, options?: RouteSearchOptions): Route[] {
const results = this.getRoutesForPairs([[startMint, endMint]], options);
return results[0][1];
}
getRoutesForPairs(
searchTokenPairs: [Address, Address][],
options?: RouteSearchOptions
): RouteSearchEntries {
const searchTokenPairsToFind = searchTokenPairs.filter(([startMint, endMint]) => {
return AddressUtil.toString(startMint) !== AddressUtil.toString(endMint);
});
const searchTokenPairsToFindAddrs = searchTokenPairsToFind.map(([startMint, endMint]) => {
return [AddressUtil.toString(startMint), AddressUtil.toString(endMint)] as const;
});
const walkMap = findWalks(
searchTokenPairsToFindAddrs,
this.graph,
options?.intermediateTokens.map((token) => AddressUtil.toString(token))
);
const results = searchTokenPairs.map(([startMint, endMint]) => {
const searchRouteId = PoolGraphUtils.getSearchRouteId(startMint, endMint);
const internalRouteId = getInternalRouteId(startMint, endMint);
const routesForSearchPair = walkMap[internalRouteId];
const paths = routesForSearchPair
? routesForSearchPair.map<Route>((route) => {
return {
startTokenMint: AddressUtil.toString(startMint),
endTokenMint: AddressUtil.toString(endMint),
hops: getHopsFromRoute(internalRouteId, searchRouteId, route),
};
})
: [];
return [searchRouteId, paths] as const;
});
return results;
}
}
function getHopsFromRoute(internalRouteId: string, searchRouteId: string, route: string[]): Hop[] {
const [intStartA] = PoolGraphUtils.deconstructRouteId(internalRouteId);
const [searchStartA] = PoolGraphUtils.deconstructRouteId(searchRouteId);
const shouldReverseRoute = searchStartA !== intStartA;
const finalRoutes = shouldReverseRoute ? route.slice().reverse() : route;
return finalRoutes.map((hopStr) => {
return { poolAddress: new PublicKey(hopStr) };
});
}
type AdjacencyPoolGraphMap = Record<string, PoolGraphEdge[]>;
type PoolGraphEdge = {
address: string;
otherToken: string;
};
// A record of route-id (tokenA-tokenB) to a list of edges
type PoolWalks = Record<string, string[][]>;
function buildPoolGraph(pools: PoolTokenPair[]): Readonly<AdjacencyPoolGraphMap> {
const insertedPoolCache: Record<string, Set<string>> = {};
const poolGraphSet = pools.reduce((poolGraph: Record<string, PoolGraphEdge[]>, pool) => {
const { address, tokenMintA, tokenMintB } = pool;
const [addr, mintA, mintB] = AddressUtil.toStrings([address, tokenMintA, tokenMintB]);
if (poolGraph[mintA] === undefined) {
poolGraph[mintA] = [];
insertedPoolCache[mintA] = new Set<string>();
}
if (poolGraph[mintB] === undefined) {
poolGraph[mintB] = [];
insertedPoolCache[mintB] = new Set<string>();
}
const [insertedPoolsForA, insertedPoolsForB] = [
insertedPoolCache[mintA],
insertedPoolCache[mintB],
];
if (!insertedPoolsForA.has(addr)) {
poolGraph[mintA].push({ address: addr, otherToken: mintB });
insertedPoolsForA.add(addr);
}
if (!insertedPoolsForB.has(addr)) {
poolGraph[mintB].push({ address: addr, otherToken: mintA });
insertedPoolsForB.add(addr);
}
return poolGraph;
}, {});
return poolGraphSet;
}
// This is currently hardcoded to find walks of max length 2, generalizing to longer walks
// may mean that a adjacency matrix might have better performance
// NOTE: that this function does not support routing between the same token on hop length 2.
function findWalks(
tokenPairs: (readonly [string, string])[],
poolGraph: AdjacencyPoolGraphMap,
intermediateTokens?: string[]
) {
const walks: PoolWalks = {};
tokenPairs.forEach(([tokenMintFrom, tokenMintTo]) => {
let routes = [];
// Adjust walk's from & to token based of of internal route id.
const internalRouteId = getInternalRouteId(tokenMintFrom, tokenMintTo);
const [internalTokenMintFrom, internalTokenMintTo] = [tokenMintFrom, tokenMintTo].sort();
const poolsForTokenFrom = poolGraph[internalTokenMintFrom] || [];
const poolsForTokenTo = poolGraph[internalTokenMintTo] || [];
// If the internal route id has already been created, then there is no need to re-search the route.
// Possible that the route was searched in reverse.
if (!!walks[internalRouteId]) {
return;
}
// Find all direct pool routes, i.e. all edges shared between tokenA and tokenB
const singleHop = poolsForTokenFrom
.filter(({ address }) => poolsForTokenTo.some((p) => p.address === address))
.map((op) => [op.address]);
routes.push(...singleHop);
// Remove all direct edges from poolA to poolB
const firstHop = poolsForTokenFrom.filter(
({ address }) => !poolsForTokenTo.some((p) => p.address === address)
);
// Find all edges/nodes from neighbors of A that connect to B to create routes of length 2
// tokenA --> tokenX --> tokenB
firstHop.forEach((firstPool) => {
const intermediateToken = firstPool.otherToken;
if (!intermediateTokens || intermediateTokens.indexOf(intermediateToken) > -1) {
const secondHops = poolsForTokenTo
.filter((secondPool) => secondPool.otherToken === intermediateToken)
.map((secondPool) => [firstPool.address, secondPool.address]);
routes.push(...secondHops);
}
});
if (routes.length > 0) {
walks[internalRouteId] = routes;
}
});
return walks;
}
function getInternalRouteId(tokenA: Address, tokenB: Address): string {
const mints = [AddressUtil.toString(tokenA), AddressUtil.toString(tokenB)];
const sortedMints = mints.sort();
return `${sortedMints[0]}${PoolGraphUtils.ROUTE_ID_DELIMITER}${sortedMints[1]} `;
}

View File

@ -0,0 +1,3 @@
export * from "./pool-graph";
export * from "./pool-graph-builder";
export * from "./pool-graph-utils";

View File

@ -0,0 +1,54 @@
import { AddressUtil } from "@orca-so/common-sdk";
import { Address } from "@project-serum/anchor";
import { AccountFetcher } from "../../../network/public";
import { convertListToMap } from "../../txn-utils";
import { AdjacencyListPoolGraph } from "../adjacency-list-pool-graph";
import { PoolGraph, PoolTokenPair } from "./pool-graph";
/**
* A builder class for creating a {@link PoolGraph}
*
* Note: we use an adjacency list as a representation of our pool graph,
* since we assume that most token pairings don't exist as pools
* @category PoolGraph
*/
export class PoolGraphBuilder {
/**
* Fetch data and build a {@link PoolGraph} from a list of pools addresses
* @param pools - a list of pool addresses to generate this pool graph
* @param fetcher - {@link AccountFetcher} to use for fetching pool data
* @returns A {@link PoolGraph} with the provided pools
*/
static async buildPoolGraphWithFetch(
pools: Address[],
fetcher: AccountFetcher
): Promise<PoolGraph> {
const poolAccounts = convertListToMap(
await fetcher.listPools(pools, false),
pools.map((pool) => AddressUtil.toPubKey(pool).toBase58())
);
const poolTokenPairs = Object.entries(poolAccounts)
.map(([addr, pool]) => {
if (pool) {
return {
address: addr,
tokenMintA: pool.tokenMintA,
tokenMintB: pool.tokenMintB,
};
}
return null;
})
.flatMap((pool) => (pool ? pool : []));
return new AdjacencyListPoolGraph(poolTokenPairs);
}
/**
* Build a {@link PoolGraph} from a list of pools in the format of {@link PoolTokenPair}
* @param poolTokenPairs - a list of {@link PoolTokenPair} to generate this pool graph
* @returns A {@link PoolGraph} with the provided pools
*/
static buildPoolGraph(poolTokenPairs: PoolTokenPair[]): PoolGraph {
return new AdjacencyListPoolGraph(poolTokenPairs);
}
}

View File

@ -0,0 +1,38 @@
import { AddressUtil } from "@orca-so/common-sdk";
import { Address } from "@project-serum/anchor";
/**
* A utility class for working with pool graphs
* @category PoolGraph
*/
export class PoolGraphUtils {
static readonly ROUTE_ID_DELIMITER = "-";
/**
* Get a search route id from two tokens. The id can be used to identify a route between the two tokens in {@link RouteSearchEntires}.
* @param tokenA The first token in the route
* @param tokenB The second token in the route
* @returns A route id that can be used to identify a route between the two tokens in {@link RouteSearchEntires}.
*/
static getSearchRouteId(tokenA: Address, tokenB: Address): string {
return `${AddressUtil.toString(tokenA)}${
PoolGraphUtils.ROUTE_ID_DELIMITER
}${AddressUtil.toString(tokenB)}`;
}
/**
* Deconstruct a route id into the two tokens it represents
* @param routeId - The route id to deconstruct
* @returns A tuple of the two tokens in the route id. Returns undefined if the provided routeId is invalid.
*/
static deconstructRouteId(routeId: string): [string, string] {
const split = routeId.split(PoolGraphUtils.ROUTE_ID_DELIMITER);
if (split.length !== 2) {
throw new Error(`Invalid route id: ${routeId}`);
}
const [tokenA, tokenB] = split;
return [tokenA, tokenB];
}
}

View File

@ -0,0 +1,91 @@
import { Address } from "@project-serum/anchor";
/**
* An object containing the token pairs of a Whirlpool.
* @category PoolGraph
*/
export interface PoolTokenPair {
address: Address;
tokenMintA: Address;
tokenMintB: Address;
}
/**
* Route search results for a series of graph search queries between two tokens.
* The search id for each entry can be obtained from {@link PoolGraphUtils.getSearchRouteId}
* If routes exist for that search id exists, it will be an array of routes.
* If routes do not exist, it will be an empty array.
*
* @category PoolGraph
*/
export type RouteSearchEntries = (readonly [string, Route[]])[];
/**
* A route to trade from start token mint to end token mint.
*
* @category PoolGraph
* @param startMint - The token the route starts with
* @param endMint - The token the route ends with
* @param edges - An ordered list of pool addresses that make up the route
*/
export type Route = {
startTokenMint: string;
endTokenMint: string;
hops: Hop[];
};
/**
* A type representing a pool graph edge.
*
* @category PoolGraph
*/
export type Hop = {
poolAddress: Address;
};
/**
* Options for finding a route between two tokens
*
* @category PoolGraph
* @param intermediateTokens - A list of tokens that can be used as intermediate hops
*/
export type RouteSearchOptions = {
intermediateTokens: Address[];
};
/**
* A type representing a graph of pools that can be used to find routes between two tokens.
*
* @category PoolGraph
*/
export type PoolGraph = {
/**
* Get a list of routes between two tokens for this pool graph.
*
* Notes:
* - Only support routes with up to 2 hops
* - Routes between two identical token mints are not supported.
*
* @param startMint The token the route starts from
* @param endMint The token the route ends in
* @param options Options for finding a route
* @returns A list of routes between the two tokens. If no routes are found, it will be an empty array.
*/
getRoute: (startMint: Address, endMint: Address, options?: RouteSearchOptions) => Route[];
/**
* Get a map of routes from a list of token pairs for this pool graph.
*
* Notes:
* - Only support routes with up to 2 hops
* - Routes between two identical token mints are not supported.
*
* @param searchTokenPairs A list of token pairs to find routes for. The first token in the pair is the start token, and the second token is the end token.
* @param options Options for finding a route
* @return An array of search result entires in the same order as the searchTokenPairs.
*/
getRoutesForPairs(
searchTokenPairs: [Address, Address][],
options?: RouteSearchOptions
): RouteSearchEntries;
};

View File

@ -1,3 +1,4 @@
export * from "../graphs/public";
export * from "./ix-utils";
export * from "./pda-utils";
export * from "./pool-utils";

View File

@ -12,7 +12,7 @@ import { TokenType } from "./types";
* @category Whirlpool Utils
*/
export class PoolUtil {
private constructor() { }
private constructor() {}
public static isRewardInitialized(rewardInfo: WhirlpoolRewardInfoData): boolean {
return (

View File

@ -0,0 +1,446 @@
import { AddressUtil } from "@orca-so/common-sdk";
import { Address } from "@project-serum/anchor";
import * as assert from "assert";
import { PoolGraphBuilder, PoolGraphUtils, PoolTokenPair, Route, RouteSearchEntries } from "../../../../src";
import {
feeTierPoolsGraphData,
solConnectedPools,
uniqueTokenMintsGraphData,
uniqueTokenMintsGraphTokenUnsortedData,
usdcConnectedPools
} from "../../../utils/graph-test-data";
const uniqueTokenPair = uniqueTokenMintsGraphData[0];
const uniqueTokenPairSorted = uniqueTokenMintsGraphData[0];
const rlbSolPool = solConnectedPools[0];
const mSolSolPool = solConnectedPools[1];
const dustSolPool = solConnectedPools[2];
const rlbUsdcPool = usdcConnectedPools[0];
const msolUsdcPool = usdcConnectedPools[1];
const dustUsdcPool = usdcConnectedPools[2];
const usdcMint: Address = feeTierPoolsGraphData[0].tokenMintB;
describe("PoolGraph tests", () => {
describe("getRoutesForPairs", () => {
it("Route does not exist", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const uniqueTokenPair = uniqueTokenMintsGraphTokenUnsortedData[0];
const results = graph.getRoutesForPairs([
[uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB],
]);
assert.equal(results.length, 1);
const searchId = PoolGraphUtils.getSearchRouteId(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB);
assertgetRoutesForPairsResult(results, [[searchId, []]]);
});
it("Route between the same token mint", async () => {
const testData = [...solConnectedPools, ...feeTierPoolsGraphData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[usdcMint, usdcMint]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const searchId = PoolGraphUtils.getSearchRouteId(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintA);
assertgetRoutesForPairsResult(results, [[searchId, []]]);
})
it("1 route exist", async () => {
const testData = [...solConnectedPools, ...uniqueTokenMintsGraphData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[uniqueTokenPair]
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("1 route exist - token ordering reversed", async () => {
const testData = [...solConnectedPools, ...uniqueTokenMintsGraphTokenUnsortedData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[uniqueTokenPairSorted]
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("1 route with 2 hops exist - verify edge ordering correct", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbSolPool, mSolSolPool]
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("1 route with 2 hops exist - verify edge ordering correct (reverse)", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[mSolSolPool.tokenMintB, rlbSolPool.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[mSolSolPool, rlbSolPool]
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("1 tokenPair input to multiple routes exist - verify token order, edge ordering", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("duplicated token-pairs will still be executed and ordered in results", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB],
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB],
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 2);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
]],
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[1][0], searchTokenPairs[1][1]), [
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("same token-pairs but with reversed order has unique search ids", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB],
[mSolSolPool.tokenMintB, rlbSolPool.tokenMintB],
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 2);
// TODO: Directionality of the hops is not being considered
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
]],
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[1][0], searchTokenPairs[1][1]), [
[mSolSolPool, rlbSolPool],
[msolUsdcPool, rlbUsdcPool],
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("only allow 2-hop routes that go through tokens from the intermediate token list ", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbUsdcPool.tokenMintB, msolUsdcPool.tokenMintB]
];
const results = graph.getRoutesForPairs(searchTokenPairs, {
intermediateTokens: [rlbUsdcPool.tokenMintA],
});
// Assert that the SOL routes are filtered out
assert.equal(results.length, 1);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbUsdcPool, msolUsdcPool]
]]
];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
it("multiple tokenPair input to multiple routes exist - verify token order, edge ordering", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[rlbSolPool.tokenMintB, mSolSolPool.tokenMintB],
[dustSolPool.tokenMintB, mSolSolPool.tokenMintB],
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 2);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
]],
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[1][0], searchTokenPairs[1][1]), [
[dustSolPool, mSolSolPool],
[dustUsdcPool, msolUsdcPool],
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries)
});
});
describe("getRoute", async () => {
it("Route does not exist", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB);
assert.equal(result.length, 0);
});
it("1 route exist", async () => {
const testData = [...solConnectedPools, ...uniqueTokenMintsGraphData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB);
assertGetRouteResult(
result,
[[uniqueTokenPair]],
uniqueTokenPair.tokenMintA,
uniqueTokenPair.tokenMintB
);
});
it("1 route exist - token ordering reversed", async () => {
const testData = [...solConnectedPools, ...uniqueTokenMintsGraphTokenUnsortedData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB);
assertGetRouteResult(
result,
[[uniqueTokenPairSorted]],
uniqueTokenPair.tokenMintA,
uniqueTokenPair.tokenMintB
);
});
it("Route between the same token mint", async () => {
const testData = [...solConnectedPools, ...feeTierPoolsGraphData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const results = graph.getRoute(usdcMint, usdcMint);
assertGetRouteResult(results, [], usdcMint, usdcMint);
})
it("1 route with 2 hops exist - verify edge ordering correct", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(rlbSolPool.tokenMintB, mSolSolPool.tokenMintB);
assertGetRouteResult(
result,
[[rlbSolPool, mSolSolPool]],
rlbSolPool.tokenMintB,
mSolSolPool.tokenMintB
);
});
it("1 route with 2 hops exist - verify edge ordering correct (reverse)", async () => {
const testData = [...solConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(mSolSolPool.tokenMintB, rlbSolPool.tokenMintB);
assertGetRouteResult(
result,
[[mSolSolPool, rlbSolPool]],
mSolSolPool.tokenMintB,
rlbSolPool.tokenMintB
);
});
it("1 tokenPair input to multiple routes exist - verify token order, edge ordering", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(rlbSolPool.tokenMintB, mSolSolPool.tokenMintB);
assertGetRouteResult(
result,
[
[rlbSolPool, mSolSolPool],
[rlbUsdcPool, msolUsdcPool],
],
rlbSolPool.tokenMintB,
mSolSolPool.tokenMintB
);
});
it("only allow 2-hop routes that go through tokens from the intermediate token list ", async () => {
const testData = [...solConnectedPools, ...usdcConnectedPools];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const result = graph.getRoute(rlbUsdcPool.tokenMintB, msolUsdcPool.tokenMintB, {
intermediateTokens: [rlbUsdcPool.tokenMintA],
});
assertGetRouteResult(
result,
[[rlbUsdcPool, msolUsdcPool]],
rlbUsdcPool.tokenMintB,
msolUsdcPool.tokenMintB
);
});
});
describe("Pool graph edge cases", () => {
it("Zero pools in graph should not return any results", async () => {
const graph = PoolGraphBuilder.buildPoolGraph([]);
const uniqueTokenPair = uniqueTokenMintsGraphTokenUnsortedData[0];
const results = graph.getRoutesForPairs([
[uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB],
]);
assert.equal(results.length, 1);
const searchId = PoolGraphUtils.getSearchRouteId(uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB);
assertgetRoutesForPairsResult(results, [[searchId, []]]);
});
it("Duplicate pool data in input should not affect output", async () => {
const testData = [...solConnectedPools, ...solConnectedPools, ...uniqueTokenMintsGraphData];
const graph = PoolGraphBuilder.buildPoolGraph(testData);
const searchTokenPairs: [Address, Address][] = [
[uniqueTokenPair.tokenMintA, uniqueTokenPair.tokenMintB],
[rlbSolPool.tokenMintA, rlbSolPool.tokenMintB]
]
const results = graph.getRoutesForPairs(searchTokenPairs);
assert.equal(results.length, 2);
const expectedRoutesForTokenPairQueries: [string, PoolTokenPair[][]][] = [
[PoolGraphUtils.getSearchRouteId(searchTokenPairs[0][0], searchTokenPairs[0][1]), [
[uniqueTokenPair]
]], [PoolGraphUtils.getSearchRouteId(rlbSolPool.tokenMintA, rlbSolPool.tokenMintB), [
[rlbSolPool]
]]];
assertgetRoutesForPairsResult(results, expectedRoutesForTokenPairQueries);
});
});
});
function assertgetRoutesForPairsResult(
searchResultEntires: RouteSearchEntries,
expectedRoutes: [string, PoolTokenPair[][]][]
) {
assert.equal(searchResultEntires.length, expectedRoutes.length, `Number of routes should match expected routes`);
searchResultEntires.forEach((searchEntry, entryIndex) => {
const [routeId, routes] = searchEntry;
const [startMint, endMint] = PoolGraphUtils.deconstructRouteId(routeId);
// Assert route is correct
const expectedRoutesForEntry = expectedRoutes[entryIndex];
assert.equal(
routes.length,
expectedRoutesForEntry[1].length,
"Expected number of paths to match expected pools"
);
assertGetRouteResult(routes, expectedRoutesForEntry[1], startMint, endMint);
})
}
function assertGetRouteResult(
routes: Route[],
expectedRoutes: PoolTokenPair[][],
expectedStartMint: Address,
expectedEndMint: Address
) {
assert.equal(routes.length, expectedRoutes.length);
routes.forEach((route, routeIndex) => {
assertRoute(route, routeIndex, expectedStartMint, expectedEndMint, expectedRoutes);
});
}
function assertRoute(
route: Route,
routeIndex: number,
expectedStartMint: Address,
expectedEndMint: Address,
expectedRoutes: PoolTokenPair[][]
) {
assert.equal(route.startTokenMint, AddressUtil.toString(expectedStartMint));
assert.equal(route.endTokenMint, AddressUtil.toString(expectedEndMint));
const expectedRoute = expectedRoutes[routeIndex];
assert.equal(
route.hops.length,
expectedRoute.length,
`Expected number of edges to match expected pools at index ${routeIndex}`
);
route.hops.forEach((hop, hopIndex) => {
assert.equal(
AddressUtil.toString(hop.poolAddress),
AddressUtil.toString(expectedRoutes[routeIndex][hopIndex].address),
`Expected edge pool address to match expected pool addr at hop index ${hopIndex}`
);
});
}

View File

@ -0,0 +1,86 @@
import { Address } from "@project-serum/anchor";
import { PoolTokenPair } from "../../src";
export const solConnectedPools: PoolTokenPair[] = [
{
address: "7qbRF6YsyGuLUVs6Y1q64bdVrfe4ZcUUz1JRdoVNUJnm",
tokenMintA: "So11111111111111111111111111111111111111112",
tokenMintB: "RLBxxFkseAZ4RgJH3Sqn8jXxhmGoz9jWxDNJMh8pL7a",
},
{
address: "HQcY5n2zP6rW74fyFEhWeBd3LnJpBcZechkvJpmdb8cx",
tokenMintA: "So11111111111111111111111111111111111111112",
tokenMintB: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
},
{
address: "2AEWSvUds1wsufnsDPCXjFsJCMJH5SNNm7fSF4kxys9a",
tokenMintA: "So11111111111111111111111111111111111111112",
tokenMintB: "DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ",
},
{
address: "CPsTfDvZYeVB5uTqQZcwwTTBJ7KPFvB6JKLGSWsFZEL7",
tokenMintA: "So11111111111111111111111111111111111111112",
tokenMintB: "7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",
},
{
address: "HJPjoWUrhoZzkNfRpHuieeFk9WcZWjwy6PBjZ81ngndJ",
tokenMintA: "So11111111111111111111111111111111111111112",
tokenMintB: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
},
];
export const usdcConnectedPools: PoolTokenPair[] = [
{
address: "7PNQ9rfSGCbCC3XTeL6CwwAzevqQGvKXeXMxP2TjS7rM",
tokenMintA: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
tokenMintB: "RLBxxFkseAZ4RgJH3Sqn8jXxhmGoz9jWxDNJMh8pL7a",
},
{
address: "7A1R3L7AxcxuZHMJjFgskKGeBR5Rwst3Ai5bv5uAWZFG",
tokenMintA: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
tokenMintB: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
},
{
address: "BVXNG6BrL2Tn3NmppnMeXHjBHTaQSnSnLE99JKwZSWPg",
tokenMintA: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
tokenMintB: "DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ",
},
];
export const oneRouteTwoHopsThroughSOL: [Address, Address] = ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"];
export const feeTierPoolsGraphData: PoolTokenPair[] = [
{
address: "Gr7WKYBqRLt7oUkjZ54LSbiUf8EgNWcj3ogtN8dKbfeb",
tokenMintA: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
tokenMintB: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
},
{
address: "7qbRF6YsyGuLUVs6Y1q64bdVrfe4ZcUUz1JRdoVNUJnm",
tokenMintA: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
tokenMintB: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
},
{
address: "67S6KLCtgFZmRYzy6dCDc1v754mmcpK33pZd7Hg2yeVj",
tokenMintA: "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
tokenMintB: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
},
];
export const oneRouteTwoHopsThroughmSOL: [Address, Address] = ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"];
export const uniqueTokenMintsGraphData: PoolTokenPair[] = [
{
address: "5Z66YYYaTmmx1R4mATAGLSc8aV4Vfy5tNdJQzk1GP9RF",
tokenMintA: "USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX",
tokenMintB: "orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE",
},
];
export const uniqueTokenMintsGraphTokenUnsortedData: PoolTokenPair[] = [
{
address: "5Z66YYYaTmmx1R4mATAGLSc8aV4Vfy5tNdJQzk1GP9RF",
tokenMintA: "orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE",
tokenMintB: "USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX",
},
];

2450
yarn.lock

File diff suppressed because it is too large Load Diff