기밀 도매 CBDC 모델

Blockchain App Builder의 향상된 버전에는 도매 중앙 은행 디지털 통화 (CBDC) 시나리오의 기밀 버전에 대한 추가 방법을 생성하는 모델 속성이 포함되어 있습니다.

확장된 토큰 분류법 프레임워크 표준을 사용하는 토큰에 대한 사양 파일에 model: wcbdcconfidential: true 매개변수를 포함하는 경우 Blockchain App Builder는 기밀 도매 CBDC 애플리케이션과 함께 사용할 다음 추가 TypeScript 방법 및 기능을 포함하여 애플리케이션별 체인코드를 생성합니다. 또한 기밀 도매 CBDC 모델에 대해 createAccount 방법이 수정됩니다.

샘플 도매 CBDC 애플리케이션(일반 및 기밀 버전 모두) 구성 및 설치에 대한 자세한 내용은 도매 CBDC에 대한 Oracle Database 뷰 정의도매 CBDC 샘플 애플리케이션 및 분석 패키지를 참조하십시오.

다음 표에는 도매 CBDC 모델을 기밀 모드로 사용하는 토큰 분류법 프레임워크 프로젝트를 스캐폴딩할 때 생성되는 방법이 요약되어 있습니다.

자동 생성 방법 SDK 방법 설명
createAccount createAccount 사용자 계정을 생성합니다.
setApplicationGroups setApplicationGroups CBDC 애플리케이션의 애플리케이션 그룹에 사용자를 연계합니다.
getBurnQuantity getBurnQuantity 조직에 대해 소모된 총 토큰을 반환합니다.
getActionHistory getActionHistory 민트, 레코딩 및 전송 작업에 대한 승인 또는 거부 기록을 반환합니다.
getPendingIssuance getPendingIssuance 호출자의 승인이 필요한 모든 보류 중인 출고(이전) 작업을 반환합니다.
getPendingRequest getPendingRequest 호출자의 승인이 필요한 보류 중인 모든 요청을 반환합니다.
getTotalBalanceByCallerOrgId getTotalBalanceByCallerOrgId 호출자 조직의 총 잔액을 반환합니다.
getTransactionWithBlockNumber getTransactionWithBlockNumber 트랜잭션 ID에 대한 트랜잭션 세부정보를 반환합니다.
getAllActiveAccounts getAllActiveAccounts 모든 활성 계정을 반환합니다.
getAllSuspendedAccounts getAllSuspendedAccounts 일시 중지된 모든 계정을 반환합니다.

TypeScript 기밀 도매 CBDC에 대한 방법

기밀 도매 CBDC 체인 코드에는 확장된 토큰 분류법 프레임워크 체인 코드에서 사용할 수 있는 모든 방법이 포함됩니다. 기밀 도매 CBDC 시나리오와 관련된 다음 추가 방법을 사용할 수 있습니다.
createAccount
이 메소드는 지정된 사용자 및 토큰의 계정을 만듭니다. 언제든지 토큰을 가질 사용자에 대해 계정을 만들어야 합니다. 이 메소드는 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string(), yup.string(), yup.array().of(yup.string()), yup.object().nullable())
  public async createAccount(org_id: string, user_id: string, token_type: string, application_groups: string[], dailyLimits?: DailyLimits) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.createAccount", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.CREATE_ACCOUNT, { org_id, user_id, token_type, application_groups, dailyLimits });
    return await this.Ctx.Account.createAccount(org_id, user_id, token_type, application_groups, dailyLimits);
  }
매개변수:
  • org_id – 계정을 만들 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • user_id – 사용자의 사용자 이름 또는 전자메일 ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • token_type: string – 토큰의 유형으로, fungible여야 합니다.
  • application_groups: string[] – 사용자 ID가 속한 응용 프로그램 그룹 목록으로, CBDC 응용 프로그램에서 사용자의 연관을 정의합니다.
  • daily_limits: DailyLimits – 다음 유형의 JSON 객체입니다.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    예제에서 max_daily_amount 값은 매일 트랜잭션할 수 있는 최대 토큰 수이고 max_daily_transactions 값은 매일 완료할 수 있는 최대 트랜잭션 수입니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "",
    "token_name": "",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
