@huma-finance/sdk 0.0.38-beta.20 → 0.0.38-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/API.md +446 -0
  2. package/package.json +3 -3
package/API.md CHANGED
@@ -11,6 +11,8 @@
11
11
  <dd><p>An object that contains functions to interact with Huma's receivables.</p></dd>
12
12
  <dt><a href="#SubgraphService">SubgraphService</a> : <code>object</code></dt>
13
13
  <dd><p>An object that contains functions to interact with Huma's Subgraph storage.</p></dd>
14
+ <dt><a href="#ARWeaveService">ARWeaveService</a> : <code>object</code></dt>
15
+ <dd><p>An object that contains functions to interact with Huma-related data stored on ARWeave</p></dd>
14
16
  </dl>
15
17
 
16
18
  ## Functions
@@ -132,6 +134,225 @@ Note that this does not approve a creditline in Huma's pools and an approve call
132
134
  <p>An object that contains functions to interact with Huma-related data stored on ARWeave</p>
133
135
 
134
136
  **Kind**: global namespace
137
+
138
+ * [ARWeaveService](#ARWeaveService) : <code>object</code>
139
+ * [.getBundlrNetworkConfig(chainId)](#ARWeaveService.getBundlrNetworkConfig) ⇒ <code>BundlrConfig</code>
140
+ * [.getBundlrInstance(config, signer)](#ARWeaveService.getBundlrInstance) ⇒
141
+ * [.prefundBundlr(config, signer, amount)](#ARWeaveService.prefundBundlr) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
142
+ * [.storeData(config, signerOrPrivateKey, data, tags, [lazyFund])](#ARWeaveService.storeData) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
143
+ * [.queryForMetadata(chainId, sender, referenceId)](#ARWeaveService.queryForMetadata) ⇒ <code>Promise.&lt;any&gt;</code>
144
+ * [.fetchMetadataFromUrl(url)](#ARWeaveService.fetchMetadataFromUrl) ⇒ <code>Promise.&lt;JSON&gt;</code>
145
+ * [.getBundlrNetworkConfig(chainId)](#ARWeaveService.getBundlrNetworkConfig) ⇒ <code>BundlrConfig</code>
146
+ * [.getBundlrInstance(config, signer)](#ARWeaveService.getBundlrInstance) ⇒
147
+ * [.prefundBundlr(config, signer, amount)](#ARWeaveService.prefundBundlr) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
148
+ * [.storeData(config, signerOrPrivateKey, data, tags, [lazyFund])](#ARWeaveService.storeData) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
149
+ * [.queryForMetadata(chainId, sender, referenceId)](#ARWeaveService.queryForMetadata) ⇒ <code>Promise.&lt;any&gt;</code>
150
+ * [.fetchMetadataFromUrl(url)](#ARWeaveService.fetchMetadataFromUrl) ⇒ <code>Promise.&lt;JSON&gt;</code>
151
+ * [.BundlrConfig](#ARWeaveService.BundlrConfig) : <code>Object</code>
152
+ * [.BundlrConfig](#ARWeaveService.BundlrConfig) : <code>Object</code>
153
+
154
+ <a name="ARWeaveService.getBundlrNetworkConfig"></a>
155
+
156
+ ### ARWeaveService.getBundlrNetworkConfig(chainId) ⇒ <code>BundlrConfig</code>
157
+ <p>Get the configuration for Bundlr network given a chain ID</p>
158
+
159
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
160
+ **Returns**: <code>BundlrConfig</code> - <ul>
161
+ <li>The configuration for the Bundlr network.</li>
162
+ </ul>
163
+
164
+ | Param | Type | Description |
165
+ | --- | --- | --- |
166
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
167
+
168
+ <a name="ARWeaveService.getBundlrInstance"></a>
169
+
170
+ ### ARWeaveService.getBundlrInstance(config, signer) ⇒
171
+ <p>Get a Bundlr instance for a specific network</p>
172
+
173
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
174
+ **Returns**: <p>The Bundlr instance</p>
175
+
176
+ | Param | Type | Description |
177
+ | --- | --- | --- |
178
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
179
+ | signer | <code>string</code> | <p>The private key of the wallet to use Bundlr with.</p> |
180
+
181
+ <a name="ARWeaveService.prefundBundlr"></a>
182
+
183
+ ### ARWeaveService.prefundBundlr(config, signer, amount) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
184
+ <p>Prefund the Bundlr network with the specified amount. Required if not lazy funding.
185
+ Important note: The amount is denominated in the base unit of currency for that network.
186
+ If you want to upload 5 Matic to the Bundlr node, pass in an amount of 5.</p>
187
+
188
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
189
+ **Returns**: <code>Promise.&lt;FundResponse&gt;</code> - <ul>
190
+ <li>The fund response.</li>
191
+ </ul>
192
+
193
+ | Param | Type | Description |
194
+ | --- | --- | --- |
195
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
196
+ | signer | <code>string</code> | <p>The private key of the wallet to send funds from.</p> |
197
+ | amount | <code>number</code> | <p>The amount to fund, denoted in whatever currency specified by the config (e.g. MATIC, ETH)</p> |
198
+
199
+ <a name="ARWeaveService.storeData"></a>
200
+
201
+ ### ARWeaveService.storeData(config, signerOrPrivateKey, data, tags, [lazyFund]) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
202
+ <p>Store data on ARWeave using the Bundlr Network.</p>
203
+
204
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
205
+ **Returns**: <code>Promise.&lt;UploadResponse&gt;</code> - <p>Promise resolving with the upload response.</p>
206
+
207
+ | Param | Type | Default | Description |
208
+ | --- | --- | --- | --- |
209
+ | config | <code>BundlrConfig</code> | | <p>Configuration object for the Bundlr instance.</p> |
210
+ | signerOrPrivateKey | <code>Web3Provider</code> \| <code>string</code> | | <p>Wallet object used for interacting with the Bundlr instance. If calling from a browser, this should be a <code>Web3Provider</code> instance. If calling from a Node.js environment, this should be a private key string.</p> |
211
+ | data | <code>Record.&lt;string, unknown&gt;</code> | | <p>The data to store in the Bundlr instance.</p> |
212
+ | tags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Array of tag objects with <code>name</code> and <code>value</code> properties.</p> |
213
+ | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Optional flag to fund the Bundlr instance lazily. If set to <code>false</code>, the Bundlr node should already be funded or else uploads will fail.</p> |
214
+
215
+ <a name="ARWeaveService.queryForMetadata"></a>
216
+
217
+ ### ARWeaveService.queryForMetadata(chainId, sender, referenceId) ⇒ <code>Promise.&lt;any&gt;</code>
218
+ <p>Helper method to query the Arweave network for receivables metadata previously uploaded.</p>
219
+
220
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
221
+ **Returns**: <code>Promise.&lt;any&gt;</code> - <p>Promise resolving with the queried data.</p>
222
+
223
+ | Param | Type | Description |
224
+ | --- | --- | --- |
225
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
226
+ | sender | <code>string</code> | <p>The sender tag to query.</p> |
227
+ | referenceId | <code>string</code> | <p>The referenceId tag to query, whatever was used when uploading the metadata.</p> |
228
+
229
+ <a name="ARWeaveService.fetchMetadataFromUrl"></a>
230
+
231
+ ### ARWeaveService.fetchMetadataFromUrl(url) ⇒ <code>Promise.&lt;JSON&gt;</code>
232
+ <p>Helper method to fetch data from an ARWeave URL.</p>
233
+
234
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
235
+ **Returns**: <code>Promise.&lt;JSON&gt;</code> - <p>Promise resolving with the queried data.</p>
236
+
237
+ | Param | Type | Description |
238
+ | --- | --- | --- |
239
+ | url | <code>string</code> | <p>The ARWeave metadata URL to query.</p> |
240
+
241
+ <a name="ARWeaveService.getBundlrNetworkConfig"></a>
242
+
243
+ ### ARWeaveService.getBundlrNetworkConfig(chainId) ⇒ <code>BundlrConfig</code>
244
+ <p>Get the configuration for Bundlr network given a chain ID</p>
245
+
246
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
247
+ **Returns**: <code>BundlrConfig</code> - <ul>
248
+ <li>The configuration for the Bundlr network.</li>
249
+ </ul>
250
+
251
+ | Param | Type | Description |
252
+ | --- | --- | --- |
253
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
254
+
255
+ <a name="ARWeaveService.getBundlrInstance"></a>
256
+
257
+ ### ARWeaveService.getBundlrInstance(config, signer) ⇒
258
+ <p>Get a Bundlr instance for a specific network</p>
259
+
260
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
261
+ **Returns**: <p>The Bundlr instance</p>
262
+
263
+ | Param | Type | Description |
264
+ | --- | --- | --- |
265
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
266
+ | signer | <code>string</code> | <p>The private key of the wallet to use Bundlr with.</p> |
267
+
268
+ <a name="ARWeaveService.prefundBundlr"></a>
269
+
270
+ ### ARWeaveService.prefundBundlr(config, signer, amount) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
271
+ <p>Prefund the Bundlr network with the specified amount. Required if not lazy funding.
272
+ Important note: The amount is denominated in the base unit of currency for that network.
273
+ If you want to upload 5 Matic to the Bundlr node, pass in an amount of 5.</p>
274
+
275
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
276
+ **Returns**: <code>Promise.&lt;FundResponse&gt;</code> - <ul>
277
+ <li>The fund response.</li>
278
+ </ul>
279
+
280
+ | Param | Type | Description |
281
+ | --- | --- | --- |
282
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
283
+ | signer | <code>string</code> | <p>The private key of the wallet to send funds from.</p> |
284
+ | amount | <code>number</code> | <p>The amount to fund, denoted in whatever currency specified by the config (e.g. MATIC, ETH)</p> |
285
+
286
+ <a name="ARWeaveService.storeData"></a>
287
+
288
+ ### ARWeaveService.storeData(config, signerOrPrivateKey, data, tags, [lazyFund]) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
289
+ <p>Store data on ARWeave using the Bundlr Network.</p>
290
+
291
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
292
+ **Returns**: <code>Promise.&lt;UploadResponse&gt;</code> - <p>Promise resolving with the upload response.</p>
293
+
294
+ | Param | Type | Default | Description |
295
+ | --- | --- | --- | --- |
296
+ | config | <code>BundlrConfig</code> | | <p>Configuration object for the Bundlr instance.</p> |
297
+ | signerOrPrivateKey | <code>Web3Provider</code> \| <code>string</code> | | <p>Wallet object used for interacting with the Bundlr instance. If calling from a browser, this should be a <code>Web3Provider</code> instance. If calling from a Node.js environment, this should be a private key string.</p> |
298
+ | data | <code>Record.&lt;string, unknown&gt;</code> | | <p>The data to store in the Bundlr instance.</p> |
299
+ | tags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Array of tag objects with <code>name</code> and <code>value</code> properties.</p> |
300
+ | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Optional flag to fund the Bundlr instance lazily. If set to <code>false</code>, the Bundlr node should already be funded or else uploads will fail.</p> |
301
+
302
+ <a name="ARWeaveService.queryForMetadata"></a>
303
+
304
+ ### ARWeaveService.queryForMetadata(chainId, sender, referenceId) ⇒ <code>Promise.&lt;any&gt;</code>
305
+ <p>Helper method to query the Arweave network for receivables metadata previously uploaded.</p>
306
+
307
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
308
+ **Returns**: <code>Promise.&lt;any&gt;</code> - <p>Promise resolving with the queried data.</p>
309
+
310
+ | Param | Type | Description |
311
+ | --- | --- | --- |
312
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
313
+ | sender | <code>string</code> | <p>The sender tag to query.</p> |
314
+ | referenceId | <code>string</code> | <p>The referenceId tag to query, whatever was used when uploading the metadata.</p> |
315
+
316
+ <a name="ARWeaveService.fetchMetadataFromUrl"></a>
317
+
318
+ ### ARWeaveService.fetchMetadataFromUrl(url) ⇒ <code>Promise.&lt;JSON&gt;</code>
319
+ <p>Helper method to fetch data from an ARWeave URL.</p>
320
+
321
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
322
+ **Returns**: <code>Promise.&lt;JSON&gt;</code> - <p>Promise resolving with the queried data.</p>
323
+
324
+ | Param | Type | Description |
325
+ | --- | --- | --- |
326
+ | url | <code>string</code> | <p>The ARWeave metadata URL to query.</p> |
327
+
328
+ <a name="ARWeaveService.BundlrConfig"></a>
329
+
330
+ ### ARWeaveService.BundlrConfig : <code>Object</code>
331
+ <p>The configuration for Bundlr network instances</p>
332
+
333
+ **Kind**: static typedef of [<code>ARWeaveService</code>](#ARWeaveService)
334
+ **Properties**
335
+
336
+ | Name | Type | Description |
337
+ | --- | --- | --- |
338
+ | nodeUrl | <code>string</code> | <p>The Bundlr node URL to use.</p> |
339
+ | currency | <code>string</code> | <p>The currency to pay for uploads with. Please see https://docs.bundlr.network/sdk/using-other-currencies for all the supported currencies</p> |
340
+ | [providerUrl] | <code>string</code> | <p>The provider URL, required for devnets.</p> |
341
+
342
+ <a name="ARWeaveService.BundlrConfig"></a>
343
+
344
+ ### ARWeaveService.BundlrConfig : <code>Object</code>
345
+ <p>The configuration for Bundlr network instances</p>
346
+
347
+ **Kind**: static typedef of [<code>ARWeaveService</code>](#ARWeaveService)
348
+ **Properties**
349
+
350
+ | Name | Type | Description |
351
+ | --- | --- | --- |
352
+ | nodeUrl | <code>string</code> | <p>The Bundlr node URL to use.</p> |
353
+ | currency | <code>string</code> | <p>The currency to pay for uploads with. Please see https://docs.bundlr.network/sdk/using-other-currencies for all the supported currencies</p> |
354
+ | [providerUrl] | <code>string</code> | <p>The provider URL, required for devnets.</p> |
355
+
135
356
  <a name="EAService"></a>
136
357
 
137
358
  ## EAService : <code>object</code>
@@ -351,6 +572,231 @@ in Huma's pools that can be drawn down by the borrower.</p>
351
572
  | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
352
573
  | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
353
574
 
575
+ <a name="ARWeaveService"></a>
576
+
577
+ ## ARWeaveService : <code>object</code>
578
+ <p>An object that contains functions to interact with Huma-related data stored on ARWeave</p>
579
+
580
+ **Kind**: global namespace
581
+
582
+ * [ARWeaveService](#ARWeaveService) : <code>object</code>
583
+ * [.getBundlrNetworkConfig(chainId)](#ARWeaveService.getBundlrNetworkConfig) ⇒ <code>BundlrConfig</code>
584
+ * [.getBundlrInstance(config, signer)](#ARWeaveService.getBundlrInstance) ⇒
585
+ * [.prefundBundlr(config, signer, amount)](#ARWeaveService.prefundBundlr) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
586
+ * [.storeData(config, signerOrPrivateKey, data, tags, [lazyFund])](#ARWeaveService.storeData) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
587
+ * [.queryForMetadata(chainId, sender, referenceId)](#ARWeaveService.queryForMetadata) ⇒ <code>Promise.&lt;any&gt;</code>
588
+ * [.fetchMetadataFromUrl(url)](#ARWeaveService.fetchMetadataFromUrl) ⇒ <code>Promise.&lt;JSON&gt;</code>
589
+ * [.getBundlrNetworkConfig(chainId)](#ARWeaveService.getBundlrNetworkConfig) ⇒ <code>BundlrConfig</code>
590
+ * [.getBundlrInstance(config, signer)](#ARWeaveService.getBundlrInstance) ⇒
591
+ * [.prefundBundlr(config, signer, amount)](#ARWeaveService.prefundBundlr) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
592
+ * [.storeData(config, signerOrPrivateKey, data, tags, [lazyFund])](#ARWeaveService.storeData) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
593
+ * [.queryForMetadata(chainId, sender, referenceId)](#ARWeaveService.queryForMetadata) ⇒ <code>Promise.&lt;any&gt;</code>
594
+ * [.fetchMetadataFromUrl(url)](#ARWeaveService.fetchMetadataFromUrl) ⇒ <code>Promise.&lt;JSON&gt;</code>
595
+ * [.BundlrConfig](#ARWeaveService.BundlrConfig) : <code>Object</code>
596
+ * [.BundlrConfig](#ARWeaveService.BundlrConfig) : <code>Object</code>
597
+
598
+ <a name="ARWeaveService.getBundlrNetworkConfig"></a>
599
+
600
+ ### ARWeaveService.getBundlrNetworkConfig(chainId) ⇒ <code>BundlrConfig</code>
601
+ <p>Get the configuration for Bundlr network given a chain ID</p>
602
+
603
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
604
+ **Returns**: <code>BundlrConfig</code> - <ul>
605
+ <li>The configuration for the Bundlr network.</li>
606
+ </ul>
607
+
608
+ | Param | Type | Description |
609
+ | --- | --- | --- |
610
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
611
+
612
+ <a name="ARWeaveService.getBundlrInstance"></a>
613
+
614
+ ### ARWeaveService.getBundlrInstance(config, signer) ⇒
615
+ <p>Get a Bundlr instance for a specific network</p>
616
+
617
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
618
+ **Returns**: <p>The Bundlr instance</p>
619
+
620
+ | Param | Type | Description |
621
+ | --- | --- | --- |
622
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
623
+ | signer | <code>string</code> | <p>The private key of the wallet to use Bundlr with.</p> |
624
+
625
+ <a name="ARWeaveService.prefundBundlr"></a>
626
+
627
+ ### ARWeaveService.prefundBundlr(config, signer, amount) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
628
+ <p>Prefund the Bundlr network with the specified amount. Required if not lazy funding.
629
+ Important note: The amount is denominated in the base unit of currency for that network.
630
+ If you want to upload 5 Matic to the Bundlr node, pass in an amount of 5.</p>
631
+
632
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
633
+ **Returns**: <code>Promise.&lt;FundResponse&gt;</code> - <ul>
634
+ <li>The fund response.</li>
635
+ </ul>
636
+
637
+ | Param | Type | Description |
638
+ | --- | --- | --- |
639
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
640
+ | signer | <code>string</code> | <p>The private key of the wallet to send funds from.</p> |
641
+ | amount | <code>number</code> | <p>The amount to fund, denoted in whatever currency specified by the config (e.g. MATIC, ETH)</p> |
642
+
643
+ <a name="ARWeaveService.storeData"></a>
644
+
645
+ ### ARWeaveService.storeData(config, signerOrPrivateKey, data, tags, [lazyFund]) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
646
+ <p>Store data on ARWeave using the Bundlr Network.</p>
647
+
648
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
649
+ **Returns**: <code>Promise.&lt;UploadResponse&gt;</code> - <p>Promise resolving with the upload response.</p>
650
+
651
+ | Param | Type | Default | Description |
652
+ | --- | --- | --- | --- |
653
+ | config | <code>BundlrConfig</code> | | <p>Configuration object for the Bundlr instance.</p> |
654
+ | signerOrPrivateKey | <code>Web3Provider</code> \| <code>string</code> | | <p>Wallet object used for interacting with the Bundlr instance. If calling from a browser, this should be a <code>Web3Provider</code> instance. If calling from a Node.js environment, this should be a private key string.</p> |
655
+ | data | <code>Record.&lt;string, unknown&gt;</code> | | <p>The data to store in the Bundlr instance.</p> |
656
+ | tags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Array of tag objects with <code>name</code> and <code>value</code> properties.</p> |
657
+ | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Optional flag to fund the Bundlr instance lazily. If set to <code>false</code>, the Bundlr node should already be funded or else uploads will fail.</p> |
658
+
659
+ <a name="ARWeaveService.queryForMetadata"></a>
660
+
661
+ ### ARWeaveService.queryForMetadata(chainId, sender, referenceId) ⇒ <code>Promise.&lt;any&gt;</code>
662
+ <p>Helper method to query the Arweave network for receivables metadata previously uploaded.</p>
663
+
664
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
665
+ **Returns**: <code>Promise.&lt;any&gt;</code> - <p>Promise resolving with the queried data.</p>
666
+
667
+ | Param | Type | Description |
668
+ | --- | --- | --- |
669
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
670
+ | sender | <code>string</code> | <p>The sender tag to query.</p> |
671
+ | referenceId | <code>string</code> | <p>The referenceId tag to query, whatever was used when uploading the metadata.</p> |
672
+
673
+ <a name="ARWeaveService.fetchMetadataFromUrl"></a>
674
+
675
+ ### ARWeaveService.fetchMetadataFromUrl(url) ⇒ <code>Promise.&lt;JSON&gt;</code>
676
+ <p>Helper method to fetch data from an ARWeave URL.</p>
677
+
678
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
679
+ **Returns**: <code>Promise.&lt;JSON&gt;</code> - <p>Promise resolving with the queried data.</p>
680
+
681
+ | Param | Type | Description |
682
+ | --- | --- | --- |
683
+ | url | <code>string</code> | <p>The ARWeave metadata URL to query.</p> |
684
+
685
+ <a name="ARWeaveService.getBundlrNetworkConfig"></a>
686
+
687
+ ### ARWeaveService.getBundlrNetworkConfig(chainId) ⇒ <code>BundlrConfig</code>
688
+ <p>Get the configuration for Bundlr network given a chain ID</p>
689
+
690
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
691
+ **Returns**: <code>BundlrConfig</code> - <ul>
692
+ <li>The configuration for the Bundlr network.</li>
693
+ </ul>
694
+
695
+ | Param | Type | Description |
696
+ | --- | --- | --- |
697
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
698
+
699
+ <a name="ARWeaveService.getBundlrInstance"></a>
700
+
701
+ ### ARWeaveService.getBundlrInstance(config, signer) ⇒
702
+ <p>Get a Bundlr instance for a specific network</p>
703
+
704
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
705
+ **Returns**: <p>The Bundlr instance</p>
706
+
707
+ | Param | Type | Description |
708
+ | --- | --- | --- |
709
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
710
+ | signer | <code>string</code> | <p>The private key of the wallet to use Bundlr with.</p> |
711
+
712
+ <a name="ARWeaveService.prefundBundlr"></a>
713
+
714
+ ### ARWeaveService.prefundBundlr(config, signer, amount) ⇒ <code>Promise.&lt;FundResponse&gt;</code>
715
+ <p>Prefund the Bundlr network with the specified amount. Required if not lazy funding.
716
+ Important note: The amount is denominated in the base unit of currency for that network.
717
+ If you want to upload 5 Matic to the Bundlr node, pass in an amount of 5.</p>
718
+
719
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
720
+ **Returns**: <code>Promise.&lt;FundResponse&gt;</code> - <ul>
721
+ <li>The fund response.</li>
722
+ </ul>
723
+
724
+ | Param | Type | Description |
725
+ | --- | --- | --- |
726
+ | config | <code>BundlrConfig</code> | <p>The configuration for the Bundlr network.</p> |
727
+ | signer | <code>string</code> | <p>The private key of the wallet to send funds from.</p> |
728
+ | amount | <code>number</code> | <p>The amount to fund, denoted in whatever currency specified by the config (e.g. MATIC, ETH)</p> |
729
+
730
+ <a name="ARWeaveService.storeData"></a>
731
+
732
+ ### ARWeaveService.storeData(config, signerOrPrivateKey, data, tags, [lazyFund]) ⇒ <code>Promise.&lt;UploadResponse&gt;</code>
733
+ <p>Store data on ARWeave using the Bundlr Network.</p>
734
+
735
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
736
+ **Returns**: <code>Promise.&lt;UploadResponse&gt;</code> - <p>Promise resolving with the upload response.</p>
737
+
738
+ | Param | Type | Default | Description |
739
+ | --- | --- | --- | --- |
740
+ | config | <code>BundlrConfig</code> | | <p>Configuration object for the Bundlr instance.</p> |
741
+ | signerOrPrivateKey | <code>Web3Provider</code> \| <code>string</code> | | <p>Wallet object used for interacting with the Bundlr instance. If calling from a browser, this should be a <code>Web3Provider</code> instance. If calling from a Node.js environment, this should be a private key string.</p> |
742
+ | data | <code>Record.&lt;string, unknown&gt;</code> | | <p>The data to store in the Bundlr instance.</p> |
743
+ | tags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Array of tag objects with <code>name</code> and <code>value</code> properties.</p> |
744
+ | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Optional flag to fund the Bundlr instance lazily. If set to <code>false</code>, the Bundlr node should already be funded or else uploads will fail.</p> |
745
+
746
+ <a name="ARWeaveService.queryForMetadata"></a>
747
+
748
+ ### ARWeaveService.queryForMetadata(chainId, sender, referenceId) ⇒ <code>Promise.&lt;any&gt;</code>
749
+ <p>Helper method to query the Arweave network for receivables metadata previously uploaded.</p>
750
+
751
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
752
+ **Returns**: <code>Promise.&lt;any&gt;</code> - <p>Promise resolving with the queried data.</p>
753
+
754
+ | Param | Type | Description |
755
+ | --- | --- | --- |
756
+ | chainId | <code>number</code> | <p>The chain ID.</p> |
757
+ | sender | <code>string</code> | <p>The sender tag to query.</p> |
758
+ | referenceId | <code>string</code> | <p>The referenceId tag to query, whatever was used when uploading the metadata.</p> |
759
+
760
+ <a name="ARWeaveService.fetchMetadataFromUrl"></a>
761
+
762
+ ### ARWeaveService.fetchMetadataFromUrl(url) ⇒ <code>Promise.&lt;JSON&gt;</code>
763
+ <p>Helper method to fetch data from an ARWeave URL.</p>
764
+
765
+ **Kind**: static method of [<code>ARWeaveService</code>](#ARWeaveService)
766
+ **Returns**: <code>Promise.&lt;JSON&gt;</code> - <p>Promise resolving with the queried data.</p>
767
+
768
+ | Param | Type | Description |
769
+ | --- | --- | --- |
770
+ | url | <code>string</code> | <p>The ARWeave metadata URL to query.</p> |
771
+
772
+ <a name="ARWeaveService.BundlrConfig"></a>
773
+
774
+ ### ARWeaveService.BundlrConfig : <code>Object</code>
775
+ <p>The configuration for Bundlr network instances</p>
776
+
777
+ **Kind**: static typedef of [<code>ARWeaveService</code>](#ARWeaveService)
778
+ **Properties**
779
+
780
+ | Name | Type | Description |
781
+ | --- | --- | --- |
782
+ | nodeUrl | <code>string</code> | <p>The Bundlr node URL to use.</p> |
783
+ | currency | <code>string</code> | <p>The currency to pay for uploads with. Please see https://docs.bundlr.network/sdk/using-other-currencies for all the supported currencies</p> |
784
+ | [providerUrl] | <code>string</code> | <p>The provider URL, required for devnets.</p> |
785
+
786
+ <a name="ARWeaveService.BundlrConfig"></a>
787
+
788
+ ### ARWeaveService.BundlrConfig : <code>Object</code>
789
+ <p>The configuration for Bundlr network instances</p>
790
+
791
+ **Kind**: static typedef of [<code>ARWeaveService</code>](#ARWeaveService)
792
+ **Properties**
793
+
794
+ | Name | Type | Description |
795
+ | --- | --- | --- |
796
+ | nodeUrl | <code>string</code> | <p>The Bundlr node URL to use.</p> |
797
+ | currency | <code>string</code> | <p>The currency to pay for uploads with. Please see https://docs.bundlr.network/sdk/using-other-currencies for all the supported currencies</p> |
798
+ | [providerUrl] | <code>string</code> | <p>The provider URL, required for devnets.</p> |
799
+
354
800
  <a name="defaultWrapper"></a>
355
801
 
356
802
  ## defaultWrapper()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/sdk",
3
- "version": "0.0.38-beta.20+cff6989",
3
+ "version": "0.0.38-beta.25+036d713",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "@ethersproject/constants": "^5.7.0",
29
29
  "@ethersproject/contracts": "^5.7.0",
30
30
  "@ethersproject/providers": "^5.6.0",
31
- "@huma-finance/shared": "^0.0.38-beta.20+cff6989",
31
+ "@huma-finance/shared": "^0.0.38-beta.25+036d713",
32
32
  "arweave": "^1.13.5",
33
33
  "axios": "^1.4.0",
34
34
  "bignumber.js": "^9.1.1",
@@ -110,5 +110,5 @@
110
110
  "optionalDependencies": {
111
111
  "encoding": "^0.1.13"
112
112
  },
113
- "gitHead": "cff69899e39a5ec6dd2fd10bc966c26b2bc82e46"
113
+ "gitHead": "036d713d622a5432bb70a4c9fe042dd1e1ef54e1"
114
114
  }