Modèle CBDC de gros confidentiel

La version améliorée de Blockchain App Builder comprend des attributs de modèle qui génèrent des méthodes supplémentaires pour une version confidentielle du scénario de devises numériques (CBDC) de la banque centrale de gros.

Si vous incluez les paramètres model: wcbdc et confidential: true dans le fichier de spécification pour les jetons qui utilisent la norme étendue Token Taxonomy Framework, Blockchain App Builder génère du code de chaîne propre à l'application, y compris les méthodes et fonctionnalités TypeScript supplémentaires suivantes à utiliser avec l'application CBDC de gros confidentiel. En outre, les méthodes createAccount sont modifiées pour le modèle CBDC de gros confidentiel.

Pour plus d'informations sur la configuration et l'installation de l'exemple d'application CBDC de gros (versions génériques et confidentielles), voir : Oracle Database View Definitions for Wholesale CBDC et Wholesale CBDC Sample Application and Analytics Package.

TypeScript Méthodes pour le CBDC de gros confidentiel

Le code de chaîne CBDC de gros confidentiel inclut toutes les méthodes disponibles dans le code de chaîne étendu Token Taxonomy Framework. Les méthodes supplémentaires suivantes, propres au scénario CBDC confidentiel de gros, sont disponibles.
createAccount
Cette méthode crée un compte pour un utilisateur et un jeton spécifiés. Un compte doit être créé pour tout utilisateur qui aura des jetons à tout moment. Cette méthode ne peut être appelée que par Token Admin ou par Org Admin de l'organisation spécifiée.
@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);
  }
Paramètres :
  • org_id – ID fournisseur de services d'adhésion (MSP) de l'utilisateur pour lequel créer le compte. L'ID doit commencer par un caractère alphanumérique et peut inclure des lettres, des chiffres et des caractères spéciaux tels que des traits de soulignement (_), des points (.), des signes at (@) et des tirets (-).
  • user_id – Nom d'utilisateur ou ID courriel de l'utilisateur. L'ID doit commencer par un caractère alphanumérique et peut inclure des lettres, des chiffres et des caractères spéciaux tels que des traits de soulignement (_), des points (.), des signes at (@) et des tirets (-).
  • token_type: string – Type de jeton, qui doit être fungible.
  • application_groups: string[] – Liste des groupes d'applications auxquels appartient l'ID utilisateur, qui définissent les associations de l'utilisateur dans l'application CBDC.
  • daily_limits: DailyLimits – Objet JSON du type suivant.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    Dans l'exemple, la valeur max_daily_amount est le nombre maximal de jetons pouvant être traités quotidiennement et la valeur max_daily_transactions est le nombre maximal de transactions pouvant être effectuées quotidiennement.
Exemple de valeur renvoyée :
{
    "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
Cette méthode définit le paramètre application_groups dans les détails du compte pour les groupes d'applications spécifiés dans l'API. Cette méthode ne peut être appelée que par Token Admin ou Org Admin de l'organisation spécifiée.
@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)
  }
Paramètres :
  • account_id: string – ID unique du compte de jeton.
  • application_groups: string[] – Liste des groupes d'applications auxquels appartient l'ID compte, qui définissent les associations de l'utilisateur dans l'application CBDC.
