# Token Issuer

## Tokenise Real World Assets

Use these APIs to tokenise an asset, and view/ manage tokenised assets.

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets" method="put" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

Steps before tokenising an asset:

<details>

<summary>How to Connect Your Wallet</summary>

```tsx
import React, { useState } from "react";
import { ethers } from "ethers";

const MetaMaskConnect = () => {
  const [account, setAccount] = useState(null);
  const [balance, setBalance] = useState(null);
  const [error, setError] = useState(null);

  const connectWallet = async () => {
    if (window.ethereum) {
      try {
        const provider = new ethers.BrowserProvider(window.ethereum);
        const accounts = await provider.send("eth_requestAccounts", []);
        setAccount(accounts[0]);

        const signer = await provider.getSigner();
        const balance = await provider.getBalance(signer.address);
        setBalance(ethers.formatEther(balance));
      } catch (err) {
        setError("Failed to connect to MetaMask");
      }
    } else {
      setError("MetaMask is not installed");
    }
  };

  return (
    <div className="p-4 text-center">
      <h1 className="text-2xl font-bold">MetaMask Wallet Connect</h1>
      <button
        onClick={connectWallet}
        className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
      >
        Connect Wallet
      </button>
      {account && (
        <div className="mt-4">
          <p><strong>Connected Account:</strong> {account}</p>
          <p><strong>Balance:</strong> {balance} ETH</p>
        </div>
      )}
      {error && <p className="text-red-500 mt-4">{error}</p>}
    </div>
  );
};

export default MetaMaskConnect;

```

Similarly other libraries can be used to achieve this functionality

* <https://reown.com/appkit>
* <https://www.rainbowkit.com/>

</details>

<details>

<summary>Publishing Asset</summary>

Payment via wallet directly to spydra

1. Fetch the fee config by calling the api `https://api.openrwa.io/api/v/1/config/store/{storeId}/fee`
2. After fetching the data, check the balance and obtain approval for the appropriate listing fee
3. To check balance, use the following snippet:
   1. `userAddress` is the wallet address of the user making the transaction
   2. `signer` is the JsonRPCSigner object
   3. `provider` is the BrowserProvider object
   4. `listingFee` is the amount for publishing asset from fee config result
   5. `contractAddress` is the currency contract address from fee config result
   6. `contractDecimal` is the currency contract decimal from fee config result

```tsx
const genericErc20Abi = [
  'function balanceOf(address account) public view returns (uint256)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

const nativeTokenBalance = await provider.getBalance(userAddress as string);
const formattedBalanceNative = Number(formatEther(nativeTokenBalance));

if (
  Number.isNaN(formattedBalanceNative)
  || formattedBalanceNative <= 0
) {
  throw new Error('Not enough native tokens to pay the gas fee.')
}

const balance = await contract.balanceOf(userAddress);
const formattedBalance = Number(formatUnits(balance, contractDecimal));

if (
  formattedBalance < listingFee
) {
  throw new Error('Not enough tokens for listing fee.')
}
```

4. To approve, use the following snippet:
   1. `signer` is the JsonRPCSigner object
   2. `listingFee` is the amount for publishing asset from fee config result
   3. `contractAddress` is the currency contract address from fee config result
   4. `contractDecimal` is the currency contract decimal from fee config result
   5. `tRexContractAddress` is the RWA contract address from fee config result

```tsx
const approvalAmount = parseUnits(listingFee.toString(), contractDecimal);

const genericErc20Abi = [
  'function approve(address spender, uint256 amount) public returns (bool)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

await contract.approve(tRexContractAddress, approvalAmount).then(async (tx: any) => tx.wait());
```

5. After successful approval, send these additional parameters to the publish API

```tsx
listingFeePaymentMode: 'wallet' // this value will always be wallet
listingFeePaymentChainId: number // chain id passed to fee config api
listingFeeContractAddress: string // selected currency contract address 
```

Node Modules Required

1. `ethers.js`
2. Any preferred libaray to connect wallet for getting the BrowserProvider and Signer objects

</details>

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets" method="get" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets/{assetId}" method="get" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets/{assetId}/tokens" method="get" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets/{assetId}/token-sales" method="get" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/assets/publish" method="post" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

