Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -38,7 +38,7 @@ You can deposit and withdraw asset liquidity through the Rafiki Admin applicatio
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down Expand Up @@ -78,7 +78,7 @@ mutation CreateAssetLiquidityWithdrawal($input: CreateAssetLiquidityWithdrawalIn
````

</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ For more information about how Rafiki handles liquidity, see the [Accounting](/o
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down Expand Up @@ -75,7 +75,7 @@ For more information about how Rafiki handles liquidity, see the [Accounting](/o
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down Expand Up @@ -110,7 +110,7 @@ For more information about how Rafiki handles liquidity, see the [Accounting](/o
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can deposit and withdraw peer liquidity through the Rafiki Admin application
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down Expand Up @@ -77,7 +77,7 @@ For more information about this mutation's input object, see [`DepositPeerLiquid
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If the timeout interval passes before the transaction posts or is voided, the tr
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down Expand Up @@ -76,7 +76,7 @@ If the timeout interval passes before the transaction posts or is voided, the tr
}
```
</TabItem>
<TabItem label="Arguments">
<TabItem label="Variables">
```json
{
"input": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,72 +1,61 @@
---
title: Assets
tableOfContents:
maxHeadingLevel: 4
---

import { Tabs, TabItem } from '@astrojs/starlight/components'
import { Badge } from '@astrojs/starlight/components'
import { Mermaid, CodeBlock, LinkOut } from '@interledger/docs-design-system'

An asset represents an item of value that can be transferred via the Interledger Protocol. Assets in Rafiki can be added through the Backend Admin API or the [Rafiki Admin](/admin/admin-user-guide/#assets) application.

## Add an asset using the `CreateAsset` GraphQL mutation

<CodeBlock title='CreateAsset mutation'>

```graphql
mutation CreateAsset($input: CreateAssetInput!) {
createAsset(input: $input) {
code
success
message
asset {
id
code
scale
## Add an asset

<Tabs>
<TabItem label="Operation">
```graphql
mutation CreateAsset($input: CreateAssetInput!) {
createAsset(input: $input) {
code
success
message
asset {
id
code
scale
}
}
}
}
}
```

</CodeBlock>

### Example

To add US dollars, for example, as an asset type to your Rafiki instance, call the `CreateAsset` mutation and pass the `input` parameters for the asset `code`, represented by its <LinkOut href="https://en.wikipedia.org/wiki/ISO_4217">ISO 4217 currency code</LinkOut> (USD), and `scale` variables as follows:

<CodeBlock title='Example JSON request'>

```json
{
"input": {
"code": "USD",
"scale": 2
}
}
```

</CodeBlock>

| Variable | Description |
| -------- | --------------------------------------------------------------------------------- |
| `code` | The asset code, generally an ISO 4217 currency code where available. |
| `scale` | Difference in order of magnitude between the standard unit and a fractional unit. |

<CodeBlock title='Example JSON response'>

```json
{
"data": {
"createAsset": {
"code": "200",
"success": true,
"message": "Created Asset",
"asset": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9",
```
</TabItem>
<TabItem label="Variables">
```json
{
"input": {
"code": "USD",
"scale": 2
}
}
}
}
```

</CodeBlock>
```
For more information about this mutation's input object, see [`CreateAssetInput`](/apis/graphql/backend/inputobjects/#createassetinput).
</TabItem>
<TabItem label="Response">
```json
{
"data": {
"createAsset": {
"code": "200",
"success": true,
"message": "Created Asset",
"asset": {
"id": "b3dffeda-1e0e-47d4-82a3-69b1a622eeb9",
"code": "USD",
"scale": 2
}
}
}
}
```
</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ query Grants(
```
</TabItem>

<TabItem label='Arguments'>
<TabItem label="Variables">
```json
{
"input": {
Expand All @@ -88,6 +88,7 @@ query Grants(
}
}
```
For more information about this query's variables, see [`grants`](/apis/graphql/auth/queries/#grants).
</TabItem>

<TabItem label='Response'>
Expand Down Expand Up @@ -161,14 +162,15 @@ mutation revokeGrant($input: RevokeGrantInput!) {
```
</TabItem>

<TabItem label='Arguments'>
<TabItem label="Variables">
```json
{
"input": {
"grantId": "2117891e-4b89-42ae-984e-e0762d5888c1"
}
}
```
For more information about this mutation's input object, see [`RevokeGrantInput`](/apis/graphql/auth/inputobjects/#revokegrantinput).
</TabItem>

<TabItem label='Response'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mutation CreateWalletAddressKey($input: CreateWalletAddressKeyInput!) {
```
</TabItem>

<TabItem label='Arguments'>
<TabItem label="Variables">

```json
{
Expand Down Expand Up @@ -127,7 +127,7 @@ mutation RevokeWalletAddressKey($input: RevokeWalletAddressKeyInput!) {

</TabItem>

<TabItem label = 'Arguments'>
<TabItem label = 'Variables'>
```json
{
"input": {
Expand Down
Loading
Loading