@huma-finance/sdk 0.0.21 → 0.0.24

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 (131) hide show
  1. package/API.md +482 -482
  2. package/LICENSE +660 -660
  3. package/README.md +34 -34
  4. package/dist/cjs/graphql/generatedTypes.d.ts +40 -40
  5. package/dist/cjs/graphql/generatedTypes.js +8 -8
  6. package/dist/cjs/graphql/index.d.ts +1 -1
  7. package/dist/cjs/graphql/index.js +4 -4
  8. package/dist/cjs/helpers/ERC20TransferableReceivableContractHelper.d.ts +10 -10
  9. package/dist/cjs/helpers/ERC20TransferableReceivableContractHelper.js +21 -21
  10. package/dist/cjs/helpers/PoolContractHelper.d.ts +104 -104
  11. package/dist/cjs/helpers/PoolContractHelper.js +102 -104
  12. package/dist/cjs/helpers/PoolContractHelper.js.map +1 -1
  13. package/dist/cjs/helpers/RealWorldReceivableContractHelper.d.ts +10 -10
  14. package/dist/cjs/helpers/RealWorldReceivableContractHelper.js +21 -21
  15. package/dist/cjs/helpers/index.d.ts +3 -3
  16. package/dist/cjs/helpers/index.js +6 -6
  17. package/dist/cjs/hooks/index.d.ts +4 -4
  18. package/dist/cjs/hooks/index.js +7 -7
  19. package/dist/cjs/hooks/useContract.d.ts +13 -13
  20. package/dist/cjs/hooks/useContract.js +30 -30
  21. package/dist/cjs/hooks/useERC20TransferableReceivableContract.d.ts +12 -12
  22. package/dist/cjs/hooks/useERC20TransferableReceivableContract.js +20 -20
  23. package/dist/cjs/hooks/usePoolContract.d.ts +60 -60
  24. package/dist/cjs/hooks/usePoolContract.js +53 -53
  25. package/dist/cjs/hooks/useRealWorldReceivableContract.d.ts +10 -10
  26. package/dist/cjs/hooks/useRealWorldReceivableContract.js +19 -19
  27. package/dist/cjs/index.d.ts +4 -4
  28. package/dist/cjs/index.js +7 -7
  29. package/dist/cjs/services/ARWeaveService.d.ts +81 -81
  30. package/dist/cjs/services/ARWeaveService.js +140 -145
  31. package/dist/cjs/services/ARWeaveService.js.map +1 -1
  32. package/dist/cjs/services/EAService.d.ts +18 -20
  33. package/dist/cjs/services/EAService.js +12 -33
  34. package/dist/cjs/services/EAService.js.map +1 -1
  35. package/dist/cjs/services/ReceivableService.d.ts +87 -89
  36. package/dist/cjs/services/ReceivableService.js +188 -193
  37. package/dist/cjs/services/ReceivableService.js.map +1 -1
  38. package/dist/cjs/services/SubgraphService.d.ts +53 -53
  39. package/dist/cjs/services/SubgraphService.js +100 -93
  40. package/dist/cjs/services/SubgraphService.js.map +1 -1
  41. package/dist/cjs/services/index.d.ts +4 -4
  42. package/dist/cjs/services/index.js +7 -7
  43. package/dist/cjs/utils/chain.d.ts +14 -15
  44. package/dist/cjs/utils/chain.js +33 -37
  45. package/dist/cjs/utils/chain.js.map +1 -1
  46. package/dist/cjs/utils/index.d.ts +3 -4
  47. package/dist/cjs/utils/index.js +6 -7
  48. package/dist/cjs/utils/index.js.map +1 -1
  49. package/dist/cjs/utils/poolInfo.d.ts +8 -8
  50. package/dist/cjs/utils/poolInfo.js +12 -12
  51. package/dist/cjs/utils/web3.d.ts +4 -4
  52. package/dist/cjs/utils/web3.js +28 -28
  53. package/dist/graphql/generatedTypes.d.ts +40 -40
  54. package/dist/graphql/generatedTypes.js +4 -4
  55. package/dist/graphql/index.d.ts +1 -1
  56. package/dist/graphql/index.js +1 -1
  57. package/dist/helpers/ERC20TransferableReceivableContractHelper.d.ts +10 -10
  58. package/dist/helpers/ERC20TransferableReceivableContractHelper.js +17 -17
  59. package/dist/helpers/PoolContractHelper.d.ts +104 -104
  60. package/dist/helpers/PoolContractHelper.js +94 -96
  61. package/dist/helpers/PoolContractHelper.js.map +1 -1
  62. package/dist/helpers/RealWorldReceivableContractHelper.d.ts +10 -10
  63. package/dist/helpers/RealWorldReceivableContractHelper.js +17 -17
  64. package/dist/helpers/index.d.ts +3 -3
  65. package/dist/helpers/index.js +3 -3
  66. package/dist/hooks/index.d.ts +4 -4
  67. package/dist/hooks/index.js +4 -4
  68. package/dist/hooks/useContract.d.ts +13 -13
  69. package/dist/hooks/useContract.js +26 -26
  70. package/dist/hooks/useERC20TransferableReceivableContract.d.ts +12 -12
  71. package/dist/hooks/useERC20TransferableReceivableContract.js +16 -16
  72. package/dist/hooks/usePoolContract.d.ts +60 -60
  73. package/dist/hooks/usePoolContract.js +48 -48
  74. package/dist/hooks/useRealWorldReceivableContract.d.ts +10 -10
  75. package/dist/hooks/useRealWorldReceivableContract.js +15 -15
  76. package/dist/index.d.ts +4 -4
  77. package/dist/index.js +4 -4
  78. package/dist/services/ARWeaveService.d.ts +81 -81
  79. package/dist/services/ARWeaveService.js +135 -140
  80. package/dist/services/ARWeaveService.js.map +1 -1
  81. package/dist/services/EAService.d.ts +18 -20
  82. package/dist/services/EAService.js +9 -30
  83. package/dist/services/EAService.js.map +1 -1
  84. package/dist/services/ReceivableService.d.ts +87 -89
  85. package/dist/services/ReceivableService.js +184 -189
  86. package/dist/services/ReceivableService.js.map +1 -1
  87. package/dist/services/SubgraphService.d.ts +53 -53
  88. package/dist/services/SubgraphService.js +97 -90
  89. package/dist/services/SubgraphService.js.map +1 -1
  90. package/dist/services/index.d.ts +4 -4
  91. package/dist/services/index.js +4 -4
  92. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  93. package/dist/utils/chain.d.ts +14 -15
  94. package/dist/utils/chain.js +28 -31
  95. package/dist/utils/chain.js.map +1 -1
  96. package/dist/utils/index.d.ts +3 -4
  97. package/dist/utils/index.js +3 -4
  98. package/dist/utils/index.js.map +1 -1
  99. package/dist/utils/poolInfo.d.ts +8 -8
  100. package/dist/utils/poolInfo.js +8 -8
  101. package/dist/utils/web3.d.ts +4 -4
  102. package/dist/utils/web3.js +23 -23
  103. package/getting-started.md +190 -190
  104. package/package.json +3 -3
  105. package/dist/cjs/helpers/BaseCreditPoolReceivableContractHelper.d.ts +0 -10
  106. package/dist/cjs/helpers/BaseCreditPoolReceivableContractHelper.js +0 -22
  107. package/dist/cjs/helpers/BaseCreditPoolReceivableContractHelper.js.map +0 -1
  108. package/dist/cjs/hooks/useBaseCreditPoolReceivableContract.d.ts +0 -10
  109. package/dist/cjs/hooks/useBaseCreditPoolReceivableContract.js +0 -20
  110. package/dist/cjs/hooks/useBaseCreditPoolReceivableContract.js.map +0 -1
  111. package/dist/cjs/hooks/useReceivableFactoringPoolContract.d.ts +0 -10
  112. package/dist/cjs/hooks/useReceivableFactoringPoolContract.js +0 -17
  113. package/dist/cjs/hooks/useReceivableFactoringPoolContract.js.map +0 -1
  114. package/dist/cjs/utils/maticGasStation.d.ts +0 -3
  115. package/dist/cjs/utils/maticGasStation.js +0 -39
  116. package/dist/cjs/utils/maticGasStation.js.map +0 -1
  117. package/dist/helpers/BaseCreditPoolReceivableContractHelper.d.ts +0 -10
  118. package/dist/helpers/BaseCreditPoolReceivableContractHelper.js +0 -18
  119. package/dist/helpers/BaseCreditPoolReceivableContractHelper.js.map +0 -1
  120. package/dist/hooks/useBaseCreditPoolReceivableContract.d.ts +0 -10
  121. package/dist/hooks/useBaseCreditPoolReceivableContract.js +0 -16
  122. package/dist/hooks/useBaseCreditPoolReceivableContract.js.map +0 -1
  123. package/dist/hooks/usePool.d.ts +0 -0
  124. package/dist/hooks/usePool.js +0 -2
  125. package/dist/hooks/usePool.js.map +0 -1
  126. package/dist/hooks/useReceivableFactoringPoolContract.d.ts +0 -10
  127. package/dist/hooks/useReceivableFactoringPoolContract.js +0 -13
  128. package/dist/hooks/useReceivableFactoringPoolContract.js.map +0 -1
  129. package/dist/utils/maticGasStation.d.ts +0 -3
  130. package/dist/utils/maticGasStation.js +0 -33
  131. package/dist/utils/maticGasStation.js.map +0 -1
