Introduction

The Fungible Token Flex tier offers an expanded set of functionalities compared to the Base tier, providing developers with advanced tools and capabilities for tokenization within the Overledger ecosystem. In addition to the core functionalities available in the Base tier, the Flex tier introduces enhanced features such as Mint Tokens, Burn Tokens and more.

Prerequisites


The tokenisation APIs are divided into two categories: the first includes APIs that write transactions to the blockchain network, altering the network's state. The second category comprises read operations that solely retrieve data from the blockchain. In addition to the core functionalities outlined in Base Tier, the Flex tier offers a range of additional features, including:

Write Operations

Write functions (or 'non-view' functions) modify the blockchain state. Since they cause permanent changes in the blockchain, they require a transaction signature for authorisation and cost transaction fees to compensate miners for processing the change. The write operations for the base tier are listed below:

Mint Tokens

The "Mint Tokens" enables you to initiate the creation of new tokens and is performed by an approved user. You can find the burn token endpoint under our API references Mint Tokens

To successfully mint a token, the following steps are necessary:

Prepare

You can utilize the curl command to prepare your mint token transaction.

curl --location 'https://api.sandbox.overledger.io/v2/preparation/supply' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: authorization' \
--data '{
    "location": {
        "technology": "Ethereum",
        "network": "Ethereum Sepolia Testnet"
    },
    "type": "Mint Tokens",
    "urgency": "normal",
    "message": "A message",
    "overledgerSigningType": "overledger-javascript-library",
    "requestDetails": {
        "creator": {
            "accountId": "0x37dC24Fd0b91Bd2B17C5e4b52d90f13DAcc057aA"
        },
        "beneficiary": {
            "accountId": "0x37dC24Fd0b91Bd2B17C5e4b52d90f13DAcc057aA",
            "mint": {
                "amount": 100000,
                "unit": "QNT"
            }
        }
    }
}'

Sign

Once the transaction is prepared with the specified details (like recipient address, amount, etc.), it is possible to use the private key that was obtained earlier (in the prerequisites) to sign it cryptographically. You can follow the article for signing a transaction here.

Execute

After signing your request, you can proceed to execute it, which will write this transaction onto the network. For detailed instructions on executing your signed request, please refer to the execute signed request API reference.

Burn Tokens

The "Burn Tokens" enables you to destroy your tokens and is performed by an approved user. You can find the burn token endpoint under our API references Burn Tokens

You must follow the prepare, sign, and execute steps outlined in the previous section for this task as well.

Add And Remove Secondary Account Owner

The Add Secondary Account Owner adds someone as an operator of your account so that they can make payments on your behalf, and "Remove Secondary Account Owner" removes someone as an operator of your account so that they can no longer make payments on your behalf. Both of these operations can be performed by any user holding the token. You can find the endpoints under our API references Secondary Account Owner

You must follow the prepare, sign, and execute steps outlined in the previous section for this task as well.

Create Credit from Secondary Account Owner

The "Create Credit from a Secondary Account Owner" allows account operators to execute a QRC20 token payment on behalf of the account owner. You can find the endpoints under our API references Pay from a Secondary Account Owner

You must follow the prepare, sign, and execute steps outlined in the previous section for this task as well.


Read operations

Read functions, also referred to as 'view' functions, retrieve data from the blockchain without altering its state. These functions do not require signing, do not incur transaction fees, execute on a single node, and importantly, do not modify the blockchain's state. The read operations for the base tier are listed below:

Retrieve contract owner information

The "Read Contract Owner" enables you to retrieve the current address with contract owner permissions for a particular QRC token. You can find the endpoints under our API references Retrieve contract owner information

Retrieve Secondary Account Owner

The "Retrieve Secondary Account Owner" enables you to determine whether an account is authorized to initiate payments on behalf of another account for a specific QRC20 token. You can find the endpoints under our API references Retrieve Secondary Account Owner