Package API wrapper struttura token non fungibile

Oracle Blockchain Platform Digital Assets Edition include un package API wrapper che estende l'API REST per supportare operazioni specifiche per un marketplace NFT da collezione.

Il package API wrapper utilizza il servizio gateway API e le funzioni OCI per distribuire instradamenti API progettati in modo specifico per l'applicazione marketplace da collezione. Il package API wrapper framework di token non fungibile può essere scaricato dalla console di Oracle Blockchain Platform e include i componenti riportati di seguito.
  • NFTCollectiblesWithERC721WrapperAPI.zip, un file di archivio che contiene il package API wrapper, inclusi gli script Terraform necessari per la distribuzione. Questo file viene distribuito in uno stack di Resource Manager su Oracle Cloud Infrastructure (OCI) per creare le risorse Oracle necessarie per le API Wrapper.
  • NFTCollectiblesWithERC721_WrapperAPI.postman_collection.json, una raccolta Postman che consente di eseguire il test delle API wrapper distribuite. La raccolta include richieste preconfigurate con endpoint e payload corrispondenti alle API definite nel package API wrapper.

API wrapper

registerOrg
Nome metodo originale: registerOrg
Questo metodo POST registra un'organizzazione nel sistema. Questo metodo può essere chiamato solo da un amministratore di token.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "orgName": "org_name value",
    "endorsers": {{endorsers}}
}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • orgName: string: (facoltativo) il nome dell'organizzazione.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "assetType": "oorgregistry",
    "org_registry_id": "orgregistry",
    "registered_orgs": [
        {
            "org_id": "Org1MSP",
            "org_name": "Organisation name"
        }
    ]
}
getAllRegisteredOrgs
Nome metodo originale: getAllRegisteredOrgs
Questo metodo GET recupera i dettagli di tutte le organizzazioni registrate. Questo metodo può essere chiamato solo da un amministratore di token.
Query:
/getAllRegisteredOrgs
Parametri:
  • nessuno
Esempio di valore restituito:
[
    {
        "org_id": "Org1MSP",
        "org_name": "Organisation name"
    }
]
activateAccount
Nome metodo originale: activateAccount
Questo metodo POST attiva un account token. Questo metodo può essere chiamato solo da un amministratore. Per gli account creati prima della funzionalità di stato dell'account, è necessario chiamare questo metodo per visualizzare lo stato dell'account come attivo.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dell'oggetto di stato dell'account per l'account token specificato.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "db0738d4a44f6d9c80b24fce7c518c07023f7be19edaa69b272eaf7886b4b925",
        "payload": {
            "assetType": "oaccountStatus",
            "status_id": "oaccountStatus~d5814d96d8517ac31727d60aace0519c58a425892ab0d378fcfb0a35771f65ae",
            "account_id": "oaccount~802bf8da5579c6103b2dddaa6c4385df8e722d639a18029e0e93d7a5d6f826d6",
            "status": "active"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 194
    }
}
addTokenAdmin
Nome metodo originale: addTokenAdmin
Questo metodo POST aggiunge un utente come Token Admin del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • sameOrgEndorser: boolean: valore booleano che indica se le dichiarazioni a sostegno delle transazioni devono provenire dalla stessa organizzazione del richiedente.
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:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg":"Successfully added Admin (orgId: Org1MSP, userId: User1)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 190
    }
}
addRole
Nome metodo originale: addRole
Questo metodo aggiunge il ruolo all'utente e al token specificati.
Payload:
{
    "role": "role value (for example minter / burner)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • role: string: il nome del ruolo da aggiungere all'utente specificato.
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully added role 'minter' to Account Id: oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d (Org-Id: Org1MSP, User-Id: admin)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
addTokenSysRole
Nome metodo originale: addTokenSysRole
Questo metodo aggiunge Org Admins al codice concatenato del token.
Payload:
{
    "role": "role value (for example vault)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • role: string: il nome del ruolo da aggiungere all'utente specificato.
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "96a84dffcb9156f7271dfb414e8c43b540595044cf9145f5fd56e9873797fc4a",
        "payload": {
            "msg": "Successfully added Org Admin (Org_Id: CB, User_Id: cb)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 197
    }
}
balanceOf
Nome metodo originale: balanceOf
Questo metodo GET restituisce il numero totale di NFT detenuti da un utente specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal proprietario dell'account.
Query:
/balanceOf?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload":  {
            "totalNfts": 0
        },
        "encode": "JSON"
    }
}
buy
Nome metodo originale: buy
Questo metodo POST acquista un token in vendita.
Payload:
{
    "fromOrgId": "from_org_id value",
    "fromUserId": "from_user_id value",
    "toOrgId": "to_org_id value",
    "toUserId": "to_user_id value",
    "nonfungibleTokenId": "nonfungible_token_id value",
    "amountPaid": 1,
    "endorsers": {{endorsers}}
}
Parametri:
  • fromOrgId: string – L'ID MSP (Membership Service Provider) del mittente (proprietario) dell'organizzazione corrente.
  • fromUserId: string – Il nome utente o l'ID e-mail del mittente (proprietario).
  • toOrgId: string - L'ID MSP (Membership Service Provider) del destinatario nell'organizzazione corrente.
  • toUserId: string: il nome utente o l'ID e-mail del destinatario.
  • nonfungibleTokenId: string – L'ID del token da acquistare.
  • amountPaid: number – Il prezzo del token.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Token ID: 'monalisa' has been successfully transferred to UserID :oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
