@huma-finance/soroban-sdk 0.0.32-beta.180 → 0.0.32

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 +72 -72
  2. package/package.json +11 -11
package/API.md CHANGED
@@ -1,15 +1,6 @@
1
1
  ## Functions
2
2
 
3
3
  <dl>
4
- <dt><a href="#getYieldToWithdraw">getYieldToWithdraw(poolName, network, wallet)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
5
- <dd><p>Get yield available to withdraw from the pool for a lender account</p></dd>
6
- <dt><a href="#deposit">deposit(poolName, network, wallet, assets, trancheType)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
7
- <dd><p>Deposit assets into a tranche of the pool</p></dd>
8
- <dt><a href="#withdrawYields">withdrawYields(poolName, network, wallet)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
9
- <dd><p>Withdraw yield from the pool for a lender account</p></dd>
10
- <dt><a href="#approveSep41Allowance">approveSep41Allowance(poolName, network, wallet, spenderAddress)</a></dt>
11
- <dd><p>Approves an Sep41 allowance for a spender address.
12
- Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p></dd>
13
4
  <dt><a href="#getAvailableBalanceForPool">getAvailableBalanceForPool(poolName, network, wallet)</a></dt>
14
5
  <dd><p>Returns the current pool balance available for borrowing</p></dd>
15
6
  <dt><a href="#getCreditRecordForPool">getCreditRecordForPool(poolName, network, wallet, borrower)</a></dt>
@@ -29,17 +20,23 @@ Note: To ensure that allowance is always available for autopay, please call appr
29
20
  <dt><a href="#makePayment">makePayment(poolName, network, wallet, paymentAmount, principalOnly)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
30
21
  <dd><p>Makes a payment.
31
22
  Note: To ensure that allowance is always available for autopay, please call approveAllowanceForSentinel() before calling this function.</p></dd>
23
+ <dt><a href="#approveSep41Allowance">approveSep41Allowance(poolName, network, wallet, spenderAddress)</a></dt>
24
+ <dd><p>Approves an Sep41 allowance for a spender address.
25
+ Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p></dd>
26
+ <dt><a href="#getYieldToWithdraw">getYieldToWithdraw(poolName, network, wallet)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
27
+ <dd><p>Get yield available to withdraw from the pool for a lender account</p></dd>
28
+ <dt><a href="#deposit">deposit(poolName, network, wallet, assets, trancheType)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
29
+ <dd><p>Deposit assets into a tranche of the pool</p></dd>
30
+ <dt><a href="#withdrawYields">withdrawYields(poolName, network, wallet)</a> ⇒ <code>Promise.&lt;SentTransaction&gt;</code></dt>
31
+ <dd><p>Withdraw yield from the pool for a lender account</p></dd>
32
32
  </dl>
33
33
 
34
- <a name="getYieldToWithdraw"></a>
34
+ <a name="getAvailableBalanceForPool"></a>
35
35
 
36
- ## getYieldToWithdraw(poolName, network, wallet) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
37
- <p>Get yield available to withdraw from the pool for a lender account</p>
36
+ ## getAvailableBalanceForPool(poolName, network, wallet)
37
+ <p>Returns the current pool balance available for borrowing</p>
38
38
 
39
39
  **Kind**: global function
40
- **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
41
- <li>A Promise of the SentTransaction.</li>
42
- </ul>
43
40
 
44
41
  | Param | Type | Description |
45
42
  | --- | --- | --- |
@@ -47,59 +44,56 @@ Note: To ensure that allowance is always available for autopay, please call appr
47
44
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
48
45
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
49
46
 
50
- <a name="deposit"></a>
47
+ <a name="getCreditRecordForPool"></a>
51
48
 
52
- ## deposit(poolName, network, wallet, assets, trancheType) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
53
- <p>Deposit assets into a tranche of the pool</p>
49
+ ## getCreditRecordForPool(poolName, network, wallet, borrower)
50
+ <p>Returns the credit record of the borrower</p>
54
51
 
55
52
  **Kind**: global function
56
- **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
57
- <li>A Promise of the SentTransaction containing the shares minted.</li>
58
- </ul>
59
53
 
60
54
  | Param | Type | Description |
61
55
  | --- | --- | --- |
