批發 CBDC 包裝程式 API 套件

Oracle Blockchain Platform Digital Assets Edition 包含一個包裝函式 API 套件,可擴充 REST API 以支援批發 CBDC 特定的作業。

包裝程式 API 套裝程式使用 API 閘道服務和 OCI 函數 (使用 Oracle Cloud Infrastructure (OCI) 上的資源管理程式堆疊建立) 來部署專為批發 CBDC 應用程式設計的 API 路由。批發 CBDC 包裝函式 API 套件可從 Oracle Blockchain Platform 主控台下載,並包含下列元件。
  • WholesaleCBDCWrapperAPI.zip,包含包裝函式 API 套件的封存檔案,包含部署所需的 Terraform 指令碼。您可以將此檔案部署至 OCI 上的資源管理程式堆疊,為包裝程式 API 建立必要的 Oracle 資源。
  • WholesaleCBDC_WrapperAPI.postman_collection.json - Postman 集合,可讓您測試已部署的包裝函式 API。此集合包含預先設定的要求,其端點和有效負載與包裝函式 API 套裝程式中定義的 API 相對應。

包裝函式 API

activateCBDCAccount
原始方法名稱:activateAccount
此 POST 方法會啟用權杖帳戶。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。無法啟用已刪除的帳戶。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值:
  • 成功時,指定記號帳戶之帳戶狀態物件的 JSON 表示法。
傳回值範例:
{
    "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
    }
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
addCBAdmin
原始方法名稱:addTokenAdmin
此 POST 方法會將使用者新增為權杖鏈碼的 Token Admin。此方法只能由權杖鏈碼的 Token Admin 呼叫。第一次呼叫來自建立鏈碼的管理員。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:addTokenAuditor
此 POST 方法會將記號稽核者新增至記號鏈碼。此方法只能由鏈碼的 Token Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:addOrgAdmin
此方法會將組織管理員新增至權杖鏈碼。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:

{
    "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
原始方法名稱:addOrgAuditor
此方法會將組織稽核者新增至記號鏈碼。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:addRole
這個方法會將角色新增至指定的使用者和記號。帳號 ID 是透過建立串連記號 ID、組織 ID 和使用者 ID 的 SHA-256 雜湊來形成。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "role": "role value (for example minter / burner / notary)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • role: string – 要新增至指定使用者的角色名稱。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:approveMint
Notaries 可以呼叫此 POST 方法來核准 mint 要求。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "sameOrgEndorser": true
}
參數:
  • tokenId: string – 記號的 ID。
  • operationId: string – 要核准之 Mint 要求的唯一作業 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:approveBurn
Notaries 可以呼叫此 POST 方法來核准燒錄請求。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "sameOrgEndorser": true
}
參數:
  • tokenId: string – 記號的 ID。
  • operationId: string – 要核准之 Mint 要求的唯一作業 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:executeHoldTokens
Notaries 呼叫此方法來核准保留權杖,此權杖會觸發將權杖從付款人轉移至此業務案例中的受款人。權杖擁有者之前保留的權杖數量現在已移轉給收件者。如果 quantity 值小於實際保留值,則記號的擁有者可以再次使用剩餘金額。如果在記號模型的 behaviors 區段中指定 roles 行為,且已設定 notary_role_name 值,則呼叫者帳戶必須具有公證人角色。否則,任何具有帳戶的來電者都可以作為公證人。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "quantity": 1,
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • operationId: string – 要核准之 Mint 要求的唯一作業 ID。
  • quantity: number – 要轉移的保留記號數目。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:associateTokenToAccount
此 POST 方法會將指定的帳戶 ID 與指定的權杖建立關聯。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "accountId": "account_id value",
    "tokenId": "{{bc-token-id}}",
    "endorsers": {{endorsers}}
}
參數:
  • accountId: string – 帳戶的 ID。
  • tokenId: string – 記號的 ID。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:createAccount