Exemple de valeur renvoyée :
{
          "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
Cette méthode retourne la quantité totale de jetons brûlés pour une organisation spécifiée. Cette méthode ne peut être appelée que par Token Admin, Token Auditor ou un utilisateur doté du rôle de brûleur.
@GetMethod()
  @Validator(yup.string())
  public async getBurnQuantity(token_id: string) {
    return await this.Ctx.CBDCToken.getBurnQuantity(token_id);
  }
Paramètres :
  • token_id: string – ID du jeton.
Exemple de valeur renvoyée :
{
           "burnt_quantity": 1200
       }
getActionHistory
Cette méthode extrait l'historique des approbations ou des rejets effectués par l'appelant pour les opérations de menthe, de brûlure et de transfert (émission), y compris les détails de l'organisation et les ID utilisateur des comptes concernés (expéditeur, destinataire et notaire).
@GetMethod()
  @Validator(yup.string())
  public async getActionHistory(token_id: string) {
    return await this.Ctx.CBDCToken.getActionHistory(token_id);
  }
Paramètres :
  • token_id: string – ID du jeton.
Exemple de valeur renvoyée :
[
           {
               "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": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~81d7c4ac",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-25T13:16:55.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_name": null,
               "quantity": 200
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~1e19",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-13T06:12:41.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
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~1f74",
               "holding_status": "REJECT_BURN",
               "last_updated_time": "2025-08-12T21:09:53.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "",
               "to_org_id": null,
               "token_name": null,
               "quantity": 1000
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~d67c",
               "holding_status": "REJECT_BURN",
               "last_updated_time": "2025-08-12T21:09:47.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "",
               "to_org_id": null,
               "token_name": null,
               "quantity": 2000
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~911b",
               "holding_status": "APPROVE_BURN",
               "last_updated_time": "2025-08-12T21:09:40.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": 1000
           },
           {
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~ed815e20",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-12T21:09:25.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
               "to_org_id": "org2",
               "token_name": null,
               "quantity": 10000
           },
           {
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~12d87129",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-12T21:09:17.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_name": null,
               "quantity": 10000
           },
           {
               "from_account_id": "",
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~54a4",
               "holding_status": "REJECT_MINT",
               "last_updated_time": "2025-08-12T21:01:27.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": 40000
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~9b27",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:16.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": 30000
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~eda0",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:05.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": 20000
           },
           {
               "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
Cette méthode extrait toutes les transactions de sortie en attente (transfert) auxquelles l'appelant est affecté en tant qu'approbateur, y compris les détails de l'organisation et les codes d'utilisateur des comptes concernés (expéditeur, destinataire et notaire). Cette méthode ne peut être appelée que par Token Admin ou Token Auditor du code de chaîne, un Org Admin ou Org Auditor de l'organisation spécifiée ou le 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);
  }
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour obtenir les transferts en attente.
Exemple de valeur renvoyée :
[
           {
               "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
Cette méthode extrait toutes les demandes en attente d'un type spécifié où l'appelant est affecté en tant qu'approbateur. Cette méthode ne peut être appelée que par Token Admin ou Token Auditor du code de chaîne, un Org Admin ou Org Auditor de l'organisation spécifiée ou le 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);
  }
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour obtenir les demandes en attente.
  • request_type: string – Type de transaction. Par exemple, mint ou burn.
Exemple de valeur renvoyée :
[
           {
               "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
Cette méthode extrait le solde total de l'organisation de l'appelant. Il peut être appelé par Token Admin, Token Auditor, Org Admin, Org Auditor ou tout responsable de compte.
@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();
  }
Exemple de valeur renvoyée :
{
           "totalBalance": 50500
       }
getTransactionWithBlockNumber
Cette méthode retourne les détails de la transaction pour l'ID transaction spécifié. Cette méthode ne peut être appelée que par Token Admin, Token Auditor, Org Admin, Org Auditor ou tout participant à la transaction.
@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);
  }
Paramètres :
  • token_id: string – ID du jeton.
  • transaction_id: string – ID de la transaction.
Exemple de valeur renvoyée :
[
          {
              "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
Cette méthode retourne tous les comptes actifs associés à l'ID jeton spécifié.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAllActiveAccounts(orgId: string, tokenId: string) {
    return this.Ctx.CBDCToken.getAllActiveAccounts(orgId, tokenId);
  }
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour l'obtention des comptes actifs.
Retourne :
  • En cas de succès, un message qui inclut les détails de l'utilisateur. La sortie varie en fonction du rôle de l'utilisateur, comme illustré dans les exemples suivants.
Exemple de valeur de retour (Administrateur de jeton, Vérificateur de jeton, Administrateur d'organisation, Vérificateur d'organisation) :
[
           {
               "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~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ISSUERS"
                   ],
                   "max_daily_amount": "100000",
                   "max_daily_transactions": "10000"
               },
               "non_account_role_name": []
           },
           {
               "key": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "role_name": "burner",
               "valueJson": {
                   "account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_RETIRERS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": []
           }
       ]
Exemple de valeur de retour (tous les autres utilisateurs) :
[
            {
                "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"
                    ]
                }
            },
            {
                "key": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ISSUERS"
                    ]
                }
            },
            {
                "key": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                "role_name": "burner",
                "valueJson": {
                    "account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_RETIRERS"
                    ]
                }
            }
        ]
getAllSuspendedAccounts
Cette méthode retourne tous les comptes suspendus associés à l'ID jeton spécifié.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAllSuspendedAccounts(orgId: string, tokenId: string) {
    return this.Ctx.CBDCToken.getAllSuspendedAccounts(orgId, tokenId);
  }
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour l'obtention des comptes suspendus.
Retourne :
  • En cas de succès, un message qui inclut les détails de l'utilisateur. La sortie varie en fonction du rôle de l'utilisateur, comme illustré dans les exemples suivants.
Exemple de valeur de retour (Administrateur de jeton, Vérificateur de jeton, Administrateur d'organisation, Vérificateur d'organisation) :
[
           {
               "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"
               ]
           }
       ]
Exemple de valeur de retour (tous les autres utilisateurs) :
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            }
        ]

TypeScript Méthodes SDK pour CBDC de gros confidentiel

Le code de chaîne CBDC de gros confidentiel inclut toutes les méthodes SDK disponibles dans le code de chaîne NFT générique Token Taxonomy Framework. Les méthodes de trousse SDK supplémentaires suivantes, propres au scénario CBDC de gros confidentiel, sont disponibles.

createAccount
Cette méthode crée un compte pour un utilisateur et un jeton spécifiés. Chaque utilisateur qui a des jetons à tout moment doit avoir un compte.
Ctx.Account.createAccount(org_id: string, user_id: string, token_type: string, application_groups: string[], dailyLimits);
Paramètres :
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'utilisateur dans l'organisation courante. L'ID doit commencer par un caractère alphanumérique et peut inclure des lettres, des chiffres et des caractères spéciaux tels que des traits de soulignement (_), des points (.), des signes at (@) et des tirets (-).
  • user_id: string – Nom d'utilisateur ou ID courriel de l'utilisateur. L'ID doit commencer par un caractère alphanumérique et peut inclure des lettres, des chiffres et des caractères spéciaux tels que des traits de soulignement (_), des points (.), des signes at (@) et des tirets (-).
  • token_type: string – Type du jeton, qui doit être fungible.
  • application_groups: string[] – Liste des groupes d'applications auxquels appartient l'ID compte, qui définissent les associations de l'utilisateur dans l'application CBDC.
  • daily_limits: DailyLimits – Objet JSON du type suivant.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    Dans l'exemple, la valeur max_daily_amount est le nombre maximal de jetons pouvant être traités quotidiennement et la valeur max_daily_transactions est le nombre maximal de transactions pouvant être effectuées quotidiennement.
Exemple de valeur renvoyée :
{
    "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
Cette méthode définit le paramètre application_groups dans les détails du compte pour les groupes d'applications spécifiés dans l'API.
Ctx.Account.setApplicationGroups (account_id: string, application_groups: string[])
Paramètres :
  • account_id: string – ID unique du compte de jeton.
  • application_groups: string[] – Liste des groupes d'applications auxquels appartient l'ID compte, qui définissent les associations de l'utilisateur dans l'application CBDC.
Exemple de valeur renvoyée :
{
          "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
Cette méthode retourne la quantité totale de jetons brûlés pour une organisation spécifiée.
Ctx.CBDCToken.getBurnQuantity(token_id: string);
Paramètres :
  • token_id: string – ID du jeton.
Exemple de valeur renvoyée :
{
           "burnt_quantity": 1200
       }
getActionHistory
Cette méthode extrait l'historique des approbations ou des rejets effectués par l'appelant pour les opérations de menthe, de brûlure et de transfert (émission), y compris les détails de l'organisation et les ID utilisateur des comptes concernés (expéditeur, destinataire et notaire).
Ctx.CBDCToken.getActionHistory(token_id: string);
Paramètres :
  • token_id: string – ID du jeton.
Exemple de valeur renvoyée :
[
           {
               "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": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~81d7c4ac",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-25T13:16:55.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_name": null,
               "quantity": 200
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~1e19",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-13T06:12:41.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
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~1f74",
               "holding_status": "REJECT_BURN",
               "last_updated_time": "2025-08-12T21:09:53.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "",
               "to_org_id": null,
               "token_name": null,
               "quantity": 1000
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~d67c",
               "holding_status": "REJECT_BURN",
               "last_updated_time": "2025-08-12T21:09:47.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "",
               "to_org_id": null,
               "token_name": null,
               "quantity": 2000
           },
           {
               "from_account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~911b",
               "holding_status": "APPROVE_BURN",
               "last_updated_time": "2025-08-12T21:09:40.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": 1000
           },
           {
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~ed815e20",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-12T21:09:25.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
               "to_org_id": "org2",
               "token_name": null,
               "quantity": 10000
           },
           {
               "from_account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "from_org_id": "CentralBank",
               "holding_id": "ohold~cbdc~USD~12d87129",
               "holding_status": "EXECUTEHOLD",
               "last_updated_time": "2025-08-12T21:09:17.000Z",
               "notary_account_id": "oaccount~9b136ef4a60230846a8c14761683851a386d306b79493bc4d00433020c96cfa7",
               "notary_org_id": "CentralBank",
               "operation_id": null,
               "timetoexpiration": null,
               "to_account_id": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
               "to_org_id": "Org1",
               "token_name": null,
               "quantity": 10000
           },
           {
               "from_account_id": "",
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~54a4",
               "holding_status": "REJECT_MINT",
               "last_updated_time": "2025-08-12T21:01:27.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": 40000
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~9b27",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:16.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": 30000
           },
           {
               "from_account_id": null,
               "from_org_id": null,
               "holding_id": "ohold~cbdc~USD~eda0",
               "holding_status": "APPROVE_MINT",
               "last_updated_time": "2025-08-12T21:01:05.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": 20000
           },
           {
               "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
Cette méthode extrait toutes les transactions de sortie en attente (transfert) auxquelles l'appelant est affecté en tant qu'approbateur, y compris les détails de l'organisation et les codes d'utilisateur des comptes concernés (expéditeur, destinataire et notaire).
Ctx.CBDCToken.getPendingIssuance(token_id: string, org_id: string);
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour obtenir les transferts en attente.
Exemple de valeur renvoyée :
[
           {
               "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
Cette méthode extrait toutes les demandes en attente d'un type spécifié où l'appelant est affecté en tant qu'approbateur.
Ctx.CBDCToken.getPendingRequest(token_id: string, request_type: string, org_id: string)
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour obtenir les demandes en attente.
  • request_type: string – Type de transaction. Par exemple, mint ou burn.
Exemple de valeur renvoyée :
[
           {
               "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
Cette méthode extrait le solde total de l'organisation de l'appelant.
Ctx.CBDCToken.getTotalBalanceByCallerOrgId();
Exemple de valeur renvoyée :
{
           "totalBalance": 50500
       }
getTransactionWithBlockNumber
Cette méthode retourne les détails de la transaction pour l'ID transaction spécifié.
Ctx.CBDCToken.getTransactionWithBlockNumber(token_id: string, transaction_id: string);
Paramètres :
  • token_id: string – ID du jeton.
  • transaction_id: string – ID de la transaction.
Exemple de valeur renvoyée :
[
          {
              "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
Cette méthode retourne tous les comptes actifs associés à l'ID jeton spécifié.
Ctx.CBDCToken.getAllActiveAccounts(orgId: string, tokenId: string);
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour l'obtention des comptes actifs.
Retourne :
  • En cas de succès, un message qui inclut les détails de l'utilisateur. La sortie varie en fonction du rôle de l'utilisateur, comme illustré dans les exemples suivants.
Exemple de valeur de retour (Administrateur de jeton, Vérificateur de jeton, Administrateur d'organisation, Vérificateur d'organisation) :
[
           {
               "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~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
               "role_name": null,
               "valueJson": {
                   "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_ISSUERS"
                   ],
                   "max_daily_amount": "100000",
                   "max_daily_transactions": "10000"
               },
               "non_account_role_name": []
           },
           {
               "key": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
               "role_name": "burner",
               "valueJson": {
                   "account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                   "org_id": "CentralBank",
                   "token_id": "USD",
                   "application_groups": [
                       "SYSTEM_RETIRERS"
                   ],
                   "max_daily_amount": "10000",
                   "max_daily_transactions": "1000"
               },
               "non_account_role_name": []
           }
       ]
Exemple de valeur de retour (tous les autres utilisateurs) :
[
            {
                "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"
                    ]
                }
            },
            {
                "key": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ISSUERS"
                    ]
                }
            },
            {
                "key": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                "role_name": "burner",
                "valueJson": {
                    "account_id": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_RETIRERS"
                    ]
                }
            }
        ]
getAllSuspendedAccounts
Cette méthode retourne tous les comptes suspendus associés à l'ID jeton spécifié.
Ctx.CBDCToken.getAllSuspendedAccounts(orgId: string, tokenId: string);
Paramètres :
  • token_id: string – ID du jeton.
  • org_id: string – ID fournisseur de services d'adhésion (MSP) de l'organisation pour l'obtention des comptes suspendus.
Retourne :
  • En cas de succès, un message qui inclut les détails de l'utilisateur. La sortie varie en fonction du rôle de l'utilisateur, comme illustré dans les exemples suivants.
Exemple de valeur de retour (Administrateur de jeton, Vérificateur de jeton, Administrateur d'organisation, Vérificateur d'organisation) :
[
           {
               "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"
               ]
           }
       ]
Exemple de valeur de retour (tous les autres utilisateurs) :
[
            {
                "key": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                "role_name": null,
                "valueJson": {
                    "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
                    "org_id": "CentralBank",
                    "token_id": "USD",
                    "application_groups": [
                        "SYSTEM_ADMINS"
                    ]
                }
            }
        ]