62
- | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to deposit into.</p> |
56
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
63
57
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
64
58
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
65
- | assets | <code>bigint</code> | <p>The amount of underlying assets to deposit.</p> |
66
- | trancheType | <code>&#x27;juniorTranche&#x27;</code> \| <code>&#x27;seniorTranche&#x27;</code> | <p>The tranche to deposit into.</p> |
59
+ | borrower | <code>string</code> | <p>The address of the borrower to check the credit record for.</p> |
67
60
 
68
- <a name="withdrawYields"></a>
61
+ <a name="getAvailableCreditForPool"></a>
69
62
 
70
- ## withdrawYields(poolName, network, wallet) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
71
- <p>Withdraw yield from the pool for a lender account</p>
63
+ ## getAvailableCreditForPool(poolName, network, wallet, borrower)
64
+ <p>Returns the borrower's remaining credit they can use for borrowing. Note that this might not be
65
+ currently available for borrowing as the credit limit might exceed the available pool balance. Use
66
+ getPoolBalance() to get the current available pool balance.</p>
72
67
 
73
68
  **Kind**: global function
74
- **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
75
- <li>A Promise of the SentTransaction.</li>
76
- </ul>
77
69
 
78
70
  | Param | Type | Description |
79
71
  | --- | --- | --- |
80
72
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
81
73
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
82
74
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
75
+ | borrower | <code>string</code> | <p>The address of the borrower to check the available credit for.</p> |
83
76
 
84
- <a name="approveSep41Allowance"></a>
77
+ <a name="getTotalDue"></a>
85
78
 
86
- ## approveSep41Allowance(poolName, network, wallet, spenderAddress)
87
- <p>Approves an Sep41 allowance for a spender address.
88
- Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p>
79
+ ## getTotalDue(poolName, network, wallet, borrower) ⇒ <code>bigint</code> \| <code>null</code>
80
+ <p>Returns borrower's total due amount in bigint format
81
+ associated with the given pool name on the current chain.</p>
89
82
 
90
83
  **Kind**: global function
84
+ **Returns**: <code>bigint</code> \| <code>null</code> - <p>The account's total due amount in bigint format</p>
91
85
 
92
86
  | Param | Type | Description |
93
87
  | --- | --- | --- |
94
88
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
95
89
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
96
- | wallet | <code>StellarWallet</code> | <p>The wallet used to send the transaction.</p> |
97
- | spenderAddress | <code>string</code> | <p>The address of the spender to approve an allowance for.</p> |
90
+ | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
91
+ | borrower | <code>string</code> | <p>The address of the borrower to check the available credit for.</p> |
98
92
 
99
- <a name="getAvailableBalanceForPool"></a>
93
+ <a name="approveAllowanceForSentinel"></a>
100
94
 
101
- ## getAvailableBalanceForPool(poolName, network, wallet)
102
- <p>Returns the current pool balance available for borrowing</p>
95
+ ## approveAllowanceForSentinel(poolName, network, wallet)
96
+ <p>Approve allowance for sentinel if not enough allowance is approved.</p>
103
97
 
104
98
  **Kind**: global function
105
99
 
