Skip to content

Node Client

Connect to the node.

Rust
let node_client = NodeClient::connect(config);

Public Node API

Get Account Balances

The Get Account Balances method retrieves the balance for a specific wallet address across all currency denominations within the account.

It provides the balance details encapsulated in a response structure, typically including the coin type and respective amounts.

Method Declaration

Python
async def get_account_balances(
        self,
        address: str,
) -> bank_query.QueryAllBalancesResponse

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchemaDescription
200OKCoinThe response containing all account balances.

Examples: Python | TypeScript | Rust

Get Account Balance

The Get Account Balance query retrieves the balance of a specified account address for a particular denomination.

This function is crucial for obtaining the current funds available in a wallet within blockchain network.

Method Declaration

Python
async def get_account_balance(
    self,
    address: str,
    denom: str,
) -> bank_query.QueryBalanceResponse

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.
denomqueryDenomtrueThe denomination of the balance.

Response

StatusMeaningSchema
200OKCoin

Examples: Python | Rust

Get Account

The Get Account function retrieves an account using its unique wallet address, returning detailed account information encapsulated in the BaseAccount structure.

This is essential for obtaining ownership details and balances associated with the account address provided.

Method Declaration

Python
async def get_account(self, address: str) -> BaseAccount
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKBaseAccount

Examples: Python | TypeScript | Rust

Get Latest Block

The method Get Latest Block retrieves the most recent block from the blockchain network.

This is useful for obtaining the latest state or data committed on the chain, ensuring the application operates with up-to-date information.

Method Declaration

Python
async def latest_block(self) -> tendermint_query.GetLatestBlockResponse

Parameters

Response

StatusMeaningSchema
200OKBlock

Examples: Python | Rust

Get Latest Block Height

The Get Latest Block Height function asynchronously retrieves the most recent block height from a blockchain network.

This information is typically returned as an integer value wrapped in a specific data type or promise, indicating the current height of the blockchain.

Method Declaration

Python
async def latest_block_height(self) -> int

Parameters

Response

StatusMeaningSchema
200OKHeight

Examples: Python | Rust

Get User Stats

The Get User Stats method retrieves statistical data for a user's Maker and Taker positions associated with a specified wallet address.

By querying this API, users can access detailed insights into their trading activities across various financial positions.

Method Declaration

Python
async def get_user_stats(
    self,
    address: str,
) -> stats_query.QueryUserStatsResponse
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
userqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKUserStats

Examples: Python | TypeScript | Rust

Get All Validators

The Get All Validators method fetches a list of all validators, optionally filtering them by a specified status.

This can be useful for monitoring network participants and their roles within a blockchain staking system.

Method Declaration

Python
async def get_all_validators(
    self,
    status: str = "",
) -> staking_query.QueryValidatorsResponse

Parameters

ParameterLocationTypeRequiredDescription
statusqueryStringfalseStatus to filter out the matched result.

Response

StatusMeaningSchema
200OKValidator

Examples: Python | TypeScript | Rust

Get Subaccounts

The Get Subaccounts function retrieves a comprehensive list of all subaccounts associated with an account, returning structured information encapsulated in a response object.

This aids in managing and viewing details of subaccounts under a main account efficiently.

Method Declaration

Python
async def get_subaccounts(self) -> QuerySubaccountAllResponse

Parameters

Response

StatusMeaningSchema
200OKSubaccountInfo

Examples: Python | TypeScript | Rust

Get Subaccount

The Get Subaccount method fetches details of a specific subaccount based on its owner's address and the subaccount's unique number.

It returns information about the subaccount, including its configuration and current status.

Method Declaration

Python
async def get_subaccount(
    self,
    address: str,
    account_number: int,
) -> Optional[subaccount_type.Subaccount]
Unification Plan
  • Rust uses Subaccount - a wrapper that combines Address with SubaccountNumber, it's safer to create the same type for Python and TypeScript

Parameters

ParameterLocationTypeRequiredDescription
ownerqueryAddresstrueThe wallet address that owns the subaccount.
numberquerySubaccountNumbertrueThe identifier for the specific subaccount withing the wallet address.

Response

