Skip to main content

LoanApplication

Submits a loan application backed by totem collateral. The applicant pledges totems as security for the loan.

Request​

POST /nxt?requestType=loanApplication

Parameters​

NameTypeDescriptionRequired
secretPhrasestringApplicant's secret passphraseYes
currencylongCurrency ID for the loanYes
totemlongTotem ID used as collateralYes
quantityQNTlongQuantity of totem units pledgedYes
unitsQNTlongNumber of currency units requestedYes
issuanceHeightintBlock height at which loan is issuedYes
repaymentHeightintBlock height at which loan must be repaidYes
interestRatelongInterest rate percentage (0-100)Yes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

Constraints​

  • unitsQNT cannot exceed current currency supply
  • repaymentHeight must be >= issuanceHeight
  • Totem collateral is locked for the duration of the loan

Response​

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

Error Handling​

ErrorCondition
NOT_ENOUGH_FUNDSInsufficient balance for transaction fee

Example​

curl -X POST http://localhost:22024/nxt \
-d "requestType=loanApplication" \
-d "secretPhrase=your_phrase" \
-d "currency=987654321" \
-d "totem=11111" \
-d "quantityQNT=500000000" \
-d "unitsQNT=1000000000" \
-d "issuanceHeight=1000" \
-d "repaymentHeight=2000" \
-d "interestRate=5"