Modify Currency
Modify Currency
Add, remove, or set a user's wallet, bank, or crystals
Fields
| Field | Type | Required | Description |
|---|---|---|---|
target | enum: wallet | bank | crystals | yes | Which balance to modify. |
operation | enum: add | subtract | set | addPercent | subtractPercent | yes | addPercent/subtractPercent compute floor(current * amount / 100). |
amount | number (as string) or {path} | yes | Capped at 1,000,000,000. |
preventNegative | boolean | no | Defaults to true; floors the result at 0. |
targetUserId | string or {path} | no | Cross-user write target; only valid on six of the seven modify_* step types (all except modify_status) plus read_field. |
Example
{
"id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
"type": "modify_currency",
"target": "wallet",
"operation": "add",
"amount": "50",
"preventNegative": true
}Updated about 14 hours ago
Did this page help you?