@@ -109,58 +103,67 @@ Allowance is required to do certain actions on the Huma protocol (e.g. makePayme
109
103
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
110
104
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
111
105
 
112
- <a name="getCreditRecordForPool"></a>
106
+ <a name="drawdown"></a>
113
107
 
114
- ## getCreditRecordForPool(poolName, network, wallet, borrower)
115
- <p>Returns the credit record of the borrower</p>
108
+ ## drawdown(poolName, network, wallet, drawdownAmount) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
109
+ <p>Draws down from a pool.
110
+ Note: To ensure that allowance is always available for autopay, please call approveAllowanceForSentinel() before calling this function.</p>
116
111
 
117
112
  **Kind**: global function
113
+ **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
114
+ <li>A Promise of the SentTransaction.</li>
115
+ </ul>
118
116
 
119
117
  | Param | Type | Description |
120
118
  | --- | --- | --- |
121
119
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
122
120
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
123
121
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
124
- | borrower | <code>string</code> | <p>The address of the borrower to check the credit record for.</p> |
122
+ | drawdownAmount | <code>BigNumberish</code> | <p>The amount to drawdown.</p> |
125
123
 
126
- <a name="getAvailableCreditForPool"></a>
124
+ <a name="makePayment"></a>
127
125
 
128
- ## getAvailableCreditForPool(poolName, network, wallet, borrower)
129
- <p>Returns the borrower's remaining credit they can use for borrowing. Note that this might not be
130
- currently available for borrowing as the credit limit might exceed the available pool balance. Use
131
- getPoolBalance() to get the current available pool balance.</p>
126
+ ## makePayment(poolName, network, wallet, paymentAmount, principalOnly) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
127
+ <p>Makes a payment.
128
+ Note: To ensure that allowance is always available for autopay, please call approveAllowanceForSentinel() before calling this function.</p>
132
129
 
133
130
  **Kind**: global function
131
+ **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
132
+ <li>A Promise of the SentTransaction.</li>
133
+ </ul>
134
134
 
135
135
  | Param | Type | Description |
136
136
  | --- | --- | --- |
137
137
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
138
138
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
139
139
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
140
- | borrower | <code>string</code> | <p>The address of the borrower to check the available credit for.</p> |
140
+ | paymentAmount | <code>bigint</code> | <p>The amount to payback.</p> |
141
+ | principalOnly | <code>boolean</code> | <p>Whether this payment should ONLY apply to the principal</p> |
141
142
 
142
- <a name="getTotalDue"></a>
143
+ <a name="approveSep41Allowance"></a>
143
144
 
144
- ## getTotalDue(poolName, network, wallet, borrower) ⇒ <code>bigint</code> \| <code>null</code>
145
- <p>Returns borrower's total due amount in bigint format
146
- associated with the given pool name on the current chain.</p>
145
+ ## approveSep41Allowance(poolName, network, wallet, spenderAddress)
146
+ <p>Approves an Sep41 allowance for a spender address.
147
+ Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p>
147
148
 
148
149
  **Kind**: global function
149
- **Returns**: <code>bigint</code> \| <code>null</code> - <p>The account's total due amount in bigint format</p>
150
150
 
151
151
  | Param | Type | Description |
152
152
  | --- | --- | --- |
153
153
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
154
154
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
155
- | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
156
- | borrower | <code>string</code> | <p>The address of the borrower to check the available credit for.</p> |
155
+ | wallet | <code>StellarWallet</code> | <p>The wallet used to send the transaction.</p> |
156
+ | spenderAddress | <code>string</code> | <p>The address of the spender to approve an allowance for.</p> |
157
157
 
158
- <a name="approveAllowanceForSentinel"></a>
158
+ <a name="getYieldToWithdraw"></a>
159
159
 
160
- ## approveAllowanceForSentinel(poolName, network, wallet)
161
- <p>Approve allowance for sentinel if not enough allowance is approved.</p>
160
+ ## getYieldToWithdraw(poolName, network, wallet) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
161
+ <p>Get yield available to withdraw from the pool for a lender account</p>
162
162
 
163
163
  **Kind**: global function
164
+ **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
165
+ <li>A Promise of the SentTransaction.</li>
166
+ </ul>
164
167
 
165
168
  | Param | Type | Description |
166
169
  | --- | --- | --- |
@@ -168,29 +171,28 @@ associated with the given pool name on the current chain.</p>
168
171
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
169
172
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
170
173
 
171
- <a name="drawdown"></a>
174
+ <a name="deposit"></a>
172
175
 
173
- ## drawdown(poolName, network, wallet, drawdownAmount) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
174
- <p>Draws down from a pool.
175
- Note: To ensure that allowance is always available for autopay, please call approveAllowanceForSentinel() before calling this function.</p>
176
+ ## deposit(poolName, network, wallet, assets, trancheType) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
177
+ <p>Deposit assets into a tranche of the pool</p>
176
178
 
177
179
  **Kind**: global function
178
180
  **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
179
- <li>A Promise of the SentTransaction.</li>
181
+ <li>A Promise of the SentTransaction containing the shares minted.</li>
180
182
  </ul>
181
183
 
182
184
  | Param | Type | Description |
183
185
  | --- | --- | --- |
184
- | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
186
+ | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to deposit into.</p> |
185
187
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
186
188
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
187
- | drawdownAmount | <code>BigNumberish</code> | <p>The amount to drawdown.</p> |
189
+ | assets | <code>bigint</code> | <p>The amount of underlying assets to deposit.</p> |
190
+ | trancheType | <code>&#x27;juniorTranche&#x27;</code> \| <code>&#x27;seniorTranche&#x27;</code> | <p>The tranche to deposit into.</p> |
188
191
 
189
- <a name="makePayment"></a>
192
+ <a name="withdrawYields"></a>
190
193
 
191
- ## makePayment(poolName, network, wallet, paymentAmount, principalOnly) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
192
- <p>Makes a payment.
193
- Note: To ensure that allowance is always available for autopay, please call approveAllowanceForSentinel() before calling this function.</p>
194
+ ## withdrawYields(poolName, network, wallet) ⇒ <code>Promise.&lt;SentTransaction&gt;</code>
195
+ <p>Withdraw yield from the pool for a lender account</p>
194
196
 
195
197
  **Kind**: global function
196
198
  **Returns**: <code>Promise.&lt;SentTransaction&gt;</code> - <ul>
@@ -202,6 +204,4 @@ Note: To ensure that allowance is always available for autopay, please call appr
202
204
  | poolName | <code>POOL\_NAME</code> | <p>The name of the credit pool to get the contract instance for.</p> |
203
205
  | network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
204
206
  | wallet | <code>StellarWallet</code> | <p>The stellar wallet.</p> |
205
- | paymentAmount | <code>bigint</code> | <p>The amount to payback.</p> |
206
- | principalOnly | <code>boolean</code> | <p>Whether this payment should ONLY apply to the principal</p> |
207
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/soroban-sdk",
3
- "version": "0.0.32-beta.180+c8480a4",
3
+ "version": "0.0.32",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/00labs/huma-soroban-sdk"
@@ -35,15 +35,15 @@
35
35
  "test:badges": "yarn run test:coverage && yarn jest-coverage-badges"
36
36
  },
