Skip to main content

CurrencyVault

Locks currency units in a time-locked vault that releases them at a specified block height.

Request

POST /nxt?requestType=currencyVault

Parameters

NameTypeDescriptionRequired
secretPhrasestringAccount's secret passphraseYes
currencylongCurrency IDYes
unitsQNTlongAmount of units to lockYes
releaseHeightintBlock height at which units are releasedYes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

Constraints

  • releaseHeight must be between current height + MIN_CURRENCY_VAULT_PERIOD and current height + MAX_CURRENCY_VAULT_PERIOD
  • Locked units cannot be spent until release height
  • The vault can be viewed via GetAccountCurrencyVaults

Response

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

Error Handling

ErrorCondition
NOT_ENOUGH_CURRENCYInsufficient currency balance

Example

# Lock currency for 1000 blocks
curl -X POST http://localhost:22024/nxt \
-d "requestType=currencyVault" \
-d "secretPhrase=your_phrase" \
-d "currency=987654321" \
-d "unitsQNT=5000000000" \
-d "releaseHeight=101000"