OrderlyApiClient

Documentation for eth_defi.orderly.api.OrderlyApiClient Python class.

class OrderlyApiClient

Bases: object

Orderly API client for deposit/withdrawals.

  • This client is responsible for registering accounts and keys with Orderly, so that we can delegate a vault to be a trading account on Orderly.

Parameters
  • account – The local account to register the account for.

  • broker_id – The broker ID to register the account for.

  • chain_id – The chain ID to register the account for.

  • is_testnet – Whether to use the testnet API endpoint.

Methods summary

__init__(*[, account, broker_id, chain_id, ...])

param account

delegate_signer(*, delegate_contract, ...)

Register a new orderly key for the given account.

get_balance()

register_account()

Register a new orderly account for the given account.

register_key(*[, permissions, delegate_contract])

Register a new orderly key for the given account.

__init__(*, account=None, broker_id=None, chain_id=None, is_testnet=False, orderly_account_id='', orderly_secret='')
Parameters
  • account (eth_account.signers.local.LocalAccount | None) – The local account to register the account for.

  • broker_id (str | None) – The broker ID to register the account for.

  • chain_id (int | None) – The chain ID to register the account for.

  • is_testnet (bool) – Whether to use the testnet API endpoint.

  • orderly_account_id (str) –

  • orderly_secret (str) –

register_account()

Register a new orderly account for the given account.

See also: https://orderly.network/docs/build-on-omnichain/user-flows/accounts

Return type

str

register_key(*, permissions='read,trading', delegate_contract=None)

Register a new orderly key for the given account.

See also: https://orderly.network/docs/build-on-omnichain/user-flows/wallet-authentication

Parameters
  • permissions (str) – The permissions to register the key for.

  • delegate_contract (str | None) – The contract (which delegated signing right to this account) to register the key for.

Return type

dict

delegate_signer(*, delegate_contract, delegate_tx_hash)

Register a new orderly key for the given account.

See also: https://orderly.network/docs/build-on-omnichain/user-flows/wallet-authentication

Parameters
  • permissions – The permissions to register the key for.

  • delegate_contract (str) –

  • delegate_tx_hash (str) –

Return type

dict