StatusMeaningSchema
200OKSubaccountInfo

Examples: Python | TypeScript | Rust

Get Clob Pair

The Get Clob Pair function fetches the order book pair identified by a given ID, allowing users to retrieve detailed information about a specific trading pair within a Central Limit Order Book (CLOB) system.

The response typically includes data structured within the ClobPair schema.

Method Declaration

Python
async def get_clob_pair(self, pair_id: int) -> clob_pair_type.ClobPair

Parameters

ParameterLocationTypeRequiredDescription
idqueryu32trueClob pair id

Response

StatusMeaningSchema
200OKClobPair

Examples: Python | Rust

Get Clob Pairs

The Get Clob Pairs function is utilized to obtain a comprehensive list of all available order book trading pairs from a centralized limit order book.

It facilitates managing large datasets by supporting optional pagination parameters, ensuring efficient data retrieval (not in all clients yet).

Method Declaration

Python
async def get_clob_pairs(self) -> QueryClobPairAllResponse
Unification Plan
  • Python and TypeScript don't contain options

Parameters

ParameterLocationTypeRequiredDescription
paginationqueryPageRequestfalseParameters of pagination.

Response

StatusMeaningSchema
200OKClobPair

Examples: Python | TypeScript | Rust

Get Price

The Get Price method is used to retrieve the current market price for a specified market, identified by its id.

It returns the price as a MarketPrice object when the request is successful.

Method Declaration

Python
async def get_price(self, market_id: int) -> market_price_type.MarketPrice
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
idqueryu32truemarket id to get price

Response

StatusMeaningSchema
200OKMarketPrice

Examples: Python | Rust

Get Prices

The Get Prices method is used to query all market prices from the system, providing an overview of current market values.

It can include optional pagination parameters to manage large sets of data efficiently (not in all clients yet).

Method Declaration

Python
async def get_prices(self) -> QueryAllMarketPricesResponse
Unification Plan
  • Python and TypeScript don't contain options

Parameters

ParameterLocationTypeRequiredDescription
paginationqueryPageRequestfalseParameters of pagination.

Response

StatusMeaningSchema
200OKMarketPrice

Examples: Python | TypeScript | Rust

Get Perpetual

The Get Perpetual method queries a specific perpetual contract by its unique perpetual_id, returning details about the contract.

This is an asynchronous function typically used to retrieve data such as market conditions or contract specifications.

Method Declaration

Python
async def get_perpetual(self, perpetual_id: int) -> QueryPerpetualResponse
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
idqueryu32truePerpetual id

Response

StatusMeaningSchema
200OKPerpetual

Examples: Python | Rust

Get Perpetuals

The Get Perpetuals function allows you to retrieve a list of all perpetuals currently available in the system.

It's designed to support pagination, so you can specify pagination parameters to control the volume of data retrieved in each query (no in all clients yet).

Method Declaration

Python
async def get_perpetuals(self) -> QueryAllPerpetualsResponse
Unification Plan
  • Python and TypeScript don't contain options
  • Options in protocol are not optional

Parameters

ParameterLocationTypeRequiredDescription
paginationqueryPageRequestfalseParameters of pagination.

Response

StatusMeaningSchema
200OKPerpetual

Examples: Python | Rust

Get Equity Tier Limit Config

The Equity Tier Limit Configuration is a method used to fetch the configuration details that outline the limits set for different tiers of equity.

It provides essential data that defines the specific constraints and parameters associated with each equity tier.

Method Declaration

Python
async def get_equity_tier_limit_config(
    self,
) -> equity_tier_limit_config_type.EquityTierLimitConfiguration:
Unification Plan

Parameters

Response

StatusMeaningSchema
200OKEquityTierLimitConfiguration

Examples: Python | TypeScript | Rust

Get Delegator Delegations

The Get Delegator Delegations method retrieves all delegations associated with a specific delegator address.

This can be useful in blockchain or staking systems to view the stakes that an individual delegator has allocated to various validators.

Method Declaration

