@huma-finance/soroban-sdk 0.0.15 → 0.0.16
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.
- package/API.md +7 -14
- package/dist/cjs/helpers/CreditContractHelper.d.ts +6 -18
- package/dist/cjs/helpers/CreditContractHelper.js +107 -92
- package/dist/cjs/helpers/CreditContractHelper.js.map +1 -1
- package/dist/cjs/helpers/Sep41ContractHelper.d.ts +4 -7
- package/dist/cjs/helpers/Sep41ContractHelper.js +41 -31
- package/dist/cjs/helpers/Sep41ContractHelper.js.map +1 -1
- package/dist/cjs/services/HumaContextStellar.js +16 -19
- package/dist/cjs/services/HumaContextStellar.js.map +1 -1
- package/dist/cjs/services/StellarWallet.d.ts +3 -1
- package/dist/cjs/services/StellarWallet.js +7 -3
- package/dist/cjs/services/StellarWallet.js.map +1 -1
- package/dist/cjs/utils/client.d.ts +14 -3
- package/dist/cjs/utils/client.js +59 -4
- package/dist/cjs/utils/client.js.map +1 -1
- package/dist/cjs/utils/common.d.ts +14 -1
- package/dist/cjs/utils/common.js +41 -1
- package/dist/cjs/utils/common.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/network.d.ts +7 -3
- package/dist/cjs/utils/network.js +50 -20
- package/dist/cjs/utils/network.js.map +1 -1
- package/dist/cjs/utils/transaction.d.ts +25 -0
- package/dist/cjs/utils/transaction.js +125 -0
- package/dist/cjs/utils/transaction.js.map +1 -0
- package/dist/helpers/CreditContractHelper.d.ts +6 -18
- package/dist/helpers/CreditContractHelper.js +124 -98
- package/dist/helpers/CreditContractHelper.js.map +1 -1
- package/dist/helpers/Sep41ContractHelper.d.ts +4 -7
- package/dist/helpers/Sep41ContractHelper.js +44 -30
- package/dist/helpers/Sep41ContractHelper.js.map +1 -1
- package/dist/helpers/index.js +5 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/services/HumaContextStellar.js +21 -20
- package/dist/services/HumaContextStellar.js.map +1 -1
- package/dist/services/StellarWallet.d.ts +3 -1
- package/dist/services/StellarWallet.js +14 -6
- package/dist/services/StellarWallet.js.map +1 -1
- package/dist/services/index.js +5 -2
- package/dist/services/index.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/client.d.ts +14 -3
- package/dist/utils/client.js +98 -33
- package/dist/utils/client.js.map +1 -1
- package/dist/utils/common.d.ts +14 -1
- package/dist/utils/common.js +51 -6
- package/dist/utils/common.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +7 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/network.d.ts +7 -3
- package/dist/utils/network.js +64 -31
- package/dist/utils/network.js.map +1 -1
- package/dist/utils/transaction.d.ts +25 -0
- package/dist/utils/transaction.js +125 -0
- package/dist/utils/transaction.js.map +1 -0
- package/package.json +20 -15
package/API.md
CHANGED
|
@@ -12,14 +12,14 @@ getPoolBalance() to get the current available pool balance.</p></dd>
|
|
|
12
12
|
<dt><a href="#getTotalDue">getTotalDue(poolName, network, wallet, borrower)</a> ⇒ <code>bigint</code> | <code>null</code></dt>
|
|
13
13
|
<dd><p>Returns borrower's total due amount in bigint format
|
|
14
14
|
associated with the given pool name on the current chain.</p></dd>
|
|
15
|
-
<dt><a href="#approveAllowanceForSentinel">approveAllowanceForSentinel(poolName, network, wallet)</a
|
|
15
|
+
<dt><a href="#approveAllowanceForSentinel">approveAllowanceForSentinel(poolName, network, wallet)</a></dt>
|
|
16
16
|
<dd><p>Approve allowance for sentinel if not enough allowance is approved.</p></dd>
|
|
17
17
|
<dt><a href="#drawdown">drawdown(poolName, network, wallet, drawdownAmount)</a> ⇒ <code>Promise.<SentTransaction></code></dt>
|
|
18
18
|
<dd><p>Draws down from a pool.</p></dd>
|
|
19
19
|
<dt><a href="#makePayment">makePayment(poolName, network, wallet, paymentAmount, principalOnly)</a> ⇒ <code>Promise.<SentTransaction></code></dt>
|
|
20
20
|
<dd><p>Makes a payment.</p></dd>
|
|
21
|
-
<dt><a href="#
|
|
22
|
-
<dd><p>Approves an Sep41 allowance for a spender address
|
|
21
|
+
<dt><a href="#approveSep41Allowance">approveSep41Allowance(poolName, network, wallet, spenderAddress)</a></dt>
|
|
22
|
+
<dd><p>Approves an Sep41 allowance for a spender address.
|
|
23
23
|
Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p></dd>
|
|
24
24
|
</dl>
|
|
25
25
|
|
|
@@ -84,13 +84,10 @@ associated with the given pool name on the current chain.</p>
|
|
|
84
84
|
|
|
85
85
|
<a name="approveAllowanceForSentinel"></a>
|
|
86
86
|
|
|
87
|
-
## approveAllowanceForSentinel(poolName, network, wallet)
|
|
87
|
+
## approveAllowanceForSentinel(poolName, network, wallet)
|
|
88
88
|
<p>Approve allowance for sentinel if not enough allowance is approved.</p>
|
|
89
89
|
|
|
90
90
|
**Kind**: global function
|
|
91
|
-
**Returns**: <code>Promise.<SentTransaction></code> - <ul>
|
|
92
|
-
<li>A Promise of the SentTransaction.</li>
|
|
93
|
-
</ul>
|
|
94
91
|
|
|
95
92
|
| Param | Type | Description |
|
|
96
93
|
| --- | --- | --- |
|
|
@@ -133,16 +130,13 @@ associated with the given pool name on the current chain.</p>
|
|
|
133
130
|
| paymentAmount | <code>bigint</code> | <p>The amount to payback.</p> |
|
|
134
131
|
| principalOnly | <code>boolean</code> | <p>Whether this payment should ONLY apply to the principal</p> |
|
|
135
132
|
|
|
136
|
-
<a name="
|
|
133
|
+
<a name="approveSep41Allowance"></a>
|
|
137
134
|
|
|
138
|
-
##
|
|
139
|
-
<p>Approves an Sep41 allowance for a spender address
|
|
135
|
+
## approveSep41Allowance(poolName, network, wallet, spenderAddress)
|
|
136
|
+
<p>Approves an Sep41 allowance for a spender address.
|
|
140
137
|
Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)</p>
|
|
141
138
|
|
|
142
139
|
**Kind**: global function
|
|
143
|
-
**Returns**: <code>Promise.<(SentTransaction.<null>\|null)></code> - <ul>
|
|
144
|
-
<li>A Promise of the transaction response, or null if the allowance was already sufficient.</li>
|
|
145
|
-
</ul>
|
|
146
140
|
|
|
147
141
|
| Param | Type | Description |
|
|
148
142
|
| --- | --- | --- |
|
|
@@ -150,5 +144,4 @@ Allowance is required to do certain actions on the Huma protocol (e.g. makePayme
|
|
|
150
144
|
| network | <code>StellarNetwork</code> | <p>The stellar network.</p> |
|
|
151
145
|
| wallet | <code>StellarWallet</code> | <p>The wallet used to send the transaction.</p> |
|
|
152
146
|
| spenderAddress | <code>string</code> | <p>The address of the spender to approve an allowance for.</p> |
|
|
153
|
-
| allowanceAmount | <code>bigint</code> | <p>The amount of tokens to approve, if applicable. Denominated in the Sep41 tokens.</p> |
|
|
154
147
|
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { POOL_NAME, StellarNetwork } from '../utils/network';
|
|
5
|
-
/**
|
|
6
|
-
* Returns an soroban contract client instance for the credit line contract
|
|
7
|
-
* associated with the given pool name on the current chain.
|
|
8
|
-
*
|
|
9
|
-
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
10
|
-
* @param {StellarNetwork} network - The stellar network.
|
|
11
|
-
* @param {StellarWallet} wallet - The stellar wallet.
|
|
12
|
-
* @returns {PoolCreditClient | undefined} A contract client instance for the CreditLine contract or undefined if it could not be found.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getCreditLineClient(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet): PoolCreditClient | undefined;
|
|
1
|
+
import { CreditRecord } from '@huma-finance/soroban-pool-credit';
|
|
2
|
+
import { StellarWallet } from '../services';
|
|
3
|
+
import { POOL_NAME, StellarNetwork } from '../utils';
|
|
15
4
|
/**
|
|
16
5
|
* Returns the current pool balance available for borrowing
|
|
17
6
|
*
|
|
@@ -59,9 +48,8 @@ export declare function getTotalDue(poolName: POOL_NAME, network: StellarNetwork
|
|
|
59
48
|
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
60
49
|
* @param {StellarNetwork} network - The stellar network.
|
|
61
50
|
* @param {StellarWallet} wallet - The stellar wallet.
|
|
62
|
-
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
63
51
|
*/
|
|
64
|
-
export declare function approveAllowanceForSentinel(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet): Promise<
|
|
52
|
+
export declare function approveAllowanceForSentinel(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet): Promise<any>;
|
|
65
53
|
/**
|
|
66
54
|
* Draws down from a pool.
|
|
67
55
|
*
|
|
@@ -73,7 +61,7 @@ export declare function approveAllowanceForSentinel(poolName: POOL_NAME, network
|
|
|
73
61
|
* @param {BigNumberish} drawdownAmount - The amount to drawdown.
|
|
74
62
|
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
75
63
|
*/
|
|
76
|
-
export declare function drawdown(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet, drawdownAmount: bigint): Promise<
|
|
64
|
+
export declare function drawdown(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet, drawdownAmount: bigint): Promise<any>;
|
|
77
65
|
/**
|
|
78
66
|
* Makes a payment.
|
|
79
67
|
*
|
|
@@ -86,4 +74,4 @@ export declare function drawdown(poolName: POOL_NAME, network: StellarNetwork, w
|
|
|
86
74
|
* @param {boolean} principalOnly - Whether this payment should ONLY apply to the principal
|
|
87
75
|
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
88
76
|
*/
|
|
89
|
-
export declare function makePayment(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet, paymentAmount: bigint, principalOnly: boolean): Promise<
|
|
77
|
+
export declare function makePayment(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet, paymentAmount: bigint, principalOnly: boolean): Promise<any>;
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePayment = exports.drawdown = exports.approveAllowanceForSentinel = exports.getTotalDue = exports.getAvailableCreditForPool = exports.getCreditRecordForPool = exports.getAvailableBalanceForPool =
|
|
4
|
-
const
|
|
3
|
+
exports.makePayment = exports.drawdown = exports.approveAllowanceForSentinel = exports.getTotalDue = exports.getAvailableCreditForPool = exports.getCreditRecordForPool = exports.getAvailableBalanceForPool = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
5
|
const Sep41ContractHelper_1 = require("./Sep41ContractHelper");
|
|
6
|
-
/**
|
|
7
|
-
* Returns an soroban contract client instance for the credit line contract
|
|
8
|
-
* associated with the given pool name on the current chain.
|
|
9
|
-
*
|
|
10
|
-
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
11
|
-
* @param {StellarNetwork} network - The stellar network.
|
|
12
|
-
* @param {StellarWallet} wallet - The stellar wallet.
|
|
13
|
-
* @returns {PoolCreditClient | undefined} A contract client instance for the CreditLine contract or undefined if it could not be found.
|
|
14
|
-
*/
|
|
15
|
-
function getCreditLineClient(poolName, network, wallet) {
|
|
16
|
-
return (0, client_1.getPoolCreditClient)(poolName, network, wallet);
|
|
17
|
-
}
|
|
18
|
-
exports.getCreditLineClient = getCreditLineClient;
|
|
19
6
|
/**
|
|
20
7
|
* Returns the current pool balance available for borrowing
|
|
21
8
|
*
|
|
@@ -24,11 +11,11 @@ exports.getCreditLineClient = getCreditLineClient;
|
|
|
24
11
|
* @param {StellarWallet} wallet - The stellar wallet.
|
|
25
12
|
*/
|
|
26
13
|
async function getAvailableBalanceForPool(poolName, network, wallet) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
const poolStorageContext = new utils_1.TransactionContext(poolName, network, wallet, 'poolStorage');
|
|
15
|
+
const { result } = await (0, utils_1.sendTransaction)({
|
|
16
|
+
context: poolStorageContext,
|
|
17
|
+
method: 'get_available_balance',
|
|
18
|
+
});
|
|
32
19
|
return result;
|
|
33
20
|
}
|
|
34
21
|
exports.getAvailableBalanceForPool = getAvailableBalanceForPool;
|
|
@@ -41,18 +28,31 @@ exports.getAvailableBalanceForPool = getAvailableBalanceForPool;
|
|
|
41
28
|
* @param {string} borrower - The address of the borrower to check the credit record for.
|
|
42
29
|
*/
|
|
43
30
|
async function getCreditRecordForPool(poolName, network, wallet, borrower) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
const creditStorageContext = new utils_1.TransactionContext(poolName, network, wallet, 'creditStorage');
|
|
32
|
+
const { result: creditHash } = await (0, utils_1.sendTransaction)({
|
|
33
|
+
context: creditStorageContext,
|
|
34
|
+
method: 'get_credit_hash',
|
|
35
|
+
params: [
|
|
36
|
+
{
|
|
37
|
+
name: 'borrower',
|
|
38
|
+
type: utils_1.ScValType.address,
|
|
39
|
+
value: borrower,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
50
42
|
});
|
|
51
43
|
if (!creditHash) {
|
|
52
44
|
throw new Error('Could not find credit hash');
|
|
53
45
|
}
|
|
54
|
-
const { result: creditRecord } = await
|
|
55
|
-
|
|
46
|
+
const { result: creditRecord } = await (0, utils_1.sendTransaction)({
|
|
47
|
+
context: creditStorageContext,
|
|
48
|
+
method: 'get_credit_record',
|
|
49
|
+
params: [
|
|
50
|
+
{
|
|
51
|
+
name: 'credit_hash',
|
|
52
|
+
type: utils_1.ScValType.buffer,
|
|
53
|
+
value: creditHash,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
56
|
});
|
|
57
57
|
if (!creditRecord) {
|
|
58
58
|
throw new Error('Could not find credit record');
|
|
@@ -71,24 +71,36 @@ exports.getCreditRecordForPool = getCreditRecordForPool;
|
|
|
71
71
|
* @param {string} borrower - The address of the borrower to check the available credit for.
|
|
72
72
|
*/
|
|
73
73
|
async function getAvailableCreditForPool(poolName, network, wallet, borrower) {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
const creditStorageContext = new utils_1.TransactionContext(poolName, network, wallet, 'creditStorage');
|
|
75
|
+
const { result: creditHash } = await (0, utils_1.sendTransaction)({
|
|
76
|
+
context: creditStorageContext,
|
|
77
|
+
method: 'get_credit_hash',
|
|
78
|
+
params: [
|
|
79
|
+
{
|
|
80
|
+
name: 'borrower',
|
|
81
|
+
type: utils_1.ScValType.address,
|
|
82
|
+
value: borrower,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
80
85
|
});
|
|
81
86
|
if (!creditHash) {
|
|
82
87
|
throw new Error('Could not find credit hash');
|
|
83
88
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const creditHashParam = {
|
|
90
|
+
name: 'credit_hash',
|
|
91
|
+
type: utils_1.ScValType.buffer,
|
|
92
|
+
value: creditHash,
|
|
93
|
+
};
|
|
94
|
+
const { result: creditConfig } = await (0, utils_1.sendTransaction)({
|
|
95
|
+
context: creditStorageContext,
|
|
96
|
+
method: 'get_credit_config',
|
|
97
|
+
params: [creditHashParam],
|
|
98
|
+
});
|
|
99
|
+
const { result: creditRecord } = await (0, utils_1.sendTransaction)({
|
|
100
|
+
context: creditStorageContext,
|
|
101
|
+
method: 'get_credit_record',
|
|
102
|
+
params: [creditHashParam],
|
|
103
|
+
});
|
|
92
104
|
if (!creditConfig || !creditRecord) {
|
|
93
105
|
throw new Error('Could not find credit config or credit record');
|
|
94
106
|
}
|
|
@@ -121,22 +133,18 @@ exports.getTotalDue = getTotalDue;
|
|
|
121
133
|
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
122
134
|
* @param {StellarNetwork} network - The stellar network.
|
|
123
135
|
* @param {StellarWallet} wallet - The stellar wallet.
|
|
124
|
-
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
125
136
|
*/
|
|
126
137
|
async function approveAllowanceForSentinel(poolName, network, wallet) {
|
|
127
138
|
const totalDue = await getTotalDue(poolName, network, wallet, wallet.userInfo.publicKey);
|
|
128
139
|
if (totalDue === null) {
|
|
129
140
|
throw new Error('Could not find total due');
|
|
130
141
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
poolStorageClient.get_sentinel(),
|
|
138
|
-
]);
|
|
139
|
-
const tx = await (0, Sep41ContractHelper_1.approveSep41AllowanceIfInsufficient)(network, wallet, underlyingToken, sentinel, totalDue);
|
|
142
|
+
const poolStorageContext = new utils_1.TransactionContext(poolName, network, wallet, 'poolStorage');
|
|
143
|
+
const { result: sentinel } = await (0, utils_1.sendTransaction)({
|
|
144
|
+
context: poolStorageContext,
|
|
145
|
+
method: 'get_sentinel',
|
|
146
|
+
});
|
|
147
|
+
const tx = await (0, Sep41ContractHelper_1.approveSep41Allowance)(poolName, network, wallet, sentinel);
|
|
140
148
|
return tx;
|
|
141
149
|
}
|
|
142
150
|
exports.approveAllowanceForSentinel = approveAllowanceForSentinel;
|
|
@@ -152,18 +160,25 @@ exports.approveAllowanceForSentinel = approveAllowanceForSentinel;
|
|
|
152
160
|
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
153
161
|
*/
|
|
154
162
|
async function drawdown(poolName, network, wallet, drawdownAmount) {
|
|
155
|
-
const poolCreditClient = (0, client_1.getPoolCreditClient)(poolName, network, wallet);
|
|
156
|
-
if (!poolCreditClient) {
|
|
157
|
-
throw new Error('Could not find credit contract for pool');
|
|
158
|
-
}
|
|
159
163
|
await approveAllowanceForSentinel(poolName, network, wallet);
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
const poolCreditContext = new utils_1.TransactionContext(poolName, network, wallet, 'poolCredit');
|
|
165
|
+
const result = await (0, utils_1.sendTransaction)({
|
|
166
|
+
context: poolCreditContext,
|
|
167
|
+
method: 'drawdown',
|
|
168
|
+
params: [
|
|
169
|
+
{
|
|
170
|
+
name: 'borrower',
|
|
171
|
+
type: utils_1.ScValType.address,
|
|
172
|
+
value: wallet.userInfo.publicKey,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'amount',
|
|
176
|
+
type: utils_1.ScValType.u128,
|
|
177
|
+
value: drawdownAmount,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
shouldSignTransaction: true,
|
|
165
181
|
});
|
|
166
|
-
const result = await tx.signAndSend();
|
|
167
182
|
return result;
|
|
168
183
|
}
|
|
169
184
|
exports.drawdown = drawdown;
|
|
@@ -180,39 +195,39 @@ exports.drawdown = drawdown;
|
|
|
180
195
|
* @returns {Promise<SentTransaction>} - A Promise of the SentTransaction.
|
|
181
196
|
*/
|
|
182
197
|
async function makePayment(poolName, network, wallet, paymentAmount, principalOnly) {
|
|
183
|
-
const poolCreditClient = (0, client_1.getPoolCreditClient)(poolName, network, wallet);
|
|
184
|
-
if (!poolCreditClient) {
|
|
185
|
-
throw new Error('Could not find credit contract for pool');
|
|
186
|
-
}
|
|
187
|
-
const poolStorageClient = (0, client_1.getPoolStorageClient)(poolName, network, wallet);
|
|
188
|
-
if (!poolStorageClient) {
|
|
189
|
-
throw new Error('Could not find pool storage contract for pool');
|
|
190
|
-
}
|
|
191
198
|
await approveAllowanceForSentinel(poolName, network, wallet);
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
199
|
+
const poolStorageContext = new utils_1.TransactionContext(poolName, network, wallet, 'poolStorage');
|
|
200
|
+
const { result: sentinel } = await (0, utils_1.sendTransaction)({
|
|
201
|
+
context: poolStorageContext,
|
|
202
|
+
method: 'get_sentinel',
|
|
203
|
+
});
|
|
204
|
+
await (0, Sep41ContractHelper_1.approveSep41Allowance)(poolName, network, wallet, sentinel);
|
|
205
|
+
const poolCreditContext = new utils_1.TransactionContext(poolName, network, wallet, 'poolCredit');
|
|
206
|
+
const params = [
|
|
207
|
+
{
|
|
208
|
+
name: 'borrower',
|
|
209
|
+
type: utils_1.ScValType.address,
|
|
210
|
+
value: wallet.userInfo.publicKey,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'amount',
|
|
214
|
+
type: utils_1.ScValType.u128,
|
|
215
|
+
value: paymentAmount,
|
|
216
|
+
},
|
|
217
|
+
];
|
|
218
|
+
if (!principalOnly) {
|
|
219
|
+
params.unshift({
|
|
220
|
+
name: 'caller',
|
|
221
|
+
type: utils_1.ScValType.address,
|
|
222
|
+
value: wallet.userInfo.publicKey,
|
|
213
223
|
});
|
|
214
224
|
}
|
|
215
|
-
const result = await
|
|
225
|
+
const result = await (0, utils_1.sendTransaction)({
|
|
226
|
+
context: poolCreditContext,
|
|
227
|
+
method: principalOnly ? 'make_principal_payment' : 'make_payment',
|
|
228
|
+
params: params,
|
|
229
|
+
shouldSignTransaction: true,
|
|
230
|
+
});
|
|
216
231
|
return result;
|
|
217
232
|
}
|
|
218
233
|
exports.makePayment = makePayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditContractHelper.js","sourceRoot":"","sources":["../../../src/helpers/CreditContractHelper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CreditContractHelper.js","sourceRoot":"","sources":["../../../src/helpers/CreditContractHelper.ts"],"names":[],"mapp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AiB,GAAG,IAAI,0BAAkB,CAC9C,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,CACb,CAAA;IACD,MAAM,MAAM,GAAG;QACb;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,iBAAS,CAAC,OAAO;YACvB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS;SACjC;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iBAAS,CAAC,IAAI;YACpB,KAAK,EAAE,aAAa;SACrB;KACF,CAAA;IACD,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,CAAC,OAAO,CAAC;YACb,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iBAAS,CAAC,OAAO;YACvB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS;SACjC,CAAC,CAAA;KACH;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAe,EAAC;QACnC,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,cAAc;QACjE,MAAM,EAAE,MAAM;QACd,qBAAqB,EAAE,IAAI;KAC5B,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC;AAtDD,kCAsDC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { SentTransaction } from '@stellar/stellar-sdk/lib/contract';
|
|
2
1
|
import { StellarWallet } from '../services';
|
|
3
|
-
import { StellarNetwork } from '../utils';
|
|
2
|
+
import { POOL_NAME, StellarNetwork } from '../utils';
|
|
4
3
|
/**
|
|
5
|
-
* Approves an Sep41 allowance for a spender address
|
|
4
|
+
* Approves an Sep41 allowance for a spender address.
|
|
6
5
|
* Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)
|
|
7
6
|
*
|
|
8
7
|
* @async
|
|
9
8
|
* @function
|
|
9
|
+
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
10
10
|
* @param {StellarNetwork} network - The stellar network.
|
|
11
11
|
* @param {StellarWallet} wallet - The wallet used to send the transaction.
|
|
12
|
-
* @param {string} tokenAddress - The address of the Sep41 token to approve.
|
|
13
12
|
* @param {string} spenderAddress - The address of the spender to approve an allowance for.
|
|
14
|
-
* @param {bigint} allowanceAmount - The amount of tokens to approve, if applicable. Denominated in the Sep41 tokens.
|
|
15
|
-
* @returns {Promise<SentTransaction<null> | null>} - A Promise of the transaction response, or null if the allowance was already sufficient.
|
|
16
13
|
*/
|
|
17
|
-
export declare function
|
|
14
|
+
export declare function approveSep41Allowance(poolName: POOL_NAME, network: StellarNetwork, wallet: StellarWallet, spenderAddress: string): Promise<any>;
|
|
@@ -1,45 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.approveSep41Allowance = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
/**
|
|
6
|
-
* Approves an Sep41 allowance for a spender address
|
|
6
|
+
* Approves an Sep41 allowance for a spender address.
|
|
7
7
|
* Allowance is required to do certain actions on the Huma protocol (e.g. makePayment for Autopay)
|
|
8
8
|
*
|
|
9
9
|
* @async
|
|
10
10
|
* @function
|
|
11
|
+
* @param {POOL_NAME} poolName - The name of the credit pool to get the contract instance for.
|
|
11
12
|
* @param {StellarNetwork} network - The stellar network.
|
|
12
13
|
* @param {StellarWallet} wallet - The wallet used to send the transaction.
|
|
13
|
-
* @param {string} tokenAddress - The address of the Sep41 token to approve.
|
|
14
14
|
* @param {string} spenderAddress - The address of the spender to approve an allowance for.
|
|
15
|
-
* @param {bigint} allowanceAmount - The amount of tokens to approve, if applicable. Denominated in the Sep41 tokens.
|
|
16
|
-
* @returns {Promise<SentTransaction<null> | null>} - A Promise of the transaction response, or null if the allowance was already sufficient.
|
|
17
15
|
*/
|
|
18
|
-
async function
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
async function approveSep41Allowance(poolName, network, wallet, spenderAddress) {
|
|
17
|
+
const underlyingTokenContext = new utils_1.TransactionContext(poolName, network, wallet, 'underlyingToken');
|
|
18
|
+
const { result: decimals } = await (0, utils_1.sendTransaction)({
|
|
19
|
+
context: underlyingTokenContext,
|
|
20
|
+
method: 'decimals',
|
|
21
|
+
});
|
|
22
|
+
const latestLedger = await (0, utils_1.getLatestLedger)(network);
|
|
23
|
+
// @TODO find a better to advance the ledger number
|
|
24
|
+
const advanceLedgerNum = 3_000_000;
|
|
25
|
+
const result = await (0, utils_1.sendTransaction)({
|
|
26
|
+
context: underlyingTokenContext,
|
|
27
|
+
method: 'approve',
|
|
28
|
+
params: [
|
|
29
|
+
{
|
|
30
|
+
name: 'from',
|
|
31
|
+
type: utils_1.ScValType.address,
|
|
32
|
+
value: wallet.userInfo.publicKey,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'spender',
|
|
36
|
+
type: utils_1.ScValType.address,
|
|
37
|
+
value: spenderAddress,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'amount',
|
|
41
|
+
type: utils_1.ScValType.i128,
|
|
42
|
+
value: 1000_000_000 * Math.pow(10, Number(decimals)),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'expiration_ledger',
|
|
46
|
+
type: utils_1.ScValType.u32,
|
|
47
|
+
value: latestLedger.sequence + advanceLedgerNum,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
shouldSignTransaction: true,
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
43
53
|
}
|
|
44
|
-
exports.
|
|
54
|
+
exports.approveSep41Allowance = approveSep41Allowance;
|
|
45
55
|
//# sourceMappingURL=Sep41ContractHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sep41ContractHelper.js","sourceRoot":"","sources":["../../../src/helpers/Sep41ContractHelper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Sep41ContractHelper.js","sourceRoot":"","sources":["../../../src/helpers/Sep41ContractHelper.ts"],"names":[],"mappings":";;;AACA,oCAOiB;AAEjB;;;;;;;;;;GAUG;AACI,KAAK,UAAU,qBAAqB,CACzC,QAAmB,EACnB,OAAuB,EACvB,MAAqB,EACrB,cAAsB;IAEtB,MAAM,sBAAsB,GAAG,IAAI,0BAAkB,CACnD,QAAQ,EACR,OAAO,EACP,MAAM,EACN,iBAAiB,CAClB,CAAA;IAED,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAuB,MAAM,IAAA,uBAAe,EAAC;QACrE,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,UAAU;KACnB,CAAC,CAAA;IACF,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAA;IACnD,mDAAmD;IACnD,MAAM,gBAAgB,GAAG,SAAS,CAAA;IAElC,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAe,EAAC;QACnC,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,iBAAS,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS;aACjC;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,iBAAS,CAAC,OAAO;gBACvB,KAAK,EAAE,cAAc;aACtB;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,iBAAS,CAAC,IAAI;gBACpB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;aACrD;YACD;gBACE,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,iBAAS,CAAC,GAAG;gBACnB,KAAK,EAAE,YAAY,CAAC,QAAQ,GAAG,gBAAgB;aAChD;SACF;QACD,qBAAqB,EAAE,IAAI;KAC5B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAlDD,sDAkDC"}
|
|
@@ -1,47 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _HumaContextStellar_wallet, _HumaContextStellar_network, _HumaContextStellar_poolName, _HumaContextStellar_poolType;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.HumaContextStellar = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
4
|
class HumaContextStellar {
|
|
5
|
+
#wallet;
|
|
6
|
+
#network;
|
|
7
|
+
#poolName;
|
|
8
|
+
#poolType;
|
|
7
9
|
constructor({ wallet, network, poolName, poolType, }) {
|
|
8
|
-
_HumaContextStellar_wallet.set(this, void 0);
|
|
9
|
-
_HumaContextStellar_network.set(this, void 0);
|
|
10
|
-
_HumaContextStellar_poolName.set(this, void 0);
|
|
11
|
-
_HumaContextStellar_poolType.set(this, void 0);
|
|
12
10
|
if (!wallet || !network || !poolName || !poolType) {
|
|
13
11
|
throw new Error('All parameters are required');
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
this.#wallet = wallet;
|
|
14
|
+
this.#network = network;
|
|
15
|
+
this.#poolName = poolName;
|
|
16
|
+
this.#poolType = poolType;
|
|
19
17
|
}
|
|
20
18
|
get wallet() {
|
|
21
|
-
return
|
|
19
|
+
return this.#wallet;
|
|
22
20
|
}
|
|
23
21
|
set wallet(value) {
|
|
24
|
-
|
|
22
|
+
this.#wallet = value;
|
|
25
23
|
}
|
|
26
24
|
get network() {
|
|
27
|
-
return
|
|
25
|
+
return this.#network;
|
|
28
26
|
}
|
|
29
27
|
set network(value) {
|
|
30
|
-
|
|
28
|
+
this.#network = value;
|
|
31
29
|
}
|
|
32
30
|
get poolName() {
|
|
33
|
-
return
|
|
31
|
+
return this.#poolName;
|
|
34
32
|
}
|
|
35
33
|
set poolName(value) {
|
|
36
|
-
|
|
34
|
+
this.#poolName = value;
|
|
37
35
|
}
|
|
38
36
|
get poolType() {
|
|
39
|
-
return
|
|
37
|
+
return this.#poolType;
|
|
40
38
|
}
|
|
41
39
|
set poolType(value) {
|
|
42
|
-
|
|
40
|
+
this.#poolType = value;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
exports.HumaContextStellar = HumaContextStellar;
|
|
46
|
-
_HumaContextStellar_wallet = new WeakMap(), _HumaContextStellar_network = new WeakMap(), _HumaContextStellar_poolName = new WeakMap(), _HumaContextStellar_poolType = new WeakMap();
|
|
47
44
|
//# sourceMappingURL=HumaContextStellar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HumaContextStellar.js","sourceRoot":"","sources":["../../../src/services/HumaContextStellar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HumaContextStellar.js","sourceRoot":"","sources":["../../../src/services/HumaContextStellar.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAC7B,OAAO,CAAe;IAEtB,QAAQ,CAAgB;IAExB,SAAS,CAAW;IAEpB,SAAS,CAAW;IAEpB,YAAY,EACV,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,GAMT;QACC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;SAC/C;QAED,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,KAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACtB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,IAAI,OAAO,CAAC,KAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;IACvB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,IAAI,QAAQ,CAAC,KAAgB;QAC3B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,IAAI,QAAQ,CAAC,KAAgB;QAC3B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;CACF;AA7DD,gDA6DC"}
|