createAccount
Nome metodo originale: 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. Gli account tengono traccia del numero di NFT di proprietà di un utente. Un ID account è un set alfanumerico di caratteri, preceduto da oaccount~ e seguito da un hash SHA-256 dell'ID provider di servizi di appartenenza (orgId) dell'utente nell'organizzazione di rete corrente, il nome utente o l'ID e-mail (userId) del proprietario dell'istanza o dell'utente che ha eseguito il login all'istanza e la stringa costante nft. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "tokenType": "nonfungible",
    "endorsers": {{endorsers}}
}
Parametri:
  • orgId - 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 (-).
  • userId: 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 (-).
  • tokenType: TokenType: il tipo di token, che deve essere fungible.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "assetType": "oaccount",
            "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "bapAccountVersion": 0,
            "userId": "admin",
            "orgId": "Org1MSP",
            "tokenType": "nonfungible",
            "noOfNfts": 0
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
createArtCollectionToken
Nome metodo originale: createArtCollectionToken
Questo metodo POST crea (mette) un NFT. L'asset e le proprietà associate vengono salvate nel database di stato. Il chiamante di questa transazione deve avere un account token. Il chiamante di questa transazione diventa il proprietario di NFT. Se il file di specifica del token include la sezione roles per behaviors e la proprietà minter_role_name per roles, il chiamante della transazione deve avere il ruolo minore. Altrimenti, qualsiasi chiamante può coniare NFT.
Payload:
{
    "tokenAsset": "{\"tokenId\":\"{{bc-token-id}}\",\"tokenDesc\":\"tokenDesc value\",\"tokenUri\":\"tokenUri value\",\"metadata\":{\"Painting_Name\":\"Painting_Name value\",\"Description\":\"Description value\",\"Painter_Name\":\"Painter_Name value\"},\"Price\":999,\"On_Sale_Flag\":true}",
    "sameOrgEndorser": true
}
Parametri:
  • tokenAsset: <Token Class>: l'asset token da zecca. Per ulteriori informazioni sulle proprietà dell'asset token, vedere il file delle specifiche di input.
  • sameOrgEndorser: boolean: valore booleano che indica se le dichiarazioni a sostegno delle transazioni devono provenire dalla stessa organizzazione del richiedente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "metadata": {
                "painting_name": "Mona_Lisa",
                "description": "Mona Lisa Painting",
                "image": "monalisa.jpeg",
                "painter_name": "Leonardo_da_Vinci"
            },
            "assetType": "otoken",
            "tokenId": "monalisa",
            "tokenName": "artcollection",
            "tokenDesc": "token description",
            "symbol": "ART",
            "tokenStandard": "erc721+",
            "tokenType": "nonfungible",
            "tokenUnit": "whole",
            "behaviors": [
                "indivisible",
                "singleton",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 20000
            },
            "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "creationDate": "2022-04-05T08:30:42.000Z",
            "isBurned": false,
            "tokenUri": "\"https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg\"",
            "price": 100,
            "on_sale_flag": false
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
deleteAccount
Nome metodo originale: deleteAccount
Questo metodo POST elimina un account token. Dopo l'eliminazione di un conto, il conto si trova in uno stato finale e non può essere aggiornato o modificato in un altro stato. Per eliminare un conto, il saldo del conto deve essere zero. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
 "orgId": "{{bc-org-id}}",
 "userId": "{{bc-user-id}}",
 "endorsers": {{endorsers}}
}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dello stato dell'account token.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
          "assetType": "oaccountStatus",
          "statusId": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
          "accountId": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
          "status": "deleted"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
