Deploy and Test Wrapper APIs for Generic Token Frameworks
Deploying the Fungible Token Framework Wrapper API Package
For information about using the Postman collections included with each package, see Wrapper API Package Components.
Before you can deploy the wrapper API package, you must update the required configuration variables. Some configuration variables have default values, but you must manually update any variable that contains a placeholder as its default value. Configuration variables are stored in the terraform.tfvars
file in the wrapper API archive. For more information about deploying wrapper APIs and about configuration variables, see Wrapper APIs. The following table lists the configuration variables and their defaults values for the non-fungible token framework wrapper API package. If the default value contains placeholders, it indicates that the user must manually provide the necessary values.
Variable name | Default value | Description |
---|---|---|
compartment_ocid |
<compartment_ocid> |
The OCID of the compartment in Oracle Cloud Infrastructure (OCI). |
compartment_name |
<compartment_name> |
The name of the OCI compartment. |
identity_domain |
<identity_domain> |
The identity domain to use. |
blockchain_channel |
<blockchain_channel> |
The name of the Oracle Blockchain Platform channel where the chaincode is deployed. |
blockchain_url |
<blockchain_url> |
The Oracle Blockchain Platform URL associated with the chaincode deployment. |
blockchain_chaincode |
DepositToken |
The name of the chaincode to generate wrapper APIs for. |
blockchain_sync |
true |
The sync value to include in the payload for API calls. |
blockchain_timeout |
6000 |
The timeout value to include in the payload for API calls. |
vcn_display_name |
DepositToken |
The display name of the OCI virtual cloud network. |
application_display_name |
DepositToken |
The display name of the OCI application. |
gateway_display_name |
DepositToken |
The display name of API Gateway. |
deployment_display_name |
DepositToken |
The display name of the deployment in API Gateway. |
deployment_path_prefix |
/DepositToken |
The deployment path prefix in API Gateway, which specifies the path where routes are deployed. The deployment_path_prefix variable must begin with a slash (/).
|
ocir_repo_name |
deposittoken |
The OCI Registry repository name. The ocir_repo_name variable must be all lowercase letters.
|
policy_name |
DepositToken |
The name of the policy that enables controlled management and access to APIs through defined permissions for groups and compartments within the organization |
Fungible Token Framework Sample Process Flow
A typical process flow using the fungible token framework wrapper APIs follows these basic steps.- Admins use the
initializeDepositToken
API to initialize the deposit token system. - Admins use the
createAccount
andassociateTokenToAccount
APIs to create accounts and associate the token to accounts for all users. - Admins use the
addRole
API to assign the minter role to the creator and the notary role to the approver. - The token creator uses the
requestMint
API to submit a request to mint deposit tokens. - The approver uses the
approveMint
API to review and approve the request to mint deposit tokens. The deposit tokens are credited to the creator's account. - The issuer uses the
getAccountBalance
API to verify that the credited amount is accurate. - The creator uses the
holdTokens
API to request transfer of the tokens to the issuer. - The approver uses the
executeHoldTokens
API to validate and approve the transfer request. The deposit tokens are transferred to the issuer's account. - The issuer uses the
transferTokens
API to a user. The deposit tokens are credit to the first user's account. - The first user uses the
getAccountBalance
API to verify their account balance. - The issuer uses the
transferTokens
API to a user. The deposit tokens are credit to the second user's account. - The second user uses the
getAccountBalance
API to verify their account balance. - The second user uses the
burnTokens
API to redeem their deposit tokens.
Deploying the Non-Fungible Token Wrapper API Package
Before you can deploy the wrapper API package, you must update the required configuration variables. Some configuration variables have default values, but you must manually update any variable that contains a placeholder as its default value. Configuration variables are stored in the terraform.tfvars
file in the wrapper API archive. For more information about deploying wrapper APIs and about configuration variables, see Wrapper APIs. The following table lists the configuration variables and their defaults values for the non-fungible token framework wrapper API package. If the default value contains placeholders, it indicates that the user must manually provide the necessary values.
Variable name | Default value | Description |
---|---|---|
compartment_ocid |
<compartment_ocid> |
The OCID of the compartment in Oracle Cloud Infrastructure (OCI). |
compartment_name |
<compartment_name> |
The name of the OCI compartment. |
identity_domain |
<identity_domain> |
The identity domain to use. |
blockchain_channel |
<blockchain_channel> |
The name of the Oracle Blockchain Platform channel where the chaincode is deployed. |
blockchain_url |
<blockchain_url> |
The Oracle Blockchain Platform URL associated with the chaincode deployment. |
blockchain_chaincode |
NFTCollectiblesWithERC721 |
The name of the chaincode to generate wrapper APIs for. |
blockchain_sync |
true |
The sync value to include in the payload for API calls. |
blockchain_timeout |
6000 |
The timeout value to include in the payload for API calls. |
vcn_display_name |
NFTCollectiblesWithERC721 |
The display name of the OCI virtual cloud network. |
application_display_name |
NFTCollectiblesWithERC721 |
The display name of the OCI application. |
gateway_display_name |
NFTCollectiblesWithERC721 |
The display name of API Gateway. |
deployment_display_name |
NFTCollectiblesWithERC721 |
The display name of the deployment in API Gateway. |
deployment_path_prefix |
/NFTCollectiblesWithERC721 |
The deployment path prefix in API Gateway, which specifies the path where routes are deployed. The deployment_path_prefix variable must begin with a slash (/).
|
ocir_repo_name |
nftcollectibleswitherc721 |
The OCI Registry repository name. The ocir_repo_name variable must be all lowercase letters.
|
policy_name |
NFTCollectiblesWithERC721 |
The name of the policy that enables controlled management and access to APIs through defined permissions for groups and compartments within the organization |
Non-Fungible Token Framework Sample Process Flow
A typical process flow using the non-fungible token framework wrapper APIs follows these basic steps.- Admins use the
createAccount
API to create accounts for all stakeholders, including museums/curators, buyers, and sellers. - Admins use the
addRole
API to assign the minter role to the curator, enabling them to mint NFTs. - Curators use the
createArtCollectionToken
API to mint an art collection NFT. - Curators use the
post
API to set the price for an NFT and post it for sale in the marketplace. - Buyers use the
buy
API to buy the NFT by using direct payment via a payment gateway. The purchased NFT is transferred to the buyer's account and is no longer for sale. - Optionally, buyers can use the
post
API to set a new price for an NFT and post it for resale in the marketplace.
Deploying the Combined Token Wrapper API Package
Before you can deploy the wrapper API package, you must update the required configuration variables. Some configuration variables have default values, but you must manually update any variable that contains a placeholder as its default value. Configuration variables are stored in the terraform.tfvars
file in the wrapper API archive. For more information about deploying wrapper APIs and about configuration variables, see Wrapper APIs. The following table lists the configuration variables and their defaults values for the combined token framework wrapper API package. If the default value contains placeholders, it indicates that the user must manually provide the necessary values.
Variable name | Default value | Description |
---|---|---|
compartment_ocid |
<compartment_ocid> |
The OCID of the compartment in Oracle Cloud Infrastructure (OCI). |
compartment_name |
<compartment_name> |
The name of the OCI compartment. |
identity_domain |
<identity_domain> |
The identity domain to use. |
blockchain_channel |
<blockchain_channel> |
The name of the Oracle Blockchain Platform channel where the chaincode is deployed. |
blockchain_url |
<blockchain_url> |
The Oracle Blockchain Platform URL associated with the chaincode deployment. |
blockchain_chaincode |
WholesaleCBDC |
The name of the chaincode to generate wrapper APIs for. |
blockchain_sync |
true |
The sync value to include in the payload for API calls. |
blockchain_timeout |
6000 |
The timeout value to include in the payload for API calls. |
vcn_display_name |
NFTCollectiblesWithERC1155 |
The display name of the OCI virtual cloud network. |
application_display_name |
NFTCollectiblesWithERC1155 |
The display name of the OCI application. |
gateway_display_name |
NFTCollectiblesWithERC1155 |
The display name of API Gateway. |
deployment_display_name |
NFTCollectiblesWithERC1155 |
The display name of the deployment in API Gateway. |
deployment_path_prefix |
/NFTCollectiblesWithERC1155 |
The deployment path prefix in API Gateway, which specifies the path where routes are deployed. The deployment_path_prefix variable must begin with a slash (/).
|
ocir_repo_name |
nftcollectibleswitherc1155 |
The OCI Registry repository name. The ocir_repo_name variable must be all lowercase letters.
|
policy_name |
NFTCollectiblesWithERC1155 |
The name of the policy that enables controlled management and access to APIs through defined permissions for groups and compartments within the organization |
Combined Token Framework Sample Process Flow
A typical process flow using the combined token framework wrapper APIs follows these basic steps.- Admins use the
createAccount
API to create fungible and non-fungible token accounts for all stakeholders, including museums/curators, buyers, and sellers. - Admins use the
addRole
API to assign the minter role to the curator, enabling them to mint NFTs. - Curators use the
mintBatch
API to mint art collection NFTs. - Curators use the
post
API to set the price for an NFT and post it for sale in the marketplace. - Buyers and sellers use the
createTokenAccount
API to create consumer accounts for fungible and non-fungible tokens on the platform. - Buyers use the
buyWithEthCoin
API to buy the NFT with Ethereum. The purchased NFT is transferred to the buyer's account and is no longer for sale. - Optionally, buyers can use the
post
API to set a new price for an NFT and post it for resale in the marketplace. - Optionally, buyers can use the
burnBatch
API to redeem the NFT or permanently remove it from circulation.