37
37
  "dependencies": {
38
- "@huma-finance/soroban-credit-manager": "^0.0.32-beta.180+c8480a4",
39
- "@huma-finance/soroban-credit-storage": "^0.0.32-beta.180+c8480a4",
40
- "@huma-finance/soroban-huma-config": "^0.0.32-beta.180+c8480a4",
41
- "@huma-finance/soroban-pool": "^0.0.32-beta.180+c8480a4",
42
- "@huma-finance/soroban-pool-credit": "^0.0.32-beta.180+c8480a4",
43
- "@huma-finance/soroban-pool-manager": "^0.0.32-beta.180+c8480a4",
44
- "@huma-finance/soroban-pool-storage": "^0.0.32-beta.180+c8480a4",
45
- "@huma-finance/soroban-sep41": "^0.0.32-beta.180+c8480a4",
46
- "@huma-finance/soroban-tranche-vault": "^0.0.32-beta.180+c8480a4",
38
+ "@huma-finance/soroban-credit-manager": "^0.0.32",
39
+ "@huma-finance/soroban-credit-storage": "^0.0.32",
40
+ "@huma-finance/soroban-huma-config": "^0.0.32",
41
+ "@huma-finance/soroban-pool": "^0.0.32",
42
+ "@huma-finance/soroban-pool-credit": "^0.0.32",
43
+ "@huma-finance/soroban-pool-manager": "^0.0.32",
44
+ "@huma-finance/soroban-pool-storage": "^0.0.32",
45
+ "@huma-finance/soroban-sep41": "^0.0.32",
46
+ "@huma-finance/soroban-tranche-vault": "^0.0.32",
47
47
  "@stellar/stellar-sdk": "16.0.1",
48
48
  "dotenv": "^16.0.3",
49
49
  "ts-node": "^10.9.1",
@@ -113,5 +113,5 @@
113
113
  "prettier": "^2.7.1",
114
114
  "ts-jest": "^29.1.1"
115
115
  },
116
- "gitHead": "c8480a458eb9531ca9bf98a56cc2dd75cdcf711c"
116
+ "gitHead": "4cd3aa05fd5865daca698d20ad65e2788fd1e010"
117
117
  }