getAccountByUser
Nome metodo originale: getAccountByUser
Questo metodo restituisce i dettagli del conto per un utente specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal Account Owner dell'account.
Query:
/getAccountByUser?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
          "bapAccountVersion": 0,
          "assetType": "oaccount",
          "status": "active",
          "accountId": "oaccount~cc301bee057f14236a97d434909ec1084970921b008f6baab09c2a0f5f419a9a",
          "userId": "idcqa",
          "orgId": "appdev",
          "tokenType": "nonfungible",
          "noOfNfts": 0
        },
        "encode": "JSON"
    }
}
getAccountHistory
Nome metodo originale: getAccountHistory
Questo metodo restituisce la cronologia del conto per un utente specificato. Questo è un metodo asincrono. Questo metodo può essere chiamato solo dal Token Admin del codice concatenato o dal proprietario dell'account.
Query:
/getAccountHistory?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": [
            {
                "trxId": "6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
                "timeStamp": 1649151044,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 5,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 1
                }
            },
            {
                "trxId": "a605f1fa62e511c2945fce5437f983a5e70ec814b82520d3ecd2d81e3ecf53a3",
                "timeStamp": 1649151022,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 4,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 2
                }
            },
            {
                "trxId": "ca4c07bf04240345de918cbf1f4f3da4b4d0ab044c5b8bea94343e427d9ed4e7",
                "timeStamp": 1649150910,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 3,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 1
                }
            },
            {
                "trxId": "cfb52ffc8c34c7fd86210fcf8c5f53d9f92a056c45ed3a33671d638020c1f9cb",
                "timeStamp": 1649149545,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 2,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 0
                }
            },
            {
                "trxId": "e7747b3001a170f88688620956320e9402e1dd8edad8afb4818a08a34647337c",
                "timeStamp": 1649147442,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 1,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 1
                }
            },
            {
                "trxId": "d2d1f9c898707ae831e9361bc25da6369eac37b10c87dc04d18d6f3808222f08",
                "timeStamp": 1649137534,
                "value": {
                    "assetType": "oaccount",
                    "bapAccountVersion" : 0,
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 0
                }
            }
        ],
        "encode": "JSON"
    }
}
getAccountsByRole
Nome metodo originale: getAccountsByRole
Questo metodo restituisce un elenco di tutti gli ID account per un ruolo specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Query:
/getAccountsByRole?role=role value (for example minter / burner)
Parametri:
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "accounts": [
                "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d"
            ]
        },
        "encode": "JSON"
    }
}
getAccountsByTokenSysRole
Nome metodo originale: getAccountsByTokenSysRole
Questo metodo restituisce un elenco di tutti gli ID account per un ruolo TokenSys specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Query:
/getAccountsByTokenSysRole?role=role value (for example vault)
Parametri:
  • role: string: il nome del ruolo TokenSys da cercare.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "accountIds": [
                "oaccount~bf07f584a94be44781e49d9101bfaf58c6fbbe77a4dfebdb83c874c2caf03eba"
            ]
        },
        "encode": "JSON"
    }
}
getAccountStatus
Nome metodo originale: getAccountStatus
Questo metodo GET recupera lo stato corrente dell'account token. Questo metodo può essere chiamato dal Token Admin del codice concatenato o dal proprietario dell'account token.
Query:
/getAccountStatus?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, una rappresentazione JSON dello stato dell'account token.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "assetType": "oaccountStatus",
            "statusId": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
            "accountId": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
            "status": "active"
        },
        "encode": "JSON"
    }
}
getAccountStatusHistory
Nome metodo originale: getAccountStatusHistory
Questo metodo GET recupera la cronologia dello stato dell'account. Questo metodo può essere chiamato dal Token Admin del codice concatenato o dal proprietario dell'account token.
Query:
/getAccountStatusHistory?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Restituisce:
  • In caso di operazione riuscita, la cronologia dello stato dell'account in formato JSON.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
          {
            "trxId": "d5c6d6f601257ba9b6edaf5b7660f00adc13c37d5321b8f7d3a35afab2e93e63",
            "timeStamp": "2022-12-02T10:39:14.000Z",
            "value": {
              "assetType": "oaccountStatus",
              "statusId": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
              "accountId": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
              "status": "suspended"
            }
          },
          {
            "trxId": "e6c850cfa084dc20ad95fb2bb8165eef3a3bd62a0ac867cccee57c2003125183",
            "timeStamp": "2022-12-02T10:37:50.000Z",
            "value": {
              "assetType": "oaccountStatus",
              "statusId": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
              "accountId": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
              "status": "active"
            }
          }
        ],
        "encode": "JSON"
    }
}
getAccountTransactionHistory
Nome metodo originale: getAccountTransactionHistory
Questo metodo GET restituisce la cronologia delle transazioni del conto. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal proprietario dell'account.
/getAccountTransactionHistory?orgId={{bc-org-id}}&userId={{bc-user-id}}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "transactionId": "otransaction~6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
                "timestamp": "2022-04-05T09:30:44.000Z",
                "tokenId": "monalisa1",
                "noOfNfts": 1,
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "BURN"
            },
            {
                "transactionId": "otransaction~a605f1fa62e511c2945fce5437f983a5e70ec814b82520d3ecd2d81e3ecf53a3",
                "timestamp": "2022-04-05T09:30:22.000Z",
                "tokenId": "monalisa1",
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "MINT"
            },
            {
                "transactionId": "otransaction~ca4c07bf04240345de918cbf1f4f3da4b4d0ab044c5b8bea94343e427d9ed4e7",
                "timestamp": "2022-04-05T09:28:30.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba",
                "transactionType": "CREDIT"
            },
            {
                "transactionId": "otransaction~cfb52ffc8c34c7fd86210fcf8c5f53d9f92a056c45ed3a33671d638020c1f9cb",
                "timestamp": "2022-04-05T09:05:45.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba",
                "transactionType": "DEBIT"
            },
            {
                "transactionId": "otransaction~e7747b3001a170f88688620956320e9402e1dd8edad8afb4818a08a34647337c",
                "timestamp": "2022-04-05T08:30:42.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "MINT"
            }
        ],
        "encode": "JSON"
    }
}
getAccountTransactionHistoryWithFilters
Nome metodo originale: getAccountTransactionHistoryWithFilters
Questo metodo GET restituisce la cronologia delle transazioni del conto per un utente specificato, filtrata in base a PageSize, Bookmark, startTime e endTime. Questo è un metodo asincrono. Questo metodo può essere chiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform. Questo metodo può essere chiamato solo dal Token Admin del codice concatenato o dal proprietario dell'account.
/getAccountTransactionHistoryWithFilters?orgId={{bc-org-id}}&userId={{bc-user-id}}&filters={"pageSize":20,"bookmark":"","startTime":"2022-01-16T15:16:36+00:00","endTime":"2022-01-17T15:16:36+00:00"}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • filters: object: oggetto della classe Filtro contenente quattro attributi: pageSize, bookmark, startTime e endTime.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "transactionId": "otransaction~6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
                "timestamp": "2022-04-05T09:30:44.000Z",
                "tokenId": "monalisa1",
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "BURN"
            },
            {
                "transactionId": "otransaction~a605f1fa62e511c2945fce5437f983a5e70ec814b82520d3ecd2d81e3ecf53a3",
                "timestamp": "2022-04-05T09:30:22.000Z",
                "tokenId": "monalisa1",
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "MINT"
            },
            {
                "transactionId": "otransaction~ca4c07bf04240345de918cbf1f4f3da4b4d0ab044c5b8bea94343e427d9ed4e7",
                "timestamp": "2022-04-05T09:28:30.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba",
                "transactionType": "CREDIT"
            },
            {
                "transactionId": "otransaction~cfb52ffc8c34c7fd86210fcf8c5f53d9f92a056c45ed3a33671d638020c1f9cb",
                "timestamp": "2022-04-05T09:05:45.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba",
                "transactionType": "DEBIT"
            },
            {
                "transactionId": "otransaction~e7747b3001a170f88688620956320e9402e1dd8edad8afb4818a08a34647337c",
                "timestamp": "2022-04-05T08:30:42.000Z",
                "tokenId": "monalisa",
                "transactedAccount": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "transactionType": "MINT"
            }
        ],
        "encode": "JSON"
    }
}
getAllAccounts
Nome metodo originale: getAllAccounts
Questo metodo GET restituisce i dettagli di tutti gli account utente. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Query:
/getAllAccounts
Parametri:
  • nessuno