Python
async def get_delegator_delegations(
    self, delegator_addr: str
) -> staking_query.QueryDelegatorDelegationsResponse
Unification Plan
  • Python and TypeScript don't contain options
  • Options in protocol are not optional
  • Two types of options (v4 and cosmos, are the same, please use cosmos)

Parameters

ParameterLocationTypeRequiredDescription
delegator_addrqueryAddresstrueThe wallet address that owns the subaccount.
paginationqueryPageRequestfalseParameters of pagination.

Response

StatusMeaningSchema
200OKDelegationResponse

:::

Examples: Python | TypeScript | Rust

Get Delegator Unbounding Delegations

The Get Delegator Unbonding Delegations function allows you to query all unbonding delegations associated with a specific delegator address.

This is particularly useful for tracking assets that are in the process of being unbonded from validators, providing insight into pending delegation changes.

Method Declaration

Python
async def get_delegator_unbonding_delegations(
    self, delegator_addr: str
) -> staking_query.QueryDelegatorUnbondingDelegationsResponse
Unification Plan
  • Python and TypeScript don't contain options
  • Options in protocol are not optional
  • Two types of options (v4 and cosmos, are the same, please use cosmos)

Parameters

ParameterLocationTypeRequiredDescription
delegator_addrqueryAddresstrueThe wallet address that owns the subaccount.
paginationqueryPageRequestfalseParameters of pagination.

Response

StatusMeaningSchema
200OKUnbondingDelegation

Examples: Python | TypeScript | Rust

Get Delayed Complete Bridge Messages

This method retrieves delayed bridge messages associated with a specified wallet address, focusing on messages that have not yet reached completion.

It requires the address of the wallet to access its related subaccount messages and returns a structured response detailing the delayed messages.

Method Declaration

Python
async def get_delayed_complete_bridge_messages(
    self,
    address: str = "",
) -> bridge_query.QueryDelayedCompleteBridgeMessagesResponse
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKDelayedCompleteBridgeMessage

Examples: Python | TypeScript | Rust

Get Fee Tiers

The Get Fee Tiers method retrieves current fee tiers associated with perpetual trading, helping to understand the fees applied based on trading volume or other criteria.

It responds with a structure defined by the PerpetualFeeTier, providing data essential for financial calculations and strategy planning.

Method Declaration

Python
async def get_fee_tiers(self) -> fee_tier_query.QueryPerpetualFeeParamsResponse
Unification Plan

Response

StatusMeaningSchema
200OKPerpetualFeeTier

Examples: Python | TypeScript | Rust

Get User Fee Tier

The Get User Fee Tier function retrieves the perpetual fee tier associated with a specific wallet address, providing information on the user's current fee structure.

This is essential for users to understand the fees applicable to their transactions on the platform.

Method Declaration

Python
async def get_user_fee_tier(
    self, address: str
) -> fee_tier_query.QueryUserFeeTierResponse
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
userqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKPerpetualFeeTier

Examples: Python | TypeScript | Rust

Get Rewards Params

The Get Rewards Params function retrieves the parameters for the rewards system, providing insight into the set configurations for earning and distributing rewards.

This API call returns a structured response detailing these parameters, ensuring users have access to the current rewards setup for planning and analysis.

Method Declaration

Python
async def get_rewards_params(self) -> rewards_query.QueryParamsResponse
Unification Plan
  • Rename Params to RewardsParams in Rust

Parameters

Response

StatusMeaningSchema
200OKRewardsParams

Examples: Python | TypeScript | Rust

Private Node API

Place Order

The Place Order method is used to execute a transaction that places an order on a market.

This function takes parameters for wallet authentication, various order details, and optional transaction options to manage specific order types and behaviors.

Method Declaration

Python
async def place_order(
    self,
    wallet: Wallet,
    order: Order,
    tx_options: Optional[TxOptions] = None,
)
Unification Plan
  • Use a convenient Wallet and Order pair for all clients
  • TypeScript doesn't use authenticators
  • In Python we use them explicitly
  • Consider to do the same like in Rust (set it automatically)

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction.
orderqueryOrdertrueThe order to place.
tx_optionsqueryTxOptionsfalseOptions for transaction to support authenticators.

Response

StatusMeaningSchema
200OKTxHash

