Developer tools FAQs
In this section we address some common questions that developers may have.
How can i limit a query to transactions sent from a specific address?
You can also filter based on the RPC API query using the following:
- mainnet
- testnet
terpd query txs --events 'wasm._contract_address=<contract-address>&message.sender=<address>
terpd query txs --events 'wasm._contract_address=<contract-address>&message.sender=<address>
You can also filter based on the RPC API query using the following:
- mainnet
- testnet
https://rpc-terp.zenchainlabs.io/tx_search?query=message.sender=<address>ANDmessage.action=/cosmwasm.wasm.v1.MsgInstantiateContract&order_by=desc
https://rpc-t.terp.nodestake.top/tx_search?query=message.sender=<address>ANDmessage.action=/cosmwasm.wasm.v1.MsgInstantiateContract&order_by=desc
How can I query the bank module and filter for a particular action type?
You can use the events flag and filter events based on various actions, for example:
- mainnet
- testnet
terpd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node https://rpc.mainnet.terp.network:443
terpd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node https://rpc.testnet.terp.network:443
How can I convert an address from one network to another?
You can get a network address from an address of a different network via Javascript using the CosmosJS library @cosmjs/encoding which you can find inside the cosmjs. The following code snippet shows how to convert from a JUNO address to Terp:
import { fromBech32, toBech32 } from ""@cosmjs/encoding""
const { data } = fromBech32('juno1xxxyyy...')
const terpAddress = toBech32('terp', data)"
if you want to convert an public address manually, you can use the terpd cli like this:
terpd debug bech32-convert <address> terp
Usage:
terpd debug bech32-convert [bech32 string] [flags]
Flags:
-h, --help help for bech32-convert
-p, --prefix string Bech32 Prefix to encode to (default "terp")
Global Flags:
--home string directory for config and data (default "/Users/returniflost/.terp")
--log_format string The logging format (json|plain) (default "plain")
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
--trace print out full stack trace on errors
How can I query paginated data?
To query paginated data, append the --page 1 flag to the command for the page you required, where 1 in this example signifies the first page. By default 100 records are returned per page.
How can I output data in JSON format?
To output data in a JSON format, you can append the --output "json" flag to the command.