Restituisce:
  • Al successo, un array JSON di tutti gli account.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "key": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                "valueJson": {
                    "assetType": "oaccount",
                    "accountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "userId": "admin",
                    "orgId": "Org1MSP",
                    "tokenType": "nonfungible",
                    "noOfNfts": 1
                }   
            }
        ],
        "encode": "JSON"
    }
}
getAllLockedNFTs
Nome metodo originale: getAllLockedNFTs
Questo metodo GET restituisce un elenco di tutti gli NFT bloccati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o da Vault Manager (l'utente con il ruolo TokenSys vault).
Query:
/getAllLockedNFTs
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
           {
              "key":"token1",
              "valueJson":{
                 "assetType":"otoken",
                 "tokenId":"token1",
                 "tokenName":"artcollection",
                 "symbol":"ART",
                 "tokenStandard":"erc721+",
                 "tokenType":"nonfungible",
                 "tokenUnit":"whole",
                 "behaviors":[
                    "indivisible",
                    "singleton",
                    "mintable",
                    "transferable",
                    "lockable",
                    "burnable",
                    "roles"
                 ],
                 "roles":{
                    "minter_role_name":"minter"
                 },
                 "mintable":{
                    "max_mint_quantity":20000
                 },
                 "createdBy":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
                 "creationDate":"2023-10-20T10:26:29.000Z",
                 "owner":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
                 "isBurned":false,
                 "isLocked":true,
                 "tokenUri":"token1.example.com",
                 "price":120,
                 "on_sale_flag":false
              }
           }
        ],
        "encode": "JSON"
    }
}
getAllTokenAdmins
Nome metodo originale: getAllTokenAdmins
Questo metodo restituisce un elenco di tutti gli utenti che sono un Token Admin del codice concatenato. Questo metodo può essere chiamato solo dal Token Admin del codice concatenato.
Query:
/getAllTokenAdmins
Parametri:
  • nessuno