setApplicationGroups
이 메소드는 API에서 지정된 애플리케이션 그룹에 대한 계정 세부정보에 application_groups 매개변수를 설정합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.array().of(yup.string()))
  public async setApplicationGroups (account_id: string, application_groups: string[]) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('CBDC_TOKEN.setApplicationGroups', 'TOKEN', { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SET_APPLICATION_GROUPS, { account_id, application_groups }, token_asset);
    return this.Ctx.Account.setApplicationGroups (account_id, application_groups)
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • application_groups: string[] – CBDC 응용 프로그램에서 사용자의 연관을 정의하는 계정 ID가 속한 응용 프로그램 그룹 목록입니다.
반환 값 예제:
{
          "bapAccountVersion": 10,
          "assetType": "oaccount",
          "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
          "org_id": "CentralBank",
          "token_type": "fungible",
          "token_id": "USD",
          "token_name": "cbdc",
          "balance": "02c4601262fa7ece1ffc909811f829ad973d4133ca27c9c0fa82972d441400ad3e",
          "onhold_balance": "028954d23bfabee1a10d9f5a07793dec08ab0f93fd506079b0fa33f525d527595f",
          "onhold_burn_balance": "028954d23bfabee1a10d9f5a07793dec08ab0f93fd506079b0fa33f525d527595f",
          "application_groups": [
              "SYSTEM_RETIRERS"
          ]
      }
getBurnQuantity
이 방법은 지정된 조직에 대해 레코딩된 토큰의 총 수량을 반환합니다. 이 메소드는 Token Admin, Token Auditor 또는 버너 롤을 가진 사용자만 호출할 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getBurnQuantity(token_id: string) {
    return await this.Ctx.CBDCToken.getBurnQuantity(token_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
{
           "burnt_quantity": 1200
       }
getActionHistory
이 방법은 조직 세부정보 및 관련 계정(발신자, 수신자 및 공증)의 사용자 ID를 포함하여 민트, 레코딩 및 이전(발행) 작업에 대해 호출자가 수행한 승인 또는 거부 기록을 검색합니다.
@GetMethod()
  @Validator(yup.string())
  public async getActionHistory(token_id: string) {
    return await this.Ctx.CBDCToken.getActionHistory(token_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
[
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~b770",
               "holding_status": "APPROVE_BURN",
               "last_updated_time": "2025-08-25T13:21:24.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": null,
               "to_org_id": null,
               "token_name": null,
               "quantity": 200
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~e7b6",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-25T13:20:50.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "to_org_id": "CentralBank",
               "token_name": null,
               "quantity": 1000
           },
           .
           .
           .
           .
           .
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~1baa",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:03.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "to_org_id": "CentralBank",
               "token_name": null,
               "quantity": 10000
           }
       ]
getPendingIssuance
이 방법은 발신자가 승인자로 지정된 모든 보류 중인 출고(이전) 트랜잭션을 검색합니다. 여기에는 조직의 세부정보 및 관련된 계정의 사용자 ID(발신자, 수신자 및 공증)가 포함됩니다. 이 메소드는 체인 코드의 Token Admin 또는 Token Auditor, 지정된 조직의 Org Admin 또는 Org Auditor 또는 Notary에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getPendingIssuance(token_id: string, org_id: string) {
    return await this.Ctx.CBDCToken.getPendingIssuance(token_id, org_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 보류 중인 전송을 가져올 조직의 MSP(멤버쉽 서비스 제공자) ID입니다.
반환 값 예제:
[
           {
               "asset_type": "ONHOLD",
               "category": "issuance",
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~77b75873",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": "77b75873",
               "timetoexpiration": "0",
               "to_account_id": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
               "to_org_id": "org2",
               "token_id": "USD",
               "token_name": "cbdc",
               "quantity": 200
           },
           {
               "asset_type": "ONHOLD",
               "category": "transfer",
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~e26f11da",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": "e26f11da",
               "timetoexpiration": "0",
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_id": "USD",
               "token_name": "cbdc",
               "quantity": 100
           }
       ]
getPendingRequest
이 메소드는 호출자가 승인자로 지정된 지정된 유형의 보류 중인 모든 요청을 검색합니다. 이 메소드는 체인 코드의 Token Admin 또는 Token Auditor, 지정된 조직의 Org Admin 또는 Org Auditor 또는 Notary에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string())
  public async getPendingRequest(token_id: string, request_type: string, org_id: string) {
    return await this.Ctx.CBDCToken.getPendingRequest(token_id, request_type, org_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 보류 중인 요청을 가져올 조직의 MSP(멤버쉽 서비스 공급자) ID입니다.
  • request_type: string – 트랜잭션 유형입니다. 예를 들어, mint 또는 burn입니다.
반환 값 예제:
[
           {
               "valueJson": {
                   "assetType": "ohold",
                   "holding_id": "ohold~cbdc~USD~89ce",
                   "operation_id": "89ce",
                   "token_name": "cbdc",
                   "from_org_id": "CentralBank",
                   "operation_type": "mint",
                   "status": "pending",
                   "from_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "to_account_id": "",
                   "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "token_id": "USD",
                   "quantity": 2000,
                   "time_to_expiration": "0",
                   "description": "Minting 2000 tokens"
               }
           },
           {
               "valueJson": {
                   "assetType": "ohold",
                   "holding_id": "ohold~cbdc~USD~cf73",
                   "operation_id": "cf73",
                   "token_name": "cbdc",
                   "from_org_id": "CentralBank",
                   "operation_type": "mint",
                   "status": "pending",
                   "from_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "to_account_id": "",
                   "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "token_id": "USD",
                   "quantity": 200,
                   "time_to_expiration": "0",
                   "description": "Minting 200"
               }
           }
       ]
getTotalBalanceByCallerOrgId
이 메소드는 호출자 조직의 총 잔액을 검색합니다. Token Admin, Token Auditor, Org Admin, Org Auditor 또는 임의의 계정 소유자가 호출할 수 있습니다.
@GetMethod()
  @Validator()
  public async getTotalBalanceByCallerOrgId() {
    const org_id =  await this.Ctx.Model.getCallerOrgId()
    await this.Ctx.Auth.checkAuthorization("CBDC_TOKEN.getTotalBalanceByCallerOrgId", "TOKEN", { org_id });
    return await this.Ctx.CBDCToken.getTotalBalanceByCallerOrgId();
  }
반환 값 예제:
{
           "totalBalance": 50500
       }
getTransactionWithBlockNumber
이 메소드는 지정된 트랜잭션 ID에 대한 트랜잭션 세부정보를 반환합니다. 이 메소드는 Token Admin, Token Auditor, Org Admin, Org Auditor 또는 트랜잭션 참여자에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getTransactionWithBlockNumber(token_id: string, transaction_id: string) {
    return await this.Ctx.CBDCToken.getTransactionWithBlockNumber(token_id, transaction_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • transaction_id: string – 트랜잭션의 ID입니다.
반환 값 예제:
[
          {
              "blockNo": 340,
              "key": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
              "metadata": null,
              "txnNo": 0,
              "value": null,
              "valueJson": {
                  "assetType": "otransaction",
                  "blockNo": 336,
                  "txnNo": 1,
                  "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
                  "token_id": "USD",
                  "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                  "from_account_balance": 26800,
                  "from_account_onhold_balance": 300,
                  "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
                  "transaction_type": "EXECUTE_HOLD_SENDER",
                  "amount": 200,
                  "timestamp": "2025-08-25T13:16:55.000Z",
                  "number_of_sub_transactions": 0,
                  "holding_id": "ohold~cbdc~USD~81d7c4ac",
                  "sub_transaction": "false",
                  "category": "transfer",
                  "global_transaction_id": "b54d4333-f4bb-4ca4-a7b7-cc75b659d912"
              }
          }
      ]
getAllActiveAccounts
이 메소드는 지정된 토큰 ID와 연관된 모든 활성 계정을 반환합니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAllActiveAccounts(orgId: string, tokenId: string) {
    return this.Ctx.CBDCToken.getAllActiveAccounts(orgId, tokenId);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 활성 계정을 가져올 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환값:
  • 성공 시 사용자 세부 정보가 포함된 메시지입니다. 출력은 다음 예에 표시된 대로 사용자의 역할에 따라 달라집니다.
반환 값 예(토큰 관리자, 토큰 감사자, 조직 관리자, 조직 감사자):
[
           {
               "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ADMINS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_admin"
               ]
           },
           {
               "key": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_AUDITORS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_auditor"
               ]
           },
           {
               "key": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "role_name": "minter",
               "valueJson": {
                   "account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_CREATORS"
                   ],
                   "max_daily_amount": "1000000",
                   "max_daily_transactions": "100000"
               },
               "non_account_role_name": []
           },
           {
               "key": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "role_name": "notary",
               "valueJson": {
                   "account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_MANAGERS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": []
           }
       ]
반환 값 예제(다른 모든 사용자):
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            },
            {
                "key": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_AUDITORS"
                    ]
                }
            },
            {
                "key": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                "role_name": "minter",
                "valueJson": {
                    "account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_CREATORS"
                    ]
                }
            },
            {
                "key": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                "role_name": "notary",
                "valueJson": {
                    "account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_MANAGERS"
                    ]
                }
            }
        ]
getAllSuspendedAccounts
이 메소드는 지정된 토큰 ID와 연관된 일시 중지된 계정을 모두 반환합니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAllSuspendedAccounts(orgId: string, tokenId: string) {
    return this.Ctx.CBDCToken.getAllSuspendedAccounts(orgId, tokenId);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 일시 중지된 계정을 가져올 조직의 멤버쉽 서비스 공급자(MSP) ID입니다.
반환값:
  • 성공 시 사용자 세부 정보가 포함된 메시지입니다. 출력은 다음 예에 표시된 대로 사용자의 역할에 따라 달라집니다.
반환 값 예(토큰 관리자, 토큰 감사자, 조직 관리자, 조직 감사자):
[
           {
               "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ADMINS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_admin"
               ]
           }
       ]
반환 값 예제(다른 모든 사용자):
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            }
        ]

