Confidential Transactions Model
The enhanced version of Blockchain App Builder includes a model attribute that generates additional methods for confidential mode.
If you include the confidential: true parameter in the specification file for tokens that use the extended Token Taxonomy Framework standard, Blockchain App Builder generates chaincode for use in confidential mode, including the following modified versions of the standard automatically generated and SDK methods (TypeScript only).
For more information about confidential transactions and the confidential wholesale central bank digital currency (CBDC) scenario, see Wholesale Central Bank Digital Currency with Confidential Transactions.
The following table summarizes the methods that are generated when you scaffold a Token Taxonomy Framework project in confidential mode.
| Method Category | Auto-generated Method | SDK Method | Description |
|---|---|---|---|
| Access Control Management | isTokenAdmin |
isUserTokenAdmin |
Returns true if the caller is an Admin |
addTokenAdmin |
addTokenAdmin |
Adds an Admin | |
removeTokenAdmin |
removeTokenAdmin |
Removes an Admin | |
|
getAllTokenAdmins |
Returns all Admins | |
addOrgAdmin |
addOrgAdmin |
Adds an Org Admin | |
removeOrgAdmin |
removeOrgAdmin |
Removes an Org Admin | |
|
getAllOrgAdmins |
Returns all Org Admins | |
addTokenAuditor |
addTokenAuditor |
Adds an Auditor | |
removeTokenAuditor |
removeTokenAuditor |
Removes an Auditor | |
|
getAllTokenAuditors |
Returns all Auditors | |
addOrgAuditor |
addOrgAuditor |
Adds an Org Auditor | |
removeOrgAuditor |
removeOrgAuditor |
Removes an Org Auditor | |
|
getAllOrgAuditors |
Returns all Org Auditors | |
| Token Management | |
getAllTokens |
Returns all token assets |
|
getDecimals |
Returns the number of decimal places for a specified token | |
|
history |
Returns the history of a token | |
|
getTokensByName |
Returns all token assets for a specified token name | |
| Account Management | createAccount |
createAccount |
Creates a user account |
associateTokenToAccount |
associateToken |
Associates an account with a token | |
getAllAccounts |
getAllAccounts |
Returns details for all user accounts | |
getAllOrgAccounts |
getAllOrgAccounts |
Returns details for all user accounts in an organization | |
getAccountsByUser |
getAccountsByUser |
Returns all account IDs for a user | |
getUserByAccountId |
getUserByAccountId |
Returns user details for an account ID | |
getAccount |
getAccountWithStatus |
Returns details for a token account | |
getAccountDetailsByCustomAccountId |
getAccountDetailsByCustomAccountId |
Returns account details for a custom account ID | |
getAccountBalance |
getAccountBalance |
Returns the current balance of an account | |
getAccountStatus |
getAccountStatus |
Returns the status of an account | |
getAccountStatusHistory |
history |
Returns history for a token account | |
activateAccount |
activateAccount |
Activates a token account | |
suspendAccount |
suspendAccount |
Suspends a token account | |
deleteAccount |
deleteAccount |
Deletes a token account | |
setMaxDailyAmount |
setMaxDailyAmount |
Sets the maximum amount of tokens a user can transfer daily | |
setMaxDailyTransactionCount |
setMaxDailyTransactionCount |
Sets the maximum number of transactions a user can complete daily | |
getMaxDailyAmount |
getMaxDailyAmount |
Returns the maximum amount of tokens a user can transfer daily | |
getMaxDailyTransactionCount |
getMaxDailyTransactionCount |
Returns the maximum number of transactions a user can complete daily | |
getAccountOnHoldBalance |
getAccountOnHoldBalance |
Returns the current on-hold balance for an account | |
| Role Management | addRole |
addRoleMember |
Adds a role to a user |
removeRole |
removeRoleMember |
Removes a role from a user | |
getAccountsByRole |
getAccountsByRole |
Returns account IDs for a specified role | |
getOrgAccountsByRole |
getOrgAccountsByRole |
Returns account IDs for a specified role in an organization | |
getUsersByRole |
getUsersByRole |
Returns a list of users for a specified role | |
getOrgUsersByRole |
getOrgUsersByRole |
Returns a list of users for a specified role in an organization | |
isInRole |
isInRole |
Returns whether a user has a specified role | |
| Transaction Management | getAccountTransactionHistory |
getAccountTransactionHistory |
Returns transaction history for an account |
getAccountTransactionHistoryWithFilters |
getAccountTransactionHistoryWithFilters |
Returns filtered transaction history for an account | |
getAccountTransactionHistoryWithFiltersFromRichHistDB |
getAccountTrxHistoryWithFiltersFromRichHistDB |
Returns filtered transaction history from the rich history database for an account | |
getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB |
getOrgAccountsTrxHistoryWithFiltersFromRichHistDB |
Returns filtered transaction history from the rich history database for an organization | |
getAllAccountsTransactionHistoryWithFiltersFromRichHistDB |
getAllAccountsTrxHistoryWithFiltersFromRichHistDB |
Returns filtered transaction history from the rich history database for all accounts | |
consolidateRunningBalanceInTransactions |
consolidateRunningBalanceInTransactions |
Updates running account balances for pending transactions | |
processSendersAndReceivers |
processSendersAndReceivers |
Updates account balances during inter-organization transfers | |
deleteHistoricalTransactions |
deleteTransactions |
Deletes older transactions | |
getTransactionById |
getTransactionById |
Returns the history of a transaction asset | |
| Mintable Behavior | requestMint |
|
Requests that tokens be issued |
approveMint |
|
Approves a mint request | |
rejectMint |
|
Rejects a mint request | |
issueTokens |
issueTokens |
Mints tokens | |
getTotalMintedTokens |
getTotalMintedTokens |
Returns the total number of minted tokens | |
getNetTokens |
getNetTokens |
Returns the net quantity of available tokens | |
| Transferable Behavior | transferTokens |
transferTokens |
Transfers tokens |
| Holdable Behavior | holdTokens |
hold |
Puts a token balance on hold |
executeHoldTokens |
executeHold |
Completes a token hold | |
releaseHoldTokens |
releaseHold |
Releases a token hold | |
getOnHoldIds |
getOnHoldIds |
Returns all holding IDs for an account | |
getOnHoldDetailsWithOperationId |
getOnHoldDetailsWithOperationId |
Returns the on-hold transaction details for an operation ID | |
getOnHoldBalanceWithOperationId |
getOnHoldBalanceWithOperationId |
Returns the on-hold balance for an operation ID | |
| Burnable Behavior | requestBurn |
|
Requests that tokens be destroyed |
approveBurn |
|
Approves a burn request | |
rejectBurn |
|
Rejects a burn request | |
| Inter-Organization Transfers | executeHoldTokensSender |
executeHoldTokensSender |
Deducts tokens from a sender's account |
executeHoldTokensReceiver |
executeHoldTokensReceiver |
Credits tokens to a receiver's account |
Modified TypeScript Methods for Confidential Chaincode
If you include the confidential: true parameter in the specification file for tokens that use the extended Token Taxonomy Framework standard, Blockchain App Builder generates modified versions of the standard automatically generated methods as well as additional methods.
-
isTokenAdmin - This method returns the Boolean value
trueif the caller of the function is aToken Admin, otherwise it returnsfalse. AToken Admin,Token Auditor, anyOrg Admin, or anyOrg Auditorcan call this function on any other user in the blockchain network. Other users can call this method only on their own accounts. -
addTokenAdmin - This method adds a user as a
Token Adminof the chaincode. This method can be called only by aToken Adminof the chaincode. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeTokenAdmin - This method removes a user as a
Token Adminof the chaincode. This method can be called only by aToken Adminof the chaincode. -
addOrgAdmin - This method adds a user as an
Org Adminof the organization. This method can be called only by aToken Adminof the chaincode or anOrg Adminof the specified organization. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeOrgAdmin - This method removes a user as an
Org Adminof the organization. This method can be called only by aToken Adminof the chaincode or by anOrg Adminof the specified organization. -
addTokenAuditor - This method adds a user as a
Token Auditorof the chaincode. This method can be called only by aToken Adminof the chaincode. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeTokenAuditor - This method removes a user as a
Token Auditorof the chaincode. This method can be called only by aToken Adminof the chaincode. -
addOrgAuditor - This method adds a user as a
Org Auditorof the chaincode. This method can be called only by aToken AdminorOrg Adminof the chaincode. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeOrgAuditor - This method removes a user as a
Org Auditorof the chaincode. This method can be called only by aToken AdminorOrg Adminof the chaincode. -
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 formed by concatenating the asset type and token ID and then creating a SHA-256 hash over a concatenation of the organization ID and user ID. This method can be called only by a
Token Adminor by anOrg Adminof the specified organization. -
associateTokenToAccount - This method associates a fungible token with an account. This method can be called only by a
Token Adminof the chaincode or by anOrg Adminof the relevant organization. -
getAllAccounts - This method returns a list of all accounts. This method can be called only by a
Token AdminorToken Auditor. This method uses Berkeley DB SQL rich queries and can only be called when connected to the remote Oracle Blockchain Platform network. -
getAllOrgAccounts - This method returns a list of all token accounts that belong to a specified organization. This method can be called only by a
Token AdminorToken Auditor, or by anOrg AdminorOrg Auditorof the specified organization. -
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 the
Token AdminorToken Auditor, by theOrg AdminorOrg Auditorof the specified organization, or by theAccount Ownerspecified in the parameters. -
getUserByAccountId - This method returns user details (
org_idanduser_id) for a specified account. This method can be called by aToken AdminorToken Auditor, or by anOrg AdminorOrg Auditorof the specified organization. -
getAccount - This method returns details for a specified account. This method can be called only by a
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getAccountDetailsByCustomAccountId - This method returns details for a specified custom account ID. This method can be called only by a
Token AdminorToken Auditor, or anOrg AdminorOrg Auditorof the specified organization. -
getAccountBalance - This method returns the current balance for a specified account. This method can be called only by a
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getAccountStatus - This method gets the current status of the token account. This method can be called by the
Token Adminof the chaincode, anOrg Adminof the specified organization, or by the token account owner. -
getAccountStatusHistory - This method gets the history of the account status. This method can be called by the
Token Adminof the chaincode, anOrg Adminof the specified organization, or by the token account owner. -
activateAccount - This method activates a token account. This method can be called only by a
Token Adminof the chaincode or anOrg Adminof the specified organization. Deleted accounts cannot be activated. -
suspendAccount - This method suspends a token account. This method can be called only by a
Token Adminof the chaincode or anOrg Adminof the specified organization. After an account is suspended, you cannot complete any operations that update the account. A deleted account cannot be suspended. -
deleteAccount - This method deletes a token account. This method can be called only by a
Token Adminof the chaincode or anOrg Adminof the specified organization. After an account is deleted, you cannot complete any operations that update the account. The deleted account is in a final state and cannot be changed to any other state. To delete an account, the account balance and the on-hold balance must be zero. -
setMaxDailyAmount - This method sets the
max_daily_amountvalue for a specified account. This method can be called only by aToken Adminof the chaincode or anOrg Adminof the specified organization. -
setMaxDailyTransactionCount - This method sets the
max_daily_transactionsvalue for a specified account. This method can be called only by aToken Adminof the chaincode or anOrg Adminof the specified organization. -
getMaxDailyAmount - This method gets the
max_daily_amountvalue for a specified account. This method can be called only by aToken AdminorToken Auditorof the chaincode or anOrg AdminorOrg Auditorof the specified organization. -
getMaxDailyTransactionCount - This method gets the
max_daily_transactionsvalue for a specified account. This method can be called only by aToken AdminorToken Auditorof the chaincode or anOrg AdminorOrg Auditorof the specified organization. -
getAccountOnHoldBalance - This method returns the current on-hold balance for a specified account. This method can be called only by a
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
addRole - This method adds a role to a specified user and token. This method can be called only by a
Token Adminof the chaincode or by anOrg Adminof the specified organization who also holds the specified role. -
removeRole - This method removes a role from a specified user and token. This method can be called only by a
Token Adminof the chaincode or by anOrg Adminof the specified organization who also holds the specified role. -
getAccountsByRole - This method returns a list of all account IDs for a specified role and token. This method can be called only by a
Token AdminorToken Auditor. -
getOrgAccountsByRole - This method returns a list of all account IDs for a specified role, token, and organization. This method can be called only by a
Token AdminorToken Auditor, or by anOrg AdminorOrg Auditorof the specified organization. -
getUsersByRole - This method returns a list of all users for a specified role and token. This method can be called only by a
Token AdminorToken Auditor. -
getOrgUsersByRole - This method returns a list of all users for a specified role, token, and organization. This method can be called only by a
Token AdminorToken Auditor, or by anOrg AdminorOrg Auditorof the specified organization. -
isInRole - This method returns a Boolean value to indicate if a user has a specified role. This method can be called only by a
Token AdminorToken Auditor, theAccountOwnerof the account, or anOrg AdminorOrg Auditorof the specified organization. -
getAccountTransactionHistory - This method returns an array of account transaction history details for a specified account. This method can be called only by the
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getAccountTransactionHistoryWithFilters - This method returns a filtered array of account transaction history details for a specified user and token. This method can be called only by the
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. This method can be called only when connected to a remote Oracle Blockchain Platform network. -
getAccountTransactionHistoryWithFiltersFromRichHistDB - This method fetches transaction history from the rich history database. This method can be called only by the
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB - This method fetches transaction history from the rich history database for the specified organization. This method can be called only by the
Token AdminorToken Auditor, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getAllAccountsTransactionHistoryWithFiltersFromRichHistDB - This method fetches transaction history from the rich history database for all organizations. This method can be called only by the
Token AdminorToken Auditor. -
deleteHistoricalTransactions - This method deletes older transactions from the state database. This method can be called only by a
Token Admin. -
getTransactionById - This method returns the history of a
Transactionasset. This method can be called only by aToken AdminorToken Auditor, by anOrg AdminorOrg Auditorof the specified organization, or by a transaction participant (sender, recipient, or notary). -
consolidateRunningBalanceInTransactions - This method calculates the running account balances and saves the updated values in the transaction key/value pairs. Typically the system administrators call this method by using a REST proxy scheduler. This method can be called only by a
Token AdminorOrg Admin. -
processSendersAndReceivers - This method calculates and update the token account balances that are spread in the sender and receiver key/value pairs that were created during inter-organization transfers, and then deletes the sender and receiver key/value pairs, which are no longer of use. Typically the system administrators call this method by using a REST proxy scheduler. This method can be called only by a
Token AdminorOrg Admin. -
requestMint - This method can be called by a minter to send a request to the minter notary to create a specified amount of tokens.
-
approveMint - This method can be called by a minter notary to approve a minting request.
-
rejectMint - This method can be called by a minter notary to reject a minting request.
-
issueTokens - This method mints tokens, which are then owned by the caller of the method.
-
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 AdminorOrg Auditor. -
getNetTokens - This 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. In equation form: net tokens = total minted tokens - total burned tokens. If no tokens are burned, then the number of net tokens is equal to the total minted tokens. This method can be called only by a
Token Admin,Token Auditor,Org AdminorOrg Auditor. -
transferTokens - This method transfers tokens from the caller to a specified account.
-
holdTokens - This method creates a hold on behalf of the caller (the owner of the tokens) with the
to_account_idaccount. The specified notary account is responsible for either completing or releasing 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. -
executeHoldTokens - This method completes a hold on a token. A quantity of tokens previously held by a token owner is transferred to a receiver. If the
quantityvalue is less than the actual hold value, then the remaining amount is available again to the original owner of the tokens. This method can be called only by theAccountOwnerID with thenotaryrole for the specified operation ID. The hold can only be completed by the notary. -
releaseHoldTokens - This 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
AccountOwnerID with thenotaryrole within the specified time limit or by the payer, payee, or notary after the specified time limit. -
getOnHoldIds - This method returns a list of all of the holding IDs for a specified account. This method can be called by a
Token AdminorToken Auditorof the chaincode, anOrg AdminorOrg Auditorof the specified organization, or theAccountOwnerof the account. -
getOnHoldDetailsWithOperationId - This method returns the on-hold transaction details for a specified operation ID and token. This method can be called by a
Token AdminorToken Auditorof the chaincode, or by a transaction participant (sender, recipient, notary). -
getOnHoldBalanceWithOperationId - This method returns the on-hold balance for a specified operation ID and token. This method can be called by a
Token AdminorToken Auditorof the chaincode, or by a transaction participant (sender, recipient, notary). -
requestBurn - This method can be called by a burner to send a request to the burner notary to destroy a specified amount of tokens.
-
approveBurn - This method can be called by a burner notary to approve a burning request.
-
rejectBurn - This method can be called by a burner notary to reject a burning request.
TypeScript Methods for Inter-Organizational Transfers
Inter-organization transfers have two parts: first the amount is debited from the sender and then the amount is credited to the receiver. The following two APIs are called together as an atomic transaction using the two-phase commit API of the Oracle Blockchain Platform REST proxy. Confidential transfers are done in this manner because the private data collections of the two organizations are distinct and cannot be accessed in a single transaction.
Both transactions are sent using the two-phase commit API of the REST proxy. For more information, see Invoke Atomic Transaction.
https://test-xyz-abc.blockchain.ocp.oraclecloud.com:7443/restproxy/api/v2/atomicTransactions. You must send all essential headers including the following ones.- Content-Type: application/json
- Confidential-Transaction: trueIn the request body, include the executeHoldTokensSenderand executeHoldTokensReceiver methods as shown in the following request.{
"transactions": [
{
"chaincode": "<chaincode>",
"args": [
"executeHoldTokensSender"
],
"timeout": 6000,
"sync": true,
"transientMap": {
"args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
},
"endorsers" : <Sender's endorsers List>,
"channel":"<channel name>"
},
{
"chaincode": "<chaincode name>",
"args": [
"executeHoldTokensReceiver"
],
"timeout": 6000,
"sync": true,
"transientMap": {
"args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
},
"endorsers" : <Recipient endorsers List>,
"channel":"<channelName>"
}
],
"isolationLevel": "readCommitted",
"prepareTimeout": 10000,
"copyInputsToTransientMap": true,
"sync": true,
"parallelPrepare": true
}{
"transactions": [
{
"chaincode": "WholesaleCBDCConfidential",
"args": [
"executeHoldTokensSender"
],
"timeout": 6000,
"sync": true,
"transientMap": {
"args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
},
"endorsers" : ["org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
"channel":"default"
},
{
"chaincode": "WholesaleCBDCConfidential",
"args": [
"executeHoldTokensReceiver"
],
"timeout": 6000,
"sync": true,
"transientMap": {
"args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
},
"endorsers" : ["org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
"channel":"default"
}
],
"isolationLevel": "readCommitted",
"prepareTimeout": 10000,
"copyInputsToTransientMap": true,
"sync": true,
"parallelPrepare": true
}-
executeHoldTokensSender - This method can be called only by the user with the notary role for the specified operation ID. This method is the first part of an approval of an transfer between organizations. The specified amount is deducted from the sender's account.
-
executeHoldTokensReceiver - This method can be called only by the user with the notary role for the specified operation ID. This method is the second part of an approval of an transfer between organizations. The specified amount is credited to the receiver's account.
Modified TypeScript SDK Methods for Confidential Chaincode
If you include the confidential: true parameter in the specification file for tokens that use the extended Token Taxonomy Framework standard, Blockchain App Builder generates modified versions of the standard SDK methods as well as additional methods.
-
isUserTokenAdmin - This method returns the Boolean value
trueif the caller of the function is aToken Admin. Otherwise the method returnsfalse. -
addTokenAdmin - This method adds a user as a
Token Adminof the token chaincode. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeTokenAdmin - This method removes a user as a
Token Adminof the token chaincode. -
getAllTokenAdmins - This method returns a list of all users who are a
Token Adminof the chaincode. -
addOrgAdmin - This method adds a user as an
Org Adminof the organization. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeOrgAdmin - This method removes a user as an
Org Adminof the organization. -
getAllOrgAdmins - This method returns a list of all users who are an
Org Adminof an organization. -
addTokenAuditor - This method adds a user as a
Token Auditorof the chaincode. Because theuser_idvalue is stored on the public ledger, do not use any personally identifiable information (PII) for theuser_idvalue. -
removeTokenAuditor - This method removes a user as a
Token Auditorof the chaincode. -
getAllTokenAuditors - This method returns all
Token Auditorsof the chaincode. -
addOrgAuditor - This method adds a user as a
Org Auditorof the chaincode. -
removeOrgAuditor - This method removes a user as a
Org Auditorof the chaincode. -
getAllOrgAuditors - This method returns all
Org Auditorsof the chaincode. -
getAllTokens - This method returns all the token assets saved in the state database. This method uses Berkeley DB SQL rich queries and can only be called when connected to the remote Oracle Blockchain Platform network.
-
getDecimals - This method returns the number of decimal places available for a fractional token. If the
divisiblebehavior is not specified, then the default value is 0. -
history - This method returns history for the specified token.
-
getTokensByName - This method returns all the token assets with the specified name. This method uses Berkeley DB SQL rich queries and can only be called when connected to the remote Oracle Blockchain Platform network.
-
createAccount - This method creates an account for a specified user and token. Every user who has tokens at any point must have an account.
-
associateToken - This method associates a fungible token with an account.
-
getAllAccounts - This method returns a list of all accounts. This method uses Berkeley DB SQL rich queries and can only be called when connected to the remote Oracle Blockchain Platform network.
-
getAllOrgAccounts - This method returns a list of all token accounts that belong to a specified organization.
-
getAccountsByUser - This method returns a list of all account IDs for a specified user and organization.
-
getUserByAccountId - This method returns the user details for a specified account.
-
getAccountWithStatus - This method returns account details for a specified user and token.
-
getAccountDetailsByCustomAccountId - This method returns all token account details for a specified organization and account ID.
-
getAccountBalance - This method returns the account balance for a specified account.
-
getAccountStatus - This method gets the current status of the token account.
-
history (Account Status) - This method gets the history of the account status.
-
activateAccount - This method activates a token account. Deleted accounts cannot be activated.
-
suspendAccount - This method suspends a token account. After an account is suspended, you cannot complete any operations that update the account. A deleted account cannot be suspended.
-
deleteAccount - This method deletes a token account. After an account is deleted, you cannot complete any operations that update the account. The deleted account is in a final state and cannot be changed to any other state. To delete an account, the account balance and the on-hold balance must be zero.
-
setMaxDailyAmount - This method sets the
max_daily_amountvalue for a specified account. -
setMaxDailyTransactionCount - This method sets the
max_daily_transactionsvalue for a specified account. -
getMaxDailyAmount - This method gets the
max_daily_amountvalue (the maximum amount that can be transferred daily) for a specified account. -
getMaxDailyTransactionCount - This method gets the
max_daily_transactionsvalue (the maximum number of transactions allowed per day) for a specified account. -
getAccountOnHoldBalance - This method returns the on-hold balance for a specified account.
-
addRoleMember - This method adds a role to a specified account.
-
removeRoleMember - This method removes a role from a specified account.
-
getAccountsByRole - This method returns a list of all accounts for a specified role and token.
-
getOrgAccountsByRole - This method returns information about all accounts that have a specified role in a specified organization.
-
getUsersByRole - This method returns a list of all users for a specified role and token.
-
getOrgUsersByRole - This method returns information about all users that have a specified role in a specified organization.
-
isInRole - This method indicates whether a user has a specified role.
-
getAccountTransactionHistory - This method returns an array of the transaction history details for a specified account.
-
getAccountTransactionHistoryWithFilters - This method returns an array of the transaction history details for a specified account. This method can only be called when connected to the remote Oracle Blockchain Platform network.
-
getAccountTrxHistoryWithFiltersFromRichHistDB - This method returns an array of the transaction history details from the rich history database.
-
getOrgAccountsTrxHistoryWithFiltersFromRichHistDB - This method returns an array of the transaction history details for a specified organization from the rich history database.
-
getAllAccountsTrxHistoryWithFiltersFromRichHistDB - This method returns an array of the transaction history details for all organizations from the rich history database.
-
consolidateRunningBalanceInTransactions - This method calculates the running account balances and saves the updated values in the transaction key/value pairs. Typically the system administrators call this method by using a REST proxy scheduler.
-
processSendersAndReceivers - This method calculates and update the token account balances that are spread in the sender and receiver key/value pairs that were created during inter-organization transfers, and then deletes the sender and receiver key/value pairs, which are no longer of use. Typically the system administrators call this method by using a REST proxy scheduler.
-
deleteTransactions - This method deletes older transactions from the state database.
-
getTransactionById - This method returns the history of a
Transactionasset. -
issueTokens - Minters can call this method to create a specified amount of tokens.
-
getTotalMintedTokens - This method returns the total number of tokens minted.
-
getNetTokens - This method returns the net quantity of tokens that are available in the system. The net tokens are the amount of tokens remaining after tokens are burned. In equation form: net tokens = total minted tokens - total burned tokens. If no tokens are burned, then the number of net tokens is equal to the total minted tokens.
-
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
decimalparameter of thedivisiblebehavior in the specification file. -
hold - This method is used by the minter to send a request to the minter notary to create a specified amount of tokens. The specified notary account is responsible for either completing or releasing the hold.
-
executeHold - Notaries can call this method to approve a hold operation, which can be one of three types: mint, burn, or transfer.
-
releaseHold - Notaries can call this method to reject a hold operation, which can be one of three types: mint, burn, or transfer.
-
getOnHoldIds - This method returns a list of all of the holding IDs for a specified account.
-
getOnHoldDetailsWithOperationId - This method returns the on-hold transaction details for a specified operation ID and token.
-
getOnHoldBalanceWithOperationId - This method returns the on-hold balance for a specified operation ID and token. This method can be called by anyone.
TypeScript SDK Methods for Inter-Organizational Transfers
Inter-organization transfers have two parts: first the amount is debited from the sender and then the amount is credited to the receiver. The following two APIs are called together as an atomic transaction using the two-phase commit API of the Oracle Blockchain Platform REST proxy. Confidential transfers are done in this manner because the private data collections of the two organizations are distinct and cannot be accessed in a single transaction.
-
executeHoldTokensSender - This method can be called only by the user with the notary role for the specified operation ID. This method is the first part of an approval of an transfer between organizations. The specified amount is deducted from the sender's account.
-
executeHoldTokensReceiver - This method can be called only by the user with the notary role for the specified operation ID. This method is the second part of an approval of an transfer between organizations. The specified amount is credited to the receiver's account.