LendCurrency
Lends currency units to a specific loan. The lender must have sufficient currency balance.
Request
POST /nxt?requestType=lendCurrency
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Lender's secret passphrase | Yes |
recipient | string | Recipient account ID (the loan account) | Yes |
loan | long | Loan ID | Yes |
currency | long | Currency ID | Yes |
unitsQNT | long | Number of units to lend | Yes |
feeRateQNTPerFXT | long | Transaction fee rate | Optional |
deadline | int | Transaction deadline in minutes | Optional |
Constraints
- The currency must match the loan's currency
- The recipient must be the loan account
- The loan must not already be funded
- The loan issuance height must be in the past
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}
Error Handling
| Error | Condition |
|---|---|
NOT_ENOUGH_CURRENCY | Insufficient currency balance |
INCORRECT_LOAN | Loan is not eligible for lending |
Example
curl -X POST http://localhost:22024/nxt \
-d "requestType=lendCurrency" \
-d "secretPhrase=your_phrase" \
-d "recipient=1234567890" \
-d "loan=55555" \
-d "currency=987654321" \
-d "unitsQNT=1000000000"