- Oracle Blockchain Platform Digital Assets Edition
- Wholesale Central Bank Digital Currency Application
- Wholesale CBDC Wrapper API Package
Wholesale CBDC Wrapper API Package
Oracle Blockchain Platform Digital Assets Edition includes a wrapper API package that extends the REST API to support operations specific to wholesale CBDC.
The wrapper API package uses the API Gateway service and OCI Functions, which are created using a Resource Manager stack on Oracle Cloud Infrastructure (OCI), to deploy API routes specifically designed for the wholesale CBDC application. The wholesale CBDC wrapper API package is downloadable from the Oracle Blockchain
Platform console, and includes the following components.
WholesaleCBDCWrapperAPI.zip
, an archive file that contains the wrapper API package including the Terraform scripts required for deployment. You deploy this file to a Resource Manager stack on OCI to create the necessary Oracle resources for the Wrapper APIs.WholesaleCBDC_WrapperAPI.postman_collection.json
, a Postman collection that enables you to test the deployed wrapper APIs. The collection includes pre-configured requests with endpoints and payloads that correspond to the APIs defined in the wrapper API package.
Wrapper APIs
-
activateCBDCAccount
- Original method name:
activateAccount
- This POST method activates a token account. This method can be called only by a
Token Admin
orOrg Admin
of the specified organization. Deleted accounts cannot be activated. - Payload:
{ "tokenId": "{{bc-token-id}}", "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Returns:
- On success, a JSON representation of the account status object for the specified token account.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "db0738d4a44f6d9c80b24fce7c518c07023f7be19edaa69b272eaf7886b4b925", "payload": { "assetType": "oaccountStatus", "status_id": "oaccountStatus~d5814d96d8517ac31727d60aace0519c58a425892ab0d378fcfb0a35771f65ae", "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "status": "active" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 194 } }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
-
addCBAdmin
- Original method name:
addTokenAdmin
- This POST method adds a user as a
Token Admin
of the token chaincode. The method can be called only by aToken Admin
of the token chaincode. The first invocation is from the admin who instantiates the chaincode. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed", "payload": { "msg": "User (Org_Id: CB, User_Id: cb) is already Token Admin." }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 193 } }
-
addCBAuditor
- Original method name:
addTokenAuditor
- This POST method adds token auditors to the token chaincode. This method can be called only by the
Token Admin
of the chaincode. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "cd81f6c4c9e7c18ece357dbf5c139ef66ef2d6566be3b14de5f6d0a3fd4bb2f0", "payload": { "msg": "Successfully added Token Auditor (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 196 } }
-
addFIAdmin
- Original method name:
addOrgAdmin
- This method adds organization admins to the token chaincode. This method can be called only by a
Token Admin
orOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "96a84dffcb9156f7271dfb414e8c43b540595044cf9145f5fd56e9873797fc4a", "payload": { "msg": "Successfully added Org Admin (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 197 } }
-
addFIAuditor
- Original method name:
addOrgAuditor
- This method adds organization auditors to the token chaincode. This method can be called only by a
Token Admin
orOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "44bbad35a1478cb714e32f7cfd551897868a203520aab9cea5771d3aadc1cf03", "payload": { "msg": "Successfully added Org Auditor (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 198 } }
-
addRole
- Original method name:
addRole
- This method adds the role to the specified user and token. Account IDs are formed by creating a SHA-256 hash of the concatenated token ID, organization ID, and user ID. This method can be called only by a
Token Admin
orOrg Admin
of the specified organization. - Payload:
{ "tokenId": "{{bc-token-id}}", "role": "role value (for example minter / burner / notary)", "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.role: string
– The name of the role to add to the specified user.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "29ea766dee8e6d273eba3c40a9fea75a1aa85dc3c280d40695f6224c5c52d93c", "payload": { "msg": "Successfully added role 'notary' to Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8 (Org-Id: CB, User-Id: manager_user_cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 201 } }
-
approveCBDCCreation
- Original method name:
approveMint
- Notaries can call this POST method to approve a mint request.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token.operationId: string
– The unique operation ID of the mint request to approve.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "a4537ef34a955b023b7c205b9abf06a6c79e4fdd761fb24f41b8eb34126b66c0", "payload": { "msg": "Successfully minted 10 tokens to Account Id: oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0 (Org-Id: CB, User-Id: creator_user_cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 204 } }
-
approveCBDCRetirement
- Original method name:
approveBurn
- Notaries can call this POST method to approve a burn request.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token.operationId: string
– The unique operation ID of the mint request to approve.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "8252371040e41753fd843bd086692f4e1ee7d89ffa3a50bfa121c5f1565f922f", "payload": { "msg": "Successfully burned 1 tokens from account id: oaccount~0d7b3f73aea28065017ce8b79c0bb19256dc0cb475a0b2a85192bd110f69535c (Org-Id: CB, User-Id: retirer_user_cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 209 } }
-
approveHoldCBDCTokens
- Original method name:
executeHoldTokens
- Notaries call this method to approve a hold on tokens, which triggers the transfer of the tokens from the payer to the payee in this business scenario. The quantity of tokens put on hold previously by the token owner is now transferred to the recipient. If the
quantity
value is less than the actual hold value, the remaining amount is available again to the owner of the token. If theroles
behavior is specified in thebehaviors
section of the token model and thenotary_role_name
value is set, the caller account must have notary role. Otherwise, any caller with an account can function as a notary. - Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "quantity": 1, "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.operationId: string
– The unique operation ID of the mint request to approve.quantity: number
– The number of held tokens to transfer.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "c1149aaa486abc4931d9024c18dfcb230bb321723d1160b0bf981c0011c4856a", "payload": { "msg": "Account Id: oaccount~51e676d7182a02ea7418ef58a6d54ecfe3858ef40b4ffb3d859b320da3921594 (Org-Id: CB, User-Id: issuer_user_cb) is successfully executed '10' tokens from Operation Id '8e3145'." }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 213 } }
-
associateTokenToAccount
- Original method name:
associateTokenToAccount
- This POST method associates a specified account ID to a specified token. This method can be called only by a
Token Admin
orOrg Admin
of the specified organization. - Payload:
{ "accountId": "account_id value", "tokenId": "{{bc-token-id}}", "endorsers": {{endorsers}} }
- Parameters:
accountId: string
– The ID of the account.tokenId: string
– The ID of the token.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "efc7381fb6fc6174a40e83ff5f09d2bbf7f6f490365e3bbf19d5502c2cfec474", "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~1c6aa60e220b8fc70caf4cea1ed723ddb193a00321e5e0004def062816b77090", "user_id": "cb12", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 100, "daily_transactions": 0, "current_date": "2024-12-11T00:00:00.000Z" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 216 } }
-
createAccount
- Original method name:
createAccount
- This method creates an account for a specified user and token. An account must be created for any user who will have tokens at any point. Accounts track balances, on-hold balances, and transaction history. An account ID is an alphanumeric set of characters, prefixed with
oaccount~<token asset name>~
and followed by a hash of the user name or email ID (userId
) of the instance owner or the user who is logged in to the instance, the membership service provider ID (orgId
) of the user in the current network organization. This method can be called only by aToken Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "tokenType": "fungible", "applicationGroups": "[\"application_groups value\"]", "dailyLimits": "{\"max_daily_amount\":10000,\"max_daily_transactions\":100}", "endorsers": {{endorsers}} }
- Parameters:
orgId
– The membership service provider (MSP) ID of the user to create the account for. The ID must begin with an alphanumeric character and can include letters, numbers, and special characters such as underscores (_), periods (.), at signs (@), and hyphens (-).userId
– The user name or email ID of the user. The ID must begin with an alphanumeric character and can include letters, numbers, and special characters such as underscores (_), periods (.), at signs (@), and hyphens (-).tokenType: TokenType
– The type of token, which must befungible
.applicationGroups: string[]
– A list of application groups the user Id belongs to, which define the user's associations in the CBDC application.dailyLimits: JSON object
– A JSON object of the following type.
In the example, the{ "max_daily_amount": 100000 "max_daily_transactions": 10000 }
max_daily_amount
value is the maximum amount of tokens that can be transacted daily andmax_daily_transactions
value is the maximum number of transactions that can be completed daily.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "453821c7ffd477987ef8ccbd836b893969531ab768098cd4a99e3b89cd38a391", "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~28ac774001f374064029d51af4fb67e26ea1ea9ef62828b7a72dbf3beb8efd8d", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "", "token_name": "", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 100, "daily_transactions": 0, "current_date": "2024-12-09T00:00:00.000Z" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 188 } }
-
getAllActiveCBDCAccounts
- Original method name:
getAllActiveAccounts
- This GET method returns all of the active accounts that are associated with the specified token ID.
- Query:
/getAllActiveCBDCAccounts?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Returns:
- On success, a message that includes user details. The output varies based on the user's role, as shown in the following examples.
- Return Value Example (Token Admin, Token Auditor):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "non_account_role_name": [ "token_admin" ], "role_name": null, "valueJson": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" } } ], "encode": "JSON" } }
- Return Value Example (Organization Admin, Organization Auditor):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "non_account_role_name": [ "token_admin" ], "role_name": null, "valueJson": { "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "org_id": "CB", "user_id": "admin_user_cb", "token_id": "USD", "max_daily_amount": 10000, "max_daily_transactions": 1000 } } ], "encode": "JSON" } }
- Return Value Example (all other users):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "non_account_role_name": [ "token_admin" ], "role_name": null, "valueJson": { "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "org_id": "CB", "user_id": "admin_user_cb", "token_id": "USD", "max_daily_amount": 10000, "max_daily_transactions": 1000 } } ], "encode": "JSON" } }
-
getAllSuspendedCBDCAccounts
- Original method name:
getAllSuspendedAccounts
- This GET method returns all of the suspended accounts that are associated with the specified token ID.
- Query:
/getAllSuspendedCBDCAccounts?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Returns:
- On success, a message that includes user details. The output varies based on the user's role, as shown in the following examples.
- Return Value Example (Token Admin, Token Auditor):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "non_account_role_name": null, "role_name": null, "valueJson": { "assetType": "oaccount", "bapAccountVersion": 1, "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "user_id": "user1_fi1", "org_id": "FI1", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 5, "onhold_balance": 0, "application_groups": [ "FI_CBDC_USERS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" } } ], "encode": "JSON" } }
- Return Value Example (Organization Admin, Organization Auditor):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "non_account_role_name": null, "role_name": null, "valueJson": { "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "org_id": "FI1", "user_id": "user1_fi1", "token_id": "USD", "max_daily_amount": 10000, "max_daily_transactions": 1000 } } ], "encode": "JSON" } }
- Return Value Example (all other users):
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "key": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "non_account_role_name": null, "role_name": null, "valueJson": { "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "org_id": "FI1", "user_id": "user1_fi1", "token_id": "USD" } } ], "encode": "JSON" } }
-
getApproverActionHistory
- Original method name:
getActionHistory
- This GET method retrieves the history of approvals or rejections made by the caller for mint, burn, and transfer (issuance) operations, including details of the organization, and user IDs of accounts involved (sender, recipient, and notary). This method can be called only by a
Token Admin
,Token Auditor
,Org Admin
,Org Auditor
or the notary. - Query:
/getApproverActionHistory?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "from_account_id": "oaccount~0d7b3f73aea28065017ce8b79c0bb19256dc0cb475a0b2a85192bd110f69535c", "from_org_id": "CB", "from_user_id": "retirer_user_cb", "holding_id": "ohold~cbdc~USD~eaf6", "holding_status": "REJECT_BURN", "last_updated_time": "2024-11-26T21:43:22.000Z", "notary_account_id": null, "notary_org_id": null, "notary_user_id": null, "operation_id": null, "quantity": 3, "timetoexpiration": null, "to_account_id": "", "to_org_id": null, "to_user_id": null, "token_id": "USD", "token_name": null }, { "from_account_id": "oaccount~0d7b3f73aea28065017ce8b79c0bb19256dc0cb475a0b2a85192bd110f69535c", "from_org_id": "CB", "from_user_id": "retirer_user_cb", "holding_id": "ohold~cbdc~USD~0031", "holding_status": "REJECT_BURN", "last_updated_time": "2024-11-26T21:43:15.000Z", "notary_account_id": null, "notary_org_id": null, "notary_user_id": null, "operation_id": null, "quantity": 2, "timetoexpiration": null, "to_account_id": "", "to_org_id": null, "to_user_id": null, "token_id": "USD", "token_name": null } ], "encode": "JSON" } }
-
getCBDCAccount
- Original method name:
getAccount
- This GET method returns account details for a specified user and token. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. - Query:
/getCBDCAccount?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "status": "active", "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" }, "encode": "JSON" } }
-
getCBDCAccountBalance
- Original method name:
getAccountBalance
- This GET method returns the current balance for a specified account and token. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. /getCBDCAccountBalance?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "msg": "Current Balance is: 100", "user_balance": 100 }, "encode": "JSON" } }
-
getCBDCAccountsByUser
- Original method name:
getAccountsByUser
- This method returns a list of all account IDs for a specified organization ID and user ID. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. /getCBDCAccountsByUser?orgId={{bc-org-id}}&userId={{bc-user-id}}
- Parameters:
orgId string
– The membership service provider (MSP) ID of the user in the current organization.userId string
– The user name or email ID of the user.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~8db15b42910eeec401e1bf22c69dfdd11c820ecc26539ea03a3426fa25cb8c28", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "", "token_name": "", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" }, { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" }, { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~28ac774001f374064029d51af4fb67e26ea1ea9ef62828b7a72dbf3beb8efd8d", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "", "token_name": "", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 100, "daily_transactions": 0, "current_date": "2024-12-09T00:00:00.000Z" } ], "encode": "JSON" } }
-
getCBDCAccountTransactionHistory
- Original method name:
getAccountTransactionHistory
- This method returns an array of account transaction history details for a specified user and token. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. /getCBDCAccountTransactionHistory?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "transaction_id": "otransaction~64c5a4830949eae1424600f3d4a438c6f603a7c3ea31a68e374b899803999e22", "transacted_amount": 10, "timestamp": "2024-12-11T13:37:28.000Z", "balance": 550, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REJECT_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~a4537ef34a955b023b7c205b9abf06a6c79e4fdd761fb24f41b8eb34126b66c0", "transacted_amount": 10, "timestamp": "2024-12-11T13:36:32.000Z", "balance": 550, "onhold_balance": 10, "token_id": "USD", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "APPROVE_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~6237a759422bd9fb112742e8cd7e6450df5a74a32236d9b1005571afed8904a4", "transacted_amount": 10, "timestamp": "2024-12-11T13:36:18.000Z", "balance": 540, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REQUEST_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~06b35071415d74aa1a7c18449149c937d886cae76a832c44cf8d98e84586e76e", "transacted_amount": 10, "timestamp": "2024-12-11T13:35:46.000Z", "balance": 540, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REQUEST_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" } ], "encode": "JSON" } }
-
getAccountTransactionHistoryWithFilters
- Original method name:
getAccountTransactionHistoryWithFiltersFromRichHistDB
- This method returns the account transaction history details from the rich history database. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. /getCBDCAccountTransactionHistoryWithFilters?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}&customEndpoint=custom_endpoint value&bearerToken=bearer_token value&filters={"pageSize":20,"bookmark":"","startTime":"2022-01-16T15:16:36+00:00","endTime":"2022-01-17T15:16:36+00:00"}
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.customEndpoint
– The RESTful service endpoint of the rich history database to fetch the transaction history from.bearerToken
– The token to use to call the RESTful endpoint to ensure that the request is authorized.filters: JSON object
– An optional parameter. If empty, all records are returned. ThepageSize
property determines the number of records to return. IfpageSize
is 0, the default page size is 20. Thebookmark
property determines the starting index of the records to return. ThestartTime
andendTime
properties must be specified in RFC-3339 format.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "transaction_id": "otransaction~64c5a4830949eae1424600f3d4a438c6f603a7c3ea31a68e374b899803999e22", "transacted_amount": 10, "timestamp": "2024-12-11T13:37:28.000Z", "balance": 550, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REJECT_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~a4537ef34a955b023b7c205b9abf06a6c79e4fdd761fb24f41b8eb34126b66c0", "transacted_amount": 10, "timestamp": "2024-12-11T13:36:32.000Z", "balance": 550, "onhold_balance": 10, "token_id": "USD", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "APPROVE_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~6237a759422bd9fb112742e8cd7e6450df5a74a32236d9b1005571afed8904a4", "transacted_amount": 10, "timestamp": "2024-12-11T13:36:18.000Z", "balance": 540, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REQUEST_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" }, { "transaction_id": "otransaction~06b35071415d74aa1a7c18449149c937d886cae76a832c44cf8d98e84586e76e", "transacted_amount": 10, "timestamp": "2024-12-11T13:35:46.000Z", "balance": 540, "onhold_balance": 10, "token_id": "USD", "category": "category value", "description": "description value", "transacted_account": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "transaction_type": "REQUEST_MINT", "transacted_org_id": "CB", "transacted_user_id'": "creator_user_cb" } ], "encode": "JSON" } }
-
getCBDCRetiredQuantity
- Original method name:
getBurnQuantity
- This GET method returns the total quantity of burned tokens for a specified organization. This method can be called only by a
Token Admin
,Token Auditor
, or a user with the burner role. /getCBDCRetiredQuantity?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "burnt_quantity": 31 }, "encode": "JSON" } }
-
getNetCBDCTokens
- Original method name:
getNetTokens
- This GET method returns the total net number of tokens available in the system for a specified token. The net token total is the amount of tokens remaining after tokens are burned. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, or anOrg Admin
orOrg Auditor
. /getNetCBDCTokens?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "msg": "Net supply of token for Token Id: USD is 878 tokens.", "quantity": 878 }, "encode": "JSON" } }
-
getOnHoldIds
- Original method name:
getOnHoldIds
- This GET method returns a list of all of the holding IDs for a specified account. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
of the specified organization, or theAccountOwner
of the account. /getOnHoldIds?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "msg": "Holding Ids are: ohold~cbdc~USD~8e3147,ohold~cbdc~USD~8e315", "holding_ids": [ "ohold~cbdc~USD~8e3147", "ohold~cbdc~USD~8e315" ] }, "encode": "JSON" } }
-
getPendingCBDCIssuance
- Original method name:
getPendingIssuance
- This method retrieves all pending issuance (transfer) transactions where the caller is assigned as an approver, including details of the organization, and user IDs of accounts involved (sender, recipient, and notary). This method can be called only by a
Token Admin
orToken Auditor
of the chaincode, anOrg Admin
orOrg Auditor
, or theNotary
. /getPendingCBDCIssuance?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "asset_type": "ONHOLD", "category": "category value", "from_account_id": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "from_org_id": "CB", "from_user_id": "creator_user_cb", "holding_id": "ohold~cbdc~USD~8e314", "notary_account_id": "oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8", "notary_org_id": "CB", "notary_user_id": "manager_user_cb", "operation_id": "8e314", "quantity": 10, "timetoexpiration": "0", "to_account_id": "oaccount~44b844deccc6c314e14b8b9b95b51db5c8de499dbdbd3def2a44ba54c899c142", "to_org_id": "FI1", "to_user_id": "officer_user1_fi1", "token_id": "USD", "token_name": "cbdc" }, { "asset_type": "ONHOLD", "category": "category value", "from_account_id": "oaccount~51e676d7182a02ea7418ef58a6d54ecfe3858ef40b4ffb3d859b320da3921594", "from_org_id": "CB", "from_user_id": "issuer_user_cb", "holding_id": "ohold~cbdc~USD~8e315", "notary_account_id": "oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8", "notary_org_id": "CB", "notary_user_id": "manager_user_cb", "operation_id": "8e315", "quantity": 10, "timetoexpiration": "0", "to_account_id": "oaccount~44b844deccc6c314e14b8b9b95b51db5c8de499dbdbd3def2a44ba54c899c142", "to_org_id": "FI1", "to_user_id": "officer_user1_fi1", "token_id": "USD", "token_name": "cbdc" } ], "encode": "JSON" } }
-
getPendingCBDCRequest
- Original method name:
getPendingRequest
- This method retrieves all pending requests of a specified type where the caller is assigned as an approver. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode or theNotary
. /getPendingCBDCRequest?tokenId={{bc-token-id}}&requestType=request_type value
- Parameters:
tokenId: string
– The ID of the token.requestType: string
– The transaction type. For example,mint
orburn
.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "valueJson": { "assetType": "ohold", "holding_id": "ohold~cbdc~USD~op123", "operation_id": "op123", "token_id": "USD", "token_name": "cbdc", "operation_type": "mint", "status": "pending", "from_account_id": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "to_account_id": "", "notary_account_id": "oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8", "quantity": 10, "time_to_expiration": "0", "category": "category value", "description": "description value" } } ], "encode": "JSON" } }
-
getTotalBalanceByCallerOrgId
- Original method name:
getTotalBalanceByCallerOrgId
- This method retrieves the total balance of the caller's organization. This method can be called only by a
Token Admin
,Token Auditor
,Org Admin
,Org Auditor
, or any account owner. /getTotalCBDCBalanceByCallerOrgId
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "totalBalance": 704 } ], "encode": "JSON" } }
-
getTotalCreatedCBDCTokens
- Original method name:
getTotalMintedTokens
- This method returns the total number of minted tokens for a specified token. This method can be called only by a
Token Admin
,Token Auditor
,Org Admin
, orOrg Auditor
. - Query:
/getTotalCreatedCBDCTokens?tokenId={{bc-token-id}}
- Parameters:
tokenId: string
– The ID of the token.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "msg": "Total minted token for Token Id: USD is 910 tokens.", "quantity": 910 }, "encode": "JSON" } }
-
getTransactionWithBlockNumber
- Original method name:
getTransactionWithBlockNumber
- This GET method returns the details of the transaction for the specified transaction ID.
- Query:
/getTransactionWithBlockNumber?tokenId={{bc-token-id}}&transactionId=transaction_id value
- Parameters:
tokenId: string
– The ID of the token.transactionId: string
– The ID of the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": [ { "blockNo": 82, "key": "otransaction~24f391919a8837d654beaa7346148ea8b2b9704624aef482ce68078c485f5b1b", "metadata": null, "txnNo": 0, "value": null, "valueJson": { "assetType": "otransaction", "transaction_id": "otransaction~24f391919a8837d654beaa7346148ea8b2b9704624aef482ce68078c485f5b1b", "token_id": "USD", "from_account_id": "", "from_account_balance": 0, "from_account_onhold_balance": 0, "to_account_id": "oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0", "to_account_balance": 100, "to_account_onhold_balance": 0, "transaction_type": "REQUEST_MINT", "amount": 200, "timestamp": "2024-11-20T06:48:42.000Z", "number_of_sub_transactions": 0, "holding_id": "", "sub_transaction": "false", "description": "" } } ], "encode": "JSON" } }
-
getUserByCBDCAccountId
- Original method name:
getUserByAccountId
- This method returns user details (
orgId
,userId
, andtokenId
) for a specified account. This method can be called only by aToken Admin
orToken Auditor
of the chaincode, or anOrg Admin
orOrg Auditor
of the specified organization. - Query:
/getUserByCBDCAccountId?accountId=account_id value
- Parameters:
accountId: string
– The ID of the account.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "token_id": "USD", "user_id": "admin_user_cb", "org_id": "CB" }, "encode": "JSON" } }
-
getUsersByRole
- Original method name:
getUsersByRole
- This GET method returns a list of all users for a specified role and token. This method can be called only by a
Token Admin
orToken Auditor
of the chaincode. - Query:
/getUsersByRole?tokenId={{bc-token-id}}&role=role value (for example minter / burner / notary)
- Parameters:
tokenId: string
– The ID of the token.role: string
– The name of the role to search for.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "payload": { "users": [ { "token_id": "USD", "user_id": "creator_user_cb", "org_id": "CB" }, { "token_id": "USD", "user_id": "cb4", "org_id": "CB" } ] }, "encode": "JSON" } }
-
holdCBDCTokens
- Original method name:
holdTokens
- This method creates a hold on behalf of the owner of the tokens with the
to_account_id
account. A notary account is specified, which is responsible to either complete or release the hold. When the hold is created, the specified token balance from the payer is put on hold. A held balance cannot be transferred until the hold is either completed or released. The caller of this method must have an account already created. - Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "toOrgId": "to_org_id value", "toUserId": "to_user_id value", "notaryOrgId": "notary_org_id value", "notaryUserId": "notary_user_id value", "quantity": 1, "timeToExpiration": "time_to_expiration value", "infoDetails": "{\"category\":\"category value\",\"description\":\"description value\"}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.operationId: string
– A unique ID to identify the hold operation. Typically this ID is passed by the client application.toOrgId: string
– The membership service provider (MSP) ID of the receiver in the current organization.toUserId: string
– The user name or email ID of the receiver.notaryOrgId: string
– The membership service provider (MSP) ID of the notary in the current organization.notaryUserId: string
– The user name or email ID of the notary.quantity: number
– The number of tokens to put on hold.timeToExpiration
– The time when the hold expires. Specify 0 for a permanent hold. Otherwise use the RFC-3339 format. For example, 2021-06-02T12:46:06Z.infoDetails: JSON
– The description and category as shown in the following example.{ "category" : "category input", "description" : "description input" }
endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "e575d339299bb98afe83207e749cd07654f209673c84c6973738b6094da33062", "payload": { "msg": "AccountId oaccount~51e676d7182a02ea7418ef58a6d54ecfe3858ef40b4ffb3d859b320da3921594 (Org-Id: CB , User-Id: issuer_user_cb) is successfully holding 10 tokens" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 211 } }
-
init
- Original method name:
init
- This method is called when the chaincode is deployed. The user information is saved as the
Token Admin
of the chaincode. - Payload:
{ "adminList": "[{\"org_id\":\"{{bc-org-id}}\",\"user_id\":\"{{bc-admin-user}}\"}]" }
- Parameters:
adminList array
– An array of{user_id, org_id}
information that specifies the list of token admins. TheadminList
array is a mandatory parameter.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "fdb7dc89832c8045a333823b77fa24ae628178148dc93b3550040e070d7cd807", "payload": "", "encode": "UTF-8", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 263 } }
-
initializeCBDCToken
- Original method name:
initializeCBDCToken
- This method creates a token and initializes the token properties. The asset and its properties are saved in the state database. This method can be invoked only by a
Token Admin
of the chaincode. - Payload:
{ "tokenAsset": "{\"token_id\":\"{{bc-token-id}}\",\"token_desc\":\"token_desc value\",\"Currency_Name\":\"Currency_Name value\"}", "sameOrgEndorser": true }
- Parameters:
tokenAsset: <Token Class>
– The token asset is passed as the parameter to this method. The properties of the token asset are described in the model file.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Returns:
- On success, a JSON representation of the token asset that was created.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "aa7a4f4cc214e1a041a5a6fb7ca7530f08256559e538c9f9582e6fd12c9e65c8", "payload": { "assetType": "otoken", "events": false, "token_id": "t1", "token_name": "cbdc", "token_desc": "token_desc value", "token_standard": "ttf+", "token_type": "fungible", "token_unit": "fractional", "behaviors": [ "divisible", "mintable", "transferable", "burnable", "holdable", "roles" ], "roles": { "minter_role_name": "minter", "burner_role_name": "burner", "notary_role_name": "notary", "mint_approver_role_name": "notary", "burn_approver_role_name": "notary" }, "mintable": { "max_mint_quantity": 1000, "mint_approval_required": true }, "burnable": { "burn_approval_required": true }, "divisible": { "decimal": 2 }, "currency_name": "currency_name value", "token_to_currency_ratio": 999 }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 267 } }
-
rejectCBDCCreation
- Original method name:
rejectMint
- This method can be called by a minter notary to reject a minting request.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token to reject minting.operationId: string
– The unique operation ID that represents the mint request.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "64c5a4830949eae1424600f3d4a438c6f603a7c3ea31a68e374b899803999e22", "payload": { "msg": "Successfully rejected mint request with Operation Id 'op1234' to mint 10 tokens of token id USD" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 205 } }
-
rejectCBDCRetirement
- Original method name:
rejectBurn
- This method can be called by a notary to reject a burning request.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token to reject for burning.operationId: string
– The unique operation ID that represents the burn request.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "474a08183986c84fe321aa925670539db3b1bc90b02fa65956ad8c771fff5bbe", "payload": { "msg": "Successfully rejected burn request with Operation Id 'burn1234' to burn 10 tokens of token id USD" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 210 } }
-
rejectHoldCBDCTokens
- Original method name:
releaseHoldTokens
- This POST method releases a hold on tokens. The transfer is not completed and all held tokens are available again to the original owner. This method can be called by the
AccountOwner
ID with thenotary
role within the specified time limit or by the payer, payee, or notary after the specified time limit. - Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.operationId: string
– A unique ID to identify the hold operation. Typically this ID is passed by the client application.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "f04ba8895d52bc636d843f88476002bc99d01480c36be87c8fa259cd47a29380", "payload": { "msg": "Successfully released '10' tokens from Operation Id '8e3144' to Account Id: oaccount~51e676d7182a02ea7418ef58a6d54ecfe3858ef40b4ffb3d859b320da3921594 (Org-Id: CB, User-Id: issuer_user_cb)." }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 214 } }
-
removeCBAdmin
- Original method name:
removeTokenAdmin
- This POST method removes a user as a
Token Admin
of the chaincode. This method can be called only by aToken Admin
of the chaincode. An admin cannot remove themselves. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "6a3b9b568d04b5beb29830f91efe4e8c6310b6cf36940cecfb4ab690fbfde739", "payload": { "msg": "Successfully removed Token Admin (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 218 } }
-
removeCBAuditor
- Original method name:
removeTokenAuditor
- This POST method removes a user as a
Token Auditor
of the chaincode. This method can be called only by aToken Admin
of the chaincode. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "a886a6040fbc76374a3c78c89ab0ffc9f7b8391cc5239b169bf3b878cf40c67b", "payload": { "msg": "Successfully removed Token Auditor (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 219 } }
-
removeFIAdmin
- Original method name:
removeOrgAdmin
- This POST method removes a user as a
Org Admin
of the chaincode. This method can be called only by aToken Admin
orOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "e2a634f6093f89b1984e20ff86a513fabb7c3ade7cc9e27d9734b4aaf6c88597", "payload": { "msg": "Successfully removed Org Admin (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 220 } }
-
removeFIAuditor
- Original method name:
removeOrgAuditor
- This POST method removes a user as a
Org Auditor
of the chaincode. This method can be called only by aToken Admin
orOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "sameOrgEndorser": true }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "c3bc720461004a53b37c68d4bb264858b88d980bc093a0a3ebb62a32974fb306", "payload": { "msg": "Successfully removed Org Auditor (Org_Id: CB, User_Id: cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 221 } }
-
removeRole
- Original method name:
removeRole
- This method removes a role from a specified user and token. This method can be called only by a
Token Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "tokenId": "{{bc-token-id}}", "role": "role value (for example minter / burner / notary)", "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.role: string
– The name of the role to remove from the specified user. Themintable
andburnable
behaviors correspond to theminter_role_name
andburner_role_name
properties of the specification file. Similarly, thenotary
role corresponds to thenotary_role_name
property of the specification file.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Returns:
- On success, a message with account details.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "274f0d0a2c4c3929817fb85b2e857519695c3c238ccf9903b084b87e9be7ee12", "payload": { "msg": "Successfully removed role 'notary' from Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8 (Org-Id: CB, User-Id: manager_user_cb)" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 200 } }
-
requestCBDCCreation
- Original method name:
requestMint
- This method can be called by a minter to send a request to the minter notary to create a specified amount of tokens.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "notaryOrgId": "notary_org_id value", "notaryUserId": "notary_user_id value", "quantity": 1, "timeToExpiration": "time_to_expiration value", "infoDetails": "{\"category\":\"category value\",\"description\":\"description value\"}", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token to mint.operationId: string
– The unique operation ID that represents the mint request.notaryOrgId: string
– The membership service provider (MSP) ID of the minter notary who will process the request.notaryUserId: string
– The user name or email ID of the minter notary who will process the request.quantity: number
– The amount of tokens to mint.timeToExpiration
– The time after which the minting request expires and is no longer valid.infoDetails: JSON
– An object specifying the category (category
) and description (description
) of the request, as shown in the following example.{ "category" : "category input", "description" : "description input" }
sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "06b35071415d74aa1a7c18449149c937d886cae76a832c44cf8d98e84586e76e", "payload": { "msg": "AccountId oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0 (Org-Id: CB , User-Id: creator_user_cb) has successfully submitted request to mint 10 tokens" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 202 } }
-
requestCBDCRetirement
- Original method name:
requestBurn
- This method can be called by a burner to send a request to the notary to destroy a specified amount of tokens.
- Payload:
{ "tokenId": "{{bc-token-id}}", "operationId": "operation_id value", "notaryOrgId": "notary_org_id value", "notaryUserId": "notary_user_id value", "quantity": 1, "timeToExpiration": "time_to_expiration value", "infoDetails": "{\"category\":\"category value\",\"description\":\"description value\"}", "sameOrgEndorser": true }
- Parameters:
tokenId: string
– The ID of the token to burn.operationId: string
– The unique operation ID that represents the burn request.notaryOrgId: string
– The membership service provider (MSP) ID of the burner notary who will process the request.notaryUserId: string
– The user name or email ID of the burner notary who will process the request.quantity: number
– The amount of tokens to burn.timeToExpiration
– The time after which the burning request expires and is no longer valid.infoDetails: JSON
– An object specifying the category (category
) and description (description
) of the request, as shown in the following example.{ "category" : "category input", "description" : "description input" }
sameOrgEndorser: boolean
– A Boolean value that indicates whether transaction endorsements must be from the same organization as the requester.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "0adb57ca9776c8760468c40465e0f0d37472f0b4b32fd02561ef28b3f7b28cf1", "payload": { "msg": "AccountId oaccount~0d7b3f73aea28065017ce8b79c0bb19256dc0cb475a0b2a85192bd110f69535c (Org-Id: CB , User-Id: retirer_user_cb) has successfully submitted request to burn 10 tokens" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 206 } }
-
setApplicationGroups
- Original method name:
setApplicationGroups
- This POST method is used to set the
application_groups
parameter in the account details for the specified application groups. This method can be called only by aToken Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "tokenId": "{{bc-token-id}}", "applicationGroups": "[\"application_groups value\"]", "endorsers": {{endorsers}} }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.tokenId: string
– The ID of the token.applicationGroups: string[]
– A list of application groups the user ID belongs to, defining the user's associations in the CBDC application.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Returns:
- On success, a success message with the quantity of tokens burned and the account ID.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "453821c7ffd477987ef8ccbd836b893969531ab768098cd4a99e3b89cd38a391", "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~28ac774001f374064029d51af4fb67e26ea1ea9ef62828b7a72dbf3beb8efd8d", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "", "token_name": "", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 100, "daily_transactions": 0, "current_date": "2024-12-09T00:00:00.000Z" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 188 } }
-
setMaxDailyAmount
- Original method name:
setMaxDailyAmount
- This POST method is used to set the
maxDailyAmount
parameter in the account details for the specified amount. This method can be called only by aToken Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "tokenId": "{{bc-token-id}}", "maxDailyAmount": 1, "endorsers": {{endorsers}} }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.tokenId: string
– The ID of the token.maxDailyAmount: number
– The maximum daily amount value for the specified account, which defines the maximum amount that can be transacted daily.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "28682e0564e4721b6c1a8ec106f8c5c98319e9439959dbb9f83d8e6f111d9975", "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 222 } }
-
setMaxDailyTransactionCount
- Original method name:
setMaxDailyTransactionCount
- This POST method is used to set the
maxDailyTransactions
parameter in the account details for the specified amount. This method can be called only by aToken Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "tokenId": "{{bc-token-id}}", "maxDailyTransactions": 1, "endorsers": {{endorsers}} }
- Parameters:
orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.tokenId: string
– The ID of the token.maxDailyTransactions: number
– The maximum daily amount value for the specified account, which defines the maximum number of transactions allowed per day.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "8b6fb01de697562ee098110054f05d4a314933bd11ef471991cb43e25b68bad9", "payload": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~cdc6fa5e64bc29f700f99da69f980d8cbb768c7e1a11dd17274e75651f6afafe", "user_id": "admin_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "cbdc", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_ADMINS" ], "max_daily_amount": 10000, "daily_amount": 0, "max_daily_transactions": 1000, "daily_transactions": 0, "current_date": "2024-11-20T00:00:00.000Z" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20010", "blockNumber": 223 } }
-
suspendCBDCAccount
- Original method name:
suspendAccount
- This method suspends a fungible token account. It throws an error if an
accountStatus
value is not found in ledger. This method can be called only by aToken Admin
of the chaincode or by anOrg Admin
of the specified organization. - Payload:
{ "tokenId": "{{bc-token-id}}", "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.orgId: string
– The membership service provider (MSP) ID of the user in the current organization.userId: string
– The user name or email ID of the user.endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "e21d91d98091df77f90105d84074c0b802b01fc97a6b1304247774397fed1294", "payload": { "assetType": "oaccountStatus", "status_id": "oaccountStatus~d5814d96d8517ac31727d60aace0519c58a425892ab0d378fcfb0a35771f65ae", "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6", "status": "suspended" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 195 } }
-
transferCBDCTokens
- Original method name:
transferTokens
- This method transfers tokens from the caller to a specified account. The caller of the method must have an account. The quantity must be within the decimal values specified by the
decimal
parameter of thedivisible
behavior in the specification file. - Payload:
{ "tokenId": "{{bc-token-id}}", "toOrgId": "to_org_id value", "toUserId": "to_user_id value", "quantity": 1, "infoDetails": "{\"category\":\"category value\",\"description\":\"description value\"}", "endorsers": {{endorsers}} }
- Parameters:
tokenId: string
– The ID of the token.toOrgId: string
– The membership service provider (MSP) ID of the receiver (payee) in the current organization.toUserId: string
– The user name or email ID of the receiver.quantity: number
– The number of tokens to transfer.infoDetails: JSON
– An object specifying the category (category
) and description (description
) of the request, as shown in the following example.{ "category" : "category input", "description" : "description input" }
endorsers: string[]
– An array of the peers (for example,peer1
,peer2
) that must endorse the transaction.
- Return Value Example:
{ "returnCode": "Success", "error": "", "result": { "txid": "d613b2494b965811b2fa2106152b7085f2d6d7d43e949b10b8668722d3636fe7", "payload": { "msg": "Successfully transferred 10 tokens from account id: oaccount~9d9806fa92aa0c4fdb34eaffac6e830181b5d47e64fbce752195e83024125ca0 (Org-Id: CB, User-Id: creator_user_cb) to account id: oaccount~51e676d7182a02ea7418ef58a6d54ecfe3858ef40b4ffb3d859b320da3921594 (Org-Id: CB, User-Id: issuer_user_cb). Only 999 number of transactions and 1990 amount transfer left for today: 12/11/2024" }, "encode": "JSON", "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009", "blockNumber": 224 } }
The wrapper API package also includes the createCBDCAccount
API, which combines chaincode APIs and Oracle Blockchain
Platform console APIs into a single endpoint for account creation.
-
createCBDCAccount
- Payload:
{ "orgId": "{{bc-org-id}}", "userId": "{{bc-user-id}}", "applicationGroups": "[\"applicationGroups value\"]", "tokenId": "{{bc-token-id}}", "role": "role value (for example minter / burner / notary / tokenAdmin / tokenAuditor / orgAdmin / orgAuditor)", "dailyLimits": "{\"max_daily_amount\":1000, \"max_daily_transactions\":100}" }
- Payload parameters:
orgId
– The membership service provider (MSP) ID of the user to create the account for. The ID must begin with an alphanumeric character and can include letters, numbers, and special characters such as underscores (_), periods (.), at signs (@), and hyphens (-).userId
– The user name or email ID of the user. The ID must begin with an alphanumeric character and can include letters, numbers, and special characters such as underscores (_), periods (.), at signs (@), and hyphens (-).applicationGroups
– The application groups the account will belong to. For example,CBDC_ADMINS
.tokenId
– The ID of the token associated with the account. The ID must begin with an alphanumeric character and can include letters, numbers, and the special characters underscore (_) and hyphen (-). It cannot exceed 16 characters in length.role
– The role must be one of the following values:minter
,burner
,notary
,tokenAdmin
,tokenAuditor
,orgAdmin
ororgAuditor
.dailyLimits
– Two numeric fields that define the daily transaction limits:max_daily_amount
andmax_daily_transactions
.
- Return Value Example:
"payload": { "msg": "Account created successfully and 'minter' role added to Account Id: oaccount~4a86f2843c2b0105c97a77202bd9aba519c81dcef27eccc1d89125ae32770700 (Org-Id: CB, User-Id: creator_user_cb)" "accountDetails": { "bapAccountVersion": 0, "assetType": "oaccount", "account_id": "oaccount~ce5c56d2068ce31b82136c8eea110a80b9251595d361db70924c4e989032a1be", "user_id": "creator_user_cb", "org_id": "CB", "token_type": "fungible", "token_id": "USD", "token_name": "", "balance": 0, "onhold_balance": 0, "application_groups": [ "CBDC_CREATORS" ], "max_daily_amount": 1000, "daily_amount": 0, "max_daily_transactions": 100, "daily_transactions": 0, "current_date": "2024-10-06T00:00:00.000Z" } }
The createCBDCAccount
API completes the following operations in sequence.
- Creates an enrollment ID for the user in Oracle Blockchain Platform. The enrollment ID that is created is the same as the user ID, with some limitations. The ID can contain only alphanumeric characters, hyphens (-), and underscores (_). If the user ID contains any other special characters, they are replaced with an underscores (_). For example, if the user ID is adam.fripp@example.com, the enrollment ID that is created is adam_fripp_example_com. If the enrollment already exists for the specified user ID, another enrollment is not created.
- Creates an account in the ledger with the details provided in the payload.
- Associates the new account with the token specified in the payload.
- Assigns the role specified in the payload to the user.
To ensure consistency and to avoid incomplete data, if any of the subsequent steps fail, the enrollment ID that was created in the first step is deleted.