# Module API

Each module in Miyabi provides additional endpoints. To verify if a module is correctly loaded, Swagger has a list of all the supported APIs.

# Asset API

URL Method Description
/asset/table/{tableName} GET Return all the addresses and corresponding balances of a particular table
/asset/value/{tableName}/{Address} GET Return the balance amount as decimal for a given address
/asset/values POST Return the balances of the requested addresses in an asset table
/asset/exists/table/{tableName} GET Return true if the asset table exists, else false
/asset/exists/value/{tableName}/{address} GET Return true if the entry of an asset table exists, else false

# Binary API

URL Method Description
/binary/table/{tableName} GET Return the entire content from a binary table
/binary/value/{tableName}/{key} GET Return the value of an entry from a binary table
/binary/values POST Return the values of the requested keys in a binary table
/binary/exists/table/{tableName} GET Return true if the binary table exists, else false
/binary/exists/value/{tableName}/{key} GET Return true if an entry of a binary table exists, else false

# Contract API

URL Method Description
/contract/analyzer/parameters GET Return the Allowed Assemblies, which are whitelisted for use in smart contracts, and the lists of Allowed and Forbidden Members. Members represent a data model or a namespace. Only the Allowed Libraries and Allowed Members can be used in smart contracts
/contract/assemblies GET Return a list of all deployed contracts' assemblies
/contract/instances GET Return a list of the instantiated contracts
/contract/query/{asmId}/{contractName}/{instanceName}/{methodName}
QueryParams arguments
GET Query a method in a deployed smart contract. This is a 'read-only' operation and will not change any state on the blockchain. The result of the method will be returned as a JSON string

# Entity API

URL Method Description
/entity/table/{tableName} GET Return the entire content from a given entity table with each entity's values in string and hex format
/entity/tree/{tableName}/{key}
QueryParams depth
GET Return the entity relationship tree for a given entity from the entity table with each entity's values in string and hex format. Each child will return the full information of the entry to form a hierarchical structure. It can be filtered by depth
/entity/value/{tableName}/{key} GET Return the entity value in string and hex format, along with the relationships for a given entity from the entity table
/entity/values POST Return multiple entity values in string and hex format, along with the relationships of the requested entries in an entity table
/entity/exists/table/{tableName} GET Return true if the entity table exists, else false
/entity/exists/value/{tableName}/{key} GET Return true if an entry of an entity table exists, else false

# NFT API

URL Method Description
/NFT/table/{tableName} GET Return the entire content from a given NFT table
/NFT/value/{tableName}/{address}/balance GET Return the number of NFT tokens owned by a given address
/NFT/value/{tableName}/{tokenId}/owner GET Return the owner address of a specific NFT token
/NFT/values/balance POST Return the number of NFT tokens owned by the given owners
/NFT/values/owner POST Return the owners of given NFT Tokens
/NFT/exists/table/{tableName} GET Return true if the NFT table exists, else false
/NFT/exists/value/{tableName}/{tokenId} GET Return true if the token exists in the NFT table, else false

# Private Data API

URL Method Description
/PrivateDataHash/table/{tableName} GET Return all hash private data entries from a given private data table
/PrivateDataHash/value/{tableName}/{key} GET Return hash private data entry from a given table and key
/PrivateDataHash/values POST Return the hash private data entries for the requested keys in a given table
/PrivateDataHash/owners/{tableName}/{key} GET Return the data owners information of a given entry in a given table
/PrivateDataHash/exists/table/{tableName} GET Return true if the private data table exists, else false
/PrivateDataHash/exists/value/{tableName}/{key} GET Return true if an entry of a private data table exists, else false