此方法會為指定的使用者和記號建立帳戶。必須為任何需要記號的使用者建立帳戶。科目會追蹤餘額、保留餘額及交易歷史記錄。帳戶 ID 是一組英數字元,前面加上 oaccount~<token asset name>~,後面接著執行處理擁有者的使用者名稱或電子郵件 ID (userId) 雜湊、登入執行處理的使用者、目前網路組織中使用者的成員身分服務提供者 ID (orgId)。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "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}}
}
參數:
  • orgId – 要建立帳戶之使用者的成員身分服務提供者 (MSP) ID。ID 必須以數字或英文字母字元為開頭,而且可以包含英文字母、數字以及特殊字元,例如底線 (_)、句號 (.)、at 符號 (@) 以及連字號 (-)。
  • userId – 使用者的使用者名稱或電子郵件 ID。ID 必須以數字或英文字母字元為開頭,而且可以包含英文字母、數字以及特殊字元,例如底線 (_)、句號 (.)、at 符號 (@) 以及連字號 (-)。
  • tokenType: TokenType – 記號的類型,必須是 fungible
  • applicationGroups: string[] – 使用者 ID 所屬的應用程式群組清單,可定義使用者在 CBDC 應用程式中的關聯。
  • dailyLimits: JSON object – 下列類型的 JSON 物件。
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    在此範例中,max_daily_amount 值是每日可交易的記號數目上限,而 max_daily_transactions 值是每日可完成的交易數目上限。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:getAllActiveAccounts
此 GET 方法會傳回與指定權杖 ID 關聯的所有作用中帳戶。
查詢:
/getAllActiveCBDCAccounts?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值:
  • 成功時,會出現包含使用者詳細資訊的訊息。輸出會根據使用者的角色而有所不同,如下列範例所示。
傳回值範例 (記號管理員、記號稽核者):
{
    "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"
    }
}
傳回值範例 (組織管理、組織稽核者):
{
  "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"
  }
}
傳回值範例 (所有其他使用者):
{
  "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
原始方法名稱:getAllSuspendedAccounts
此 GET 方法會傳回與指定記號 ID 關聯的所有暫停帳戶。
查詢:
/getAllSuspendedCBDCAccounts?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值:
  • 成功時,會出現包含使用者詳細資訊的訊息。輸出會根據使用者的角色而有所不同,如下列範例所示。
傳回值範例 (記號管理員、記號稽核者):
{
    "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"
    }
}
傳回值範例 (組織管理、組織稽核者):
{
  "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"
  }
}
傳回值範例 (所有其他使用者):
{
  "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
原始方法名稱:getActionHistory
此 GET 方法會擷取呼叫程式針對 mint、burn 及 transfer (issuance) 作業所進行之核准或拒絕的歷史記錄,包括組織的詳細資料,以及相關帳戶的使用者 ID (寄件者、收件者及公證人)。此方法只能由 Token AdminToken AuditorOrg AdminOrg Auditor 或公證人呼叫。
查詢:
/getApproverActionHistory?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
  "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
原始方法名稱:getAccount
此 GET 方法會傳回指定之使用者和記號的帳戶詳細資訊。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
查詢:
/getCBDCAccount?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
傳回值範例:
{
    "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
原始方法名稱:getAccountBalance
此 GET 方法會傳回指定科目與變數替代字的目前餘額。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
/getCBDCAccountBalance?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
傳回值範例:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "msg": "Current Balance is: 100",
            "user_balance": 100
        },
        "encode": "JSON"
    }
}
getCBDCAccountsByUser
原始方法名稱:getAccountsByUser
此方法會傳回指定組織 ID 與使用者 ID 的所有帳戶 ID 清單。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
/getCBDCAccountsByUser?orgId={{bc-org-id}}&userId={{bc-user-id}}
參數:
  • orgId string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId string – 使用者的使用者名稱或電子郵件 ID。