package/API.md CHANGED
@@ -1,482 +1,482 @@
1
- ## Objects
2
-
3
- <dl>
4
- <dt><a href="#usePoolContract">usePoolContract</a> ⇒ <code>T</code></dt>
5
- <dd><p>A react hook that returns a contract instance of a specific pool using an ethers provider or signer</p></dd>
6
- <dt><a href="#ARWeaveService">ARWeaveService</a> : <code>object</code></dt>
7
- <dd><p>An object that contains functions to interact with Huma-related data stored on ARWeave</p></dd>
8
- <dt><a href="#EAService">EAService</a> : <code>object</code></dt>
9
- <dd><p>An object that contains functions to interact with Huma's EAVerse service.</p></dd>
10
- <dt><a href="#ReceivableService">ReceivableService</a> : <code>object</code></dt>
11
- <dd><p>An object that contains functions to interact with Huma's receivables.</p></dd>
12
- <dt><a href="#SubgraphService">SubgraphService</a> : <code>object</code></dt>
13
- <dd><p>An object that contains functions to interact with Huma's Subgraph storage.</p></dd>
14
- </dl>
15
-
16
- ## Functions
17
-
18
- <dl>
19
- <dt><a href="#defaultWrapper">defaultWrapper()</a></dt>
20
- <dd><p>All built-in and custom scalars, mapped to their actual values</p></dd>
21
- <dt><a href="#getERC20TransferableReceivableContract">getERC20TransferableReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
22
- <dd><p>Returns an ethers contract instance for the ERC20TransferableReceivable contract
23
- associated with the given pool name on the current chain.</p></dd>
24
- <dt><a href="#getPoolContract">getPoolContract(signerOrProvider, chainId, poolName, poolType)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
25
- <dd><p>Returns an ethers contract instance for a Huma pool contract</p></dd>
26
- <dt><a href="#drawdownFromPool">drawdownFromPool(signer, chainId, poolName, poolType, drawdownAmount, gasOpts)</a> ⇒ <code>Promise.&lt;TransactionResponse&gt;</code></dt>
27
- <dd><p>Calls drawdown on a Huma pool contract</p></dd>
28
- <dt><a href="#makePaymentToPool">makePaymentToPool(signer, chainId, poolName, poolType, paymentAmount, gasOpts)</a> ⇒ <code>Promise.&lt;TransactionResponse&gt;</code></dt>
29
- <dd><p>Calls drawdown on a Huma pool contract</p></dd>
30
- <dt><a href="#getRealWorldReceivableContract">getRealWorldReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
31
- <dd><p>Returns an ethers contract instance for the RealWorldReceivable contract
32
- associated with the given pool name on the current chain.</p></dd>
33
- <dt><a href="#useContract">useContract(address, ABI, signerOrProvider)</a> ⇒ <code>T</code> | <code>null</code></dt>
34
- <dd><p>Custom hook for creating an ethers instance of a smart contract.</p></dd>
35
- <dt><a href="#useERC20TransferableReceivableContract">useERC20TransferableReceivableContract(signerOrProvider, chainId, poolName)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
36
- <dd><p>A react hook that returns an ethers contract instance for the ERC20TransferableReceivable contract
37
- associated with the given pool name on the current chain.</p></dd>
38
- <dt><a href="#useRealWorldReceivableContract">useRealWorldReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
39
- <dd><p>A react hook that returns an ethers contract instance for the RealWorldReceivable contract
40
- associated with the given pool name on the current chain.</p></dd>
41
- <dt><a href="#getChainIdFromJsonSignerOrProvider">getChainIdFromJsonSignerOrProvider(signerOrProvider)</a> ⇒ <code>number</code></dt>
42
- <dd><p>Get the chain ID from a signer or provider object.</p></dd>
43
- <dt><a href="#getChainIdFromSignerOrProvider">getChainIdFromSignerOrProvider(signerOrProvider)</a> ⇒ <code>number</code></dt>
44
- <dd><p>Get the chain ID from a signer or provider object.</p></dd>
45
- <dt><a href="#getPoolInfo">getPoolInfo(signerOrProvider, poolName, poolType)</a> ⇒ <code>PoolInfoType</code> | <code>undefined</code></dt>
46
- <dd><p>Returns the pool info based on the provided pool name and type, using the same chain ID as the provider/signer given</p></dd>
47
- </dl>
48
-
49
- ## Typedefs
50
-
51
- <dl>
52
- <dt><a href="#ApprovalResult">ApprovalResult</a> : <code>Object</code></dt>
53
- <dd><p>Object representing the response to the underwriting approval request.</p></dd>
54
- <dt><a href="#EAPayload">EAPayload</a> : <code>Object</code></dt>
55
- <dd><p>Object representing an invoice payload for underwriting approval.</p></dd>
56
- <dt><a href="#CreditEventPayload">CreditEventPayload</a> : <code>Object</code></dt>
57
- <dd><p>Represents the payload of a credit event.</p></dd>
58
- </dl>
59
-
60
- <a name="usePoolContract"></a>
61
-
62
- ## usePoolContract ⇒ <code>T</code>
63
- <p>A react hook that returns a contract instance of a specific pool using an ethers provider or signer</p>
64
-
65
- **Kind**: global namespace
66
- **Returns**: <code>T</code> - <p>A contract instance of the specific pool.</p>
67
-
68
- | Param | Type | Description |
69
- | --- | --- | --- |
70
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>An ethers signer or provider instance.</p> |
71
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
72
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
73
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
74
-
75
-
76
- * [usePoolContract](#usePoolContract) ⇒ <code>T</code>
77
- * [.useCreditRecordDetails(userAddress, signerOrProvider, chainId, poolName, poolType)](#usePoolContract.useCreditRecordDetails) ⇒ <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code>
78
- * [.CreditRecordDetails](#usePoolContract.CreditRecordDetails) : <code>Object</code>
79
-
80
- <a name="usePoolContract.useCreditRecordDetails"></a>
81
-
82
- ### usePoolContract.useCreditRecordDetails(userAddress, signerOrProvider, chainId, poolName, poolType) ⇒ <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code>
83
- <p>A react hook that returns the credit record details for a user in a given pool, as well as a function to refresh the data.</p>
84
-
85
- **Kind**: static method of [<code>usePoolContract</code>](#usePoolContract)
86
- **Returns**: <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code> - <p>An array containing the credit record details and a function to refresh the data.</p>
87
-
88
- | Param | Type | Description |
89
- | --- | --- | --- |
90
- | userAddress | <code>string</code> | <p>The address of the user to get the credit record details for.</p> |
91
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider object to use for the contract.</p> |
92
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
93
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool to get the credit record details for.</p> |
94
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
95
-
96
- <a name="usePoolContract.CreditRecordDetails"></a>
97
-
98
- ### usePoolContract.CreditRecordDetails : <code>Object</code>
99
- <p>CreditRecordDetails type object representing the details of a credit line.</p>
100
-
101
- **Kind**: static typedef of [<code>usePoolContract</code>](#usePoolContract)
102
- **Properties**
103
-
104
- | Name | Type | Description |
105
- | --- | --- | --- |
106
- | aprInBps | <code>number</code> | <p>The APR (annual percentage rate) in basis points.</p> |
107
- | correction | <code>BigNumber</code> | <p>adjustment of interest over or under-counted because of drawdown or principal payment in the middle of a billing period</p> |
108
- | creditLimit | <code>BigNumber</code> | <p>The credit limit in the pools base currency.</p> |
109
- | defaultAmount | <code>BigNumber</code> | <p>The amount of the default, if any.</p> |
110
- | dueDate | <code>BigNumber</code> | <p>The due date of the next payment.</p> |
111
- | feesAndInterestDue | <code>BigNumber</code> | <p>The fees and interest due.</p> |
112
- | intervalInDays | <code>number</code> | <p>The interval in days between payment periods.</p> |
113
- | missedPeriods | <code>number</code> | <p>The number of missed periods.</p> |
114
- | remainingPeriods | <code>number</code> | <p>The number of remaining periods before this credit line is considered paid off.</p> |
115
- | state | <code>number</code> | <p>The state of the factorization. Please see the CreditState in huma-contracts for more details.</p> |
116
- | totalDue | <code>BigNumber</code> | <p>The total due amount of this credit line.</p> |
117
- | unbilledPrincipal | <code>BigNumber</code> | <p>The unbilled principal of the next payment.</p> |
118
-
119
- <a name="ARWeaveService"></a>
120
-
121
- ## ARWeaveService : <code>object</code>
122
- <p>An object that contains functions to interact with Huma-related data stored on ARWeave</p>
123
-
124
- **Kind**: global namespace
125
- <a name="EAService"></a>
126
-
127
- ## EAService : <code>object</code>
128
- <p>An object that contains functions to interact with Huma's EAVerse service.</p>
129
-
130
- **Kind**: global namespace
131
- <a name="ReceivableService"></a>
132
-
133
- ## ReceivableService : <code>object</code>
134
- <p>An object that contains functions to interact with Huma's receivables.</p>
135
-
136
- **Kind**: global namespace
137
-
138
- * [ReceivableService](#ReceivableService) : <code>object</code>
139
- * [.declareReceivablePaymentByReferenceId(signer, referenceId, paymentAmount)](#ReceivableService.declareReceivablePaymentByReferenceId) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
140
- * [.declareReceivablePaymentByTokenId(signer, receivableTokenId, paymentAmount)](#ReceivableService.declareReceivablePaymentByTokenId) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
141
- * [.createReceivable(signer, poolName, poolType, currencyCode, receivableAmount, maturityDate, uri, gasOpts)](#ReceivableService.createReceivable) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
142
- * [.createReceivableWithMetadata(signerOrProvider, privateKey, chainId, recipient, poolName, poolType, currencyCode, receivableAmount, maturityDate, metadata, referenceId, extraTags, [lazyFund], [gasOpts])](#ReceivableService.createReceivableWithMetadata) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
143
-
144
- <a name="ReceivableService.declareReceivablePaymentByReferenceId"></a>
145
-
146
- ### ReceivableService.declareReceivablePaymentByReferenceId(signer, referenceId, paymentAmount) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
147
- <p>Declares a payment on a RealWorldReceivable given a reference ID of the receivable, which was used as an index for ARWeave data.</p>
148
-
149
- **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
150
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
151
- <li>A Promise of the transaction receipt.</li>
152
- </ul>
153
-
154
- | Param | Type | Description |
155
- | --- | --- | --- |
156
- | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction. Note only the receivable owner can pay the receivable.</p> |
157
- | referenceId | <code>string</code> | <p>An internal identifier value added as a tag on ARWeave</p> |
158
- | paymentAmount | <code>number</code> | <p>The amount to declare paid to the receivable.</p> |
159
-
160
- <a name="ReceivableService.declareReceivablePaymentByTokenId"></a>
161
-
162
- ### ReceivableService.declareReceivablePaymentByTokenId(signer, receivableTokenId, paymentAmount) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
163
- <p>Declares a payment on a RealWorldReceivable given a tokenID of the receivable.</p>
164
-
165
- **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
166
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
167
- <li>A Promise of the transaction receipt.</li>
168
- </ul>
169
- **Throws**:
170
-
171
- - <code>Error</code> <ul>
172
- <li>Throws an error if the RealWorldReceivable contract is not available on the network.</li>
173
- </ul>
174
-
175
-
176
- | Param | Type | Description |
177
- | --- | --- | --- |
178
- | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction. Note only the receivable owner can pay the receivable.</p> |
179
- | receivableTokenId | <code>BigNumberish</code> | <p>The ID of the receivable token to pay.</p> |
180
- | paymentAmount | <code>number</code> | <p>The amount to pay the receivable.</p> |
181
-
182
- <a name="ReceivableService.createReceivable"></a>
183
-
184
- ### ReceivableService.createReceivable(signer, poolName, poolType, currencyCode, receivableAmount, maturityDate, uri, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
185
- <p>Creates a new RealWorldReceivable token on the given chain of the signer</p>
186
-
187
- **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
188
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
189
- <li>A Promise of the transaction response.</li>
190
- </ul>
191
- **Throws**:
192
-
193
- - <code>Error</code> <ul>
194
- <li>Throws an error if the RealWorldReceivable contract is not available on the network.</li>
195
- </ul>
196
-
197
-
198
- | Param | Type | Description |
199
- | --- | --- | --- |
200
- | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
201
- | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
202
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
203
- | currencyCode | <code>number</code> | <p>The ISO 4217 currency code that the receivable is denominated in</p> |
204
- | receivableAmount | <code>number</code> | <p>The amount of the receivable token to mint.</p> |
205
- | maturityDate | <code>number</code> | <p>The maturity date of the receivable token, in UNIX timestamp format.</p> |
206
- | uri | <code>string</code> | <p>The URI of the receivable token metadata.</p> |
207
- | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
208
-
209
- <a name="ReceivableService.createReceivableWithMetadata"></a>
210
-
211
- ### ReceivableService.createReceivableWithMetadata(signerOrProvider, privateKey, chainId, recipient, poolName, poolType, currencyCode, receivableAmount, maturityDate, metadata, referenceId, extraTags, [lazyFund], [gasOpts]) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
212
- <p>Creates a RealWorldReceivable token with metadata uploaded onto ARWeave</p>
213
-
214
- **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
215
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
216
- <li>The transaction receipt.</li>
217
- </ul>
218
-
219
- | Param | Type | Default | Description |
220
- | --- | --- | --- | --- |
221
- | signerOrProvider | <code>Web3Provider</code> \| <code>ethers.Signer</code> | | <p>If calling this function from a browser, this function expects a Web3Provider. If calling this function from a server, this function expects an ethers Signer. Note that privateKey only needs to be included from server calls.</p> |
222
- | privateKey | <code>string</code> \| <code>null</code> | | <p>Private key of the wallet used to upload metadata to ARWeave. Only required if calling this function from a server.</p> |
223
- | chainId | <code>number</code> | | <p>The chain ID to mint the receivable token on and pay ARWeave funds from.</p> |
224
- | recipient | <code>string</code> | | <p>The receivable token recipient.</p> |
225
- | poolName | <code>POOL\_NAME</code> | | <p>The pool name. Used to lookup the pool address to pay to.</p> |
226
- | poolType | <code>POOL\_TYPE</code> | | <p>The pool type. Used to lookup the pool address to pay to.</p> |
227
- | currencyCode | <code>number</code> | | <p>The ISO 4217 currency code that the receivable is denominated in</p> |
228
- | receivableAmount | <code>number</code> | | <p>The receivable amount.</p> |
229
- | maturityDate | <code>number</code> | | <p>The maturity date of the receivable, in UNIX timestamp format.</p> |
230
- | metadata | <code>JSON</code> | | <p>The metadata in JSON format. This will be uploaded onto ARWeave</p> |
231
- | referenceId | <code>number</code> | | <p>An internal identifier value added as a tag on ARWeave, for easily querying the metadata later.</p> |
232
- | extraTags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Any extraTags you'd like to tag your metadata with. Note that metadata on ARWeave is indexed by these tags, so make sure to include any tags that you'd like to be able to query by.</p> |
233
- | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Whether to lazy fund the ARWeave uploads. If true, the ARWeave uploads will be paid for by the metadata uploader immediately before uploading. If false, the ARWeave node must be pre-funded before calling this function.</p> |
234
- | [gasOpts] | <code>Overrides</code> | | <p>Optional gas overrides for the transaction.</p> |
235
-
236
- <a name="SubgraphService"></a>
237
-
238
- ## SubgraphService : <code>object</code>
239
- <p>An object that contains functions to interact with Huma's Subgraph storage.</p>
240
-
241
- **Kind**: global namespace
242
-
243
- * [SubgraphService](#SubgraphService) : <code>object</code>
244
- * [.getSubgraphUrlForChainId(chainId)](#SubgraphService.getSubgraphUrlForChainId) ⇒ <code>string</code>
245
- * [.getCreditEventsForUser(userAddress, chainId, poolName, poolType, event)](#SubgraphService.getCreditEventsForUser) ⇒ <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code>
246
- * [.getLastFactorizedAmountFromPool(userAddress, chainId, poolName, poolType)](#SubgraphService.getLastFactorizedAmountFromPool) ⇒ <code>Promise.&lt;number&gt;</code>
247
-
248
- <a name="SubgraphService.getSubgraphUrlForChainId"></a>
249
-
250
- ### SubgraphService.getSubgraphUrlForChainId(chainId) ⇒ <code>string</code>
251
- <p>Returns the subgraph URL for a given chain ID.</p>
252
-
253
- **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
254
- **Returns**: <code>string</code> - <p>The subgraph URL for the given chain ID.</p>
255
-
256
- | Param | Type | Description |
257
- | --- | --- | --- |
258
- | chainId | <code>number</code> | <p>The ID of the chain.</p> |
259
-
260
- <a name="SubgraphService.getCreditEventsForUser"></a>
261
-
262
- ### SubgraphService.getCreditEventsForUser(userAddress, chainId, poolName, poolType, event) ⇒ <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code>
263
- <p>Returns the credit events for a given user.</p>
264
-
265
- **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
266
- **Returns**: <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code> - <p>The credit events for the given user.</p>
267
-
268
- | Param | Type | Description |
269
- | --- | --- | --- |
270
- | userAddress | <code>string</code> | <p>The address of the user.</p> |
271
- | chainId | <code>number</code> | <p>The ID of the chain.</p> |
272
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
273
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
274
- | event | <code>Array.&lt;string&gt;</code> | <p>The event types to filter by.</p> |
275
-
276
- <a name="SubgraphService.getLastFactorizedAmountFromPool"></a>
277
-
278
- ### SubgraphService.getLastFactorizedAmountFromPool(userAddress, chainId, poolName, poolType) ⇒ <code>Promise.&lt;number&gt;</code>
279
- <p>Returns the last factorized amount for a given user and pool.</p>
280
-
281
- **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
282
- **Returns**: <code>Promise.&lt;number&gt;</code> - <p>The last factorized amount for the given user and pool.</p>
283
-
284
- | Param | Type | Description |
285
- | --- | --- | --- |
286
- | userAddress | <code>string</code> | <p>The address of the user.</p> |
287
- | chainId | <code>number</code> | <p>The ID of the chain.</p> |
288
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
289
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
290
-
291
- <a name="defaultWrapper"></a>
292
-
293
- ## defaultWrapper()
294
- <p>All built-in and custom scalars, mapped to their actual values</p>
295
-
296
- **Kind**: global function
297
- <a name="getERC20TransferableReceivableContract"></a>
298
-
299
- ## getERC20TransferableReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
300
- <p>Returns an ethers contract instance for the ERC20TransferableReceivable contract
301
- associated with the given pool name on the current chain.</p>
302
-
303
- **Kind**: global function
304
- **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the ERC20TransferableReceivable contract or null if it could not be found.</p>
305
-
306
- | Param | Type | Description |
307
- | --- | --- | --- |
308
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
309
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
310
-
311
- <a name="getPoolContract"></a>
312
-
313
- ## getPoolContract(signerOrProvider, chainId, poolName, poolType) ⇒ <code>Contract</code> \| <code>null</code>
314
- <p>Returns an ethers contract instance for a Huma pool contract</p>
315
-
316
- **Kind**: global function
317
- **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the Pool contract or null if it could not be found.</p>
318
-
319
- | Param | Type | Description |
320
- | --- | --- | --- |
321
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
322
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
323
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool contract to get.</p> |
324
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool contract to get.</p> |
325
-
326
- <a name="drawdownFromPool"></a>
327
-
328
- ## drawdownFromPool(signer, chainId, poolName, poolType, drawdownAmount, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
329
- <p>Calls drawdown on a Huma pool contract</p>
330
-
331
- **Kind**: global function
332
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
333
- <li>A Promise of the transaction response.</li>
334
- </ul>
335
-
336
- | Param | Type | Description |
337
- | --- | --- | --- |
338
- | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
339
- | chainId | <code>number</code> | <p>The chain ID of the pool to call drawdown on. Used to lookup the pool address.</p> |
340
- | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
341
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
342
- | drawdownAmount | <code>BigNumberish</code> | <p>The amount of tokens to withdraw, denominated in the ERC20 tokens of the pool.</p> |
343
- | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
344
-
345
- <a name="makePaymentToPool"></a>
346
-
347
- ## makePaymentToPool(signer, chainId, poolName, poolType, paymentAmount, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
348
- <p>Calls drawdown on a Huma pool contract</p>
349
-
350
- **Kind**: global function
351
- **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
352
- <li>A Promise of the transaction response.</li>
353
- </ul>
354
-
355
- | Param | Type | Description |
356
- | --- | --- | --- |
357
- | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
358
- | chainId | <code>number</code> | <p>The chain ID of the pool to call drawdown on. Used to lookup the pool address.</p> |
359
- | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
360
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
361
- | paymentAmount | <code>BigNumberish</code> | <p>The amount of tokens to payback, denominated in the ERC20 tokens of the pool.</p> |
362
- | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
363
-
364
- <a name="getRealWorldReceivableContract"></a>
365
-
366
- ## getRealWorldReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
367
- <p>Returns an ethers contract instance for the RealWorldReceivable contract
368
- associated with the given pool name on the current chain.</p>
369
-
370
- **Kind**: global function
371
- **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the RealWorldReceivable contract or null if it could not be found.</p>
372
-
373
- | Param | Type | Description |
374
- | --- | --- | --- |
375
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
376
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
377
-
378
- <a name="useContract"></a>
379
-
380
- ## useContract(address, ABI, signerOrProvider) ⇒ <code>T</code> \| <code>null</code>
381
- <p>Custom hook for creating an ethers instance of a smart contract.</p>
382
-
383
- **Kind**: global function
384
- **Returns**: <code>T</code> \| <code>null</code> - <p>An instance of the smart contract, or null if an error occurs.</p>
385
-
386
- | Param | Type | Description |
387
- | --- | --- | --- |
388
- | address | <code>string</code> \| <code>null</code> \| <code>undefined</code> | <p>The address of the smart contract instance.</p> |
389
- | ABI | <code>any</code> | <p>The ABI of the smart contract.</p> |
390
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider used to sign transactions or retrieve blockchain data. Note that this signerOrProvider must be connected to the same network as the smart contract in question.</p> |
391
-
392
- <a name="useERC20TransferableReceivableContract"></a>
393
-
394
- ## useERC20TransferableReceivableContract(signerOrProvider, chainId, poolName) ⇒ <code>Contract</code> \| <code>null</code>
395
- <p>A react hook that returns an ethers contract instance for the ERC20TransferableReceivable contract
396
- associated with the given pool name on the current chain.</p>
397
-
398
- **Kind**: global function
399
- **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the ERC20TransferableReceivable contract or null if it could not be found.</p>
400
-
401
- | Param | Type | Description |
402
- | --- | --- | --- |
403
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
404
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
405
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool to get the contract for.</p> |
406
-
407
- <a name="useRealWorldReceivableContract"></a>
408
-
409
- ## useRealWorldReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
410
- <p>A react hook that returns an ethers contract instance for the RealWorldReceivable contract
411
- associated with the given pool name on the current chain.</p>
412
-
413
- **Kind**: global function
414
- **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the RealWorldReceivable contract or null if it could not be found.</p>
415
-
416
- | Param | Type | Description |
417
- | --- | --- | --- |
418
- | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
419
- | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
420
-
421
- <a name="getChainIdFromJsonSignerOrProvider"></a>
422
-
423
- ## getChainIdFromJsonSignerOrProvider(signerOrProvider) ⇒ <code>number</code>
424
- <p>Get the chain ID from a signer or provider object.</p>
425
-
426
- **Kind**: global function
427
- **Returns**: <code>number</code> - <ul>
428
- <li>The chain ID.</li>
429
- </ul>
430
-
431
- | Param | Type | Description |
432
- | --- | --- | --- |
433
- | signerOrProvider | <code>JsonRpcProvider</code> \| <code>JsonRpcSigner</code> | <p>The signer or provider object to get the chain ID from.</p> |
434
-
435
- <a name="getChainIdFromSignerOrProvider"></a>
436
-
437
- ## getChainIdFromSignerOrProvider(signerOrProvider) ⇒ <code>number</code>
438
- <p>Get the chain ID from a signer or provider object.</p>
439
-
440
- **Kind**: global function
441
- **Returns**: <code>number</code> - <ul>
442
- <li>The chain ID.</li>
443
- </ul>
444
-
445
- | Param | Type | Description |
446
- | --- | --- | --- |
447
- | signerOrProvider | <code>ethers.provider.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider object to get the chain ID from.</p> |
448
-
449
- <a name="getPoolInfo"></a>
450
-
451
- ## getPoolInfo(signerOrProvider, poolName, poolType) ⇒ <code>PoolInfoType</code> \| <code>undefined</code>
452
- <p>Returns the pool info based on the provided pool name and type, using the same chain ID as the provider/signer given</p>
453
-
454
- **Kind**: global function
455
- **Returns**: <code>PoolInfoType</code> \| <code>undefined</code> - <ul>
456
- <li>The pool info or undefined if the chain ID is not supported.</li>
457
- </ul>
458
-
459
- | Param | Type | Description |
460
- | --- | --- | --- |
461
- | signerOrProvider | <code>JsonRpcProvider</code> \| <code>JsonRpcSigner</code> | <p>The Web3 provider or signer.</p> |
462
- | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
463
- | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
464
-
465
- <a name="ApprovalResult"></a>
466
-
467
- ## ApprovalResult : <code>Object</code>
468
- <p>Object representing the response to the underwriting approval request.</p>
469
-
470
- **Kind**: global typedef
471
- <a name="EAPayload"></a>
472
-
473
- ## EAPayload : <code>Object</code>
474
- <p>Object representing an invoice payload for underwriting approval.</p>
475
-
476
- **Kind**: global typedef
477
- <a name="CreditEventPayload"></a>
478
-
479
- ## CreditEventPayload : <code>Object</code>
480
- <p>Represents the payload of a credit event.</p>
481
-
482
- **Kind**: global typedef
1
+ ## Objects
2
+
3
+ <dl>
4
+ <dt><a href="#usePoolContract">usePoolContract</a> ⇒ <code>T</code></dt>
5
+ <dd><p>A react hook that returns a contract instance of a specific pool using an ethers provider or signer</p></dd>
6
+ <dt><a href="#ARWeaveService">ARWeaveService</a> : <code>object</code></dt>
7
+ <dd><p>An object that contains functions to interact with Huma-related data stored on ARWeave</p></dd>
8
+ <dt><a href="#EAService">EAService</a> : <code>object</code></dt>
9
+ <dd><p>An object that contains functions to interact with Huma's EAVerse service.</p></dd>
10
+ <dt><a href="#ReceivableService">ReceivableService</a> : <code>object</code></dt>
11
+ <dd><p>An object that contains functions to interact with Huma's receivables.</p></dd>
12
+ <dt><a href="#SubgraphService">SubgraphService</a> : <code>object</code></dt>
13
+ <dd><p>An object that contains functions to interact with Huma's Subgraph storage.</p></dd>
14
+ </dl>
15
+
16
+ ## Functions
17
+
18
+ <dl>
19
+ <dt><a href="#defaultWrapper">defaultWrapper()</a></dt>
20
+ <dd><p>All built-in and custom scalars, mapped to their actual values</p></dd>
21
+ <dt><a href="#getERC20TransferableReceivableContract">getERC20TransferableReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
22
+ <dd><p>Returns an ethers contract instance for the ERC20TransferableReceivable contract
23
+ associated with the given pool name on the current chain.</p></dd>
24
+ <dt><a href="#getPoolContract">getPoolContract(signerOrProvider, chainId, poolName, poolType)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
25
+ <dd><p>Returns an ethers contract instance for a Huma pool contract</p></dd>
26
+ <dt><a href="#drawdownFromPool">drawdownFromPool(signer, chainId, poolName, poolType, drawdownAmount, gasOpts)</a> ⇒ <code>Promise.&lt;TransactionResponse&gt;</code></dt>
27
+ <dd><p>Calls drawdown on a Huma pool contract</p></dd>
28
+ <dt><a href="#makePaymentToPool">makePaymentToPool(signer, chainId, poolName, poolType, paymentAmount, gasOpts)</a> ⇒ <code>Promise.&lt;TransactionResponse&gt;</code></dt>
29
+ <dd><p>Calls drawdown on a Huma pool contract</p></dd>
30
+ <dt><a href="#getRealWorldReceivableContract">getRealWorldReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
31
+ <dd><p>Returns an ethers contract instance for the RealWorldReceivable contract
32
+ associated with the given pool name on the current chain.</p></dd>
33
+ <dt><a href="#useContract">useContract(address, ABI, signerOrProvider)</a> ⇒ <code>T</code> | <code>null</code></dt>
34
+ <dd><p>Custom hook for creating an ethers instance of a smart contract.</p></dd>
35
+ <dt><a href="#useERC20TransferableReceivableContract">useERC20TransferableReceivableContract(signerOrProvider, chainId, poolName)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
36
+ <dd><p>A react hook that returns an ethers contract instance for the ERC20TransferableReceivable contract
37
+ associated with the given pool name on the current chain.</p></dd>
38
+ <dt><a href="#useRealWorldReceivableContract">useRealWorldReceivableContract(signerOrProvider, chainId)</a> ⇒ <code>Contract</code> | <code>null</code></dt>
39
+ <dd><p>A react hook that returns an ethers contract instance for the RealWorldReceivable contract
40
+ associated with the given pool name on the current chain.</p></dd>
41
+ <dt><a href="#getChainIdFromJsonSignerOrProvider">getChainIdFromJsonSignerOrProvider(signerOrProvider)</a> ⇒ <code>number</code></dt>
42
+ <dd><p>Get the chain ID from a signer or provider object.</p></dd>
43
+ <dt><a href="#getChainIdFromSignerOrProvider">getChainIdFromSignerOrProvider(signerOrProvider)</a> ⇒ <code>number</code></dt>
44
+ <dd><p>Get the chain ID from a signer or provider object.</p></dd>
45
+ <dt><a href="#getPoolInfo">getPoolInfo(signerOrProvider, poolName, poolType)</a> ⇒ <code>PoolInfoType</code> | <code>undefined</code></dt>
46
+ <dd><p>Returns the pool info based on the provided pool name and type, using the same chain ID as the provider/signer given</p></dd>
47
+ </dl>
48
+
49
+ ## Typedefs
50
+
51
+ <dl>
52
+ <dt><a href="#ApprovalResult">ApprovalResult</a> : <code>Object</code></dt>
53
+ <dd><p>Object representing the response to the underwriting approval request.</p></dd>
54
+ <dt><a href="#EAPayload">EAPayload</a> : <code>Object</code></dt>
55
+ <dd><p>Object representing an invoice payload for underwriting approval.</p></dd>
56
+ <dt><a href="#CreditEventPayload">CreditEventPayload</a> : <code>Object</code></dt>
57
+ <dd><p>Represents the payload of a credit event.</p></dd>
58
+ </dl>
59
+
60
+ <a name="usePoolContract"></a>
61
+
62
+ ## usePoolContract ⇒ <code>T</code>
63
+ <p>A react hook that returns a contract instance of a specific pool using an ethers provider or signer</p>
64
+
65
+ **Kind**: global namespace
66
+ **Returns**: <code>T</code> - <p>A contract instance of the specific pool.</p>
67
+
68
+ | Param | Type | Description |
69
+ | --- | --- | --- |
70
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>An ethers signer or provider instance.</p> |
71
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
72
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
73
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
74
+
75
+
76
+ * [usePoolContract](#usePoolContract) ⇒ <code>T</code>
77
+ * [.useCreditRecordDetails(userAddress, signerOrProvider, chainId, poolName, poolType)](#usePoolContract.useCreditRecordDetails) ⇒ <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code>
78
+ * [.CreditRecordDetails](#usePoolContract.CreditRecordDetails) : <code>Object</code>
79
+
80
+ <a name="usePoolContract.useCreditRecordDetails"></a>
81
+
82
+ ### usePoolContract.useCreditRecordDetails(userAddress, signerOrProvider, chainId, poolName, poolType) ⇒ <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code>
83
+ <p>A react hook that returns the credit record details for a user in a given pool, as well as a function to refresh the data.</p>
84
+
85
+ **Kind**: static method of [<code>usePoolContract</code>](#usePoolContract)
86
+ **Returns**: <code>Array.&lt;(CreditRecordDetails\|undefined), function(): void&gt;</code> - <p>An array containing the credit record details and a function to refresh the data.</p>
87
+
88
+ | Param | Type | Description |
89
+ | --- | --- | --- |
90
+ | userAddress | <code>string</code> | <p>The address of the user to get the credit record details for.</p> |
91
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider object to use for the contract.</p> |
92
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
93
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool to get the credit record details for.</p> |
94
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
95
+
96
+ <a name="usePoolContract.CreditRecordDetails"></a>
97
+
98
+ ### usePoolContract.CreditRecordDetails : <code>Object</code>
99
+ <p>CreditRecordDetails type object representing the details of a credit line.</p>
100
+
101
+ **Kind**: static typedef of [<code>usePoolContract</code>](#usePoolContract)
102
+ **Properties**
103
+
104
+ | Name | Type | Description |
105
+ | --- | --- | --- |
106
+ | aprInBps | <code>number</code> | <p>The APR (annual percentage rate) in basis points.</p> |
107
+ | correction | <code>BigNumber</code> | <p>adjustment of interest over or under-counted because of drawdown or principal payment in the middle of a billing period</p> |
108
+ | creditLimit | <code>BigNumber</code> | <p>The credit limit in the pools base currency.</p> |
109
+ | defaultAmount | <code>BigNumber</code> | <p>The amount of the default, if any.</p> |
110
+ | dueDate | <code>BigNumber</code> | <p>The due date of the next payment.</p> |
111
+ | feesAndInterestDue | <code>BigNumber</code> | <p>The fees and interest due.</p> |
112
+ | intervalInDays | <code>number</code> | <p>The interval in days between payment periods.</p> |
113
+ | missedPeriods | <code>number</code> | <p>The number of missed periods.</p> |
114
+ | remainingPeriods | <code>number</code> | <p>The number of remaining periods before this credit line is considered paid off.</p> |
115
+ | state | <code>number</code> | <p>The state of the factorization. Please see the CreditState in huma-contracts for more details.</p> |
116
+ | totalDue | <code>BigNumber</code> | <p>The total due amount of this credit line.</p> |
117
+ | unbilledPrincipal | <code>BigNumber</code> | <p>The unbilled principal of the next payment.</p> |
118
+
119
+ <a name="ARWeaveService"></a>
120
+
121
+ ## ARWeaveService : <code>object</code>
122
+ <p>An object that contains functions to interact with Huma-related data stored on ARWeave</p>
123
+
124
+ **Kind**: global namespace
125
+ <a name="EAService"></a>
126
+
127
+ ## EAService : <code>object</code>
128
+ <p>An object that contains functions to interact with Huma's EAVerse service.</p>
129
+
130
+ **Kind**: global namespace
131
+ <a name="ReceivableService"></a>
132
+
133
+ ## ReceivableService : <code>object</code>
134
+ <p>An object that contains functions to interact with Huma's receivables.</p>
135
+
136
+ **Kind**: global namespace
137
+
138
+ * [ReceivableService](#ReceivableService) : <code>object</code>
139
+ * [.declareReceivablePaymentByReferenceId(signer, referenceId, paymentAmount)](#ReceivableService.declareReceivablePaymentByReferenceId) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
140
+ * [.declareReceivablePaymentByTokenId(signer, receivableTokenId, paymentAmount)](#ReceivableService.declareReceivablePaymentByTokenId) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
141
+ * [.createReceivable(signer, poolName, poolType, currencyCode, receivableAmount, maturityDate, uri, gasOpts)](#ReceivableService.createReceivable) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
142
+ * [.createReceivableWithMetadata(signerOrProvider, privateKey, chainId, recipient, poolName, poolType, currencyCode, receivableAmount, maturityDate, metadata, referenceId, extraTags, [lazyFund], [gasOpts])](#ReceivableService.createReceivableWithMetadata) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
143
+
144
+ <a name="ReceivableService.declareReceivablePaymentByReferenceId"></a>
145
+
146
+ ### ReceivableService.declareReceivablePaymentByReferenceId(signer, referenceId, paymentAmount) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
147
+ <p>Declares a payment on a RealWorldReceivable given a reference ID of the receivable, which was used as an index for ARWeave data.</p>
148
+
149
+ **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
150
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
151
+ <li>A Promise of the transaction receipt.</li>
152
+ </ul>
153
+
154
+ | Param | Type | Description |
155
+ | --- | --- | --- |
156
+ | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction. Note only the receivable owner can pay the receivable.</p> |
157
+ | referenceId | <code>string</code> | <p>An internal identifier value added as a tag on ARWeave</p> |
158
+ | paymentAmount | <code>number</code> | <p>The amount to declare paid to the receivable.</p> |
159
+
160
+ <a name="ReceivableService.declareReceivablePaymentByTokenId"></a>
161
+
162
+ ### ReceivableService.declareReceivablePaymentByTokenId(signer, receivableTokenId, paymentAmount) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
163
+ <p>Declares a payment on a RealWorldReceivable given a tokenID of the receivable.</p>
164
+
165
+ **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
166
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
167
+ <li>A Promise of the transaction receipt.</li>
168
+ </ul>
169
+ **Throws**:
170
+
171
+ - <code>Error</code> <ul>
172
+ <li>Throws an error if the RealWorldReceivable contract is not available on the network.</li>
173
+ </ul>
174
+
175
+
176
+ | Param | Type | Description |
177
+ | --- | --- | --- |
178
+ | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction. Note only the receivable owner can pay the receivable.</p> |
179
+ | receivableTokenId | <code>BigNumberish</code> | <p>The ID of the receivable token to pay.</p> |
180
+ | paymentAmount | <code>number</code> | <p>The amount to pay the receivable.</p> |
181
+
182
+ <a name="ReceivableService.createReceivable"></a>
183
+
184
+ ### ReceivableService.createReceivable(signer, poolName, poolType, currencyCode, receivableAmount, maturityDate, uri, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
185
+ <p>Creates a new RealWorldReceivable token on the given chain of the signer</p>
186
+
187
+ **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
188
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
189
+ <li>A Promise of the transaction response.</li>
190
+ </ul>
191
+ **Throws**:
192
+
193
+ - <code>Error</code> <ul>
194
+ <li>Throws an error if the RealWorldReceivable contract is not available on the network.</li>
195
+ </ul>
196
+
197
+
198
+ | Param | Type | Description |
199
+ | --- | --- | --- |
200
+ | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
201
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
202
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
203
+ | currencyCode | <code>number</code> | <p>The ISO 4217 currency code that the receivable is denominated in</p> |
204
+ | receivableAmount | <code>number</code> | <p>The amount of the receivable token to mint.</p> |
205
+ | maturityDate | <code>number</code> | <p>The maturity date of the receivable token, in UNIX timestamp format.</p> |
206
+ | uri | <code>string</code> | <p>The URI of the receivable token metadata.</p> |
207
+ | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
208
+
209
+ <a name="ReceivableService.createReceivableWithMetadata"></a>
210
+
211
+ ### ReceivableService.createReceivableWithMetadata(signerOrProvider, privateKey, chainId, recipient, poolName, poolType, currencyCode, receivableAmount, maturityDate, metadata, referenceId, extraTags, [lazyFund], [gasOpts]) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
212
+ <p>Creates a RealWorldReceivable token with metadata uploaded onto ARWeave</p>
213
+
214
+ **Kind**: static method of [<code>ReceivableService</code>](#ReceivableService)
215
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
216
+ <li>The transaction receipt.</li>
217
+ </ul>
218
+
219
+ | Param | Type | Default | Description |
220
+ | --- | --- | --- | --- |
221
+ | signerOrProvider | <code>Web3Provider</code> \| <code>ethers.Signer</code> | | <p>If calling this function from a browser, this function expects a Web3Provider. If calling this function from a server, this function expects an ethers Signer. Note that privateKey only needs to be included from server calls.</p> |
222
+ | privateKey | <code>string</code> \| <code>null</code> | | <p>Private key of the wallet used to upload metadata to ARWeave. Only required if calling this function from a server.</p> |
223
+ | chainId | <code>number</code> | | <p>The chain ID to mint the receivable token on and pay ARWeave funds from.</p> |
224
+ | recipient | <code>string</code> | | <p>The receivable token recipient.</p> |
225
+ | poolName | <code>POOL\_NAME</code> | | <p>The pool name. Used to lookup the pool address to pay to.</p> |
226
+ | poolType | <code>POOL\_TYPE</code> | | <p>The pool type. Used to lookup the pool address to pay to.</p> |
227
+ | currencyCode | <code>number</code> | | <p>The ISO 4217 currency code that the receivable is denominated in</p> |
228
+ | receivableAmount | <code>number</code> | | <p>The receivable amount.</p> |
229
+ | maturityDate | <code>number</code> | | <p>The maturity date of the receivable, in UNIX timestamp format.</p> |
230
+ | metadata | <code>JSON</code> | | <p>The metadata in JSON format. This will be uploaded onto ARWeave</p> |
231
+ | referenceId | <code>number</code> | | <p>An internal identifier value added as a tag on ARWeave, for easily querying the metadata later.</p> |
232
+ | extraTags | <code>Array.&lt;{name: string, value: string}&gt;</code> | | <p>Any extraTags you'd like to tag your metadata with. Note that metadata on ARWeave is indexed by these tags, so make sure to include any tags that you'd like to be able to query by.</p> |
233
+ | [lazyFund] | <code>boolean</code> | <code>true</code> | <p>Whether to lazy fund the ARWeave uploads. If true, the ARWeave uploads will be paid for by the metadata uploader immediately before uploading. If false, the ARWeave node must be pre-funded before calling this function.</p> |
234
+ | [gasOpts] | <code>Overrides</code> | | <p>Optional gas overrides for the transaction.</p> |
235
+
236
+ <a name="SubgraphService"></a>
237
+
238
+ ## SubgraphService : <code>object</code>
239
+ <p>An object that contains functions to interact with Huma's Subgraph storage.</p>
240
+
241
+ **Kind**: global namespace
242
+
243
+ * [SubgraphService](#SubgraphService) : <code>object</code>
244
+ * [.getSubgraphUrlForChainId(chainId)](#SubgraphService.getSubgraphUrlForChainId) ⇒ <code>string</code>
245
+ * [.getCreditEventsForUser(userAddress, chainId, poolName, poolType, event)](#SubgraphService.getCreditEventsForUser) ⇒ <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code>
246
+ * [.getLastFactorizedAmountFromPool(userAddress, chainId, poolName, poolType)](#SubgraphService.getLastFactorizedAmountFromPool) ⇒ <code>Promise.&lt;number&gt;</code>
247
+
248
+ <a name="SubgraphService.getSubgraphUrlForChainId"></a>
249
+
250
+ ### SubgraphService.getSubgraphUrlForChainId(chainId) ⇒ <code>string</code>
251
+ <p>Returns the subgraph URL for a given chain ID.</p>
252
+
253
+ **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
254
+ **Returns**: <code>string</code> - <p>The subgraph URL for the given chain ID.</p>
255
+
256
+ | Param | Type | Description |
257
+ | --- | --- | --- |
258
+ | chainId | <code>number</code> | <p>The ID of the chain.</p> |
259
+
260
+ <a name="SubgraphService.getCreditEventsForUser"></a>
261
+
262
+ ### SubgraphService.getCreditEventsForUser(userAddress, chainId, poolName, poolType, event) ⇒ <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code>
263
+ <p>Returns the credit events for a given user.</p>
264
+
265
+ **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
266
+ **Returns**: <code>Promise.&lt;Array.&lt;CreditEventPayload&gt;&gt;</code> - <p>The credit events for the given user.</p>
267
+
268
+ | Param | Type | Description |
269
+ | --- | --- | --- |
270
+ | userAddress | <code>string</code> | <p>The address of the user.</p> |
271
+ | chainId | <code>number</code> | <p>The ID of the chain.</p> |
272
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
273
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
274
+ | event | <code>Array.&lt;string&gt;</code> | <p>The event types to filter by.</p> |
275
+
276
+ <a name="SubgraphService.getLastFactorizedAmountFromPool"></a>
277
+
278
+ ### SubgraphService.getLastFactorizedAmountFromPool(userAddress, chainId, poolName, poolType) ⇒ <code>Promise.&lt;number&gt;</code>
279
+ <p>Returns the last factorized amount for a given user and pool.</p>
280
+
281
+ **Kind**: static method of [<code>SubgraphService</code>](#SubgraphService)
282
+ **Returns**: <code>Promise.&lt;number&gt;</code> - <p>The last factorized amount for the given user and pool.</p>
283
+
284
+ | Param | Type | Description |
285
+ | --- | --- | --- |
286
+ | userAddress | <code>string</code> | <p>The address of the user.</p> |
287
+ | chainId | <code>number</code> | <p>The ID of the chain.</p> |
288
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
289
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
290
+
291
+ <a name="defaultWrapper"></a>
292
+
293
+ ## defaultWrapper()
294
+ <p>All built-in and custom scalars, mapped to their actual values</p>
295
+
296
+ **Kind**: global function
297
+ <a name="getERC20TransferableReceivableContract"></a>
298
+
299
+ ## getERC20TransferableReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
300
+ <p>Returns an ethers contract instance for the ERC20TransferableReceivable contract
301
+ associated with the given pool name on the current chain.</p>
302
+
303
+ **Kind**: global function
304
+ **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the ERC20TransferableReceivable contract or null if it could not be found.</p>
305
+
306
+ | Param | Type | Description |
307
+ | --- | --- | --- |
308
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
309
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
310
+
311
+ <a name="getPoolContract"></a>
312
+
313
+ ## getPoolContract(signerOrProvider, chainId, poolName, poolType) ⇒ <code>Contract</code> \| <code>null</code>
314
+ <p>Returns an ethers contract instance for a Huma pool contract</p>
315
+
316
+ **Kind**: global function
317
+ **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the Pool contract or null if it could not be found.</p>
318
+
319
+ | Param | Type | Description |
320
+ | --- | --- | --- |
321
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
322
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
323
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool contract to get.</p> |
324
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool contract to get.</p> |
325
+
326
+ <a name="drawdownFromPool"></a>
327
+
328
+ ## drawdownFromPool(signer, chainId, poolName, poolType, drawdownAmount, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
329
+ <p>Calls drawdown on a Huma pool contract</p>
330
+
331
+ **Kind**: global function
332
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
333
+ <li>A Promise of the transaction response.</li>
334
+ </ul>
335
+
336
+ | Param | Type | Description |
337
+ | --- | --- | --- |
338
+ | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
339
+ | chainId | <code>number</code> | <p>The chain ID of the pool to call drawdown on. Used to lookup the pool address.</p> |
340
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
341
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
342
+ | drawdownAmount | <code>BigNumberish</code> | <p>The amount of tokens to withdraw, denominated in the ERC20 tokens of the pool.</p> |
343
+ | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
344
+
345
+ <a name="makePaymentToPool"></a>
346
+
347
+ ## makePaymentToPool(signer, chainId, poolName, poolType, paymentAmount, gasOpts) ⇒ <code>Promise.&lt;TransactionResponse&gt;</code>
348
+ <p>Calls drawdown on a Huma pool contract</p>
349
+
350
+ **Kind**: global function
351
+ **Returns**: <code>Promise.&lt;TransactionResponse&gt;</code> - <ul>
352
+ <li>A Promise of the transaction response.</li>
353
+ </ul>
354
+
355
+ | Param | Type | Description |
356
+ | --- | --- | --- |
357
+ | signer | <code>ethers.Signer</code> | <p>The signer used to send the transaction.</p> |
358
+ | chainId | <code>number</code> | <p>The chain ID of the pool to call drawdown on. Used to lookup the pool address.</p> |
359
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
360
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the credit pool to mint the receivable token from. Used to lookup the pool address.</p> |
361
+ | paymentAmount | <code>BigNumberish</code> | <p>The amount of tokens to payback, denominated in the ERC20 tokens of the pool.</p> |
362
+ | gasOpts | <code>Overrides</code> | <p>The gas options to use for the transaction.</p> |
363
+
364
+ <a name="getRealWorldReceivableContract"></a>
365
+
366
+ ## getRealWorldReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
367
+ <p>Returns an ethers contract instance for the RealWorldReceivable contract
368
+ associated with the given pool name on the current chain.</p>
369
+
370
+ **Kind**: global function
371
+ **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the RealWorldReceivable contract or null if it could not be found.</p>
372
+
373
+ | Param | Type | Description |
374
+ | --- | --- | --- |
375
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
376
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
377
+
378
+ <a name="useContract"></a>
379
+
380
+ ## useContract(address, ABI, signerOrProvider) ⇒ <code>T</code> \| <code>null</code>
381
+ <p>Custom hook for creating an ethers instance of a smart contract.</p>
382
+
383
+ **Kind**: global function
384
+ **Returns**: <code>T</code> \| <code>null</code> - <p>An instance of the smart contract, or null if an error occurs.</p>
385
+
386
+ | Param | Type | Description |
387
+ | --- | --- | --- |
388
+ | address | <code>string</code> \| <code>null</code> \| <code>undefined</code> | <p>The address of the smart contract instance.</p> |
389
+ | ABI | <code>any</code> | <p>The ABI of the smart contract.</p> |
390
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider used to sign transactions or retrieve blockchain data. Note that this signerOrProvider must be connected to the same network as the smart contract in question.</p> |
391
+
392
+ <a name="useERC20TransferableReceivableContract"></a>
393
+
394
+ ## useERC20TransferableReceivableContract(signerOrProvider, chainId, poolName) ⇒ <code>Contract</code> \| <code>null</code>
395
+ <p>A react hook that returns an ethers contract instance for the ERC20TransferableReceivable contract
396
+ associated with the given pool name on the current chain.</p>
397
+
398
+ **Kind**: global function
399
+ **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the ERC20TransferableReceivable contract or null if it could not be found.</p>
400
+
401
+ | Param | Type | Description |
402
+ | --- | --- | --- |
403
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
404
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
405
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool to get the contract for.</p> |
406
+
407
+ <a name="useRealWorldReceivableContract"></a>
408
+
409
+ ## useRealWorldReceivableContract(signerOrProvider, chainId) ⇒ <code>Contract</code> \| <code>null</code>
410
+ <p>A react hook that returns an ethers contract instance for the RealWorldReceivable contract
411
+ associated with the given pool name on the current chain.</p>
412
+
413
+ **Kind**: global function
414
+ **Returns**: <code>Contract</code> \| <code>null</code> - <p>A contract instance for the RealWorldReceivable contract or null if it could not be found.</p>
415
+
416
+ | Param | Type | Description |
417
+ | --- | --- | --- |
418
+ | signerOrProvider | <code>ethers.providers.Provider</code> \| <code>ethers.Signer</code> | <p>The provider or signer instance to use for the contract.</p> |
419
+ | chainId | <code>number</code> | <p>The chain id where the contract instance exists</p> |
420
+
421
+ <a name="getChainIdFromJsonSignerOrProvider"></a>
422
+
423
+ ## getChainIdFromJsonSignerOrProvider(signerOrProvider) ⇒ <code>number</code>
424
+ <p>Get the chain ID from a signer or provider object.</p>
425
+
426
+ **Kind**: global function
427
+ **Returns**: <code>number</code> - <ul>
428
+ <li>The chain ID.</li>
429
+ </ul>
430
+
431
+ | Param | Type | Description |
432
+ | --- | --- | --- |
433
+ | signerOrProvider | <code>JsonRpcProvider</code> \| <code>JsonRpcSigner</code> | <p>The signer or provider object to get the chain ID from.</p> |
434
+
435
+ <a name="getChainIdFromSignerOrProvider"></a>
436
+
437
+ ## getChainIdFromSignerOrProvider(signerOrProvider) ⇒ <code>number</code>
438
+ <p>Get the chain ID from a signer or provider object.</p>
439
+
440
+ **Kind**: global function
441
+ **Returns**: <code>number</code> - <ul>
442
+ <li>The chain ID.</li>
443
+ </ul>
444
+
445
+ | Param | Type | Description |
446
+ | --- | --- | --- |
447
+ | signerOrProvider | <code>ethers.provider.Provider</code> \| <code>ethers.Signer</code> | <p>The signer or provider object to get the chain ID from.</p> |
448
+
449
+ <a name="getPoolInfo"></a>
450
+
451
+ ## getPoolInfo(signerOrProvider, poolName, poolType) ⇒ <code>PoolInfoType</code> \| <code>undefined</code>
452
+ <p>Returns the pool info based on the provided pool name and type, using the same chain ID as the provider/signer given</p>
453
+
454
+ **Kind**: global function
455
+ **Returns**: <code>PoolInfoType</code> \| <code>undefined</code> - <ul>
456
+ <li>The pool info or undefined if the chain ID is not supported.</li>
457
+ </ul>
458
+
459
+ | Param | Type | Description |
460
+ | --- | --- | --- |
461
+ | signerOrProvider | <code>JsonRpcProvider</code> \| <code>JsonRpcSigner</code> | <p>The Web3 provider or signer.</p> |
462
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the pool.</p> |
463
+ | poolType | <code>POOL\_TYPE</code> | <p>The type of the pool.</p> |
464
+
465
+ <a name="ApprovalResult"></a>
466
+
467
+ ## ApprovalResult : <code>Object</code>
468
+ <p>Object representing the response to the underwriting approval request.</p>
469
+
470
+ **Kind**: global typedef
471
+ <a name="EAPayload"></a>
472
+
473
+ ## EAPayload : <code>Object</code>
474
+ <p>Object representing an invoice payload for underwriting approval.</p>
475
+
476
+ **Kind**: global typedef
477
+ <a name="CreditEventPayload"></a>
478
+
479
+ ## CreditEventPayload : <code>Object</code>
480
+ <p>Represents the payload of a credit event.</p>
481
+
482
+ **Kind**: global typedef