Restituisce:
  • In caso di operazione riuscita, un array admins in formato JSON contenente oggetti orgId e userId.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "admins":[
                {
                    "orgId":"Org1MSP",
                    "userId":"admin"
                }
            ]
        },
        "encode": "JSON"
    }
}
getAllTokens
Nome metodo originale: getAllTokens
Questo metodo restituisce tutti gli asset token salvati nel database di stato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform.
Query:
/getAllTokens
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "key": "monalisa",
                "valueJson": {
                    "metadata": {
                        "PaintingName": "Mona_Lisa",
                        "Description": "Mona Lisa Painting",
                        "Image": "monalisa.jpeg",
                        "PainterName": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "ravinft",
                    "tokenDesc": "token Description",
                    "symbol": "PNT",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter",
                        "burner_role_name": "burner"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "createdBy": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "creationDate": "2022-04-07T21:17:48.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "NftBasePrice": 100
                }
            },
            {
                "key": "monalisa1",
                "valueJson": {
                    "metadata": {
                        "PaintingName": "Mona_Lisa",
                        "Description": "Mona Lisa Painting",
                        "Image": "monalisa.jpeg",
                        "PainterName": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa1",
                    "tokenName": "ravinft",
                    "tokenDesc": "token Description",
                    "symbol": "PNT",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter",
                        "burner_role_name": "burner"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "createdBy": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "creationDate": "2022-04-07T21:17:59.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "NftBasePrice": 100
                }
            }
        ],
        "encode": "JSON"
    }
}
getAllTokensByUser
Nome metodo originale: getAllTokensByUser
Questo metodo GET restituisce tutti gli asset token di proprietà di un utente specificato. Questo metodo utilizza query avanzate SQL DB Berkeley e può essere richiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal proprietario dell'account.
Query:
/getAllTokensByUser?orgId={{bc-org-id}}&userId={{bc-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:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "key": "monalisa",
                "valueJson": {
                    "metadata": {
                        "PaintingName": "Mona_Lisa",
                        "Description": "Mona Lisa Painting",
                        "Image": "monalisa.jpeg",
                        "PainterName": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "ravinft",
                    "tokenDesc": "token Description",
                    "symbol": "PNT",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter",
                        "burner_role_name": "burner"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "createdBy": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "creationDate": "2022-04-07T21:17:48.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "NftBasePrice": 100
                }
            },
            {
                "key": "monalisa1",
                "valueJson": {
                    "metadata": {
                        "PaintingName": "Mona_Lisa",
                        "Description": "Mona Lisa Painting",
                        "Image": "monalisa.jpeg",
                        "PainterName": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa1",
                    "tokenName": "ravinft",
                    "tokenDesc": "token Description",
                    "symbol": "PNT",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter",
                        "burner_role_name": "burner"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "createdBy": "oaccount~543c2258e351c3e7a40ea59b81e62154d38fbfc9d1b5b79f30ac5e08e7d0dfd1",
                    "creationDate": "2022-04-07T21:17:59.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "NftBasePrice": 100
                }
            }
        ],
        "encode": "JSON"
    }
}
getLockedNFTsByOrg
Nome metodo originale: getLockedNFTsByOrg
Questo metodo restituisce un elenco di tutti i token non fungibili bloccati per un'organizzazione specificata e, facoltativamente, un utente specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal vault manager (l'utente con il ruolo TokenSys vault).
Query:
/getLockedNFTsByOrg?orgId={{bc-org-id}}&userId={{bc-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:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
           {
              "key":"token1",
              "valueJson":{
                 "assetType":"otoken",
                 "tokenId":"token1",
                 "tokenName":"artcollection",
                 "symbol":"ART",
                 "tokenStandard":"erc721+",
                 "tokenType":"nonfungible",
                 "tokenUnit":"whole",
                 "behaviors":[
                    "indivisible",
                    "singleton",
                    "mintable",
                    "transferable",
                    "lockable",
                    "burnable",
                    "roles"
                 ],
                 "roles":{
                    "minter_role_name":"minter"
                 },
                 "mintable":{
                    "max_mint_quantity":20000
                 },
                 "createdBy":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
                 "creationDate":"2023-10-20T10:26:29.000Z",
                 "owner":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
                 "isBurned":false,
                 "isLocked":true,
                 "tokenUri":"token1.examplecom",
                 "price":120,
                 "on_sale_flag":false
              }
           }
        ],
        "encode": "JSON"
    }
}
getTokenById
Nome metodo originale: getTokenById
Questo metodo restituisce un oggetto token se il token è presente nel database di stato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal proprietario del token.
Query:
/getTokenById?tokenId={{bc-token-id}}
Parametri:
  • tokenId: string: l'ID del token da ottenere.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "metadata": {
                "painting_name": "Mona_Lisa",
                "description": "Mona Lisa Painting",
                "image": "monalisa.jpeg",
                "painter_name": "Leonardo_da_Vinci"
            },
            "assetType": "otoken",
            "tokenId": "monalisa",
            "tokenName": "artcollection",
            "tokenDesc": "token description",
            "symbol": "ART",
            "tokenStandard": "erc721+",
            "tokenType": "nonfungible",
            "tokenUnit": "whole",
            "behaviors": [
                "indivisible",
                "singleton",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 20000
            },
            "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "transferredBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "creationDate": "2022-04-05T08:30:42.000Z",
            "transferredDate": "2022-04-05T09:28:30.000Z",
            "isBurned": false,
            "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
            "price": 100,
            "on_sale_flag": true
        },
        "encode": "JSON"
    }
}
getTokenHistory
Nome metodo originale: getTokenHistory
Questo metodo restituisce la cronologia per un ID token specificato. Questo è un metodo asincrono. Questo metodo può essere chiamato solo quando si è connessi alla rete remota di Oracle Blockchain Platform. Chiunque può chiamare questo metodo.
/getTokenHistory?tokenId={{bc-token-id}}
Parametri:
  • tokenId: string: l'ID del token.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": [
            {
                "trxId": "ca4c07bf04240345de918cbf1f4f3da4b4d0ab044c5b8bea94343e427d9ed4e7",
                "timeStamp": 1649150910,
                "value": {
                    "metadata": {
                        "painting_name": "Mona_Lisa",
                        "description": "Mona Lisa Painting",
                        "image": "monalisa.jpeg",
                        "painter_name": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "artcollection",
                    "tokenDesc": "token description",
                    "symbol": "ART",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "transferredBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "creationDate": "2022-04-05T08:30:42.000Z",
                    "transferredDate": "2022-04-05T09:28:30.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "price": 100,
                    "on_sale_flag": true
                }
            },
            {
                "trxId": "cfb52ffc8c34c7fd86210fcf8c5f53d9f92a056c45ed3a33671d638020c1f9cb",
                "timeStamp": 1649149545,
                "value": {
                    "metadata": {
                        "painting_name": "Mona_Lisa",
                        "description": "Mona Lisa Painting",
                        "image": "monalisa.jpeg",
                        "painter_name": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "artcollection",
                    "tokenDesc": "token description",
                    "symbol": "ART",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba",
                    "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "transferredBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "creationDate": "2022-04-05T08:30:42.000Z",
                    "transferredDate": "2022-04-05T09:05:45.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "price": 100,
                    "on_sale_flag": true
                }
            },
            {
                "trxId": "702e61cc8d6d2982521023d0d5f3195900f35e146d6a90ef66daae551e6075d2",
                "timeStamp": 1649147729,
                "value": {
                    "metadata": {
                        "painting_name": "Mona_Lisa",
                        "description": "Mona Lisa Painting",
                        "image": "monalisa.jpeg",
                        "painter_name": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "artcollection",
                    "tokenDesc": "token description",
                    "symbol": "ART",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "creationDate": "2022-04-05T08:30:42.000Z",
                    "isBurned": false,
                    "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
                    "price": 100,
                    "on_sale_flag": true
                }
            },
            {
                "trxId": "e7747b3001a170f88688620956320e9402e1dd8edad8afb4818a08a34647337c",
                "timeStamp": 1649147442,
                "value": {
                    "metadata": {
                        "painting_name": "Mona_Lisa",
                        "description": "Mona Lisa Painting",
                        "image": "monalisa.jpeg",
                        "painter_name": "Leonardo_da_Vinci"
                    },
                    "assetType": "otoken",
                    "tokenId": "monalisa",
                    "tokenName": "artcollection",
                    "tokenDesc": "token description",
                    "symbol": "ART",
                    "tokenStandard": "erc721+",
                    "tokenType": "nonfungible",
                    "tokenUnit": "whole",
                    "behaviors": [
                        "indivisible",
                        "singleton",
                        "mintable",
                        "transferable",
                        "burnable",
                        "roles"
                    ],
                    "roles": {
                        "minter_role_name": "minter"
                    },
                    "mintable": {
                        "max_mint_quantity": 20000
                    },
                    "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                    "creationDate": "2022-04-05T08:30:42.000Z",
                    "isBurned": false,
                    "tokenUri": "\"https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\ .ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg\"",
                    "price": 100,
                    "on_sale_flag": false
                }
            }
        ]
        "encode": "JSON"
    }
}
getTransactionById
Nome metodo originale: getTransactionById
Questo metodo restituisce la cronologia delle transazioni per un ID transazione specificato. Questo è un metodo asincrono. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Query:
/getTransactionById?transactionId=transactionId value
Parametri:
  • transactionId: string – L'ID della transazione, che è il prefisso otransaction~ seguito dall'hash a 64 bit in formato esadecimale.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "transactionId": "otransaction~6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
            "history": [
                {
                    "trxId": "6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
                    "timeStamp": 1649151044,
                    "value": {
                        "assetType": "otransaction",
                        "transactionId": "otransaction~6ffd0d94f234c12444a5d5aa559563b59dff4d2280b573fea956dc632bdaf5d4",
                        "tokenId": "monalisa1",
                        "fromAccountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                        "toAccountId": "",
                        "triggeredByAccountId": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
                        "transactionType": "BURN",
                        "timestamp": "2022-04-05T09:30:44.000Z",
                    }
                }
            ]
        },
        "encode": "JSON"
    }
}
getUserByAccountId
Nome metodo originale: getUserByAccountId
Questo metodo GET restituisce i dettagli utente per un account specificato.
Query:
/getUserByAccountId?accountId=accountId value
Parametri:
  • accountId: string – L'ID dell'account.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
          "userId": "admin",
          "orgId": "Org1MSP"
        },
        "encode": "JSON"
    }
}
getUsersByRole
Nome metodo originale: getUsersByRole
Questo metodo restituisce un elenco di tutti gli utenti per un ruolo specificato.
/getUsersByRole?role=role value (for example minter / burner)
Parametri:
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "users": [
                {
                    "userId": "admin",
                    "orgId": "Org1MSP"
                }
            ]
        },
        "encode": "JSON"
    }
}
init
Nome metodo originale: init
Questo metodo viene richiamato quando viene distribuito il codice concatenato. Le informazioni utente vengono salvate come Token Admin del codice concatenato.
Payload:
{
    "adminList": "[{\"orgId\":\"{{bc-org-id}}\",\"userId\":\"{{bc-admin-user}}\"}]"
}
Parametri:
  • adminList array: array di informazioni {user_id, org_id} che specifica la lista di amministratori di token. L'array adminList è un parametro obbligatorio.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "fdb7dc89832c8045a333823b77fa24ae628178148dc93b3550040e070d7cd807",
        "payload": "",
        "encode": "UTF-8",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 263
    }
}
isInRole
Nome metodo originale: isInRole
Questo metodo GET restituisce un valore booleano per indicare se un utente dispone di un ruolo specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal Account Owner dell'account.
Query:
/isInRole?orgId={{bc-org-id}}&userId={{bc-user-id}}&role=role value (for example minter / burner)
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • role: string: il nome del ruolo da cercare.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "result":"true"
        },
        "encode": "JSON"
    }
}
isInTokenSysRole
Nome metodo originale: isInTokenSysRole
Questo metodo GET restituisce un valore booleano per indicare se un utente dispone di un ruolo TokenSys specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato o dal Account Owner dell'account.
Query:
/isInTokenSysRole?orgId={{bc-org-id}}&userId={{bc-user-id}}&role=role value (for example vault)
Parametri:
  • role: string: il nome del ruolo TokenSys da cercare.
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "result": true,
            "msg": "Account Id oaccount~bf07f584a94be44781e49d9101bfaf58c6fbbe77a4dfebdb83c874c2caf03eba (Org-Id: Org1MSP, User-Id: user1) has vault role"
        },
        "encode": "JSON"
    }
}
isNFTLocked
Nome metodo originale: isNFTLocked
Questo metodo GET restituisce un valore booleano per indicare se un token specificato è bloccato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato, dal proprietario del token o dal manager del vault (l'utente con il ruolo TokenSys vault).
Query:
/isNFTLocked?tokenId={{bc-token-id}}
Parametri:
  • tokenId: string: l'ID del token.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
           "isNFTLocked":true
        },
        "encode": "JSON"
    }
}
lockNFT
Nome metodo originale: lockNFT
Questo metodo POST blocca un token non fungibile specificato. Per bloccare un token, deve esistere un utente con il ruolo TokenSys vault che funge da manager del vault.
Payload:
{
    "tokenId": "{{bc-token-id}}",
    "sameOrgEndorser": true
}
Parametri:
  • tokenId: string: l'ID del token da bloccare.
  • sameOrgEndorser: boolean: valore booleano che indica se le dichiarazioni a sostegno delle transazioni devono provenire dalla stessa organizzazione del richiedente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
           "assetType":"otoken",
           "tokenId":"token1",
           "tokenName":"artcollection",
           "symbol":"ART",
           "tokenStandard":"erc721+",
           "tokenType":"nonfungible",
           "tokenUnit":"whole",
           "behaviors":[
              "indivisible",
              "singleton",
              "mintable",
              "transferable",
              "lockable",
              "burnable",
              "roles"
           ],
           "roles":{
              "minter_role_name":"minter"
           },
           "mintable":{
              "max_mint_quantity":20000
           },
           "createdBy":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
           "creationDate":"2023-10-20T10:26:29.000Z",
           "owner":"oaccount~208e3345ac84b4849f0d2648b2f2f018019886a1230f99304ebff1b6a7733463",
           "isBurned":false,
           "isLocked":true,
           "tokenUri":"token1.example.com",
           "price":120,
           "on_sale_flag":false
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
post
Nome metodo originale: post
Questo metodo POST pubblica un token per la vendita per un prezzo specificato.
Payload:
{
    "tokenId": "{{bc-token-id}}",
    "sellingPrice": 1,
    "endorsers": {{endorsers}}
}
Parametri:
  • tokenId: string: l'ID del token.
  • sellingPrice: number – Il prezzo del token.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Token ID: 'monalisa'  has been posted for selling in the marketplace"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
