Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ While the Edit Asset page shares fields with the Create Asset page, it also incl

After editing any of the preceding fields in the General Information or Sending Fee sections, select **Save** to commit those changes.

:::note
The asset code and scale cannot be modified after creation. These fields remain read-only when viewing or editing an existing asset.
:::

#### Delete asset

The final section of the Edit Asset page is the irreversible action of deleting an asset. Select **Delete asset** to make this change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ An asset represents an item of value that can be transferred via the Interledger

## Add an asset

Use the `createAsset` mutation to register a new asset with your Rafiki instance.

<Tabs>
<TabItem label="Operation">
```graphql
Expand Down Expand Up @@ -81,3 +83,152 @@ The `asset` object in the response will include the `tenantId` of the tenant to

</TabItem>
</Tabs>

## Update an asset

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](/admin/liquidity/asset-liquidity).

<Tabs>
<TabItem label="Operation">
```graphql
mutation UpdateAsset($input: UpdateAssetInput!) {
updateAsset(input: $input) {
asset {
id
code
scale
withdrawalThreshold
liquidityThreshold
tenantId
}
}
}
```
</TabItem>

<TabItem label="Variables">
The input object for the update operation requires the asset `id`.
Only the threshold fields are editable; all other fields are immutable.

```json
{
"input": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9",
"withdrawalThreshold": 100,
"liquidityThreshold": 500
}
}
```

For more information about this mutation’s input object, see [`UpdateAssetInput`](/apis/graphql/backend/#definition-UpdateAssetInput).

:::note[Tenant ID and HMAC-signed request headers]
<TenantIdHmacNote />
:::

</TabItem>

<TabItem label="Response">
```json
{
"data": {
"updateAsset": {
"asset": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9",
"code": "USD",
"scale": 2,
"withdrawalThreshold": 100,
"liquidityThreshold": 500,
"tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}
}
```

:::note[Tenant ID in the asset response]
The `asset` object in the response will include the `tenantId` of the tenant to which the asset belongs. This `tenantId` is used to identify the tenant when processing requests related to the asset.
:::

</TabItem>
</Tabs>

---

## Delete an asset

Deleting an asset removes it from active use within a Rafiki instance.

This operation succeeds only if the asset is **not** referenced by any peers or wallet addresses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is meant by "referenced". I did a super quick search and I don't see "reference" being used anywhere else (other than in the list a bit below) in this context. If that's the right word to use, then that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This verbiage came from a deeper dive into how deletes actually work, but it doesn't sound very natural. Basically, that delete mutation checks (at the database level) if any peer or wallet address record is using an asset's id as a key.

I have some similar content in the live version of the admin user guide - https://rafiki.dev/admin/admin-user-guide/#delete-asset

"Reference" is used twice here and "associated" is used once. Let me find a smoother way to match similar phrasing - maybe something like "...if the asset is not associated with any peers..."


:::danger
Deleting an asset is permanent and cannot be reversed.

You can only delete an asset if:

- No peers reference the asset
- No wallet addresses are associated with it

If the asset is still in use, the backend prevents deletion and returns an error.
:::

<Tabs>
<TabItem label="Operation">
```graphql
mutation DeleteAsset($input: DeleteAssetInput!) {
deleteAsset(input: $input) {
asset {
id
code
scale
tenantId
}
}
}
```
</TabItem>

<TabItem label="Variables">
```json
{
"input": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9"
}
}
```

For more information about this mutation’s input object, see [`DeleteAssetInput`](/apis/graphql/backend/#definition-DeleteAssetInput).

:::note[Tenant ID and HMAC-signed request headers]
<TenantIdHmacNote />
:::

</TabItem>

<TabItem label="Response">
```json
{
"data": {
"deleteAsset": {
"asset": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9",
"code": "USD",
"scale": 2,
"tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}
}
```

:::note[Tenant ID in the asset response]
The `asset` object in the response will include the `tenantId` of the tenant to which the asset belongs. This `tenantId` is used to identify the tenant when processing requests related to the asset.
:::

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Only operators can create, edit, and delete tenants.

## Create a tenant

Use the `createTenant` mutation to register a new tenant within your Rafiki instance.

This operation is restricted to operators. When a new tenant is created, Rafiki automatically assigns a default ILP address, applies standard configuration settings, and registers the tenant with the `auth` service. Operators can also provide initial custom settings during creation.

After you create a tenant, securely communicate the tenant `id` and `apiSecret` to the tenant out-of-band.

<Tabs>
Expand Down Expand Up @@ -111,6 +115,10 @@ After you create a tenant, securely communicate the tenant `id` and `apiSecret`

## Update a tenant

Use the `updateTenant` mutation to modify an existing tenant’s configuration.

Tenants can update their own profile details such as the public name, contact email, or identity provider URLs. Operators can update any tenant’s information except for the `apiSecret`, which cannot be changed through this mutation.

<Tabs>
<TabItem label="Operation">
```graphql
Expand Down Expand Up @@ -166,6 +174,10 @@ After you create a tenant, securely communicate the tenant `id` and `apiSecret`

## Delete a tenant

Use the `deleteTenant` mutation to remove a tenant from Rafiki. Only operators can perform this action.

Deleting a tenant marks the tenant as deleted and removes all associated tenant settings and authentication entries. After deletion, the tenant can no longer be used to create or manage resources in Rafiki.

<Tabs>
<TabItem label="Operation">
```graphql
Expand Down
Loading