CurrencyVault
Locks currency units in a time-locked vault that releases them at a specified block height.
Request
POST /nxt?requestType=currencyVault
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Account's secret passphrase | Yes |
currency | long | Currency ID | Yes |
unitsQNT | long | Amount of units to lock | Yes |
releaseHeight | int | Block height at which units are released | Yes |
feeRateQNTPerFXT | long | Transaction fee rate | Optional |
deadline | int | Transaction deadline in minutes | Optional |
Constraints
releaseHeightmust 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
| Error | Condition |
|---|---|
NOT_ENOUGH_CURRENCY | Insufficient 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"