傳回值範例:
{
    "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
原始方法名稱:getAccountTransactionHistory
此方法會傳回指定使用者和記號的帳戶交易歷史記錄明細陣列。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
/getCBDCAccountTransactionHistory?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
傳回值範例:
{
    "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
原始方法名稱:getAccountTransactionHistoryWithFiltersFromRichHistDB
此方法會從 RTF 歷史記錄資料庫傳回帳戶交易歷史記錄明細。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
/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"}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • customEndpoint – 擷取交易歷史記錄之 Rich History 資料庫的 RESTful 服務端點。
  • bearerToken – 用於呼叫 RESTful 端點,以確保要求獲得授權的記號。
  • filters: JSON object – 選擇性參數。如果空白,則會傳回所有記錄。pageSize 特性決定要傳回的記錄數目。如果 pageSize 為 0,則預設頁面大小為 20。bookmark 特性決定要傳回之記錄的開始索引。必須以 RFC-3339 格式指定 startTimeendTime 特性。
傳回值範例:
{
    "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
原始方法名稱:getBurnQuantity
此 GET 方法會傳回指定組織的燒錄記號總數量。此方法只能由 Token AdminToken Auditor 或具備 burner 角色的使用者呼叫。
/getCBDCRetiredQuantity?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
  "returnCode": "Success",
  "error": "",
  "result": {
      "payload": {
          "burnt_quantity": 31
      },
      "encode": "JSON"
  }
}
getNetCBDCTokens
原始方法名稱:getNetTokens
此 GET 方法會傳回系統中指定記號可用的記號總數。網路記號總計是記號燒錄之後剩餘的記號量。只有鏈碼的 Token AdminToken AuditorOrg AdminOrg Auditor 才能呼叫此方法。
/getNetCBDCTokens?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "msg": "Net supply of token for Token Id: USD is 878 tokens.",
            "quantity": 878
        },
        "encode": "JSON"
    }
}
getOnHoldIds
原始方法名稱:getOnHoldIds
此 GET 方法會傳回指定帳戶的所有保留 ID 清單。只有鏈碼的 Token AdminToken Auditor、指定組織的 Org AdminOrg Auditor 或帳戶的 AccountOwner 才能呼叫此方法。
/getOnHoldIds?tokenId={{bc-token-id}}&orgId={{bc-org-id}}&userId={{bc-user-id}}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
傳回值範例:
{
    "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
原始方法名稱:getPendingIssuance
此方法會擷取呼叫者被指派為核准者的所有待處理核發 (轉移) 交易,包括組織的詳細資料,以及相關帳戶的使用者 ID (寄件者、收件者及公證人)。只有鏈碼的 Token AdminToken AuditorOrg AdminOrg AuditorNotary 才能呼叫此方法。
/getPendingCBDCIssuance?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
  "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
原始方法名稱:getPendingRequest
此方法會擷取指定類型的所有擱置中要求,其中呼叫者被指派為核准者。只有鏈碼的 Token AdminToken AuditorNotary 才能呼叫此方法。
/getPendingCBDCRequest?tokenId={{bc-token-id}}&requestType=request_type value
參數:
  • tokenId: string – 記號的 ID。
  • requestType: string – 交易類型。例如,mintburn
傳回值範例:
{
  "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
原始方法名稱:getTotalBalanceByCallerOrgId
此方法會擷取呼叫者組織的總結餘。此方法只能由 Token AdminToken AuditorOrg AdminOrg Auditor 或任何帳戶擁有者呼叫。
/getTotalCBDCBalanceByCallerOrgId
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
  "returnCode": "Success",
  "error": "",
  "result": {
      "payload": [
          {
              "totalBalance": 704
          }
      ],
      "encode": "JSON"
  }
}
getTotalCreatedCBDCTokens
原始方法名稱:getTotalMintedTokens
此方法會傳回指定記號的提示記號總數。此方法只能由 Token AdminToken AuditorOrg AdminOrg Auditor 呼叫。
查詢:
/getTotalCreatedCBDCTokens?tokenId={{bc-token-id}}
參數:
  • tokenId: string – 記號的 ID。
傳回值範例:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "msg": "Total minted token for Token Id: USD is 910 tokens.",
            "quantity": 910
        },
        "encode": "JSON"
    }
}
getTransactionWithBlockNumber
原始方法名稱:getTransactionWithBlockNumber
此 GET 方法會傳回指定交易 ID 的交易詳細資訊。
查詢:
/getTransactionWithBlockNumber?tokenId={{bc-token-id}}&transactionId=transaction_id value
參數:
  • tokenId: string – 記號的 ID。
  • transactionId: string – 交易的 ID。
