Skip to main content

RescueLoan

Rescues a distressed loan by providing additional currency units. Any party can participate in rescuing a loan.

Request

POST /nxt?requestType=rescueLoan

Parameters

NameTypeDescriptionRequired
secretPhrasestringRescuer's secret passphraseYes
loanlongLoan ID to rescueYes
currencylongCurrency IDYes
unitsQNTlongNumber of units to contributeYes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

Constraints

  • The loan must not already be repaid or rescued
  • The rescuer cannot be the original loan borrower
  • The currency must match the loan's currency
  • The rescue amount must be valid per the loan's interest calculation

Response

{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}

Error Handling

ErrorCondition
LOAN_REPAIDLoan is already repaid or rescued
INCORRECT_LOANLoan is not eligible for rescue
INCORRECT_CURRENCYCurrency does not match loan
INCORRECT_LOAN_AMOUNTInvalid rescue amount
NOT_ENOUGH_CURRENCYInsufficient currency balance

Example

curl -X POST http://localhost:22024/nxt \
-d "requestType=rescueLoan" \
-d "secretPhrase=your_phrase" \
-d "loan=55555" \
-d "currency=987654321" \
-d "unitsQNT=500000000"