***

## Token & Token Sale

Issuer API's to create/update a token, and token sale. API's to view and manage token price.

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/tokens" method="put" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

<details>

<summary>Creating a Debt Token</summary>

Debt Tokens require the `debt` object while creating the token which are

* interestPayoutFrequency
  * 1 - Monthly Payouts
  * 2 - Quaterly Payouts
  * 3 - Annual Payouts
  * 5 - Semi-Annual Payouts
* date
  * Required in case of monthly, quaterly, annual and semi-annual payouts
  * Accepted Range: 1-28
* month
  * Required in case of annual payouts
  * Accepted Range: 1-12
    * 1 : Jan
    * 2 : Feb
    * 3 : Mar
    * 4 : Apr
    * 5 : May
    * 6 : June
    * 7 : July
    * 8 : Aug
    * 9 : Sept
    * 10 : Oct
    * 11 : Nov
    * 12 : Dec
* quarter
  * Required in case of quartely payouts
  * Accepted Range: 1-3
    * 1 : Jan-Apr-Jul-Oct
    * 2 : Feb-May-Aug-Nov
    * 3 : Mar-Jun-Sep-Dec
* halfYear
  * Required in case of semi-annauly payouts
  * Accepted Range: 1-6
    * 1 : Jan-Jul
    * 2 : Feb-Aug
    * 3 : Mar-Sept
    * 4 : Apr-Oct
    * 5 : May-Nov
    * 6 : Jun-Dec
* schedules
  * array of schedule objects
    * name
    * principal
      * Principal amount for particular schedule
* numberOfPayouts
* interestRate
* Token Sales can be Running or have End Date

</details>

<details>

<summary>Creating an Equity Token</summary>

Equity Tokens require the `equity` object while creating the token which are

* payoutFrequency
  * 1 - Monthly Payouts
  * 2 - Quaterly Payouts
  * 3 - Annual Payouts
* expectedReturns

</details>

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/tokens/{tokenId}/price" method="post" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/HQ6e0ogbU5QoPucuYr1g" path="/tokens/{tokenId}/price" method="get" %}
[rwa-swagger (Updated-final).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2F4NaWQzBNKZI4unQ1hOfD%2Frwa-swagger%20\(Updated-final\).yaml?alt=media\&token=3b5719a6-050e-4977-b924-84ce07239267)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/token-sales/buy" method="post" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/tokens/{tokenId}/token-sales" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/token-sales" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/token-sales/{tokenSaleId}" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

***

## Token Payout

Token Lifecycle APIs: Initiating/ Managing Payout for Debt and Equity Tokens.

<details>

<summary>How to Set Up an Equity Payout</summary>

1. Fetch the payout metadata by calling the API `https://api.openrwa.io/api/v/1/payouts/{storeId}/token/{tokenId}/metadata`
2. After fetching the data, check the balance and obtain approval fora. `totalAmount` = amountPerToken × totalTokens
3. To check the balance, use the following snippet:
   1. `userAddress` is the wallet address of the user making the transaction
   2. `signer` is the JsonRPCSigner object
   3. `provider` is the BrowserProvider object
   4. `contractAddress` is the currency contract address from metadata result
   5. `contractDecimal` is the currency contract decimal from metadata result

```tsx
const genericErc20Abi = [
  'function balanceOf(address account) public view returns (uint256)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

const nativeTokenBalance = await provider.getBalance(userAddress as string);
const formattedBalanceNative = Number(formatEther(nativeTokenBalance));

if (
  Number.isNaN(formattedBalanceNative)
  || formattedBalanceNative <= 0
) {
  throw new Error('Not enough native tokens to pay the gas fee.')
}

const balance = await contract.balanceOf(userAddress);
const formattedBalance = Number(formatUnits(balance, contractDecimal));

if (
  formattedBalance < totalAmount
) {
  throw new Error('Not enough tokens for payout.')
}
```

4. To approve, use the following snippet:
   1. `signer` is the JsonRPCSigner object
   2. `contractAddress` is the currency contract address from metadata result
   3. `contractDecimal` is the currency contract decimal from metadata result
   4. `tokenContractAddress` is the Token Contract Address from metadata result

