Deploy and Test Wrapper APIs for Stablecoin
Deploying the 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 in Blockchain App Builder for Oracle Blockchain Platform. The following table lists the configuration variables and their defaults values for the stablecoin wrapper API package.
| 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 |
Stablecoin |
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 |
Stablecoin |
The display name of the OCI virtual cloud network. |
application_display_name |
Stablecoin |
The display name of the OCI application. |
gateway_display_name |
Stablecoin |
The display name of API Gateway. |
deployment_display_name |
Stablecoin |
The display name of the deployment in API Gateway. |
deployment_path_prefix |
/Stablecoin |
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 |
Stablecoin |
The OCI Registry repository name. The ocir_repo_name variable must be all lowercase letters.
|
policy_name |
Stablecoin |
The name of the policy that enables controlled management and access to APIs through defined permissions for groups and compartments in the organization |
Stablecoin Sample Process Flow
A typical process flow using the stablecoin wrapper APIs follows these basic steps.- The token administrator uses the
initializeStablecoinTokenmethod to initialize a stablecoin with a fixedcurrencyNamevalue (for example,USD) and aconversionRatevalue. - The token administrator uses the
createAccountandassociateTokenToAccountmethods to create token accounts for all users (multi-level approvers, minters, notaries, senders, and receivers). - The token administrator uses the
createStablecoinAccountPolicyCheckmethod to create account policies. Account policies are mandatory for all accounts that transfer or hold stablecoins. Each account policy includes three parameters:KYC,AML, andrestrictionFlag.-
KYC(Know Your Customer) - The transfer is allowed only when KYC values are
truefor both the sender and receiver accounts. -
AML(Anti-Money Laundering) - The transfer is allowed only when AML values are
truefor both the sender and receiver accounts. -
restrictionFlag - If the restriction flag is set to
truefor either the sender or receiver account, the transfer is allowed only in the lowest approval-policy bucket range, making an approval policy mandatory.
-
- The token administrator uses the
createApprovalPolicyCheckto create an approval policy. Approval policies define transaction thresholds, required numbers of approvals, and approver details, and set the sequence for multi-level approvals. An approval policy is mandatory for a hold operation. Without an approval policy, users cannot hold or transfer tokens when restrictions apply. - The token administrator uses the
addRolemethod to assign the minter, burner, and notary roles to the appropriate accounts. - The minter uses the
requestMintmethod to submit a request to mint stablecoins. - The notary uses the
approveMintmethod to approve the minting request. - The sender uses the
holdTokensmethod to initiate a transfer. The system runs an account policy check for the sender and receiver. If KYC or AML compliance is not satisfied for either account, the transfer is not allowed. If the restriction flag is set totruefor either account, only the amount in the lowest approval-policy threshold range can be placed on hold. The transfer amount is then matched against the approval policy thresholds, and the required approvers and their approval sequences are derived from the approval policy. - Multi-level approvers use the
approveTransactionmethod to review and authorize the transfer in the exact sequence defined in the approval policy. If the approval policy specifies zero approvers, the notary can use theexecuteHoldTokensmethod directly to complete the transaction. The system revalidates KYC and AML compliance and the restriction flag during every call toexecuteHoldTokensandapproveTransaction. If any check fails. the transaction is blocked. - After all approvals complete successfully, the assigned notary uses the
executeHoldTokensmethod to complete the transfer to the receiver's account. - The burner uses the
requestBurnmethod to submit a request to burn stablecoins. - The notary uses the
approveBurnmethod to approve the burn request. - Token administrators and auditors use the
getStablecointAccountTransactionHistoryandgetStablecoinAccountTransactionHistoryWithFiltersto track all token events, including minting, holding, multi-level approval flows, transfers, and burning.
Postman Collection
| Variable | Description | Default value |
|---|---|---|
bc-instance-client-id |
The client ID of Oracle Blockchain Platform cloud service. | bc-instance-client-id |
bc-instance-client-secret |
The client secret of Oracle Blockchain Platform cloud service. | bc-instance-client-secret |
int-app-client-id |
The client ID of the Oracle Identity Cloud Service (IDCS) confidential application, which is used to create an IDCS user in the CreateIDCS user API.
|
int-app-client-id |
int-app-client-secret |
The client secret of the IDCS confidential application, which is used to create an IDCS user in the CreateIDCS user API.
|
int-app-client-secret |
For more information, see Wrapper API Package Components in Blockchain App Builder for Oracle Blockchain Platform.