Program.html 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Program | @project-serum/anchor - v0.23.0</title><meta name="description" content="Documentation for @project-serum/anchor - v0.23.0"/><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">@project-serum/anchor - v0.23.0</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="../index.html">@project-serum/anchor - v0.23.0</a></li><li><a href="Program.html">Program</a></li></ul><h1>Class Program&lt;IDL&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">
  2. <a href="#program" id="program" style="color: inherit; text-decoration: none;">
  3. <h2>Program</h2>
  4. </a>
  5. </div><div><p>Program provides the IDL deserialized client representation of an Anchor
  6. program.</p>
  7. <p>This API is the one stop shop for all things related to communicating with
  8. on-chain programs. Among other things, one can send transactions, fetch
  9. deserialized accounts, decode instruction data, subscribe to account
  10. changes, and listen to events.</p>
  11. <p>In addition to field accessors and methods, the object provides a set of
  12. dynamically generated properties, also known as namespaces, that
  13. map one-to-one to program methods and accounts. These namespaces generally
  14. can be used as follows:</p>
  15. <a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
  16. <h2>Usage</h2>
  17. </a>
  18. <pre><code class="language-javascript"><span class="hl-0">program</span><span class="hl-1">.&lt;</span><span class="hl-0">namespace</span><span class="hl-1">&gt;.&lt;</span><span class="hl-0">program</span><span class="hl-1">-</span><span class="hl-0">specific</span><span class="hl-1">-</span><span class="hl-0">method</span><span class="hl-1">&gt;</span>
  19. </code></pre>
  20. <p>API specifics are namespace dependent. The examples used in the documentation
  21. below will refer to the two counter examples found
  22. <a href="https://github.com/project-serum/anchor#examples">here</a>.</p>
  23. </div></div></section><section class="tsd-panel tsd-type-parameters"><h3>Type parameters</h3><ul class="tsd-type-parameters"><li><h4>IDL<span class="tsd-signature-symbol">: </span><a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a> = <a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a></h4></li></ul></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">Program</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 tsd-has-type-parameter"><a href="Program.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#account" class="tsd-kind-icon">account</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#instruction" class="tsd-kind-icon">instruction</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#methods" class="tsd-kind-icon">methods</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#rpc" class="tsd-kind-icon">rpc</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#simulate" class="tsd-kind-icon">simulate</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#state" class="tsd-kind-icon">state</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#transaction" class="tsd-kind-icon">transaction</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#coder" class="tsd-kind-icon">coder</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#idl" class="tsd-kind-icon">idl</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#programId" class="tsd-kind-icon">program<wbr/>Id</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#provider" class="tsd-kind-icon">provider</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"><a href="Program.html#addEventListener" class="tsd-kind-icon">add<wbr/>Event<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Program.html#removeEventListener" class="tsd-kind-icon">remove<wbr/>Event<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a href="Program.html#at" class="tsd-kind-icon">at</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a href="Program.html#fetchIdl" class="tsd-kind-icon">fetch<wbr/>Idl</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 tsd-has-type-parameter"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">new <wbr/>Program<span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span>idl<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span>, programId<span class="tsd-signature-symbol">: </span><a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a>, provider<span class="tsd-signature-symbol">?: </span><a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</a>, coder<span class="tsd-signature-symbol">?: </span><a href="../interfaces/Coder.html" class="tsd-signature-type" data-tsd-kind="Interface">Coder</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Program.html" class="tsd-signature-type" data-tsd-kind="Class">Program</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</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/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L263">src/program/index.ts:263</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>IDL<span class="tsd-signature-symbol">: </span><a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a> = <a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>idl: <span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
  24. <p>The interface definition.</p>
  25. </div></div></li><li><h5>programId: <a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
  26. <p>The on-chain address of the program.</p>
  27. </div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> provider: <a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
  28. <p>The network and wallet context to use. If not provided
  29. then uses <a href="../index.html#getProvider">getProvider</a>.</p>
  30. </div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> coder: <a href="../interfaces/Coder.html" class="tsd-signature-type" data-tsd-kind="Interface">Coder</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="Program.html" class="tsd-signature-type" data-tsd-kind="Class">Program</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="account" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> account</h3><div class="tsd-signature tsd-kind-icon">account<span class="tsd-signature-symbol">:</span> <a href="../index.html#AccountNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">AccountNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L104">src/program/index.ts:104</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  31. <p>The namespace provides handles to an <a href="AccountClient.html">AccountClient</a> object for each
  32. account in the program.</p>
  33. </div><div>
  34. <a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
  35. <h2>Usage</h2>
  36. </a>
  37. <pre><code class="language-javascript"><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">account</span><span class="hl-1">.&lt;</span><span class="hl-0">account</span><span class="hl-1">-</span><span class="hl-0">client</span><span class="hl-1">&gt;</span>
  38. </code></pre>
  39. <a href="#example" id="example" style="color: inherit; text-decoration: none;">
  40. <h2>Example</h2>
  41. </a>
  42. <p>To fetch a <code>Counter</code> account from the above example,</p>
  43. <pre><code class="language-javascript"><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">counter</span><span class="hl-1"> = </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">account</span><span class="hl-1">.</span><span class="hl-0">counter</span><span class="hl-1">.</span><span class="hl-5">fetch</span><span class="hl-1">(</span><span class="hl-0">address</span><span class="hl-1">);</span>
  44. </code></pre>
  45. <p>For the full API, see the <a href="AccountClient.html">AccountClient</a> reference.</p>
  46. </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="instruction" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> instruction</h3><div class="tsd-signature tsd-kind-icon">instruction<span class="tsd-signature-symbol">:</span> <a href="../index.html#InstructionNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">InstructionNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">&quot;instructions&quot;</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L136">src/program/index.ts:136</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  47. <p>The namespace provides functions to build <a href="web3.TransactionInstruction.html">TransactionInstruction</a>
  48. objects for each method of a program.</p>
  49. </div><div>
  50. <a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
  51. <h2>Usage</h2>
  52. </a>
  53. <pre><code class="language-javascript"><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">instruction</span><span class="hl-1">.&lt;</span><span class="hl-0">method</span><span class="hl-1">&gt;(...</span><span class="hl-0">args</span><span class="hl-1">, </span><span class="hl-0">ctx</span><span class="hl-1">);</span>
  54. </code></pre>
  55. <a href="#parameters" id="parameters" style="color: inherit; text-decoration: none;">
  56. <h2>Parameters</h2>
  57. </a>
  58. <ol>
  59. <li><code>args</code> - The positional arguments for the program. The type and number
  60. of these arguments depend on the program being used.</li>
  61. <li><code>ctx</code> - <a href="../modules/web3.html#Context">Context</a> non-argument parameters to pass to the method.
  62. Always the last parameter in the method call.</li>
  63. </ol>
  64. <a href="#example" id="example" style="color: inherit; text-decoration: none;">
  65. <h2>Example</h2>
  66. </a>
  67. <p>To create an instruction for the <code>increment</code> method above,</p>
  68. <pre><code class="language-javascript"><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">tx</span><span class="hl-1"> = </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">instruction</span><span class="hl-1">.</span><span class="hl-5">increment</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">accounts:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">counter</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
  69. </code></pre>
  70. </div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="methods" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> methods</h3><div class="tsd-signature tsd-kind-icon">methods<span class="tsd-signature-symbol">:</span> <a href="../index.html#MethodsNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">MethodsNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">AllInstructions</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L218">src/program/index.ts:218</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  71. <p>The namespace provides a builder API for all APIs on the program.
  72. This is an alternative to using namespace the other namespaces..</p>
  73. </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="rpc" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> rpc</h3><div class="tsd-signature tsd-kind-icon">rpc<span class="tsd-signature-symbol">:</span> <a href="../index.html#RpcNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">RpcNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">AllInstructions</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L82">src/program/index.ts:82</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  74. <p>Async methods to send signed transactions to <em>non</em>-state methods on the
  75. program, returning a <a href="../modules/web3.html#TransactionSignature">TransactionSignature</a>.</p>
  76. </div><div>
  77. <a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
  78. <h2>Usage</h2>
  79. </a>
  80. <pre><code class="language-javascript"><span class="hl-0">rpc</span><span class="hl-1">.&lt;</span><span class="hl-0">method</span><span class="hl-1">&gt;(...</span><span class="hl-0">args</span><span class="hl-1">, </span><span class="hl-0">ctx</span><span class="hl-1">);</span>
  81. </code></pre>
  82. <a href="#parameters" id="parameters" style="color: inherit; text-decoration: none;">
  83. <h2>Parameters</h2>
  84. </a>
  85. <ol>
  86. <li><code>args</code> - The positional arguments for the program. The type and number
  87. of these arguments depend on the program being used.</li>
  88. <li><code>ctx</code> - <a href="../modules/web3.html#Context">Context</a> non-argument parameters to pass to the method.
  89. Always the last parameter in the method call.</li>
  90. </ol>
  91. <a href="#example" id="example" style="color: inherit; text-decoration: none;">
  92. <h2>Example</h2>
  93. </a>
  94. <p>To send a transaction invoking the <code>increment</code> method above,</p>
  95. <pre><code class="language-javascript"><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">txSignature</span><span class="hl-1"> = </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">rpc</span><span class="hl-1">.</span><span class="hl-5">increment</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">accounts:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">counter</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">authority</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
  96. </code></pre>
  97. </div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="simulate" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> simulate</h3><div class="tsd-signature tsd-kind-icon">simulate<span class="tsd-signature-symbol">:</span> <a href="../index.html#SimulateNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">SimulateNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">AllInstructions</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L205">src/program/index.ts:205</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  98. <p>The namespace provides functions to simulate transactions for each method
  99. of a program, returning a list of deserialized events <em>and</em> raw program
  100. logs.</p>
  101. </div><div><p>One can use this to read data calculated from a program on chain, by
  102. emitting an event in the program and reading the emitted event client side
  103. via the <code>simulate</code> namespace.</p>
  104. <a href="#simulate" id="simulate" style="color: inherit; text-decoration: none;">
  105. <h2>simulate</h2>
  106. </a>
  107. <pre><code class="language-javascript"><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">simulate</span><span class="hl-1">.&lt;</span><span class="hl-0">method</span><span class="hl-1">&gt;(...</span><span class="hl-0">args</span><span class="hl-1">, </span><span class="hl-0">ctx</span><span class="hl-1">);</span>
  108. </code></pre>
  109. <a href="#parameters" id="parameters" style="color: inherit; text-decoration: none;">
  110. <h2>Parameters</h2>
  111. </a>
  112. <ol>
  113. <li><code>args</code> - The positional arguments for the program. The type and number
  114. of these arguments depend on the program being used.</li>
  115. <li><code>ctx</code> - <a href="../modules/web3.html#Context">Context</a> non-argument parameters to pass to the method.
  116. Always the last parameter in the method call.</li>
  117. </ol>
  118. <a href="#example" id="example" style="color: inherit; text-decoration: none;">
  119. <h2>Example</h2>
  120. </a>
  121. <p>To simulate the <code>increment</code> method above,</p>
  122. <pre><code class="language-javascript"><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">events</span><span class="hl-1"> = </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">simulate</span><span class="hl-1">.</span><span class="hl-5">increment</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">accounts:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">counter</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
  123. </code></pre>
  124. </div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="state" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> state</h3><div class="tsd-signature tsd-kind-icon">state<span class="tsd-signature-symbol">?:</span> <a href="StateClient.html" class="tsd-signature-type" data-tsd-kind="Class">StateClient</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L212">src/program/index.ts:212</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  125. <p>A client for the program state. Similar to the base <a href="Program.html">Program</a> client,
  126. one can use this to send transactions and read accounts for the state
  127. abstraction.</p>
  128. </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="transaction" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> transaction</h3><div class="tsd-signature tsd-kind-icon">transaction<span class="tsd-signature-symbol">:</span> <a href="../index.html#TransactionNamespace" class="tsd-signature-type" data-tsd-kind="Type alias">TransactionNamespace</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">AllInstructions</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L168">src/program/index.ts:168</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  129. <p>The namespace provides functions to build <a href="web3.Transaction.html">Transaction</a> objects for each
  130. method of a program.</p>
  131. </div><div>
  132. <a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
  133. <h2>Usage</h2>
  134. </a>
  135. <pre><code class="language-javascript"><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">transaction</span><span class="hl-1">.&lt;</span><span class="hl-0">method</span><span class="hl-1">&gt;(...</span><span class="hl-0">args</span><span class="hl-1">, </span><span class="hl-0">ctx</span><span class="hl-1">);</span>
  136. </code></pre>
  137. <a href="#parameters" id="parameters" style="color: inherit; text-decoration: none;">
  138. <h2>Parameters</h2>
  139. </a>
  140. <ol>
  141. <li><code>args</code> - The positional arguments for the program. The type and number
  142. of these arguments depend on the program being used.</li>
  143. <li><code>ctx</code> - <a href="../modules/web3.html#Context">Context</a> non-argument parameters to pass to the method.
  144. Always the last parameter in the method call.</li>
  145. </ol>
  146. <a href="#example" id="example" style="color: inherit; text-decoration: none;">
  147. <h2>Example</h2>
  148. </a>
  149. <p>To create an instruction for the <code>increment</code> method above,</p>
  150. <pre><code class="language-javascript"><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">tx</span><span class="hl-1"> = </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-0">program</span><span class="hl-1">.</span><span class="hl-0">transaction</span><span class="hl-1">.</span><span class="hl-5">increment</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">accounts:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">counter</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
  151. </code></pre>
  152. </div><dl class="tsd-comment-tags"><dt>deprecated</dt><dd></dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="coder" class="tsd-anchor"></a><h3>coder</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> coder<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/Coder.html" class="tsd-signature-type" data-tsd-kind="Interface">Coder</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L239">src/program/index.ts:239</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  153. <p>Coder for serializing requests.</p>
  154. </div></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/Coder.html" class="tsd-signature-type" data-tsd-kind="Interface">Coder</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="idl" class="tsd-anchor"></a><h3>idl</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> idl<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L231">src/program/index.ts:231</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  155. <p>IDL defining the program&#39;s interface.</p>
  156. </div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="programId" class="tsd-anchor"></a><h3>program<wbr/>Id</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> programId<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="web3.PublicKey.html" class="tsd-signature-type" data-tsd-kind="Class">PublicKey</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L223">src/program/index.ts:223</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  157. <p>Address of the program.</p>
  158. </div></div><h4 class="tsd-returns-title">Returns <a href="web3.PublicKey.html" class="tsd-signature-type" data-tsd-kind="Class">PublicKey</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="provider" class="tsd-anchor"></a><h3>provider</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> provider<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L247">src/program/index.ts:247</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  159. <p>Wallet and network provider.</p>
  160. </div></div><h4 class="tsd-returns-title">Returns <a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</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"><a id="addEventListener" class="tsd-anchor"></a><h3>add<wbr/>Event<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">add<wbr/>Event<wbr/>Listener<span class="tsd-signature-symbol">(</span>eventName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, slot<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L358">src/program/index.ts:358</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  161. <p>Invokes the given callback every time the given event is emitted.</p>
  162. </div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>eventName: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
  163. <p>The PascalCase name of the event, provided by the IDL.</p>
  164. </div></div></li><li><h5>callback: <span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, slot<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
  165. <p>The function to invoke whenever the event is emitted from
  166. program logs.</p>
  167. </div></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>event<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, slot<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>event: <span class="tsd-signature-type">any</span></h5></li><li><h5>slot: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="removeEventListener" class="tsd-anchor"></a><h3>remove<wbr/>Event<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">remove<wbr/>Event<wbr/>Listener<span class="tsd-signature-symbol">(</span>listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</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">void</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/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L368">src/program/index.ts:368</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  168. <p>Unsubscribes from the given eventName.</p>
  169. </div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>listener: <span class="tsd-signature-type">number</span></h5></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">void</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a id="at" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> at</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><li class="tsd-signature tsd-kind-icon">at<span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a>, provider<span class="tsd-signature-symbol">?: </span><a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</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="Program.html" class="tsd-signature-type" data-tsd-kind="Class">Program</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><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/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L310">src/program/index.ts:310</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  170. <p>Generates a Program client by fetching the IDL from the network.</p>
  171. </div><div><p>In order to use this method, an IDL must have been previously initialized
  172. via the anchor CLI&#39;s <code>anchor idl init</code> command.</p>
  173. </div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>IDL<span class="tsd-signature-symbol">: </span><a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a> = <a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>address: <a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> provider: <a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
  174. <p>The network and wallet context.</p>
  175. </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="Program.html" class="tsd-signature-type" data-tsd-kind="Class">Program</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a id="fetchIdl" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> fetch<wbr/>Idl</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><li class="tsd-signature tsd-kind-icon">fetch<wbr/>Idl<span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a>, provider<span class="tsd-signature-symbol">?: </span><a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</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><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">IDL</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/project-serum/anchor/blob/9f74a288/ts/src/program/index.ts#L333">src/program/index.ts:333</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
  176. <p>Fetches an idl from the blockchain.</p>
  177. </div><div><p>In order to use this method, an IDL must have been previously initialized
  178. via the anchor CLI&#39;s <code>anchor idl init</code> command.</p>
  179. </div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>IDL<span class="tsd-signature-symbol">: </span><a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a> = <a href="../index.html#Idl" class="tsd-signature-type" data-tsd-kind="Type alias">Idl</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>address: <a href="../index.html#Address" class="tsd-signature-type" data-tsd-kind="Type alias">Address</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> provider: <a href="Provider.html" class="tsd-signature-type" data-tsd-kind="Class">Provider</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
  180. <p>The network and wallet context.</p>
  181. </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" data-tsd-kind="Type parameter">IDL</span><span class="tsd-signature-symbol">&gt;</span></h4></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="../index.html">Exports</a></li><li class="label tsd-is-external"><span>Internals</span></li><li class=" tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li><li class="label tsd-is-external"><span>Externals</span></li><li class=" tsd-kind-namespace tsd-is-external"><a href="../modules/BN.html">BN</a></li><li class=" tsd-kind-namespace tsd-is-external"><a href="../modules/web3.html">web3</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class tsd-has-type-parameter"><a href="Program.html" class="tsd-kind-icon">Program</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter"><a href="Program.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#account" class="tsd-kind-icon">account</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#instruction" class="tsd-kind-icon">instruction</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#methods" class="tsd-kind-icon">methods</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#rpc" class="tsd-kind-icon">rpc</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#simulate" class="tsd-kind-icon">simulate</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#state" class="tsd-kind-icon">state</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="Program.html#transaction" class="tsd-kind-icon">transaction</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#coder" class="tsd-kind-icon">coder</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#idl" class="tsd-kind-icon">idl</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#programId" class="tsd-kind-icon">program<wbr/>Id</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Program.html#provider" class="tsd-kind-icon">provider</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Program.html#addEventListener" class="tsd-kind-icon">add<wbr/>Event<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="Program.html#removeEventListener" class="tsd-kind-icon">remove<wbr/>Event<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a href="Program.html#at" class="tsd-kind-icon">at</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static"><a href="Program.html#fetchIdl" class="tsd-kind-icon">fetch<wbr/>Idl</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-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited 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-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>