```tsx
const approvalAmount = parseUnits(totalAmount.toString(), contractDecimal);

const genericErc20Abi = [
  'function approve(address spender, uint256 amount) public returns (bool)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

await contract.approve(tokenContractAddress, approvalAmount).then(async (tx: any) => tx.wait());
```

</details>

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/payouts/{storeId}/token/{tokenId}" method="post" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

<details>

<summary>How to Set Up an Debt Payout</summary>

1. Fetch the payout metadata by calling the API `https://api.openrwa.io/api/v/1/payouts/{storeId}/token/{tokenId}/metadata?payoutId={payoutId}`
2. After fetching the data, check the balance and obtain approval for `totalAmount`
3. To check balance, use the following snippet:
   1. `userAddress` is the wallet address of the user making the transaction
   2. `signer` is the JsonRPCSigner object
   3. `provider` is the BrowserProvider object
   4. `contractAddress` is the currency contract address from metadata result
   5. `contractDecimal` is the currency contract decimal from metadata result

```tsx
const genericErc20Abi = [
  'function balanceOf(address account) public view returns (uint256)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

const nativeTokenBalance = await provider.getBalance(userAddress as string);
const formattedBalanceNative = Number(formatEther(nativeTokenBalance));

if (
  Number.isNaN(formattedBalanceNative)
  || formattedBalanceNative <= 0
) {
  throw new Error('Not enough native tokens to pay the gas fee.')
}

const balance = await contract.balanceOf(userAddress);
const formattedBalance = Number(formatUnits(balance, contractDecimal));

if (
  formattedBalance < totalAmount
) {
  throw new Error('Not enough tokens for payout.')
}
```

4. To approve, use the following snippet:
   1. `signer` is the JsonRPCSigner object
   2. `contractAddress` is the currency contract address from metadata result
   3. `contractDecimal` is the currency contract decimal from metadata result
   4. `tokenContractAddress` is the Token Contract Address from metadata result

```tsx
const approvalAmount = parseUnits(totalAmount.toString(), contractDecimal);

const genericErc20Abi = [
  'function approve(address spender, uint256 amount) public returns (bool)',
];

const contract = new Contract(
  contractAddress,
  genericErc20Abi,
  signer,
);

await contract.approve(tokenContractAddress, approvalAmount).then(async (tx: any) => tx.wait());
```

</details>

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/payouts/{storeId}/token/{tokenId}/debt" method="post" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/payouts/{storeId}/token/{tokenId}/debt/past" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/payouts/{storeId}/token/{tokenId}/metadata" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/payouts/{storeId}/token/{tokenId}" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

***

## Store User Authentication

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/auth" method="post" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/auth" method="patch" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

***

## Investor Mangement

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/investors" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/investors/token/{tokenId}" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

***

## IPFS

<details>

<summary>When is this required?</summary>

* While Updating the Asset when Asset is live
* While Updating the Token when Asset/Token is live
* While Creatingthe TokenSale when Token is live

Uploading Asset Metadata to IPFS

```tsx
const tokenAbi = [
  'function setTokenURI(string _uri)',
];

const contract = new Contract(
  tokenAddress,
  tokenAbi,
  signer,
);

await contract.setTokenURI(cid).then(async (tx: any) => tx.wait());
```

After Updating the TokenURL, the respective save API's should be called.

eg. After Calling the Upload to IPFS API with new Token Sales Data and updating the Token URI, we need to call the Put TokenSales API to reflect the new token sales.

</details>

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/assets/upload-to-ipfs/{assetId}" method="post" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/assets/upload-to-ipfs/{assetId}" method="patch" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

***

## Configs

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/config/store/{storeId}/fee" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/config/contract-addresses/{tokenId}" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/countries" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}

{% openapi src="/files/rQaVKTwpDYLsx7kPHzWO" path="/chains" method="get" %}
[rwa-swagger (3).yaml](https://640808362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5jDaQI2dLzXe5VgQBNFE%2Fuploads%2FG1TXL2O3E7QJmYmUwyPT%2Frwa-swagger%20\(3\).yaml?alt=media\&token=1cb1493f-596d-43c6-a335-ed9f1990b3ac)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spydra.app/developers/api-reference/token-store-public-chain/token-issuer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