傳回值範例:
{
  "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
原始方法名稱:getUserByAccountId
此方法會傳回指定帳戶的使用者詳細資訊 (orgIduserIdtokenId)。只有鏈碼的 Token AdminToken Auditor,或指定組織的 Org AdminOrg Auditor 才能呼叫此方法。
查詢:
/getUserByCBDCAccountId?accountId=account_id value
參數:
  • accountId: string – 帳戶的 ID。
傳回值範例:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "token_id": "USD",
            "user_id": "admin_user_cb",
            "org_id": "CB"
        },
        "encode": "JSON"
    }
}
getUsersByRole
原始方法名稱:getUsersByRole
此 GET 方法會傳回指定角色和記號的所有使用者清單。只有鏈碼的 Token AdminToken Auditor 才能呼叫此方法。
查詢:
/getUsersByRole?tokenId={{bc-token-id}}&role=role value (for example minter / burner / notary)
參數:
  • tokenId: string – 記號的 ID。
  • role: string – 要搜尋之角色的名稱。
傳回值範例:
{
    "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
原始方法名稱:holdTokens
此方法會代表具有 to_account_id 帳戶之記號的擁有者建立保留。指定公證人帳戶,該帳戶負責完成或解除保留。建立保留時,會保留付款人的指定變數替代字餘額。在保留完成或解除前,無法移轉保留餘額。這個方法的呼叫程式必須已經建立一個帳戶。
有效負載:
{
    "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}}
}
參數:
  • tokenId: string – 記號的 ID。
  • operationId: string – 識別保留作業的唯一 ID。通常用戶端應用程式會傳送此 ID。
  • toOrgId: string – 目前組織中接收者的成員身分服務提供者 (MSP) ID。
  • toUserId: string – 接收者的使用者名稱或電子郵件 ID。
  • notaryOrgId: string – 目前組織中公證人的會員服務提供者 (MSP) ID。
  • notaryUserId: string – 公證人的使用者名稱或電子郵件 ID。
  • quantity: number – 要保留的記號數目。
  • timeToExpiration – 保留到期的時間。指定 0 表示永久保留。否則,請使用 RFC-3339 格式。例如,2021-06-02T12:46:06Z
  • infoDetails: JSON – 說明和類別,如下列範例所示。
    {
       "category" : "category input",
       "description" : "description input"
    }
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:init
部署鏈碼時會呼叫此方法。使用者資訊會儲存為鏈碼的 Token Admin
有效負載:
{
    "adminList": "[{\"org_id\":\"{{bc-org-id}}\",\"user_id\":\"{{bc-admin-user}}\"}]"
}
參數:
  • adminList array – 指定記號管理員清單的 {user_id, org_id} 資訊陣列。adminList 陣列是必要參數。
傳回值範例:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "fdb7dc89832c8045a333823b77fa24ae628178148dc93b3550040e070d7cd807",
        "payload": "",
        "encode": "UTF-8",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 263
    }
}
initializeCBDCToken
原始方法名稱:initializeCBDCToken
此方法會建立記號並起始記號特性。資產及其特性會儲存在狀態資料庫中。只有鏈碼的 Token Admin 才能呼叫此方法。
有效負載:
{
    "tokenAsset": "{\"token_id\":\"{{bc-token-id}}\",\"token_desc\":\"token_desc value\",\"Currency_Name\":\"Currency_Name value\"}",
    "sameOrgEndorser": true
}
參數:
  • tokenAsset: <Token Class> – 將記號資產當作參數傳遞至此方法。模型檔案中描述了記號資產的特性。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值:
  • 成功時,所建立權杖資產的 JSON 表示法。
傳回值範例:
{
    "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
原始方法名稱:rejectMint
礦工公證人可以呼叫此方法,以拒絕採礦請求。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "sameOrgEndorser": true
}
參數:
  • tokenId: string – 要拒絕採礦的記號 ID。
  • operationId: string – 代表 mint 要求的唯一作業 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:rejectBurn
公證人可以呼叫此方法來拒絕燒錄請求。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "sameOrgEndorser": true
}
參數:
  • tokenId: string – 要拒絕進行燒錄的記號 ID。
  • operationId: string – 代表燒錄要求的唯一作業 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:releaseHoldTokens
