Upon successful connection via cardano.{walletName}.enable()
, a javascript object we will refer to as API
(type) / api
(instance) is returned to the dApp with the following methods.
All methods should not require any user interaction as the user has already consented to the dApp querying information from the blockchain when they agreed to cardano.{walletName}.enable()
.
api.query.utxos.asset(asset_name: AssetName, minting_policy_hash: ScriptHash) : Promise<TransactionUnspentOutput[]>
Get all UTxOs that contain some of the specified asset
api.query.utxos.transaction_hash(transaction_hash: TransactionHash) : Promise<TransactionUnspentOutput[]>
Get all UTxOs produced by the transaction
Get all UTxOs present at the address
Get all UTxOs present at the addresses which use the payment credential
api.query.utxos.stake_credential(reward_address: RewardAddress) : Promise<TransactionUnspentOutput[]>
Get all UTxOs present at the addresses which use the stake credential
Get the block with the supplied block number
Get the block with the supplied block hash
Get the transaction with the supplied transaction hash
Get all transactions contained in the block with the supplied block number []
Get all transactions contained in the block with the supplied block hash
Get the datum that hashes to the supplied data hash
Get the plutus script that hashes to the supplied script hash
Get the native script that hashes to the supplied script hash
api.query.metadata.transaction_hash(transaction_hash: TransactionHash) : Promise<TransactionMetadatum>
Get the metadata present on the transaction with the supplied transaction hash
Get the latest protocol parameters
Get the protocol parameters at the supplied epoch number
Votes cast by the supplied cc credential
Votes cast by the supplied stake pool operator
Votes cast by the supplied DRep
Votes cast on the supplied proposal
Get all the known DReps
Get a specific DRep by id
Get the DRep that the stake credential has delegated to
Get all known committee members
Get a specific Committee member by id
Get all known stake pools
Get a specific stake pool by id
Get all known proposals
Get a specific proposal by id
Get the start and end of each era along with parameters that can vary between hard forks