Examples: Python | TypeScript | Rust

Cancel Order

The Cancel Order method terminates an existing order using the provided order_id and related parameters, such as block validity periods and transaction options. This method supports asynchronous operations for efficient order cancellation across different platforms.

Method Declaration

Python
async def cancel_order(
    self,
    wallet: Wallet,
    order_id: OrderId,
    good_til_block: int = None,
    good_til_block_time: int = None,
    tx_options: Optional[TxOptions] = None,
)
Unification Plan
  • Check the marketId is really needed (used in TypeScript)

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction.
order_idqueryOrderIdtrueThe ID of the order to cancel.
good_til_blockqueryi32falseThe block number until which the order is valid. Defaults to None.
good_til_block_timequeryi32falseThe block time until which the order is valid. Defaults to None.
tx_optionsqueryTxOptionsfalseOptions for transaction to support authenticators.

:::

Response

StatusMeaningSchema
200[OK]TxHash

Examples: Rust

Send Token

The Send Token function is used to transfer a specified token from one blockchain address to another.

It requires details such as the wallet for signing the transaction, sender and recipient addresses, and the quantum amount or denomination of the token.

Method Declaration

Python
async def send_token(
    self,
    wallet: Wallet,
    sender: str,
    recipient: str,
    quantums: int,
    denomination: str,
)
Unification Plan
  • All the types are different, revision is needed
  • Standard types like strings are used
  • Broadcast mode?
  • Zero fee?

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction.
senderqueryStringtrueThe sender address.
recipientqueryStringtrueThe recipient address.
quantumsqueryi32trueThe amount of quantums to send.
denominationqueryi32trueThe denomination of the token.

Response

StatusMeaningSchema
200OKTxHash

Examples: Rust

Simulate

The Simulate function allows for the pre-execution simulation of a transaction, predicting its execution cost and resource usage without committing any changes.

This method typically returns information like estimated gas fees or other transaction-related metrics to anticipate the impact of operations before they are executed on the blockchain.

Method Declaration

Python
async def simulate(self, transaction: Tx)
Unification Plan
  • Some extra parameters in TypeScript? What to do with them?

Parameters

ParameterLocationTypeRequiredDescription
transactionqueryTxtrueThe transaction to simulate.

Response

StatusMeaningSchema
200OKGasInfo

Examples: Python | TypeScript | Rust

Broadcast Transaction

The Broadcast Transaction method is used to send a transaction to the network for processing.

The key parameters include the transaction itself and the mode of broadcasting, which is optional and defaults to synchronous broadcasting mode.

Method Declaration

Python
async def broadcast(self, transaction: Tx, mode=BroadcastMode.BROADCAST_MODE_SYNC)
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
transactionqueryTxtrueThe transaction to broadcast.
modequeryBroadcastModefalseThe broadcast mode. Defaults to BroadcastMode.BROADCAST_MODE_SYNC.

:::

Response

StatusMeaningSchema
200OKTxHash

Examples: Rust

Authenticators

Access the authenticators/permissioned keys requests dispatcher.

Rust
let authenticators = node_client.authenticators();

Add

Add an authenticator.

Method Declaration

Python
async def add_authenticator(
    self,
    wallet: Wallet,
    authenticator: Authenticator,
):
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction or authenticating the request.
authenticatorqueryAuthenticatortrueThe authenticator to be added.

Response

StatusMeaningSchema
200[OK]TxHash

Examples: Python | TypeScript | Rust

Remove

Remove an added authenticator.

Method Declaration

Python
async def remove_authenticator(self, wallet: Wallet, authenticator_id: int)
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction or authenticating the request.
authenticator_idqueryinttrueThe authenticator identifier.

Response

StatusMeaningSchema
200[OK]TxHash

Examples: Python | TypeScript | Rust

List

List down added authenticators.

Method Declaration

Python
async def get_authenticators(
    self,
    address: str,
) -> accountplus_query.GetAuthenticatorsResponse
Unification Plan

Parameters

ParameterLocationTypeRequiredDescription
accountqueryAddresstrueThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKAccountAuthenticator

Examples: Python | TypeScript | Rust