removeRole
Nome metodo originale: removeRole
Questo metodo rimuove un ruolo da un utente specificato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
    "role": "role value (for example minter / burner)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • 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.
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully removed role 'minter' from Account Id: oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba (Org-Id: Org1MSP, User-Id: user1)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
removeTokenAdmin
Nome metodo originale: removeTokenAdmin
Questo metodo POST rimuove un utente come Token Admin del codice concatenato. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato. Un amministratore non può rimuovere se stesso.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "sameOrgEndorser": true
}
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.
  • sameOrgEndorser: boolean: valore booleano che indica se le dichiarazioni a sostegno delle transazioni devono provenire dalla stessa organizzazione del richiedente.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully removed Admin (orgId: Org1MSP, userId: User1)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
removeTokenSysRole
Nome metodo originale: removeTokenSysRole
Questo metodo rimuove un ruolo TokenSys da un utente e da un token specificati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
    "role": "role value (for example vault)",
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • role: string: il nome del ruolo TokenSys da rimuovere dall'utente specificato.
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully removed role 'vault' from Account Id: oaccount~bf07f584a94be44781e49d9101bfaf58c6fbbe77a4dfebdb83c874c2caf03eba (Org-Id: Org1MSP, User-Id: user1)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
safeTransferFrom
Nome metodo originale: safeTransferFrom
Questa è una funzione asincrona. Questo metodo POST trasferisce la proprietà dell'NFT specificato dal chiamante a un altro conto. Questo metodo include le convalide riportate di seguito.
  • Il token esiste e non viene masterizzato.
  • Il conto mittente e il conto ricevente esistono e non sono lo stesso conto.
  • L'account mittente è proprietario del token.
  • Il chiamante della funzione è il mittente.