TypeScript 기밀 도매 CBDC에 대한 SDK 방법

기밀 도매 CBDC 체인코드에는 일반 토큰 분류법 프레임워크 체인코드에서 사용할 수 있는 모든 SDK 방법이 포함됩니다. 기밀 도매 CBDC 시나리오와 관련된 다음 추가 SDK 방법을 사용할 수 있습니다.

createAccount
이 메소드는 지정된 사용자 및 토큰의 계정을 만듭니다. 토큰이 있는 모든 사용자는 계정을 가져야 합니다.
Ctx.Account.createAccount(org_id: string, user_id: string, token_type: string, application_groups: string[], dailyLimits);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • token_type: string – 토큰의 유형으로, fungible이어야 합니다.
  • application_groups: string[] – CBDC 응용 프로그램에서 사용자의 연관을 정의하는 계정 ID가 속한 응용 프로그램 그룹 목록입니다.
  • daily_limits: DailyLimits – 다음 유형의 JSON 객체입니다.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    예제에서 max_daily_amount 값은 매일 트랜잭션할 수 있는 최대 토큰 수이고 max_daily_transactions 값은 매일 완료할 수 있는 최대 트랜잭션 수입니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "",
    "token_name": "",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
setApplicationGroups
이 메소드는 API에서 지정된 애플리케이션 그룹에 대한 계정 세부정보에 application_groups 매개변수를 설정합니다.
Ctx.Account.setApplicationGroups (account_id: string, application_groups: string[])
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • application_groups: string[] – CBDC 응용 프로그램에서 사용자의 연관을 정의하는 계정 ID가 속한 응용 프로그램 그룹 목록입니다.
반환 값 예제:
{
          "bapAccountVersion": 10,
          "assetType": "oaccount",
          "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
          "org_id": "CentralBank",
          "token_type": "fungible",
          "token_id": "USD",
          "token_name": "cbdc",
          "balance": "02c4601262fa7ece1ffc909811f829ad973d4133ca27c9c0fa82972d441400ad3e",
          "onhold_balance": "028954d23bfabee1a10d9f5a07793dec08ab0f93fd506079b0fa33f525d527595f",
          "onhold_burn_balance": "028954d23bfabee1a10d9f5a07793dec08ab0f93fd506079b0fa33f525d527595f",
          "application_groups": [
              "SYSTEM_RETIRERS"
          ]
      }
