Assets
An asset represents an item of value that can be transferred via the Interledger Protocol. Assets in Rafiki are added through the Backend Admin API or the Rafiki Admin application.
Permissions
Operators can create, view, edit, and delete both their own assets and those that belong to any tenant.
Tenants can view, edit, and delete only their own assets. They cannot create assets.
Use the createAsset mutation to register a new asset with your Rafiki instance.
mutation CreateAsset($input: CreateAssetInput!) { createAsset(input: $input) { code success message asset { id code scale tenantId } }}{ "input": { "code": "USD", "scale": 2 }}For more information about this mutation’s input object, see CreateAssetInput.
{ "data": { "createAsset": { "code": "200", "success": true, "message": "Created Asset", "asset": { "id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9", "code": "USD", "scale": 2, "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } } }}Once an asset has been created, you may need to adjust its operational threshold values. You can use the updateAsset mutation to modify the withdrawalThreshold and liquidityThreshold.
These thresholds influence when Rafiki triggers low‑liquidity notifications but do not directly deposit or withdraw asset liquidity.
For information about adding or removing liquidity, see Asset liquidity.
mutation UpdateAsset($input: UpdateAssetInput!) { updateAsset(input: $input) { asset { id code scale withdrawalThreshold liquidityThreshold tenantId } }}The input object for the update operation requires the asset id. Only the threshold fields are editable; all other fields are immutable.
{ "input": { "id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9", "withdrawalThreshold": 100, "liquidityThreshold": 500 }}For more information about this mutation’s input object, see UpdateAssetInput.
{ "data": { "updateAsset": { "asset": { "id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9", "code": "USD", "scale": 2, "withdrawalThreshold": 100, "liquidityThreshold": 500, "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } } }}Deleting an asset removes it from active use within a Rafiki instance.
You can only delete an asset if it’s not associated with any peers or wallet addresses. Rafiki prevents deleting any asset that’s still in use.
mutation DeleteAsset($input: DeleteAssetInput!) { deleteAsset(input: $input) { asset { id code scale tenantId } }}{ "input": { "id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9" }}For more information about this mutation’s input object, see DeleteAssetInput.
{ "data": { "deleteAsset": { "asset": { "id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9", "code": "USD", "scale": 2, "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } } }}