Modello pagamenti riservati

La versione avanzata di Blockchain App Builder include un attributo modello che genera metodi aggiuntivi per la modalità riservata.

Se si include il parametro confidential: true nel file di specifica per i token che utilizzano lo standard Token Taxonomy Framework esteso, Blockchain App Builder genera un codice concatenato da utilizzare in modalità riservata, incluse le seguenti versioni modificate dei metodi SDK e generati automaticamente standard (solo TypeScript).

Per ulteriori informazioni sui pagamenti riservati e sullo scenario CBDC (Commercio all'ingrosso valuta digitale banca centrale) riservato, vedere Valuta digitale banca centrale all'ingrosso con pagamento riservato.

Metodi TypeScript modificati per codice concatenato riservato

Se si include il parametro confidential: true nel file di specifica per i token che utilizzano lo standard Token Taxonomy Framework esteso, Blockchain App Builder genera versioni modificate dei metodi generati automaticamente standard e metodi aggiuntivi.

isTokenAdmin
Questo metodo restituisce il valore booleano true se il chiamante della funzione è Token Admin, altrimenti restituisce false. Un Token Admin, Token Auditor, qualsiasi Org Admin o qualsiasi Org Auditor può chiamare questa funzione su qualsiasi altro utente della rete blockchain. Altri utenti possono chiamare questo metodo solo sui propri account.
@GetMethod()
 @Validator(yup.string(), yup.string())
 public async isTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.isUserTokenAdmin", "TOKEN", { org_id });
    return await this.Ctx.Auth.isUserTokenAdmin(org_id, user_id);
 }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • Il metodo restituisce true se il chiamante è Token Admin, altrimenti restituisce false.
addTokenAdmin
Questo metodo aggiunge un utente come Token Admin del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
@Validator(yup.string(), yup.string())
  public async addTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addTokenAdmin", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_TOKEN_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.addTokenAdmin(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente aggiunto come Token Admin del codice concatenato.
Esempio di valore restituito:
{
  "msg": "Successfully added Token Admin (Org_Id: CentralBank, User_Id: cb1)"
}
removeTokenAdmin
Questo metodo rimuove un utente come Token Admin del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
@Validator(yup.string(), yup.string())
  public async removeTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeTokenAdmin", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_TOKEN_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.removeTokenAdmin(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente rimosso come Token Admin del codice concatenato.
Esempio di valore restituito:
{"msg": "Successfully removed Admin (Org_Id: Org1MSP, User_Id: User1)"}
addOrgAdmin
Questo metodo aggiunge un utente come Org Admin dell'organizzazione. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
@Validator(yup.string(), yup.string())
  public async addOrgAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addOrgAdmin", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ORG_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.addOrgAdmin(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente aggiunto come Org Admin dell'organizzazione.
Esempio di valore restituito:
{
    "msg": "Successfully added Org Admin (Org_Id: Org1MSP, User_Id: orgAdmin)"
}
removeOrgAdmin
Questo metodo rimuove un utente come Org Admin dell'organizzazione. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata.
@Validator(yup.string(), yup.string())
  public async removeOrgAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeOrgAdmin", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ORG_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.removeOrgAdmin(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente rimosso come Org Admin dell'organizzazione.
Esempio di valore restituito:
{
  "msg": "Successfully removed Org Admin (Org_Id Org1MSP User_Id orgAdmin)"
}
addTokenAuditor
Questo metodo aggiunge un utente come Token Auditor del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
@Validator(yup.string(), yup.string())
  public async addTokenAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addTokenAuditor", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_TOKEN_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.addTokenAuditor(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
  "msg": "Successfully added Token Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
}
removeTokenAuditor
Questo metodo rimuove un utente come Token Auditor del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
@Validator(yup.string(), yup.string())
  public async removeTokenAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeTokenAuditor", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_TOKEN_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.removeTokenAuditor(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
           "msg": "Successfully removed Token Auditor (Org_Id: CB, User_Id: cb)"
       }
addOrgAuditor
Questo metodo aggiunge un utente come Org Auditor del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin o Org Admin del codice concatenato. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
@Validator(yup.string(), yup.string())
  public async addOrgAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addOrgAuditor", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ORG_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.addOrgAuditor(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente aggiunto come Org Auditor del codice concatenato.
Esempio di valore restituito:
{
           "msg": "Successfully added Org Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
       }
removeOrgAuditor
Questo metodo rimuove un utente come Org Auditor del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin o Org Admin del codice concatenato.
@Validator(yup.string(), yup.string())
  public async removeOrgAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeOrgAuditor", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ORG_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.removeOrgAuditor(org_id, user_id);
  }
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
           "msg": "Successfully removed Org Auditor (Org_Id: CB, User_Id: cb)"
       }
createAccount
Questo metodo crea un account per un utente e un token specificati. È necessario creare un account per qualsiasi utente che avrà token in qualsiasi momento. I conti tengono traccia dei saldi, dei saldi in sospeso e della cronologia delle transazioni. Un ID account è costituito dalla concatenazione del tipo di asset e dell'ID token, quindi dalla creazione di un hash SHA-256 su una concatenazione dell'ID organizzazione e dell'ID utente. Questo metodo può essere chiamato solo da un Token Admin o da un Org Admin dell'organizzazione specificata.
@Validator(yup.string(),yup.string(), yup.string(), yup.object().nullable())
  public async createAccount(org_id: string, user_id: string, token_type: 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, dailyLimits });
    return await this.Ctx.Account.createAccount(org_id, user_id, token_type, dailyLimits);
  }
Parametri:
  • org_id - L'ID MSP (Membership Service Provider) dell'utente per cui creare l'account. L'ID deve iniziare con un carattere alfanumerico e può includere lettere, numeri e caratteri speciali come caratteri di sottolineatura (_), punti (.), simboli at (@) e trattini (-).
  • user_id: il nome utente o l'ID e-mail dell'utente. L'ID deve iniziare con un carattere alfanumerico e può includere lettere, numeri e caratteri speciali come caratteri di sottolineatura (_), punti (.), simboli at (@) e trattini (-).
  • token_type: string: il tipo di token, che deve essere fungible.
  • daily_limits: DailyLimits: oggetto JSON del tipo seguente.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    Nell'esempio, il valore max_daily_amount è la quantità massima di token che è possibile effettuare transazioni giornaliere e il valore max_daily_transactions è il numero massimo di transazioni che è possibile completare quotidianamente.
Esempio di valore restituito:
{
    "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",
}
associateTokenToAccount
Questo metodo associa un token fungibile a un account. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione pertinente.
@Validator(yup.string(), yup.string(), yup.string().optional())
  public async associateTokenToAccount(account_id: string, token_id: string, custom_account_id?: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.associateToken", "TOKEN", { account_id });
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ASSOCIATE_TOKEN_TO_ACCOUNT, { account_id, token_asset }, token_asset);
    return await this.Ctx.Account.associateToken(account_id, token_id, custom_account_id);
  }
Parametri:
  • account_id: string – L'ID dell'account.
  • token_id: string: l'ID del token.
  • custom_account_id: string: per la modalità riservata, l'ID del conto bancario, un identificativo alfanumerico casuale univoco. Per impostazione predefinita, la lunghezza è di 14 caratteri.
Restituisce:
  • Una volta completato, un oggetto JSON dell'account aggiornato. Il parametro bapAccountVersion è definito nell'oggetto account per uso interno.
Esempio di valore restituito:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "USD",
    "token_name": "cbdc",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
getAllAccounts
Questo metodo restituisce un elenco di tutti i conti. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
@GetMethod()
  @Validator()
  public async getAllAccounts() {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllAccounts", "TOKEN");
    return await this.Ctx.Account.getAllAccounts();
  }
Parametri:
  • nessuno
Esempio di valore restituito:
[
    {
        "key": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
        "valueJson": {
            "bapAccountVersion": 3,
            "assetType": "oaccount",
            "account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "028a27c752e9b518d156e61da6589e723b179b6d7351dc34ec92bbb27b783ed1dc",
            "onhold_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "onhold_burn_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "application_groups": [
                "application_groups value"
            ]
        }
    },
    {
        "key": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
        "valueJson": {
            "bapAccountVersion": 0,
            "assetType": "oaccount",
            "account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_burn_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "application_groups": [
                "application_groups value"
            ]
        }
    }
]
getAllOrgAccounts
Questo metodo restituisce un elenco di tutti i conti token appartenenti a un'organizzazione specificata. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string())
  public async getAllOrgAccounts(org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllOrgAccounts", "TOKEN", { org_id });
    return await this.Ctx.Account.getAllOrgAccounts(org_id);
  }
Parametri:
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Restituisce:
  • In caso di operazione riuscita, un elenco di tutti gli account per l'organizzazione specificata.
Esempio di valore restituito:
[
    {
        "key": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "valueJson": {
            "bapAccountVersion": 2,
            "assetType": "oaccount",
            "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "18",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb",
            "custom_account_id": "1234567jh"
        }
    },
    {
        "key": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
        "valueJson": {
            "bapAccountVersion": 1,
            "assetType": "oaccount",
            "account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "22",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb1",
            "custom_account_id": "1234567jh"
        }
    }
]
getAccountsByUser
Questo metodo restituisce un elenco di tutti gli ID account per un ID organizzazione e un ID utente specificati. Questo metodo può essere chiamato solo da Token Admin o Token Auditor, da Org Admin o Org Auditor dell'organizzazione specificata, o da Account Owner specificato nei parametri.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountsByUser(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountsByUser", "TOKEN", { org_id, user_id });
    return await this.Ctx.Account.getAccountsByUser(org_id, user_id);
  }
Parametri:
  • org_id string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • Una volta completato, un array JSON di ID account.
Esempio di valore restituito:
[
    {
        "bapAccountVersion": 2,
        "assetType": "oaccount",
        "user_id": "cb",
        "custom_account_id": "1234567jh",
        "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "token",
        "token_name": "cbdc",
        "balance": "18",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "application_groups value"
        ]
    }
]
getUserByAccountId
Questo metodo restituisce i dettagli utente (org_id e user_id) per un account specificato. Questo metodo può essere chiamato da un Token Admin o Token Auditor, o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string())
  public async getUserByAccountId(account_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getUserByAccountId", "TOKEN", { account_id });
    return await this.Ctx.Account.getUserByAccountId(account_id);
  }
Parametri:
  • account_id: string – L'ID dell'account.
Restituisce:
  • In caso di operazione riuscita, un oggetto JSON dei dettagli utente (org_id, token_id e user_id).
Esempio di valore restituito:
{
    "token_id": "USD",
    "org_id": "CentralBank",
    "user_id": "cb_admin_demo",
    "custom_account_id": "10101234000123"
}
getAccount
Questo metodo restituisce i dettagli per un conto specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string())
  public async getAccount(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccount", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountWithStatus(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "bapAccountVersion": 2,
    "assetType": "oaccount",
    "user_id": "cb",
    "custom_account_id": "1234567jh",
    "status": "active",
    "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "token",
    "token_name": "cbdc",
    "balance": "18",
    "onhold_balance": "0",
    "onhold_burn_balance": "0",
    "application_groups": [
        "application_groups value"
    ]
}
getAccountDetailsByCustomAccountId
Questo metodo restituisce i dettagli per un ID account personalizzato specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountDetailsByCustomAccountId(custom_account_id: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountDetailsByCustomAccountId", "TOKEN", { org_id });
    return await this.Ctx.Account.getAccountDetailsByCustomAccountId(custom_account_id, org_id);
  }
Parametri:
  • custom_account_id: string: l'ID del conto bancario del conto, un identificativo alfanumerico casuale univoco.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
[
    {
        "bapAccountVersion": 0,
        "assetType": "oaccount",
        "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "USD",
        "token_name": "cbdc",
        "balance": "0",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "SYSTEM_ADMINS"
        ],
        "user_id": "cb_admin_demo",
        "custom_account_id": "10101234000123"
    }
]
getAccountTransactionHistory
Questo metodo restituisce un array di dettagli della cronologia delle transazioni conto per un conto specificato. Questo metodo può essere chiamato solo da Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string())
  public async getAccountTransactionHistory(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistory", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTransactionHistory(account_id, account.org_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~4514aa229ebcc4d2fedcaa47c4301615e30c4a9bae45cf0256a5b80d75b3697a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-25T13:20:50.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 21000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1982f73495060e0eef4d78282a91c41e27e8c95572739b0677a1e404a0d20aa9",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:12:43.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~fedd714cf1509f7517819d7cd4c0921d0b2f5d1ff6a25dcb08ab411defd6b5f3",
        "transacted_amount": 2000,
        "timestamp": "2025-08-21T05:23:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f33b47234f3ee0b636962c8c31c01d06523b789ca16b3b342d5080b71268bcc3",
        "transacted_amount": 1000,
        "timestamp": "2025-08-21T05:23:07.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~cf934527149bc24f62a8ddeeea7f74a19a0f84d8f161535a771be49d2520d5b3",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f5c0e11ca61d9adc843658929e6de2a738ad586304f9e020f75bf4aac5e42a2c",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:04.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "category": "transfer",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transaction_type": "DEBIT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8a74c6d87ca74a613aab9db5d40386f8d5b534f9800503af8ca27e8946d7616d",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:01:27.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REJECT_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~28ac66ba33f7ad0648448964b2b74525c9e3f0c9908c7a0484690b9baa56c2db",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:01:16.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~7e32ad8f365ff59814e112f27602f30ab599fb9c1638784496c66a61a6277c22",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T21:01:05.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 30000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1477050bb9e55f4f471872b31fce0d2097f5d5e57d89a842070df5e36d7ab0da",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:01:03.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~0e76c6931b7ee134e967e847d9730b867a0fd191d39697d83d36dd15745c02e3",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:00:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~07bbf9c190694371626da59ded5d87434d26f612891e13bb15bdd28f6086e760",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:00:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8721175c6cbbce17b6c4bb6a444e475d07f52352dfd0d990679f342215153513",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T20:59:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~dc24c24d43a6525e807a39edcf8c6a2b6ccb81f0d755958f509509687eacee84",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T20:59:13.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~396e6ca5a11a9609632d0864026409d46a708fb95e3e21b39fa5f3fb78f90872",
        "transacted_amount": 0,
        "timestamp": "2025-08-12T20:43:20.000Z",
        "token_id": "",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "CREATE_ACCOUNT",
        "balance": 0,
        "onhold_balance": 0
    }
]
getAccountTransactionHistoryWithFilters
Questo metodo restituisce un array filtrato di dettagli della cronologia delle transazioni account per un utente e un token specificati. Questo metodo può essere chiamato solo da Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account. Questo metodo può essere chiamato solo quando si è connessi a una rete remota di Oracle Blockchain Platform.
@GetMethod()
  @Validator(yup.string(), yup.object().nullable())
  public async getAccountTransactionHistoryWithFilters(account_id: string, filters?: Filters) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistoryWithFilters", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTransactionHistoryWithFilters(account_id, account.org_id, filters);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
           {
               "transaction_id": "otransaction~ccc2c2e89ab7887af4fdad3dc9918ea057a8aa834a0ed8d0f23271049f084952",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:22:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 18,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
               "transacted_amount": 22,
               "timestamp": "2025-08-20T23:21:45.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "to_org_id": "Org1",
               "to_user_id": "cb1",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "transaction_type": "DEBIT",
               "balance": 8,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb1",
               "transacted_custom_account_id": "1234567jh"
           },
           {
               "transaction_id": "otransaction~3212811cd7c0ff265434f5921b93621cc5b0e0450b07c52b42ad9d8ce73cf063",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:18:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 30,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~af2a1b0d56778e4ff5f4dda4e81bbcbf02c0592416ee2f105ff0b764e515fd0a",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:17:29.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 20,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6c0452a58f13db93f1c308d60eab1fde6c911921b350c0bbbe0ce7dab394721d",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:04:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 10,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~df98e24a3b90661b54b54289b600b13a1051c922db0a4d20e3705a9820ae9c20",
               "transacted_amount": 0,
               "timestamp": "2025-08-20T22:55:09.000Z",
               "category": "",
               "description": "",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "transaction_type": "CREATE_ACCOUNT",
               "balance": 0,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb",
               "transacted_custom_account_id": "1234567jh"
           }
       ]
getAccountTransactionHistoryWithFiltersFromRichHistDB
Questo metodo recupera la cronologia delle transazioni dal database della cronologia avanzata. Questo metodo può essere chiamato solo da Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string(), yup.object().nullable())
  public async getAccountTransactionHistoryWithFiltersFromRichHistDB(account_id: string, custom_endpoint: string, bearer_token: string, filters?: Filters) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistoryWithFiltersFromRichHistDB", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTrxHistoryWithFiltersFromRichHistDB(account_id, account.org_id, custom_endpoint, bearer_token, filters);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account.
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 300
    },
    {
        "transaction_id": "otransaction~2b75b3e8531a651f07c2d048d8546ad70ac49c66f0b82ed7626c1739090842ce",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:16:06.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~e26f11da",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 500
    },
    {
        "transaction_id": "otransaction~9e7bf14cf96c5f90170da9455b1318687785e936192f60b7cbeb1c8bfabc41d2",
        "transacted_amount": 100,
        "timestamp": "2025-08-21T06:57:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26900,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~b3901b4754920a9c75e36069dc55024ad505e4c127f334eedf65ef6703dc6b86",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873",
        "category": "issuance",
        "balance": 26800,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~d55c9dfc9feacb353544b5d8b2ae694162ade3890bcaaf715503fd1d6a73cd1a",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~81d7c4ac",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 200
    },
    {
        "transaction_id": "otransaction~751eaedbe4311edd5d17cae53d283caf397d0cb09f18d57a5e3fe61266875ff9",
        "transacted_amount": 200,
        "timestamp": "2025-08-13T09:59:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "from_org_id": "org2",
        "from_user_id": "fi2_org_officer_demo",
        "from_custom_account_id": "30300617202404",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27200,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~70155a8f4e388cc9395dbd03bedaf5a878705f5ad02302c8e9163218a5c3875a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-13T06:22:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~e595f3f0cc03fa5f58a546b8abbfaf155592e492f850581db2b8fed9a529c9e2",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~da92402859d87ae3069722d8e39cb0da448e9a5f67468233ee9b1fe7a4ebeef8",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:17.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~6915145aaf09fbf4d96456febddc2aa87b48c08ddd8ff17a6bab5d310f67bb36",
        "transacted_amount": 1000,
        "timestamp": "2025-08-12T21:07:11.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~244d7172d1dc90a142e1f22204c76614c7eea814b3d61f33016b786f1b347784",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:39.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~ed815e20",
        "category": "issuance",
        "balance": 25000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~c63ec37966264493bde6fa666527b9cca11695c15611c32e89af49a2246f13f6",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~12d87129",
        "category": "issuance",
        "balance": 35000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~5112f576c94c2d23c342479bfa37e34612414b3258a64b43cf51b920f4ff5868",
        "transacted_amount": 5000,
        "timestamp": "2025-08-12T21:05:02.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_retirer_demo",
        "to_custom_account_id": "10109999006543",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "DEBIT",
        "category": "burn",
        "balance": 45000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 50000,
        "onhold_balance": 0
    }
]
getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB
Questo metodo recupera la cronologia delle transazioni dal database della cronologia avanzata per l'organizzazione specificata. Questo metodo può essere chiamato solo da Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string(), yup.object().nullable())
  public async getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB(org_id: string, custom_endpoint: string, bearer_token: string, filters?: Filters) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB", "TOKEN", { org_id });
    return await this.Ctx.Account.getOrgAccountsTrxHistoryWithFiltersFromRichHistDB(org_id, custom_endpoint, bearer_token, filters);
  }
Parametri:
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "CREDIT",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~32137cd7e16c560f4d96d0f8999f6a267c1e95be2f5b11ef0541e574a6cd7275",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "transaction_type": "CREDIT",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~67844e07c06ab4c3d94d8ff36173b9dbcc2f1b9c99f4e7070f1097fd89f3f514",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:49:40.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~b6e4925b",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~b7c97d737fb978651c9132276ab677c0bcf795b9db13d0d39cba5243615c7389",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:46:09.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user1_demo",
        "to_custom_account_id": "20200198765432",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~4fbbb846",
        "category": "transfer"
    }
]
getAllAccountsTransactionHistoryWithFiltersFromRichHistDB
Questo metodo recupera la cronologia delle transazioni dal database della cronologia avanzata per tutte le organizzazioni. Questo metodo può essere chiamato solo da Token Admin o Token Auditor.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.object().nullable())
  public async getAllAccountsTransactionHistoryWithFiltersFromRichHistDB(custom_endpoint: string, bearer_token: string, filters?: Filters) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllAccountsTransactionHistoryWithFiltersFromRichHistDB", "TOKEN");
    return await this.Ctx.Account.getAllAccountsTrxHistoryWithFiltersFromRichHistDB(custom_endpoint, bearer_token, filters);
  }
Parametri:
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "DEBIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~c628fb7738222ed969295ccc8d21b4be95d96e3aada4f14570f7820a7051b5f7",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:51:18.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "RELEASEHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873"
    },
    {
        "transaction_id": "otransaction~af2cc8e43ecb4c5520d90a8d7955b5a47623a29b13eef47e31c16eb48cc0adec",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:50:45.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "REJECT_BURN",
        "holding_id": "ohold~cbdc~USD~8d34",
        "description": "Burn",
        "to_account": ""
    },
    {
        "transaction_id": "otransaction~182b99bb2ed753994a8c638ab9b08c3a4e73ac8159a3173a2a1f56b651d2eeac",
        "transacted_amount": 2000,
        "timestamp": "2025-08-25T13:50:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "to_org_id": "CentralBank",
        "to_user_id": "cb__creator_demo",
        "to_custom_account_id": "10105678004567",
        "transaction_type": "REJECT_MINT",
        "holding_id": "ohold~cbdc~USD~89ce",
        "description": "Minting 2000 tokens",
        "from_account": ""
    },
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    }
]
getAccountBalance
Questo metodo restituisce il saldo corrente per un conto specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string())
  public async getAccountBalance(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountBalance", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountBalance(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • Una volta completato, una rappresentazione JSON del saldo del conto corrente.
Esempio di valore restituito:
{
    "msg": "Current Balance is: 100",
    "user_balance": 100
}
deleteHistoricalTransactions
Questo metodo elimina le transazioni meno recenti dal database di stato. Questo metodo può essere chiamato solo da un Token Admin.
@Validator(yup.date())
  public async deleteHistoricalTransactions(time_to_expiration: Date) {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.deleteTransactions", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.DELETE_HISTORICAL_TRANSACTIONS, { time_to_expiration });
    return await this.Ctx.Transaction.deleteTransactions(time_to_expiration);
  }
Parametri:
  • time_to_expiration Date: indicatore orario che indica quando eliminare le transazioni. I cespiti transazione precedenti all'ora specificata verranno eliminati.
Esempio di valore restituito:
{
    "msg": "Successfully deleted transaction older than date: Thu Aug 19 2025 11:19:36 GMT+0000 (Coordinated Universal Time).",
    "transactions": [
           "otransaction~ec3366dd48b4ce2838f820f2f138648e6e55a07226713e59b411ff31b0d21058"
     ]
}
getTransactionById
Questo metodo restituisce la cronologia di un asset Transaction. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, da un Org Admin o Org Auditor dell'organizzazione specificata, o da un partecipante alla transazione (mittente, destinatario o notaio).
@GetMethod()
  @Validator(yup.string())
  public async getTransactionById(transaction_id: string) {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.getTransactionById", "TOKEN", { transaction_id });
    return await this.Ctx.Transaction.getTransactionById(transaction_id);
  }
Parametri:
  • transaction_id string: l'ID dell'asset transazione.
Restituisce:
  • Una volta completata la transazione, un array JSON della cronologia.
Esempio di valore restituito:
{
    "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
    "history": [
        {
            "trxId": "6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
            "timeStamp": "2025-08-20T23:21:45.000Z",
            "value": {
                "assetType": "otransaction",
                "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
                "token_id": "token",
                "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
                "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
                "transaction_type": "TRANSFER",
                "amount": 22,
                "timestamp": "2025-08-20T23:21:45.000Z",
                "number_of_sub_transactions": 0,
                "holding_id": "",
                "sub_transaction": "false",
                "category": "category value",
                "description": "description value"
            }
        }
    ],
    "sub_transactions": []
}
getAccountStatus
Questo metodo ottiene lo stato corrente dell'account token. Questo metodo può essere chiamato dal Token Admin del codice concatenato, un Org Admin dell'organizzazione specificata, o dal proprietario dell'account token.
@GetMethod()
  @Validator(yup.string())
  public async getAccountStatus(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.get", "TOKEN", { account_id });
    try {
      return await this.Ctx.AccountStatus.getAccountStatus(account_id);
    } catch (err) {
      return await this.Ctx.AccountStatus.getDefaultAccountStatus(account_id);
    }
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dello stato dell'account token.
Esempio di valore restituito:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "active"
}
getAccountStatusHistory
Questo metodo recupera la cronologia dello stato dell'account. Questo metodo può essere chiamato dal Token Admin del codice concatenato, un Org Admin dell'organizzazione specificata, o dal proprietario dell'account token.
@GetMethod()
  @Validator(yup.string())
  public async getAccountStatusHistory(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.history", "TOKEN", { account_id });
    const status_id = await this.Ctx.AccountStatus.generateAccountStatusId(account_id);
    let account_status_history: any;
    try {
      account_status_history = await this.Ctx.AccountStatus.history(status_id);
    } catch (err) {
      return [];
    }
    return account_status_history;
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli della cronologia dello stato dell'account.
Esempio di valore restituito:
[
  {
    "trxId": "d5c6d6f601257ba9b6edaf5b7660f00adc13c37d5321b8f7d3a35afab2e93e63",
    "timeStamp": "2025-12-02T10:39:14.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "suspended"
    }
  },
  {
    "trxId": "e6c850cfa084dc20ad95fb2bb8165eef3a3bd62a0ac867cccee57c2003125183",
    "timeStamp": "2025-12-02T10:37:50.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "active"
    }
  }
]
activateAccount
Questo metodo attiva un account token. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata. Impossibile attivare gli account eliminati.
@Validator(yup.string())
  public async activateAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.activateAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ACTIVATE_ACCOUNT, { account_id }, token_asset);
    return await this.Ctx.Account.activateAccount(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dell'oggetto di stato dell'account per l'account token specificato.
Esempio di valore restituito:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "active"
}
suspendAccount
Questo metodo sospende un account token. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata. Dopo la sospensione di un account, non è possibile completare alcuna operazione di aggiornamento dell'account. Impossibile sospendere un account eliminato.
@Validator(yup.string())
  public async suspendAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.suspendAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SUSPEND_ACCOUNT, { account }, token_asset);
    return await this.Ctx.Account.suspendAccount(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dell'oggetto di stato dell'account per l'account token specificato.
Esempio di valore restituito:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "suspended"
}
deleteAccount
Questo metodo elimina un account token. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata. Dopo l'eliminazione di un account, non è possibile completare alcuna operazione di aggiornamento dell'account. L'account eliminato è in stato finale e non può essere modificato in nessun altro stato. Per eliminare un conto, il saldo del conto e il saldo in sospeso devono essere pari a zero.
@Validator(yup.string())
  public async deleteAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.deleteAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.DELETE_ACCOUNT, { account_id }, token_asset);
    return await this.Ctx.Account.deleteAccount(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dell'oggetto di stato dell'account per l'account token specificato.
Esempio di valore restituito:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "deleted"
}
setMaxDailyAmount
Questo metodo imposta il valore max_daily_amount per un account specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata.
@Validator(yup.string(), yup.string().optional())
  public async setMaxDailyAmount (account_id: string, max_daily_amount?: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.setMaxDailyAmount', 'TOKEN', { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SET_MAX_DAILY_AMOUNT, { account_id, max_daily_amount }, token_asset);
    return this.Ctx.Account.setMaxDailyAmount (account_id, max_daily_amount);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • max_daily_amount?: string – (Facoltativo) La quantità massima di token che l'utente può trasferire quotidianamente. Se non specificato, l'utente può trasferire ogni giorno qualsiasi quantità di token.
Esempio di valore restituito:
{
           "msg": "Successfully set max daily amount for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 1000000"
       }
setMaxDailyTransactionCount
Questo metodo imposta il valore max_daily_transactions per un account specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata.
@Validator(yup.string(), yup.string().optional())
  public async setMaxDailyTransactionCount (account_id: string, max_daily_transactions?: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.setMaxDailyTransactionCount', 'TOKEN', { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SET_MAX_DAILY_TRANSACTION_COUNT, { account_id, max_daily_transactions}, token_asset);
    return this.Ctx.Account.setMaxDailyTransactionCount (account_id, max_daily_transactions);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • max_daily_transactions?: string: (facoltativo) il numero massimo di transazioni che l'utente può completare quotidianamente. Se non specificato, l'utente può completare giornalmente un numero qualsiasi di transazioni.
Esempio di valore restituito:
{
            "msg": "Successfully set max daily transactions for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 100000"
        }
getMaxDailyAmount
Questo metodo ottiene il valore max_daily_amount per un account specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor del codice concatenato o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string())
  public async getMaxDailyAmount (account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.getMaxDailyAmount', 'TOKEN', { account_id });
    return this.Ctx.Account.getMaxDailyAmount (account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "max_daily_amount": "10000"
       }
getMaxDailyTransactionCount
Questo metodo ottiene il valore max_daily_transactions per un account specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor del codice concatenato o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string())
  public async getMaxDailyTransactionCount (account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.getMaxDailyTransactionCount', 'TOKEN', { account_id });
    return this.Ctx.Account.getMaxDailyTransactionCount (account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "max_daily_transactions": "100"
       }
consolidateRunningBalanceInTransactions
Questo metodo calcola i saldi conto in esecuzione e salva i valori aggiornati nelle coppie chiave/valore transazione. In genere, gli amministratori di sistema chiamano questo metodo utilizzando uno scheduler proxy REST. Questo metodo può essere chiamato solo da un Token Admin o Org Admin.
@Validator(yup.string())
  public async consolidateRunningBalanceInTransactions() {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.consolidateRunningBalanceInTransactions", "TOKEN");
    return this.Ctx.Transaction.consolidateRunningBalanceInTransactions(true);
  }
Esempio di valore restituito:
{ msg: "Successfully updated account running balance for pending transactions."}
processSendersAndReceivers
Questo metodo calcola e aggiorna i saldi dei conti token distribuiti nelle coppie chiave/valore mittente e destinatario create durante i trasferimenti tra organizzazioni, quindi elimina le coppie chiave/valore mittente e destinatario, che non sono più utilizzate. In genere, gli amministratori di sistema chiamano questo metodo utilizzando uno scheduler proxy REST. Questo metodo può essere chiamato solo da un Token Admin o Org Admin.
@Validator(yup.string())
  public async processSendersAndReceivers() {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.processSendersAndReceivers", "TOKEN");
    return this.Ctx.Account.processSendersAndReceivers(true);
  }
Esempio di valore restituito:
{ msg: "Successfully updated balance for accounts from pending receivers."}
addRole
Questo metodo aggiunge un ruolo a un utente e a un token specificati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata che detiene anche il ruolo specificato.
@Validator(yup.string(), yup.string())
  public async addRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.addRoleMember", "TOKEN", { token_id: account.token_id, org_id: account.org_id, role });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ROLE, { role, account_id }, token_asset);
    return await this.Ctx.Token.addRoleMember(role, account_id, token_asset);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • role: string: il nome del ruolo da aggiungere all'utente specificato. I comportamenti mintable e burnable corrispondono alle proprietà minter_role_name e burner_role_name del file di specifica. Analogamente, il ruolo notary corrisponde alla proprietà notary_role_name del file di specifica.
Restituisce:
  • In caso di successo, un messaggio con i dettagli dell'account.
Esempio di valore restituito:
{
     "msg": "Successfully added role 'notary' to Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
removeRole
Questo metodo rimuove un ruolo da un utente e da un token specificati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da un Org Admin dell'organizzazione specificata che detiene anche il ruolo specificato.
@Validator(yup.string(), yup.string())
  public async removeRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.removeRoleMember", "TOKEN", { token_id: account.token_id, org_id: account.org_id, role });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ROLE, { role, account_id }, token_asset);
    return await this.Ctx.Token.removeRoleMember(role, account_id, token_asset);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • role: string: il nome del ruolo da rimuovere dall'utente specificato. I comportamenti mintable e burnable corrispondono alle proprietà minter_role_name e burner_role_name del file di specifica. Analogamente, il ruolo notary corrisponde alla proprietà notary_role_name del file di specifica.
Restituisce:
  • In caso di successo, un messaggio con i dettagli dell'account.
Esempio di valore restituito:
{
   "msg": "Successfully removed role 'notary' from Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
getAccountsByRole
Questo metodo restituisce un elenco di tutti gli ID account per un ruolo e un token specificati. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountsByRole(token_id: string, role: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getAccountsByRole", "TOKEN");
    return await this.Ctx.Role.getAccountsByRole(token_id, role);
  }
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
Restituisce:
  • Una volta completato, un array JSON di ID account.
Esempio di valore restituito:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getOrgAccountsByRole
Questo metodo restituisce un elenco di tutti gli ID account per un ruolo, un token e un'organizzazione specificati. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string())
  public async getOrgAccountsByRole(token_id: string, role: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getOrgAccountsByRole", "TOKEN", { org_id });
    return await this.Ctx.Role.getOrgAccountsByRole(token_id, role, org_id);
  }
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Restituisce:
  • Una volta completato, un array JSON di ID account.
Esempio di valore restituito:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getUsersByRole
Questo metodo restituisce un elenco di tutti gli utenti per un ruolo e un token specificati. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getUsersByRole(token_id: string, role: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getUsersByRole", "TOKEN");
    return await this.Ctx.Role.getUsersByRole(token_id, role);
  }
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
          "users": [
              {
                  "token_id": "token",
                  "org_id": "CentralBank"
              }
          ]
      }
getOrgUsersByRole
Questo metodo restituisce un elenco di tutti gli utenti per un ruolo, un token e un'organizzazione specificati. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, o da un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string())
  public async getOrgUsersByRole(token_id: string, role: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getOrgUsersByRole", "TOKEN", { org_id });
    return await this.Ctx.Role.getOrgUsersByRole(token_id, role, org_id);
  }
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
{
           "users": [
               {
                   "token_id": "token",
                   "org_id": "CentralBank",
                   "user_id": "cb1",
                   "custom_account_id": "1234567jh"
               }
           ]
       }
isInRole
Questo metodo restituisce un valore booleano per indicare se un utente dispone di un ruolo specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, il AccountOwner dell'account, o un Org Admin o Org Auditor dell'organizzazione specificata.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async isInRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.isInRole", "TOKEN", { account_id });
    return { result: await this.Ctx.Token.isInRole(role, account_id, token_asset) };
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • role: string: il nome del ruolo da cercare.
Restituisce:
  • In caso di operazione riuscita, una stringa JSON del risultato booleano.
Esempio di valore restituito:
{
           "result": "true"
       }
getTotalMintedTokens
Questo metodo restituisce il numero totale di token coniati per un token specificato. Questo metodo può essere chiamato solo da Token Admin, Token Auditor, Org Admin o Org Auditor.
@GetMethod()
  @Validator(yup.string())
  public async getTotalMintedTokens(token_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.getTotalMintedTokens", "TOKEN");
    const totalMintedTokens = await this.Ctx.Token.getTotalMintedTokens(token_asset);
    return {
      msg: `Total minted token for Token Id: ${token_id} is ${totalMintedTokens} tokens.`,
      quantity: totalMintedTokens,
    };
  }
Parametri:
  • token_id: string: l'ID del token.
Restituisce:
  • In caso di operazione riuscita, una stringa JSON che indica il numero totale di token.
Esempio di valore restituito:
{
    "msg": "Total minted token for Token Id: USD is 910 tokens.",
    "quantity": 910
}
getNetTokens
Questo metodo restituisce il numero netto totale di token disponibili nel sistema per un token specificato. Il totale token netto è la quantità di token rimanenti dopo la masterizzazione dei token. In forma di equazione: token netti = token coniati totali - token bruciati totali. Se non vengono bruciati token, il numero di token netti è uguale al totale dei token coniati. Questo metodo può essere chiamato solo da Token Admin, Token Auditor, Org Admin o Org Auditor.
@GetMethod()
  @Validator(yup.string())
  public async getNetTokens(token_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.getNetTokens", "TOKEN");
    const netTokens = await this.Ctx.Token.getNetTokens(token_asset);
    return {
      msg: `Net supply of token for Token Id: ${token_id} is ${netTokens} tokens.`,
      quantity: netTokens,
    };
  }
Parametri:
  • token_id: string: l'ID del token.
Restituisce:
  • In caso di operazione riuscita, una stringa JSON che indica il numero netto di token.
Esempio di valore restituito:
{
    "msg": "Net supply of token for Token Id: USD is 878 tokens.",
    "quantity": 878
}
requestMint
Questo metodo può essere chiamato da un minter per inviare una richiesta al notaio minore per creare una quantità specificata di token.
@Validator(
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async requestMint(
      operation_id: string,
      notary_account_id: string,
      quantity:number,
      time_to_expiration: Date,
      info_details ?: InfoDetails
  ) {
    const notary_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(notary_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REQUEST_MINT, { operation_id, notary_account_id, quantity, time_to_expiration, info_details }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, null, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.MINT, info_details);
  }
Parametri:
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta mint.
  • notary_account_id: string – L'ID account univoco del notaio minore che elaborerà la richiesta.
  • quantity: number: la quantità di token da mint.
  • time_to_expiration – Il tempo dopo il quale la richiesta di conio scade e non è più valida.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
           "msg": "AccountId oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41 has successfully submitted request to mint 200 tokens"
       }
approveMint
Questo metodo può essere chiamato da un notaio minore per approvare una richiesta di conio.
@Validator(yup.string(), yup.string())
  public async approveMint(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.APPROVE_MINT, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.MINT);
  }
Parametri:
  • token_id: string: l'ID del token da zecca.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta mint.
Esempio di valore restituito:
{
           "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
       }
rejectMint
Questo metodo può essere chiamato da un notaio minore per rifiutare una richiesta di conio.
@Validator(yup.string(), yup.string())
  public async rejectMint(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REJECT_MINT, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.MINT);
  }
Parametri:
  • token_id: string: l'ID del token da zecca.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta mint.
Esempio di valore restituito:
{
           "msg": "Successfully rejected mint request with Operation Id '89ce' to mint 2000 tokens of token id USD"
       }
issueTokens
Questo metodo estrae i token, che sono quindi di proprietà del chiamante del metodo.
@Validator(yup.string(), yup.number().positive(), yup.object().nullable())
  public async issueTokens(token_id: string, quantity: number, info_details?: InfoDetails) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ISSUE_TOKENS, { quantity, token_asset, info_details }, token_asset);
    return await this.Ctx.Token.mint(quantity, token_asset, info_details);
  }
Parametri:
  • token_id: string: l'ID del token.
  • quantity: il numero di token da convertire.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
          "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
      }
transferTokens
Questo metodo trasferisce i token dal chiamante a un account specificato.
@Validator(yup.string(), yup.number(), yup.object().nullable())
  public async transferTokens(to_account_id: string, quantity: number, info_details ?: InfoDetails) {
    if (quantity <= 0) {
      throw new Error("The quantity should be a positive number.")
    }
    const to_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(to_account_id);
    const token_asset = await this.getTokenObject(to_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.TRANSFER_TOKENS, { to_account_id, quantity, info_details }, token_asset);
    let isNotary = await this.Ctx.Token.checkNotary(to_account_id, token_asset);
    if(isNotary) {
      throw new Error(`To Account Id '${to_account_id}' can not have a notary role!`);
    }
    return await this.Ctx.Token.transfer(to_account_id, quantity, token_asset, info_details);
  }
Parametri:
  • to_account_id: string: l'ID conto univoco del destinatario (beneficiario).
  • quantity: number: il numero di token da trasferire.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
          "msg": "Successfully transferred 10000 tokens from account id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41  to account id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
      }
getAccountOnHoldBalance
Questo metodo restituisce il saldo in sospeso corrente per un conto specificato. Questo metodo può essere chiamato solo da un Token Admin o Token Auditor, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string())
  public async getAccountOnHoldBalance(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountOnHoldBalance", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountOnHoldBalance(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON del saldo in sospeso corrente.
Esempio di valore restituito:
{
           "msg": "Total Holding Balance is: 0",
           "holding_balance": 0
       }
getOnHoldDetailsWithOperationId
Questo metodo restituisce i dettagli della transazione in sospeso per un ID operazione e un token specificati. Questo metodo può essere chiamato da un Token Admin o Token Auditor del codice concatenato o da un partecipante alla transazione (mittente, destinatario, notaio).
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getOnHoldDetailsWithOperationId(token_id: string, operation_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldDetailsWithOperationId", "TOKEN", { token_id, operation_id });
    return await this.Ctx.Hold.getOnHoldDetailsWithOperationId(token_id, operation_id);
  }
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
Esempio di valore restituito:
{
          "assetType": "ohold",
          "holding_id": "ohold~cbdc~token~hold1",
          "operation_id": "hold1",
          "token_name": "cbdc",
          "from_org_id": "CentralBank",
          "operation_type": "transfer",
          "status": "approved",
          "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
          "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
          "notary_account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
          "token_id": "token",
          "quantity": "0",
          "time_to_expiration": "2029-01-04T00:00:00.000Z",
          "category": "category value",
          "description": "description value"
      }
getOnHoldIds
Questo metodo restituisce un elenco di tutti gli ID azienda per un conto specificato. Questo metodo può essere chiamato da un Token Admin o Token Auditor del codice concatenato, un Org Admin o Org Auditor dell'organizzazione specificata, o il AccountOwner dell'account.
@GetMethod()
  @Validator(yup.string())
  public async getOnHoldIds(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldIds", "TOKEN", { account_id });
    return await this.Ctx.Account.getOnHoldIds(account_id);
  }
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Restituisce:
  • Una volta completato, un elenco JSON di ID in sospeso.
Esempio di valore restituito:
{
           "msg": "Holding Ids are: ",
           "holding_ids": ["ohold~cbdc~token~hold1"]
       }
getOnHoldBalanceWithOperationId
Questo metodo restituisce il saldo in sospeso per un ID operazione e un token specificati. Questo metodo può essere chiamato da un Token Admin o Token Auditor del codice concatenato o da un partecipante alla transazione (mittente, destinatario, notaio).
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getOnHoldBalanceWithOperationId(token_id: string, operation_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldBalanceWithOperationId", "TOKEN", { token_id, operation_id });
    return await this.Ctx.Hold.getOnHoldBalanceWithOperationId(token_id, operation_id);
  }
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
Restituisce:
  • In caso di operazione riuscita, una stringa JSON che indica il saldo del blocco.
Esempio di valore restituito:
{
           "msg": "Current Holding Balance of Operation 'hold1' for token 'token' is: 0",
           "holding_balance": 0
       }
holdTokens
Questo metodo crea un blocco per conto del chiamante (proprietario dei token) con l'account to_account_id. L'account notaio specificato è responsabile del completamento o del rilascio del blocco. Quando viene creato il blocco, il saldo del token specificato dal responsabile pagamento viene bloccato. Impossibile trasferire un saldo bloccato finché il blocco non viene completato o rilasciato.
@Validator(
    yup.string(),
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async holdTokens(
    operation_id: string,
    to_account_id: string,
    notary_account_id: string,
    quantity: number,
    time_to_expiration: Date,
    info_details ?: InfoDetails,
  ) {
    const to_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(to_account_id);
    await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(to_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.HOLD_TOKENS, {
      operation_id,
      to_account_id,
      notary_account_id,
      quantity,
      time_to_expiration,
      info_details
    }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, to_account_id, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.TRANSFER, info_details);
  }
Parametri:
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
  • to_account_id: string: l'ID conto univoco del ricevente.
  • notary_account_id: string: l'ID conto univoco del notaio.
  • quantity: number: il numero di token da mettere in attesa.
  • time_to_expiration: l'ora di scadenza del blocco. Specificare 0 per un blocco permanente. In alternativa utilizzare il formato RFC-3339. Ad esempio, 2021-06-02T12:46:06Z.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
           "msg": "AccountId oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3 is successfully holding 100 tokens"
       }
executeHoldTokens
Questo metodo completa il blocco di un token. Una quantità di token precedentemente detenuti da un proprietario di token viene trasferita a un ricevente. Se il valore quantity è inferiore al valore di blocco effettivo, l'importo rimanente sarà nuovamente disponibile per il proprietario originale dei token. Questo metodo può essere richiamato solo dall'ID AccountOwner con il ruolo notary per l'ID operazione specificato. La presa può essere completata solo dal notaio.
@Validator(yup.string(), yup.string(), yup.number().positive())
  public async executeHoldTokens(token_id: string, operation_id: string, quantity: number) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.EXECUTE_HOLD_TOKENS, { token_asset, operation_id, quantity }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.TRANSFER, quantity);
  }
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
  • quantity: number: il numero di token in sospeso da trasferire.
Restituisce:
  • In caso di operazione riuscita, un messaggio con l'ID conto del chiamante e la quantità della transazione.
Esempio di valore restituito:
{
           "msg": "Account Id: oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111 is successfully executed '10' tokens from Operation Id '454f4bf6'."
       }
releaseHoldTokens
Questo metodo rilascia un blocco sui token. Il trasferimento non è stato completato e tutti i token bloccati sono di nuovo disponibili per il proprietario originale. Questo metodo può essere richiamato dall'ID AccountOwner con il ruolo notary entro il limite di tempo specificato o dal responsabile pagamento, dal beneficiario o dal notaio dopo il limite di tempo specificato.
@Validator(yup.string(), yup.string())
  public async releaseHoldTokens(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.RELEASE_HOLD_TOKENS, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.TRANSFER);
  }
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
Restituisce:
  • In caso di esito positivo, viene visualizzato un messaggio che indica che il blocco è stato rilasciato.
Esempio di valore restituito:
{
           "msg": "Successfully released '200' tokens from Operation Id '77b75873' to Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
       }
requestBurn
Questo metodo può essere chiamato da un bruciatore per inviare una richiesta al notaio del bruciatore per distruggere una determinata quantità di token.
@Validator(
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async requestBurn(
      operation_id: string,
      notary_account_id: string,
      quantity:number,
      time_to_expiration: Date,
      info_details ?: InfoDetails,
  ) {
    const notary_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(notary_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REQUEST_BURN, { operation_id, notary_account_id, quantity, time_to_expiration, info_details }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, null, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.BURN, info_details);
  }
Parametri:
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di masterizzazione.
  • notary_account_id: string – L'ID account univoco del notaio del bruciatore che elaborerà la richiesta.
  • quantity: number: la quantità di token da bruciare.
  • time_to_expiration – Il tempo trascorso il quale la richiesta di masterizzazione scade e non è più valida.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
           "msg": "AccountId oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98 has successfully submitted request to burn 100 tokens"
       }
approveBurn
Questo metodo può essere chiamato da un notaio bruciatore per approvare una richiesta di masterizzazione.
@Validator(yup.string(), yup.string())
  public async approveBurn(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.APPROVE_BURN, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.BURN);
  }
Parametri:
  • token_id: string: l'ID del token da masterizzare.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di masterizzazione.
Esempio di valore restituito:
{
           "msg": "Successfully burned 200 tokens from account id: oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98"
       }
rejectBurn
Questo metodo può essere chiamato da un notaio bruciatore per rifiutare una richiesta di masterizzazione.
@Validator(yup.string(), yup.string())
  public async rejectBurn(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REJECT_BURN, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.BURN);
  }
Parametri:
  • token_id: string: l'ID del token da masterizzare.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di masterizzazione.
Esempio di valore restituito:
{
           "msg": "Successfully rejected burn request with Operation Id '8d34' to burn 100 tokens of token id USD"
       }

TypeScript Metodi per trasferimenti tra organizzazioni

I trasferimenti tra organizzazioni hanno due parti: prima l'importo viene addebitato dal mittente e poi l'importo viene accreditato al destinatario. Le due API seguenti vengono chiamate insieme come transazione atomica utilizzando l'API di commit a due fasi del proxy REST di Oracle Blockchain Platform. I trasferimenti riservati vengono effettuati in questo modo perché le raccolte di dati private delle due organizzazioni sono distinte e non è possibile accedervi in una singola transazione.

Entrambe le transazioni vengono inviate utilizzando l'API di commit a due fasi del proxy REST. Per ulteriori informazioni, vedere Richiama transazione atomica.

È possibile creare una richiesta POST nella raccolta Postman in cui l'URL è simile a: https://test-xyz-abc.blockchain.ocp.oraclecloud.com:7443/restproxy/api/v2/atomicTransactions. È necessario inviare tutte le intestazioni essenziali, comprese quelle seguenti.
- Content-Type: application/json
- Confidential-Transaction: true
Nel corpo della richiesta, includere i metodi executeHoldTokensSendere executeHoldTokensReceiver come mostrato nella seguente richiesta.
{
 "transactions": [
   {
        "chaincode": "<chaincode>",
        "args": [
            "executeHoldTokensSender"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : <Sender's endorsers List>,
        "channel":"<channel name>"
   },
   {
        "chaincode": "<chaincode name>",
        "args": [
            "executeHoldTokensReceiver"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : <Recipient endorsers List>,
        "channel":"<channelName>"
    }
 ],
 "isolationLevel": "readCommitted",
 "prepareTimeout": 10000,
 "copyInputsToTransientMap": true,
 "sync": true,
 "parallelPrepare": true
}
L'esempio seguente mostra un corpo della richiesta.
{
 "transactions": [
   {
        "chaincode": "WholesaleCBDCConfidential",
        "args": [
            "executeHoldTokensSender"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : ["org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
        "channel":"default"
   },
   {
        "chaincode": "WholesaleCBDCConfidential",
        "args": [
            "executeHoldTokensReceiver"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : ["org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
        "channel":"default"
    }
 ],
 "isolationLevel": "readCommitted",
 "prepareTimeout": 10000,
 "copyInputsToTransientMap": true,
 "sync": true,
 "parallelPrepare": true
}
executeHoldTokensSender
Questo metodo può essere richiamato solo dall'utente con il ruolo notarile per l'ID operazione specificato. Questo metodo è la prima parte di un'approvazione di un trasferimento tra organizzazioni. L'importo specificato viene detratto dal conto del mittente.
@ExcludeFromPostmanCollection()
  @Validator(yup.string(), yup.string(), yup.number().positive(), yup.string(), yup.string())
  public async executeHoldTokensSender(token_id: string, operation_id: string, quantity: number,  isolationLevel: string, globalIdInput:string) {
    if (!this.Ctx.Utils.isValidInterOrgTransferRequest()) {
      throw new Error("The request for the inter-org transfer is invalid.")
    }
    const globalTxId =  this.Ctx.Utils.extractGlobalTransactionId(globalIdInput);
    const token_asset = await this.getTokenObject(token_id);
    return await this.Ctx.Hold.executeHoldSender(operation_id, quantity, globalTxId, token_asset);
  }
Parametri:
  • token_id: string: l'ID del token da masterizzare.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di blocco da approvare.
  • quantity: number – La quantità di token detenuti da trasferire.
  • isolationLevel: string: il livello di isolamento della transazione atomica, serializable o readCommitted.
  • globalIdInput: string
Esempio di valore restituito:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1'."
    }
executeHoldTokensReceiver
Questo metodo può essere richiamato solo dall'utente con il ruolo notarile per l'ID operazione specificato. Questo metodo è la seconda parte di un'approvazione di un trasferimento tra organizzazioni. L'importo specificato viene accreditato sul conto del ricevente.
@ExcludeFromPostmanCollection()
  @Validator(yup.string(), yup.string(), yup.number().positive(), yup.string(), yup.string())
  public async executeHoldTokensReceiver(token_id: string, operation_id: string, quantity: number,  isolationLevel: string, globalIdInput:string) {
    if (!this.Ctx.Utils.isValidInterOrgTransferRequest()) {
      throw new Error("The request for the inter-org transfer is invalid.")
    }
    const globalTxId =  this.Ctx.Utils.extractGlobalTransactionId(globalIdInput);
    const token_asset = await this.getTokenObject(token_id);
    return await this.Ctx.Hold.executeHoldReceiver(operation_id, quantity, globalTxId, token_asset);
  }
Parametri:
  • token_id: string: l'ID del token da masterizzare.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di blocco da approvare.
  • quantity: number – La quantità di token detenuti da trasferire.
  • isolationLevel: string: il livello di isolamento della transazione atomica, serializable o readCommitted.
  • globalIdInput: string
Esempio di valore restituito:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1, receiverId oreceiver~72d9bfcf-2c68-4c33-b8c3-fe3374983bf2'."
    }

Metodi SDK TypeScript modificati per codice concatenato riservato

Se si include il parametro confidential: true nel file di specifica per i token che utilizzano lo standard Token Taxonomy Framework esteso, Blockchain App Builder genera versioni modificate dei metodi SDK standard e metodi aggiuntivi.

isUserTokenAdmin
Questo metodo restituisce il valore booleano true se il chiamante della funzione è un valore Token Admin. Altrimenti, il metodo restituisce false.
Ctx.Auth.isUserTokenAdmin(org_id: string, user_id: string);
Parametri:
  • org_id: l'ID MSP (Membership Service Provider) dell'utente nell'organizzazione di rete corrente.
  • user_id: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "result": true
}
addTokenAdmin
Questo metodo aggiunge un utente come Token Admin del codice concatenato del token. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
Ctx.Admin.addTokenAdmin(org_id: string, user_id: string);
Parametri:
  • user_id: il nome utente o l'ID e-mail dell'utente.
  • org_id: l'ID MSP (Membership Service Provider) dell'utente nell'organizzazione di rete corrente.
Esempio di valore restituito:
{
  "msg": "Successfully added Token Admin (Org_Id: CentralBank, User_Id: cb1)"
}
removeTokenAdmin
Questo metodo rimuove un utente come Token Admin del codice concatenato del token.
Ctx.Admin.removeTokenAdmin(org_id: string, user_id: string);
Parametri:
  • user_id: il nome utente o l'ID e-mail dell'utente.
  • org_id: l'ID MSP (Membership Service Provider) dell'utente nell'organizzazione di rete corrente.
Esempio di valore restituito:
{"msg": "Successfully removed Admin (Org_Id: Org1MSP, User_Id: User1)"}
getAllTokenAdmins
Questo metodo restituisce un elenco di tutti gli utenti che sono un Token Admin del codice concatenato.
Ctx.Admin.getAllTokenAdmins();
Parametri:
  • nessuno
Esempio di valore restituito:
{"admins":[{"org_id":"Org1MSP","user_id":"admin"}]}
addOrgAdmin
Questo metodo aggiunge un utente come Org Admin dell'organizzazione. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
 Ctx.Admin.addOrgAdmin(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "msg": "Successfully added Org Admin (Org_Id: Org1MSP, User_Id: orgAdmin)"
}
removeOrgAdmin
Questo metodo rimuove un utente come Org Admin dell'organizzazione.
Ctx.Admin.removeOrgAdmin(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
  "msg": "Successfully removed Org Admin (Org_Id Org1MSP User_Id orgAdmin)"
}
getAllOrgAdmins
Questo metodo restituisce un elenco di tutti gli utenti che sono un Org Admin di un'organizzazione.
Ctx.Admin.getAllOrgAdmins();
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "admins": [
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin"
        },
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin1"
        },
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin2"
        }
    ]
}
addTokenAuditor
Questo metodo aggiunge un utente come Token Auditor del codice concatenato. Poiché il valore user_id è memorizzato nel registro pubblico, non utilizzare alcuna informazione di identificazione personale (PII) per il valore user_id.
Ctx.Admin.addTokenAuditor(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, un messaggio che include i dettagli dell'utente aggiunto come Token Auditor del codice concatenato.
Esempio di valore restituito:
{
  "msg": "Successfully added Token Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
}
removeTokenAuditor
Questo metodo rimuove un utente come Token Auditor del codice concatenato.
Ctx.Admin.removeTokenAuditor(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
           "msg": "Successfully removed Token Auditor (Org_Id: CB, User_Id: cb)"
       }
getAllTokenAuditors
Questo metodo restituisce tutti i valori Token Auditors del codice concatenato.
this.Ctx.Admin.getAllTokenAuditors();
addOrgAuditor
Questo metodo aggiunge un utente come Org Auditor del codice concatenato.
Ctx.Admin.addOrgAuditor(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
           "msg": "Successfully added Org Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
       }
removeOrgAuditor
Questo metodo rimuove un utente come Org Auditor del codice concatenato.
this.Ctx.Admin.removeOrgAuditor(org_id: string, user_id: string);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • user_id: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
           "msg": "Successfully removed Org Auditor (Org_Id: CB, User_Id: cb)"
       }
getAllOrgAuditors
Questo metodo restituisce tutti i valori Org Auditors del codice concatenato.
this.Ctx.Admin.getAllOrgAuditors()
getAllTokens
Questo metodo restituisce tutti gli asset token salvati nel database di stato. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
this.Ctx.Token.getAllTokens();
Parametri:
  • nessuno
Restituisce:
  • Al successo, restituisce una promessa con tutti gli asset token. In caso di errore, restituisce un messaggio di errore.
getDecimals
Questo metodo restituisce il numero di posizioni decimali disponibili per un token frazionario. Se il comportamento divisible non è specificato, il valore predefinito è 0.
this.Ctx.Token.getDecimals(token_asset)
Parametri:
  • token_id: string: l'ID del token.
Esempio di valore restituito:
1
history
Questo metodo restituisce la cronologia per il token specificato.
Ctx.Token.history(tokenId: string);
Parametri:
  • token_id: string: l'ID del token.
Esempio di valore restituito:
[
    {
        "trxId": "0d75f09446a60088afb948c6aca046e261fddcd43df416076201cdc5565f1a35",
        "timeStamp": "2023-09-01T16:48:41.000Z",
        "value": {
            "assetType": "otoken",
            "token_id": "token",
            "token_name": "fiatmoneytok",
            "token_desc": "updatedDesc",
            "token_standard": "ttf+",
            "token_type": "fungible",
            "token_unit": "fractional",
            "behaviors": [
                "divisible",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 1000
            },
            "divisible": {
                "decimal": 2
            }
        }
    },
    {
        "trxId": "3666344878b043b65d5b821cc79c042ba52aec467618800df5cf14eac69f72fa",
        "timeStamp": "2023-08-31T20:24:55.000Z",
        "value": {
            "assetType": "otoken",
            "token_id": "token",
            "token_name": "fiatmoneytok",
            "token_standard": "ttf+",
            "token_type": "fungible",
            "token_unit": "fractional",
            "behaviors": [
                "divisible",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 1000
            },
            "divisible": {
                "decimal": 2
            }
        }
    }
]
getTokensByName
Questo metodo restituisce tutti gli asset token con il nome specificato. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
Ctx.Token.getTokensByName(token_name: string);
Parametri:
  • token_name: string – Il nome del token, che corrisponde alla proprietà Token_name del modello. Il valore è il nome della classe del token.
Esempio di valore restituito:
[
 {
    "assetType": "otoken",
    "token_id": "digiCurr101",
    "token_name": "digicur",
    "token_desc": "Digital Currency equiv of dollar",
    "token_type": "fungible",
    "behaviors": [
        "divisible",
        "mintable",
        "transferable",
        "burnable",
        "roles"
    ],
    "roles": {
        "minter_role_name": "minter"
        "burner_role_name": "burner",
        "notary_role_name": "notary"
    },
    "mintable": {
        "max_mint_quantity": 2000
    },
    "divisible": {
        "decimal": 1
    },
    "currency_name": "DOLLAR",
    "token_to_currency_ratio": 1
 }
]
createAccount
Questo metodo crea un account per un utente e un token specificati. Ogni utente che ha token in qualsiasi momento deve avere un account.
Ctx.Account.createAccount(org_id: string, user_id: string, token_type: string, dailyLimits);
Parametri:
  • org_id: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente. L'ID deve iniziare con un carattere alfanumerico e può includere lettere, numeri e caratteri speciali come caratteri di sottolineatura (_), punti (.), simboli at (@) e trattini (-).
  • user_id: string: il nome utente o l'ID e-mail dell'utente. L'ID deve iniziare con un carattere alfanumerico e può includere lettere, numeri e caratteri speciali come caratteri di sottolineatura (_), punti (.), simboli at (@) e trattini (-).
  • token_type: string: il tipo di token, che deve essere fungible.
  • daily_limits: DailyLimits: oggetto JSON del tipo seguente.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    Nell'esempio, il valore max_daily_amount è la quantità massima di token che è possibile effettuare transazioni giornaliere e il valore max_daily_transactions è il numero massimo di transazioni che è possibile completare quotidianamente.
Esempio di valore restituito:
{
    "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"
}
associateToken
Questo metodo associa un token fungibile a un account.
Ctx.Account.associateToken(account_id: string, token_id: string, custom_account_id?: string);
Parametri:
  • account_id: string – L'ID dell'account.
  • token_id: string: l'ID del token.
  • custom_account_id: string: per la modalità riservata, l'ID del conto bancario, un identificativo alfanumerico casuale univoco. Per impostazione predefinita, la lunghezza è di 14 caratteri.
Esempio di valore restituito:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "USD",
    "token_name": "cbdc",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
getAllAccounts
Questo metodo restituisce un elenco di tutti i conti. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
this.Ctx.Account.getAllAccounts();
Parametri:
  • nessuno
Esempio di valore restituito:
[
    {
        "key": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
        "valueJson": {
            "bapAccountVersion": 3,
            "assetType": "oaccount",
            "account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "028a27c752e9b518d156e61da6589e723b179b6d7351dc34ec92bbb27b783ed1dc",
            "onhold_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "onhold_burn_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "application_groups": [
                "application_groups value"
            ]
        }
    },
    {
        "key": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
        "valueJson": {
            "bapAccountVersion": 0,
            "assetType": "oaccount",
            "account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_burn_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "application_groups": [
                "application_groups value"
            ]
        }
    }
]
getAllOrgAccounts
Questo metodo restituisce un elenco di tutti i conti token appartenenti a un'organizzazione specificata.
Ctx.Account.getAllOrgAccounts(org_id: string);
Parametri:
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
[
    {
        "key": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "valueJson": {
            "bapAccountVersion": 2,
            "assetType": "oaccount",
            "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "18",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb",
            "custom_account_id": "1234567jh"
        }
    },
    {
        "key": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
        "valueJson": {
            "bapAccountVersion": 1,
            "assetType": "oaccount",
            "account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "22",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb1",
            "custom_account_id": "1234567jh"
        }
    }
]
getAccountsByUser
Questo metodo restituisce un elenco di tutti gli ID account per un utente e un'organizzazione specificati.
Ctx.Account.getAccountsByUser(org_id: string, user_id: string);
Parametri:
  • org_id string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • user_id string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
[
    {
        "bapAccountVersion": 2,
        "assetType": "oaccount",
        "user_id": "cb",
        "custom_account_id": "1234567jh",
        "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "token",
        "token_name": "cbdc",
        "balance": "18",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "application_groups value"
        ]
    }
]
getUserByAccountId
Questo metodo restituisce i dettagli utente per un account specificato.
this.Ctx.Account.getUserByAccountId(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "token_id": "USD",
    "org_id": "CentralBank",
    "user_id": "cb_admin_demo",
    "custom_account_id": "10101234000123"
}
getAccountWithStatus
Questo metodo restituisce i dettagli dell'account per un utente e un token specificati.
Ctx.Account.getAccountWithStatus(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "bapAccountVersion": 2,
    "assetType": "oaccount",
    "user_id": "cb",
    "custom_account_id": "1234567jh",
    "status": "active",
    "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "token",
    "token_name": "cbdc",
    "balance": "18",
    "onhold_balance": "0",
    "onhold_burn_balance": "0",
    "application_groups": [
        "application_groups value"
    ]
}
getAccountDetailsByCustomAccountId
Questo metodo restituisce tutti i dettagli del conto token per un'organizzazione e un ID conto specificati.
Ctx.Account.getAccountDetailsByCustomAccountId(custom_account_id: string, org_id: string)
Parametri:
  • custom_account_id: string: l'ID del conto bancario del conto, un identificativo alfanumerico casuale univoco.
  • org_id string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
[
    {
        "bapAccountVersion": 0,
        "assetType": "oaccount",
        "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "USD",
        "token_name": "cbdc",
        "balance": "0",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "SYSTEM_ADMINS"
        ],
        "user_id": "cb_admin_demo",
        "custom_account_id": "10101234000123"
    }
]
getAccountTransactionHistory
Questo metodo restituisce un array dei dettagli della cronologia delle transazioni per un conto specificato.
Ctx.Account.getAccountTransactionHistory(account_id: string)
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~4514aa229ebcc4d2fedcaa47c4301615e30c4a9bae45cf0256a5b80d75b3697a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-25T13:20:50.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 21000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1982f73495060e0eef4d78282a91c41e27e8c95572739b0677a1e404a0d20aa9",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:12:43.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~fedd714cf1509f7517819d7cd4c0921d0b2f5d1ff6a25dcb08ab411defd6b5f3",
        "transacted_amount": 2000,
        "timestamp": "2025-08-21T05:23:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f33b47234f3ee0b636962c8c31c01d06523b789ca16b3b342d5080b71268bcc3",
        "transacted_amount": 1000,
        "timestamp": "2025-08-21T05:23:07.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~cf934527149bc24f62a8ddeeea7f74a19a0f84d8f161535a771be49d2520d5b3",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f5c0e11ca61d9adc843658929e6de2a738ad586304f9e020f75bf4aac5e42a2c",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:04.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "category": "transfer",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transaction_type": "DEBIT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8a74c6d87ca74a613aab9db5d40386f8d5b534f9800503af8ca27e8946d7616d",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:01:27.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REJECT_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~28ac66ba33f7ad0648448964b2b74525c9e3f0c9908c7a0484690b9baa56c2db",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:01:16.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~7e32ad8f365ff59814e112f27602f30ab599fb9c1638784496c66a61a6277c22",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T21:01:05.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 30000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1477050bb9e55f4f471872b31fce0d2097f5d5e57d89a842070df5e36d7ab0da",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:01:03.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~0e76c6931b7ee134e967e847d9730b867a0fd191d39697d83d36dd15745c02e3",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:00:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~07bbf9c190694371626da59ded5d87434d26f612891e13bb15bdd28f6086e760",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:00:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8721175c6cbbce17b6c4bb6a444e475d07f52352dfd0d990679f342215153513",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T20:59:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~dc24c24d43a6525e807a39edcf8c6a2b6ccb81f0d755958f509509687eacee84",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T20:59:13.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~396e6ca5a11a9609632d0864026409d46a708fb95e3e21b39fa5f3fb78f90872",
        "transacted_amount": 0,
        "timestamp": "2025-08-12T20:43:20.000Z",
        "token_id": "",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "CREATE_ACCOUNT",
        "balance": 0,
        "onhold_balance": 0
    }
]
getAccountTransactionHistoryWithFilters
Questo metodo restituisce un array dei dettagli della cronologia delle transazioni per un conto specificato. Questo metodo può essere chiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
Ctx.Account.getAccountTransactionHistoryWithFilters(account_id: string, org_id: string, filters);
Parametri:
  • account_id: string – L'ID dell'account.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
           {
               "transaction_id": "otransaction~ccc2c2e89ab7887af4fdad3dc9918ea057a8aa834a0ed8d0f23271049f084952",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:22:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 18,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
               "transacted_amount": 22,
               "timestamp": "2025-08-20T23:21:45.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "to_org_id": "Org1",
               "to_user_id": "cb1",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "transaction_type": "DEBIT",
               "balance": 8,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb1",
               "transacted_custom_account_id": "1234567jh"
           },
           {
               "transaction_id": "otransaction~3212811cd7c0ff265434f5921b93621cc5b0e0450b07c52b42ad9d8ce73cf063",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:18:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 30,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~af2a1b0d56778e4ff5f4dda4e81bbcbf02c0592416ee2f105ff0b764e515fd0a",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:17:29.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 20,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6c0452a58f13db93f1c308d60eab1fde6c911921b350c0bbbe0ce7dab394721d",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:04:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 10,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~df98e24a3b90661b54b54289b600b13a1051c922db0a4d20e3705a9820ae9c20",
               "transacted_amount": 0,
               "timestamp": "2025-08-20T22:55:09.000Z",
               "category": "",
               "description": "",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "transaction_type": "CREATE_ACCOUNT",
               "balance": 0,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb",
               "transacted_custom_account_id": "1234567jh"
           }
       ]
getAccountTrxHistoryWithFiltersFromRichHistDB
Questo metodo restituisce un array dei dettagli della cronologia delle transazioni dal database della cronologia avanzata.
Ctx.Account.getAccountTrxHistoryWithFiltersFromRichHistDB(account_id: string, org_id: string, custom_endpoint: string, bearer_token: string, filters);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 300
    },
    {
        "transaction_id": "otransaction~2b75b3e8531a651f07c2d048d8546ad70ac49c66f0b82ed7626c1739090842ce",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:16:06.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~e26f11da",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 500
    },
    {
        "transaction_id": "otransaction~9e7bf14cf96c5f90170da9455b1318687785e936192f60b7cbeb1c8bfabc41d2",
        "transacted_amount": 100,
        "timestamp": "2025-08-21T06:57:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26900,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~b3901b4754920a9c75e36069dc55024ad505e4c127f334eedf65ef6703dc6b86",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873",
        "category": "issuance",
        "balance": 26800,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~d55c9dfc9feacb353544b5d8b2ae694162ade3890bcaaf715503fd1d6a73cd1a",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~81d7c4ac",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 200
    },
    {
        "transaction_id": "otransaction~751eaedbe4311edd5d17cae53d283caf397d0cb09f18d57a5e3fe61266875ff9",
        "transacted_amount": 200,
        "timestamp": "2025-08-13T09:59:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "from_org_id": "org2",
        "from_user_id": "fi2_org_officer_demo",
        "from_custom_account_id": "30300617202404",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27200,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~70155a8f4e388cc9395dbd03bedaf5a878705f5ad02302c8e9163218a5c3875a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-13T06:22:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~e595f3f0cc03fa5f58a546b8abbfaf155592e492f850581db2b8fed9a529c9e2",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~da92402859d87ae3069722d8e39cb0da448e9a5f67468233ee9b1fe7a4ebeef8",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:17.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~6915145aaf09fbf4d96456febddc2aa87b48c08ddd8ff17a6bab5d310f67bb36",
        "transacted_amount": 1000,
        "timestamp": "2025-08-12T21:07:11.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~244d7172d1dc90a142e1f22204c76614c7eea814b3d61f33016b786f1b347784",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:39.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~ed815e20",
        "category": "issuance",
        "balance": 25000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~c63ec37966264493bde6fa666527b9cca11695c15611c32e89af49a2246f13f6",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~12d87129",
        "category": "issuance",
        "balance": 35000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~5112f576c94c2d23c342479bfa37e34612414b3258a64b43cf51b920f4ff5868",
        "transacted_amount": 5000,
        "timestamp": "2025-08-12T21:05:02.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_retirer_demo",
        "to_custom_account_id": "10109999006543",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "DEBIT",
        "category": "burn",
        "balance": 45000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 50000,
        "onhold_balance": 0
    }
]
getOrgAccountsTrxHistoryWithFiltersFromRichHistDB
Questo metodo restituisce un array dei dettagli della cronologia delle transazioni per un'organizzazione specificata dal database della cronologia avanzata.
Ctx.Account.getOrgAccountsTrxHistoryWithFiltersFromRichHistDB(org_id: string, custom_endpoint: string, bearer_token: string, filters);
Parametri:
  • org_id string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "CREDIT",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~32137cd7e16c560f4d96d0f8999f6a267c1e95be2f5b11ef0541e574a6cd7275",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "transaction_type": "CREDIT",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~67844e07c06ab4c3d94d8ff36173b9dbcc2f1b9c99f4e7070f1097fd89f3f514",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:49:40.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~b6e4925b",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~b7c97d737fb978651c9132276ab677c0bcf795b9db13d0d39cba5243615c7389",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:46:09.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user1_demo",
        "to_custom_account_id": "20200198765432",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~4fbbb846",
        "category": "transfer"
    }
]
getAllAccountsTrxHistoryWithFiltersFromRichHistDB
Questo metodo restituisce un array dei dettagli della cronologia delle transazioni per tutte le organizzazioni dal database della cronologia avanzata.
Ctx.Account.getAllAccountsTrxHistoryWithFiltersFromRichHistDB(custom_endpoint: string, bearer_token: string, filters);
Parametri:
  • org_id string – L'ID MSP (Membership Service Provider) dell'organizzazione.
  • custom_endpoint: endpoint del servizio RESTful del database della cronologia RTF.
  • bearer_token: token di autorizzazione di accesso per l'endpoint del servizio RESTful.
  • filters: string: parametro facoltativo. Se vuoto, vengono restituiti tutti i record. La proprietà PageSize determina il numero di record da restituire. Se PageSize è 0, la dimensione di pagina predefinita è 20. La proprietà Bookmark determina l'indice iniziale dei record da restituire. Per ulteriori informazioni, consultare la documentazione di Hyperledger Fabric. Le proprietà StartTime e EndTime devono essere specificate nel formato RFC-3339.
Esempio di valore restituito:
[
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "DEBIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~c628fb7738222ed969295ccc8d21b4be95d96e3aada4f14570f7820a7051b5f7",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:51:18.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "RELEASEHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873"
    },
    {
        "transaction_id": "otransaction~af2cc8e43ecb4c5520d90a8d7955b5a47623a29b13eef47e31c16eb48cc0adec",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:50:45.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "REJECT_BURN",
        "holding_id": "ohold~cbdc~USD~8d34",
        "description": "Burn",
        "to_account": ""
    },
    {
        "transaction_id": "otransaction~182b99bb2ed753994a8c638ab9b08c3a4e73ac8159a3173a2a1f56b651d2eeac",
        "transacted_amount": 2000,
        "timestamp": "2025-08-25T13:50:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "to_org_id": "CentralBank",
        "to_user_id": "cb__creator_demo",
        "to_custom_account_id": "10105678004567",
        "transaction_type": "REJECT_MINT",
        "holding_id": "ohold~cbdc~USD~89ce",
        "description": "Minting 2000 tokens",
        "from_account": ""
    },
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    }
]
getAccountBalance
Questo metodo restituisce il saldo del conto per un conto specificato.
Ctx.Account.getAccountBalance(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "msg": "Current Balance is: 100",
    "user_balance": 100
}
deleteTransactions
Questo metodo elimina le transazioni meno recenti dal database di stato.
Ctx.Transaction.deleteTransactions(time_to_expiration: Date);
Parametri:
  • time_to_expiration: Date: indicatore orario che indica quando eliminare le transazioni. I cespiti transazione precedenti all'ora specificata verranno eliminati.
Esempio di valore restituito:
{
    "msg": "Successfully deleted transaction older than date: Thu Aug 19 2025 11:19:36 GMT+0000 (Coordinated Universal Time).",
    "transactions": [
           "otransaction~ec3366dd48b4ce2838f820f2f138648e6e55a07226713e59b411ff31b0d21058"
     ]
}
getTransactionById
Questo metodo restituisce la cronologia di un asset Transaction.
Ctx.Transaction.getTransactionById(transaction_id: string);
Parametri:
  • transaction_id string: l'ID dell'asset transazione.
Esempio di valore restituito:
{
    "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
    "history": [
        {
            "trxId": "6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
            "timeStamp": "2025-08-20T23:21:45.000Z",
            "value": {
                "assetType": "otransaction",
                "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
                "token_id": "token",
                "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
                "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
                "transaction_type": "TRANSFER",
                "amount": 22,
                "timestamp": "2025-08-20T23:21:45.000Z",
                "number_of_sub_transactions": 0,
                "holding_id": "",
                "sub_transaction": "false",
                "category": "category value",
                "description": "description value"
            }
        }
    ],
    "sub_transactions": []
}
getAccountStatus
Questo metodo ottiene lo stato corrente dell'account token.
Ctx.AccountStatus.getAccountStatus(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "active"
}
history (Account Status)
Questo metodo recupera la cronologia dello stato dell'account.
Ctx.AccountStatus.history(status_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
[
  {
    "trxId": "d5c6d6f601257ba9b6edaf5b7660f00adc13c37d5321b8f7d3a35afab2e93e63",
    "timeStamp": "2025-12-02T10:39:14.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "suspended"
    }
  },
  {
    "trxId": "e6c850cfa084dc20ad95fb2bb8165eef3a3bd62a0ac867cccee57c2003125183",
    "timeStamp": "2025-12-02T10:37:50.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "active"
    }
  }
]
activateAccount
Questo metodo attiva un account token. Impossibile attivare gli account eliminati.
Ctx.Account.activateAccount(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "active"
}
suspendAccount
Questo metodo sospende un account token. Dopo la sospensione di un account, non è possibile completare alcuna operazione di aggiornamento dell'account. Impossibile sospendere un account eliminato.
Ctx.Account.suspendAccount(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "suspended"
}
deleteAccount
Questo metodo elimina un account token. Dopo l'eliminazione di un account, non è possibile completare alcuna operazione di aggiornamento dell'account. L'account eliminato è in stato finale e non può essere modificato in nessun altro stato. Per eliminare un conto, il saldo del conto e il saldo in sospeso devono essere pari a zero.
Ctx.Account.deleteAccount(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "deleted"
}
setMaxDailyAmount
Questo metodo imposta il valore max_daily_amount per un account specificato.
Ctx.Account.setMaxDailyAmount(account_id: string, max_daily_amount?: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • max_daily_amount?: string – (Facoltativo) La quantità massima di token che l'utente può trasferire quotidianamente. Se non specificato, l'utente può trasferire ogni giorno qualsiasi quantità di token.
Esempio di valore restituito:
{
           "msg": "Successfully set max daily amount for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 1000000"
       }
setMaxDailyTransactionCount
Questo metodo imposta il valore max_daily_transactions per un account specificato.
Ctx.Account.setMaxDailyTransactionCount(account_id: string, max_daily_transactions?: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
  • max_daily_transactions?: string: (facoltativo) il numero massimo di transazioni che l'utente può completare quotidianamente. Se non specificato, l'utente può completare giornalmente un numero qualsiasi di transazioni.
Esempio di valore restituito:
{
            "msg": "Successfully set max daily transactions for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 100000"
        }
getMaxDailyAmount
Questo metodo ottiene il valore max_daily_amount (l'importo massimo che può essere trasferito giornalmente) per un conto specificato.
Ctx.Account.getMaxDailyAmount(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "max_daily_amount": "10000"
       }
getMaxDailyTransactionCount
Questo metodo recupera il valore max_daily_transactions (il numero massimo di transazioni consentite al giorno) per un conto specificato.
Ctx.Account.getMaxDailyTransactionCount(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "max_daily_transactions": "100"
       }
consolidateRunningBalanceInTransactions
Questo metodo calcola i saldi conto in esecuzione e salva i valori aggiornati nelle coppie chiave/valore transazione. In genere, gli amministratori di sistema chiamano questo metodo utilizzando uno scheduler proxy REST.
Ctx.Transaction.consolidateRunningBalanceInTransactions(save: boolean);
Esempio di valore restituito:
{ msg: "Successfully updated account running balance for pending transactions."}
processSendersAndReceivers
Questo metodo calcola e aggiorna i saldi dei conti token distribuiti nelle coppie chiave/valore mittente e destinatario create durante i trasferimenti tra organizzazioni, quindi elimina le coppie chiave/valore mittente e destinatario, che non sono più utilizzate. In genere, gli amministratori di sistema chiamano questo metodo utilizzando uno scheduler proxy REST.
Ctx.Account.processSendersAndReceivers(save: boolean);
Esempio di valore restituito:
{ msg: "Successfully updated balance for accounts from pending receivers."}
addRoleMember
Questo metodo aggiunge un ruolo a un account specificato.
Ctx.Token.addRoleMember(role: string, account_id: string, token_asset);
Parametri:
  • account_id: number: l'ID account a cui aggiungere il ruolo.
  • role: string: il nome del ruolo da aggiungere all'utente specificato.
  • token_asset: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
Esempio di valore restituito:
{
     "msg": "Successfully added role 'notary' to Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
removeRoleMember
Questo metodo rimuove un ruolo da un account specificato.
Ctx.Token.removeRoleMember(role: string, account_id: string, token_asset);
Parametri:
  • account_id: number: l'ID account da cui rimuovere il ruolo.
  • role: string: il nome del ruolo da rimuovere all'utente specificato.
  • token_asset: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
Esempio di valore restituito:
{
   "msg": "Successfully removed role 'notary' from Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
getAccountsByRole
Questo metodo restituisce un elenco di tutti gli account per un ruolo e un token specificati.
Ctx.Role.getAccountsByRole(token_id: string, role: string);
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getOrgAccountsByRole
Questo metodo restituisce informazioni su tutti i conti con un ruolo specificato in un'organizzazione specificata.
Ctx.Role.getOrgAccountsByRole(token_id: string, role: string, org_id: string);
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da controllare.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getUsersByRole
Questo metodo restituisce un elenco di tutti gli utenti per un ruolo e un token specificati.
Ctx.Role.getUsersByRole(token_id: string, role: string);
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
          "users": [
              {
                  "token_id": "token",
                  "org_id": "CentralBank"
              }
          ]
      }
getOrgUsersByRole
Questo metodo restituisce informazioni su tutti gli utenti con un ruolo specificato in un'organizzazione specificata.
 Ctx.Role.getOrgUsersByRole(token_id: string, role: string, org_id: string);
Parametri:
  • token_id: string: l'ID del token.
  • role: string: il nome del ruolo da controllare.
  • org_id: string – L'ID MSP (Membership Service Provider) dell'organizzazione.
Esempio di valore restituito:
{
           "users": [
               {
                   "token_id": "token",
                   "org_id": "CentralBank",
                   "user_id": "cb1",
                   "custom_account_id": "1234567jh"
               }
           ]
       }
isInRole
Questo metodo indica se un utente dispone di un ruolo specificato.
Ctx.Token.isInRole(role: string, account_id: string, token_asset)
Parametri:
  • account_id: number: l'ID univoco dell'account token.
  • role: string: il nome del ruolo da controllare.
  • token_asset: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
Esempio di valore restituito:
{
           "result": "true"
       }
getTotalMintedTokens
Questo metodo restituisce il numero totale di token generati.
Ctx.Token.getTotalMintedTokens(token_asset);
Parametri:
  • token_asset: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
Esempio di valore restituito:
{
    "msg": "Total minted token for Token Id: USD is 910 tokens.",
    "quantity": 910
}
getNetTokens
Questo metodo restituisce la quantità netta di token disponibili nel sistema. I token netti sono la quantità di token rimanenti dopo che i token sono stati bruciati. In forma di equazione: token netti = token coniati totali - token bruciati totali. Se non vengono bruciati token, il numero di token netti è uguale al totale dei token coniati.
Ctx.Token.getNetTokens(token_asset);
Parametri:
  • token_asset: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
Esempio di valore restituito:
{
    "msg": "Net supply of token for Token Id: USD is 878 tokens.",
    "quantity": 878
}
hold
Questo metodo viene utilizzato dal minter per inviare una richiesta al notaio minore per creare una quantità specificata di token. L'account notaio specificato è responsabile del completamento o del rilascio del blocco.
Ctx.Hold.hold(operation_id: string, to_account_id: string, notary_account_id: string, quantity: number, time_to_expiration: Date, token, type: HoldOperationType, info_details?: InfoDetails)
Parametri:
  • operation_id: string: ID univoco che identifica l'operazione di blocco. In genere questo ID viene passato dall'applicazione client.
  • to_account_id: string: l'ID dell'account del destinatario.
  • notary__account_id: string – L'ID del conto notarile.
  • quantity: number: il numero totale di token da mettere in attesa.
  • time_to_expiration: Date: la durata fino alla scadenza del blocco. Specificare 0 per un blocco permanente. In alternativa utilizzare il formato RFC-3339. Ad esempio, 2021-06-02T12.
  • token: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
  • type: HoldOperationType: tipo di operazione di blocco da richiedere. Deve essere uno dei tre valori possibili, MINT, BURN o TRANSFER.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
           "msg": "AccountId oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41 has successfully submitted request to mint 200 tokens"
       }
executeHold
I notai possono chiamare questo metodo per approvare un'operazione di blocco, che può essere di tre tipi: menta, masterizzazione o trasferimento.
Ctx.Hold. executeHold(operation_id: string, token, operation_type: HoldOperationType, quantity? :number)
Parametri:
  • operation_type: HoldOperationType: tipo di operazione di blocco da approvare. Deve essere uno dei tre valori possibili, MINT, BURN o TRANSFER.
  • quantity: number: (facoltativo) solo per le operazioni di trasferimento, l'importo approvato da trasferire al destinatario.
  • token: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
  • operation_id: string: ID univoco della richiesta.
Esempio di valore restituito:
{
           "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
       }
releaseHold
I notai possono chiamare questo metodo per rifiutare un'operazione di blocco, che può essere di tre tipi: menta, bruciatura o trasferimento.
Ctx.Hold.releaseHold(operation_id: string, token, operation_type: HoldOperationType)
Parametri:
  • operation_type: HoldOperationType: il tipo di operazione di blocco da rifiutare. Deve essere uno dei tre valori possibili, MINT, BURN o TRANSFER.
  • token: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
  • operation_id: string: ID univoco della richiesta.
Esempio di valore restituito:
{
           "msg": "Successfully rejected mint request with Operation Id '89ce' to mint 2000 tokens of token id USD"
       }
issueTokens
Minters può chiamare questo metodo per creare una quantità specificata di token.
this.Ctx.Token.mint(quantity, token_asset, info_details)
Parametri:
  • token_id: string: l'ID del token.
  • quantity: il numero di token da convertire.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
          "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
      }
transferTokens
Questo metodo trasferisce i token dal chiamante a un account specificato. Il chiamante del metodo deve avere un account. La quantità deve essere compresa nei valori decimali specificati dal parametro decimal del comportamento divisible nel file di specifica.
this.Ctx.Token.transfer(to_account_id: string, quantity, token_asset, info_details);
Parametri:
  • to_account_id: string – L'ID del conto del destinatario (beneficiario).
  • quantity: number: il numero di token da trasferire.
  • info_details: JSON: un oggetto che specifica la categoria (category) e la descrizione (description) della richiesta.

    È possibile specificare il parametro info_details in un formato diverso se si utilizza Visual Studio Code rispetto all'interfaccia CLI o a una raccolta Postman.

    Codice Visual Studio: { "category": "category value", "description": "description value" }

    CLI / Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

Esempio di valore restituito:
{
          "msg": "Successfully transferred 10000 tokens from account id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41  to account id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
      }
getAccountOnHoldBalance
Questo metodo restituisce il saldo in sospeso per un conto specificato.
Ctx.Account.getAccountOnHoldBalance(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "msg": "Total Holding Balance is: 0",
           "holding_balance": 0
       }
getOnHoldDetailsWithOperationId
Questo metodo restituisce i dettagli della transazione in sospeso per un ID operazione e un token specificati.
Ctx.Hold.getOnHoldDetailsWithOperationId(token_id: string, operation_id: string);
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco.
Esempio di valore restituito:
{
          "assetType": "ohold",
          "holding_id": "ohold~cbdc~token~hold1",
          "operation_id": "hold1",
          "token_name": "cbdc",
          "from_org_id": "CentralBank",
          "operation_type": "transfer",
          "status": "approved",
          "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
          "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
          "notary_account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
          "token_id": "token",
          "quantity": "0",
          "time_to_expiration": "2029-01-04T00:00:00.000Z",
          "category": "category value",
          "description": "description value"
      }
getOnHoldIds
Questo metodo restituisce un elenco di tutti gli ID azienda per un conto specificato.
Ctx.Account.getOnHoldIds(account_id: string);
Parametri:
  • account_id: string: l'ID univoco dell'account token.
Esempio di valore restituito:
{
           "msg": "Holding Ids are: ",
           "holding_ids": ["ohold~cbdc~token~hold1"]
       }
getOnHoldBalanceWithOperationId
Questo metodo restituisce il saldo in sospeso per un ID operazione e un token specificati. Questo metodo può essere chiamato da chiunque.
Ctx.Hold.getOnHoldBalanceWithOperationId(token_id: string, operation_id: string);
Parametri:
  • token_id: string: l'ID del token.
  • operation_id: string: ID univoco che identifica l'operazione di blocco.
Esempio di valore restituito:
{
           "msg": "Current Holding Balance of Operation 'hold1' for token 'token' is: 0",
           "holding_balance": 0
       }

TypeScript Metodi SDK per trasferimenti tra organizzazioni

I trasferimenti tra organizzazioni hanno due parti: prima l'importo viene addebitato dal mittente e poi l'importo viene accreditato al destinatario. Le due API seguenti vengono chiamate insieme come transazione atomica utilizzando l'API di commit a due fasi del proxy REST di Oracle Blockchain Platform. I trasferimenti riservati vengono effettuati in questo modo perché le raccolte di dati private delle due organizzazioni sono distinte e non è possibile accedervi in una singola transazione.

executeHoldTokensSender
Questo metodo può essere richiamato solo dall'utente con il ruolo notarile per l'ID operazione specificato. Questo metodo è la prima parte di un'approvazione di un trasferimento tra organizzazioni. L'importo specificato viene detratto dal conto del mittente.
Ctx.Hold.executeHoldSender(operation_id: string, quantity, globalTxId: string, token: any);
Parametri:
  • token: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di blocco da approvare.
  • quantity: number – La quantità di token detenuti da trasferire.
  • globalTxid: string: l'ID transazione globale generato dal proxy REST per una richiesta di commit a due fasi, che in questo caso viene utilizzato come riferimento comune che lega le operazioni di addebito e accredito in un trasferimento tra organizzazioni.
Esempio di valore restituito:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1'."
    }
executeHoldTokensReceiver
Questo metodo può essere richiamato solo dall'utente con il ruolo notarile per l'ID operazione specificato. Questo metodo è la seconda parte di un'approvazione di un trasferimento tra organizzazioni. L'importo specificato viene accreditato sul conto del ricevente.
Ctx.Hold.executeHoldReceiver(operation_id: string, quantity, globalTxId: string, token: any);
Parametri:
  • token: any: asset token passato come parametro. Le proprietà dell'asset token sono descritte nel file del modello.
  • operation_id: string: l'ID operazione univoco che rappresenta la richiesta di blocco da approvare.
  • quantity: number – La quantità di token detenuti da trasferire.
  • globalTxid: string: l'ID transazione globale generato dal proxy REST per una richiesta di commit a due fasi, che in questo caso viene utilizzato come riferimento comune che lega le operazioni di addebito e accredito in un trasferimento tra organizzazioni.
Esempio di valore restituito:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1, receiverId oreceiver~72d9bfcf-2c68-4c33-b8c3-fe3374983bf2'."
    }