Skip to main content

LendCurrency

Lends currency units to a specific loan. The lender must have sufficient currency balance.

Request

POST /nxt?requestType=lendCurrency

Parameters

NameTypeDescriptionRequired
secretPhrasestringLender's secret passphraseYes
recipientstringRecipient account ID (the loan account)Yes
loanlongLoan IDYes
currencylongCurrency IDYes
unitsQNTlongNumber of units to lendYes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

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

ErrorCondition
NOT_ENOUGH_CURRENCYInsufficient currency balance
INCORRECT_LOANLoan 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"