getBurnQuantity
이 방법은 지정된 조직에 대해 레코딩된 토큰의 총 수량을 반환합니다.
Ctx.CBDCToken.getBurnQuantity(token_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
{
           "burnt_quantity": 1200
       }
getActionHistory
이 방법은 조직 세부정보 및 관련 계정(발신자, 수신자 및 공증)의 사용자 ID를 포함하여 민트, 레코딩 및 이전(발행) 작업에 대해 호출자가 수행한 승인 또는 거부 기록을 검색합니다.
Ctx.CBDCToken.getActionHistory(token_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
[
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~b770",
               "holding_status": "APPROVE_BURN",
               "last_updated_time": "2025-08-25T13:21:24.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": null,
               "to_org_id": null,
               "token_name": null,
               "quantity": 200
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~e7b6",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-25T13:20:50.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "to_org_id": "CentralBank",
               "token_name": null,
               "quantity": 1000
           },
           .
           .
           .
           .
           .
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~1baa",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:03.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "to_org_id": "CentralBank",
               "token_name": null,
               "quantity": 10000
           }
       ]
getPendingIssuance
이 방법은 발신자가 승인자로 지정된 모든 보류 중인 출고(이전) 트랜잭션을 검색합니다. 여기에는 조직의 세부정보 및 관련된 계정의 사용자 ID(발신자, 수신자 및 공증)가 포함됩니다.
Ctx.CBDCToken.getPendingIssuance(token_id: string, org_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 보류 중인 전송을 가져올 조직의 MSP(멤버쉽 서비스 제공자) ID입니다.
반환 값 예제:
[
           {
               "asset_type": "ONHOLD",
               "category": "issuance",
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~77b75873",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": "77b75873",
               "timetoexpiration": "0",
               "to_account_id": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
               "to_org_id": "org2",
               "token_id": "USD",
               "token_name": "cbdc",
               "quantity": 200
           },
           {
               "asset_type": "ONHOLD",
               "category": "transfer",
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~e26f11da",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": "e26f11da",
               "timetoexpiration": "0",
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_id": "USD",
               "token_name": "cbdc",
               "quantity": 100
           }
       ]
getPendingRequest
이 메소드는 호출자가 승인자로 지정된 지정된 유형의 보류 중인 모든 요청을 검색합니다.
Ctx.CBDCToken.getPendingRequest(token_id: string, request_type: string, org_id: string)
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 보류 중인 요청을 가져올 조직의 MSP(멤버쉽 서비스 공급자) ID입니다.
  • request_type: string – 트랜잭션 유형입니다. 예를 들어, mint 또는 burn입니다.
반환 값 예제:
[
           {
               "valueJson": {
                   "assetType": "ohold",
                   "holding_id": "ohold~cbdc~USD~89ce",
                   "operation_id": "89ce",
                   "token_name": "cbdc",
                   "from_org_id": "CentralBank",
                   "operation_type": "mint",
                   "status": "pending",
                   "from_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "to_account_id": "",
                   "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "token_id": "USD",
                   "quantity": 2000,
                   "time_to_expiration": "0",
                   "description": "Minting 2000 tokens"
               }
           },
           {
               "valueJson": {
                   "assetType": "ohold",
                   "holding_id": "ohold~cbdc~USD~cf73",
                   "operation_id": "cf73",
                   "token_name": "cbdc",
                   "from_org_id": "CentralBank",
                   "operation_type": "mint",
                   "status": "pending",
                   "from_account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "to_account_id": "",
                   "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "token_id": "USD",
                   "quantity": 200,
                   "time_to_expiration": "0",
                   "description": "Minting 200"
               }
           }
       ]
getTotalBalanceByCallerOrgId
이 메소드는 호출자 조직의 총 잔액을 검색합니다.
Ctx.CBDCToken.getTotalBalanceByCallerOrgId();
반환 값 예제:
{
           "totalBalance": 50500
       }
getTransactionWithBlockNumber
이 메소드는 지정된 트랜잭션 ID에 대한 트랜잭션 세부정보를 반환합니다.
Ctx.CBDCToken.getTransactionWithBlockNumber(token_id: string, transaction_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • transaction_id: string – 트랜잭션의 ID입니다.
반환 값 예제:
[
          {
              "blockNo": 340,
              "key": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
              "metadata": null,
              "txnNo": 0,
              "value": null,
              "valueJson": {
                  "assetType": "otransaction",
                  "blockNo": 336,
                  "txnNo": 1,
                  "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
                  "token_id": "USD",
                  "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                  "from_account_balance": 26800,
                  "from_account_onhold_balance": 300,
                  "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
                  "transaction_type": "EXECUTE_HOLD_SENDER",
                  "amount": 200,
                  "timestamp": "2025-08-25T13:16:55.000Z",
                  "number_of_sub_transactions": 0,
                  "holding_id": "ohold~cbdc~USD~81d7c4ac",
                  "sub_transaction": "false",
                  "category": "transfer",
                  "global_transaction_id": "b54d4333-f4bb-4ca4-a7b7-cc75b659d912"
              }
          }
      ]
getAllActiveAccounts
이 메소드는 지정된 토큰 ID와 연관된 모든 활성 계정을 반환합니다.
Ctx.CBDCToken.getAllActiveAccounts(orgId: string, tokenId: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 활성 계정을 가져올 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환값:
  • 성공 시 사용자 세부 정보가 포함된 메시지입니다. 출력은 다음 예에 표시된 대로 사용자의 역할에 따라 달라집니다.
반환 값 예(토큰 관리자, 토큰 감사자, 조직 관리자, 조직 감사자):
[
           {
               "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ADMINS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_admin"
               ]
           },
           {
               "key": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_AUDITORS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_auditor"
               ]
           },
           {
               "key": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
               "role_name": "minter",
               "valueJson": {
                   "account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_CREATORS"
                   ],
                   "max_daily_amount": "1000000",
                   "max_daily_transactions": "100000"
               },
               "non_account_role_name": []
           },
           {
               "key": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "role_name": "notary",
               "valueJson": {
                   "account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_MANAGERS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": []
           }
       ]
반환 값 예제(다른 모든 사용자):
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            },
            {
                "key": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~1a6ea9aaa59c9ae8385bfdc870bf02616995c881ffeb111f526c8b31dbbdd43c",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_AUDITORS"
                    ]
                }
            },
            {
                "key": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                "role_name": "minter",
                "valueJson": {
                    "account_id": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_CREATORS"
                    ]
                }
            },
            {
                "key": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                "role_name": "notary",
                "valueJson": {
                    "account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_MANAGERS"
                    ]
                }
            }
        ]
getAllSuspendedAccounts
이 메소드는 지정된 토큰 ID와 연관된 일시 중지된 계정을 모두 반환합니다.
Ctx.CBDCToken.getAllSuspendedAccounts(orgId: string, tokenId: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • org_id: string – 일시 중지된 계정을 가져올 조직의 멤버쉽 서비스 공급자(MSP) ID입니다.
반환값:
  • 성공 시 사용자 세부 정보가 포함된 메시지입니다. 출력은 다음 예에 표시된 대로 사용자의 역할에 따라 달라집니다.
반환 값 예(토큰 관리자, 토큰 감사자, 조직 관리자, 조직 감사자):
[
           {
               "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ADMINS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": [
                   "token_admin"
               ]
           }
       ]
반환 값 예제(다른 모든 사용자):
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            }
        ]