Payload:
{
    "fromOrgId": "fromOrgId value",
    "fromUserId": "fromUserId value",
    "toOrgId": "toOrgId value",
    "toUserId": "toUserId value",
    "tokenId": "{{bc-token-id}}",
    "data": "data value",
    "endorsers": {{endorsers}}
}
Parametri:
  • fromOrgId: string - L'ID MSP (Membership Service Provider) del mittente e del proprietario del token nell'organizzazione corrente.
  • fromUserId: string – Il nome utente o l'ID e-mail del mittente e del proprietario del token.
  • toOrgId: string - L'ID MSP (Membership Service Provider) del destinatario nell'organizzazione corrente.
  • toUserId: string: il nome utente o l'ID e-mail del destinatario.
  • tokenId: string: l'ID del token da trasferire.
  • data: string: informazioni aggiuntive facoltative da memorizzare nel record transazione.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully transferred NFT token: 'monalisa' from Account-Id:     oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d (Org-Id: Org1MSP, User-Id: admin) to Account-Id: oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba (Org-Id: Org1MSP, User-Id: user1)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
suspendAccount
Nome metodo originale: suspendAccount
Questo metodo sospende un account token fungibile. Restituisce un errore se non viene trovato un valore accountStatus nel libro contabile. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Payload:
{
    "orgId": "{{bc-org-id}}",
    "userId": "{{bc-user-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • orgId: string - L'ID MSP (Membership Service Provider) dell'utente nell'organizzazione corrente.
  • userId: string: il nome utente o l'ID e-mail dell'utente.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "assetType": "oaccountStatus",
            "statusId": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
            "accountId": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
            "status": "suspended"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
symbol
Nome metodo originale: symbol
Questo metodo restituisce il simbolo della classe token. Chiunque può chiamare questo metodo.
Query:
/symbol
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "symbol": "PNT"
        },
        "encode": "JSON"
    }
}
tokenURI
Nome metodo originale: tokenURI
Questo metodo restituisce l'URI di un token specificato. Chiunque può chiamare questo metodo.
Query:
/tokenURI?tokenId={{bc-token-id}}
Parametri:
  • tokenId: string: l'ID del token.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {   
            "tokenURI": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\.ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg"
        },
        "encode": "JSON"
    }
}
totalNetSupply
Nome metodo originale: totalNetSupply
Questo metodo GET restituisce il numero totale di token coniati meno il numero di token bruciati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
/totalNetSupply
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "totalNetSupply": 1
        },
        "encode": "JSON"
    }
}
totalSupply
Nome metodo originale: totalSupply
Questo metodo GET restituisce il numero totale di token coniati. Questo metodo può essere chiamato solo da un Token Admin del codice concatenato.
Query:
/totalSupply
Parametri:
  • nessuno
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "payload": {
            "totalSupply": 3
        },
        "encode": "JSON"
    }
}
transferFrom
Nome metodo originale: transferFrom
Questa è una funzione asincrona. Questo metodo trasferisce la proprietà dell'NFT specificato da un conto mittente a un conto ricevente. È responsabilità del chiamante passare i parametri corretti. Questo metodo può essere richiamato da qualsiasi utente, non solo dal proprietario del token. Questo metodo include le convalide riportate di seguito.
  • Il token esiste e non viene masterizzato.
  • Il conto mittente e il conto ricevente esistono e non sono lo stesso conto.
  • L'account mittente è proprietario del token.