此 POST 方法會解除權杖的保留。移轉未完成,所有保留的變數替代字都可再供原始擁有者使用。AccountOwner ID 可在指定的時間限制內以 notary 角色呼叫此方法,或在指定的時間限制之後由付款人、受款人或公證人呼叫此方法。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "operationId": "operation_id value",
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • operationId: string – 識別保留作業的唯一 ID。通常用戶端應用程式會傳送此 ID。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:removeTokenAdmin
此 POST 方法會移除使用者作為鏈碼的 Token Admin。此方法只能由鏈碼的 Token Admin 呼叫。管理員無法移除自己。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱: removeTokenAuditor
此 POST 方法會移除使用者作為鏈碼的 Token Auditor。此方法只能由鏈碼的 Token Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:removeOrgAdmin
此 POST 方法會移除使用者作為鏈碼的 Org Admin。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:removeOrgAuditor
此 POST 方法會移除使用者作為鏈碼的 Org Auditor。此方法只能由指定組織的 Token AdminOrg Admin 呼叫。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:removeRole
此方法會從指定的使用者和記號移除角色。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "role": "role value (for example minter / burner / notary)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • role: string – 要從指定使用者移除的角色名稱。mintableburnable 行為對應規格檔案的 minter_role_nameburner_role_name 特性。同樣地,notary 角色會對應規格檔案的 notary_role_name 特性。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值:
  • 成功時,會顯示含有帳戶詳細資訊的訊息。
傳回值範例:
{
    "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
原始方法名稱:requestMint
礦工可以呼叫此方法,將請求傳送給礦工公證人,以建立指定數量的記號。
有效負載:
{
    "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
}
參數:
  • tokenId: string – 要提示之記號的 ID。
  • operationId: string – 代表 mint 要求的唯一作業 ID。
  • notaryOrgId: string – 將處理要求之礦工公證人的會員服務提供者 (MSP) ID。
  • notaryUserId: string – 將處理要求之礦工公證人的使用者名稱或電子郵件 ID。
  • quantity: number – 要提示的記號數量。
  • timeToExpiration – 採礦要求到期且不再有效的時間。
  • infoDetails: JSON – 指定要求之類別 (category) 和描述 (description) 的物件,如下列範例所示。
    {
         "category" : "category input",
         "description" : "description input"
    }
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:requestBurn
燒錄程式可以呼叫此方法,以傳送要求給公證人,以銷毀指定數量的記號。
有效負載:
{
    "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
}
參數:
  • tokenId: string – 要燒錄的記號 ID。
  • operationId: string – 代表燒錄要求的唯一作業 ID。
  • notaryOrgId: string – 將處理要求之燃燒器公證人的會員服務提供者 (MSP) ID。
  • notaryUserId: string – 將處理要求之燒錄公證人的使用者名稱或電子郵件 ID。
  • quantity: number – 要燒錄的記號量。
  • timeToExpiration – 燒錄要求到期且不再有效的時間。
  • infoDetails: JSON – 指定要求之類別 (category) 和描述 (description) 的物件,如下列範例所示。
    {
         "category" : "category input",
         "description" : "description input"
    }
  • sameOrgEndorser: boolean – 布林值,指出交易背書是否必須來自與要求者相同的組織。
傳回值範例:
{
    "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
原始方法名稱:setApplicationGroups
此 POST 方法是用來設定指定應用程式群組之帳戶詳細資訊中的 application_groups 參數。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "tokenId": "{{bc-token-id}}",
    "applicationGroups": "[\"application_groups value\"]",
    "endorsers": {{endorsers}}
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • tokenId: string – 記號的 ID。
  • applicationGroups: string[] – 使用者 ID 所屬的應用程式群組清單,定義 CBDC 應用程式中的使用者關聯。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值:
  • 成功時,會產生一個成功訊息,其中包含已燒錄的記號數量和帳戶 ID。
傳回值範例:
{
    "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
原始方法名稱:setMaxDailyAmount
此 POST 方法是用來設定指定金額之帳戶詳細資訊中的 maxDailyAmount 參數。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "tokenId": "{{bc-token-id}}",
    "maxDailyAmount": 1,
    "endorsers": {{endorsers}}
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • tokenId: string – 記號的 ID。
  • maxDailyAmount: number – 指定帳戶的每日金額上限值,定義每日可交易的金額上限。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:setMaxDailyTransactionCount
此 POST 方法是用來設定指定金額之帳戶詳細資訊中的 maxDailyTransactions 參數。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "tokenId": "{{bc-token-id}}",
    "maxDailyTransactions": 1,
    "endorsers": {{endorsers}}
}
參數:
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • tokenId: string – 記號的 ID。
  • maxDailyTransactions: number – 指定帳戶的每日金額上限值,定義每日允許的交易數上限。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:suspendAccount
此方法會暫停有趣的權杖帳戶。如果在分類帳中找不到 accountStatus 值,則會發出錯誤。只有鏈碼的 Token Admin 或指定組織的 Org Admin 才能呼叫此方法。
有效負載:
{
    "tokenId": "{{bc-token-id}}",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
參數:
  • tokenId: string – 記號的 ID。
  • orgId: string – 目前組織中使用者的成員身分服務提供者 (MSP) ID。
  • userId: string – 使用者的使用者名稱或電子郵件 ID。
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
原始方法名稱:transferTokens
此方法會將記號從呼叫程式轉移至指定的帳戶。方法的呼叫程式必須有一個帳戶。數量必須在規格檔案中 divisible 行為的 decimal 參數所指定的小數值內。
有效負載:
{
    "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}}
}
參數:
  • tokenId: string – 記號的 ID。
  • toOrgId: string – 目前組織中接收者 (受款人) 的會員服務提供者 (MSP) ID。
  • toUserId: string – 接收者的使用者名稱或電子郵件 ID。
  • quantity: number – 要傳輸的記號數目。
  • infoDetails: JSON – 指定要求之類別 (category) 和描述 (description) 的物件,如下列範例所示。
    {
         "category" : "category input",
         "description" : "description input"
    }
  • endorsers: string[] – 必須為交易背書的對等陣列 (例如 peer1peer2)。
傳回值範例:
{
    "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
    }
}

包裝程式 API 套件還包含 createCBDCAccount API,可將鏈碼 API 和 Oracle Blockchain Platform 主控台 API 結合成單一端點以建立帳戶。

createCBDCAccount
有效負載:
{
    "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}"
}
有效負載參數:
  • orgId – 要建立帳戶之使用者的成員身分服務提供者 (MSP) ID。ID 必須以數字或英文字母字元為開頭,而且可以包含英文字母、數字以及特殊字元,例如底線 (_)、句號 (.)、at 符號 (@) 以及連字號 (-)。
  • userId – 使用者的使用者名稱或電子郵件 ID。ID 必須以數字或英文字母字元為開頭,而且可以包含英文字母、數字以及特殊字元,例如底線 (_)、句號 (.)、at 符號 (@) 以及連字號 (-)。
  • applicationGroups – 帳戶所屬的應用程式群組。例如,CBDC_ADMINS
  • tokenId – 與帳戶關聯的記號 ID。ID 必須以數字或英文字母字元為開頭,而且可以包含英文字母、數字以及底線 (_) 和連字號 (-) 等特殊字元。長度不得超過 16 個字元。
  • role – 角色必須是下列其中一個值:minterburnernotarytokenAdmintokenAuditororgAdminorgAuditor
  • dailyLimits – 定義每日交易限制的兩個數值欄位:max_daily_amountmax_daily_transactions
傳回值範例:
"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"
     }
 }

createCBDCAccount API 會依序完成下列作業。

  1. Oracle Blockchain Platform 中建立使用者的註冊 ID。建立的註冊 ID 與使用者 ID 相同,但有些限制。ID 只能包含文數字字元、連字號 (-) 以及底線 (_)。如果使用者 ID 包含任何其他特殊字元,則會以底線 (_) 取代。例如,如果使用者 ID 為 adam.fripp@example.com,則建立的註冊 ID 為 adam_fripp_example_com。若指定的使用者 ID 已有註冊存在,則不會建立其他註冊。
  2. 在分類帳中建立包含有效負載中所提供明細的科目。
  3. 將新帳戶與有效負載中指定的權杖建立關聯。
  4. 將有效負載中指定的角色指定給使用者。

為了確保一致性與避免不完整的資料,若有任何後續步驟失敗,則會在第一個步驟中建立的註冊 ID 會被刪除。