Payload:
{
    "fromOrgId": "fromOrgId value",
    "fromUserId": "fromUserId value",
    "toOrgId": "toOrgId value",
    "toUserId": "toUserId value",
    "tokenId": "{{bc-token-id}}",
    "endorsers": {{endorsers}}
}
Parametri:
  • fromOrgId: string – L'ID MSP (Membership Service Provider) del mittente nell'organizzazione corrente.
  • fromUserId: string – Il nome utente o l'ID e-mail del mittente.
  • toOrgId: string - L'ID MSP (Membership Service Provider) del destinatario nell'organizzazione corrente.
  • toUserId: string: il nome utente o l'ID e-mail del destinatario.
  • tokenId: string: l'ID del token da trasferire.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully transferred NFT token: 'monalisa' from Account-Id: oaccount~ec32cff8635a056f3dda3da70b1d6090d61f66c6a170c4a95fd008181f729dba (Org-Id: Org1MSP, User-Id: user1) to Account-Id: oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d (Org-Id: Org1MSP, User-Id: admin)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
transferTokenSysRole
Nome metodo originale: transferTokenSysRole
Questo metodo trasferisce un ruolo TokenSys da un utente a un altro utente.
Payload:
{
    "role": "role value (for example vault)",
    "fromOrgId": "fromOrgId value",
    "fromUserId": "fromUserId value",
    "toOrgId": "toOrgId value",
    "toUserId": "toUserId value",
    "endorsers": {{endorsers}}
}
Parametri:
  • role: string: il nome del ruolo TokenSys da trasferire.
  • fromOrgId: string – L'ID MSP (Membership Service Provider) del mittente nell'organizzazione corrente.
  • fromUserId: string – Il nome utente o l'ID e-mail del mittente.
  • toOrgId: string - L'ID MSP (Membership Service Provider) del destinatario nell'organizzazione corrente.
  • toUserId: string: il nome utente o l'ID e-mail del destinatario.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "msg": "Successfully transfered role 'vault' from Account Id: ouaccount~f4e311528f03fffa7810753d643f66289ff6c9080fcf839902f28a1d3aff1789 (Org-Id: Org1MSP, User-Id: user1) to Account Id: ouaccount~ae5be2ae8f98d6d32f5d02b43877d987114e7937c7bacbc30390dcce09996a19 (Org-Id: Org1MSP, User-Id: user2)"
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}
updateArtCollectionToken
Nome metodo originale: updateArtCollectionToken
Questo metodo aggiorna le proprietà del token. Dopo la creazione di un asset token, solo il proprietario del token può aggiornare le proprietà personalizzate del token. Se l'utente è sia proprietario del token che creatore di un token, può anche aggiornare la proprietà TokenDesc. Impossibile aggiornare i metadati del token. È necessario passare tutte le proprietà del token a questo metodo, anche se si desidera aggiornare solo determinate proprietà.
Payload:
{
    "tokenAsset": "{\"tokenId\":\"{{bc-token-id}}\",\"tokenDesc\":\"tokenDesc value\",\"tokenUri\":\"tokenUri value\",\"Price\":999,\"On_Sale_Flag\":true}",
    "sameOrgEndorser": true
}
Parametri:
  • tokenAsset: <Token Class>: l'asset token da aggiornare. Per ulteriori informazioni sulle proprietà dell'asset token, vedere il file delle specifiche di input.
  • endorsers: string[]: un array di peer (ad esempio, peer1, peer2) che deve approvare la transazione.
Esempio di valore restituito:
{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "bd7416689b1acdace3c557faebbc0ad9a51671c10278ba6909350a6fe4b08eed",
        "payload": {
            "metadata": {
                "painting_name": "Mona_Lisa",
                "description": "Mona Lisa Painting",
                "image": "monalisa.jpeg",
                "painter_name": "Leonardo_da_Vinci"
            },
            "assetType": "otoken",
            "tokenId": "monalisa",
            "tokenName": "artcollection",
            "tokenDesc": "token description",
            "symbol": "ART",
            "tokenStandard": "erc721+",
            "tokenType": "nonfungible",
            "tokenUnit": "whole",
            "behaviors": [
                "indivisible",
                "singleton",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 20000
            },
            "owner": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "createdBy": "oaccount~42e89f4c72dfde9502814876423c6da630d466e87436dd1aae201d347ad1288d",
            "creationDate": "2022-04-05T08:30:42.000Z",
            "isBurned": false,
            "tokenUri": "https://bafybeid6pmpp62bongoip5iy2skosvyxh3gr7r2e35x3ctvawjco6ddmsq\\.ipfs.infura-ipfs.io/?filename=MonaLisa.jpeg",
            "price": 100,
            "on_sale_flag": true
        },
        "encode": "JSON",
        "sourceURL": "cb-oabcs1-bom.blockchain.ocp.example.com:20009",
        "blockNumber": 193
    }
}