Documentation ¶
Index ¶
- Variables
- func GetDerivativePrice(value, tickSize cosmtypes.Dec) cosmtypes.Dec
- func GetDerivativeQuantity(value decimal.Decimal, minTickSize cosmtypes.Dec) (qty cosmtypes.Dec)
- func GetSpotPrice(price decimal.Decimal, baseDecimals int, quoteDecimals int, ...) cosmtypes.Dec
- func GetSpotQuantity(value decimal.Decimal, minTickSize cosmtypes.Dec, baseDecimals int) (qty cosmtypes.Dec)
- func InitCosmosKeyring(cosmosKeyringDir string, cosmosKeyringAppName string, ...) (cosmtypes.AccAddress, keyring.Keyring, error)
- func KeyringForPrivKey(name string, privKey cryptotypes.PrivKey) (keyring.Keyring, error)
- func NewClientContext(chainId, fromSpec string, kb keyring.Keyring) (client.Context, error)
- func NewTxConfig(signModes []signingtypes.SignMode) client.TxConfig
- func NewTxFactory(clientCtx client.Context) tx.Factory
- type ChainClient
- type DerivativeOrderData
- type EncodingConfig
- type OrderCancelData
- type SpotOrderData
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetDerivativePrice ¶ added in v1.37.2
func GetDerivativeQuantity ¶ added in v1.37.2
func GetSpotPrice ¶ added in v1.37.2
func GetSpotQuantity ¶ added in v1.37.2
func InitCosmosKeyring ¶
func KeyringForPrivKey ¶
KeyringForPrivKey creates a temporary in-mem keyring for a PrivKey. Allows to init Context when the key has been provided in plaintext and parsed.
func NewClientContext ¶
NewClientContext creates a new Cosmos Client context, where chainID corresponds to Cosmos chain ID, fromSpec is either name of the key, or bech32-address of the Cosmos account. Keyring is required to contain the specified key.
func NewTxConfig ¶
func NewTxConfig(signModes []signingtypes.SignMode) client.TxConfig
NewTxConfig initializes new Cosmos TxConfig with certain signModes enabled.
Types ¶
type ChainClient ¶
type ChainClient interface { CanSignTransactions() bool FromAddress() sdk.AccAddress QueryClient() *grpc.ClientConn ClientContext() client.Context SyncBroadcastMsg(msgs ...sdk.Msg) (*txtypes.BroadcastTxResponse, error) AsyncBroadcastMsg(msgs ...sdk.Msg) (*txtypes.BroadcastTxResponse, error) QueueBroadcastMsg(msgs ...sdk.Msg) error GetBankBalances(ctx context.Context, address string) (*banktypes.QueryAllBalancesResponse, error) DefaultSubaccount(acc cosmtypes.AccAddress) eth.Hash SpotOrder(defaultSubaccountID eth.Hash, network common.Network, d *SpotOrderData) *exchangetypes.SpotOrder DerivativeOrder(defaultSubaccountID eth.Hash, network common.Network, d *DerivativeOrderData) *exchangetypes.DerivativeOrder OrderCancel(defaultSubaccountID eth.Hash, d *OrderCancelData) *exchangetypes.OrderData Close() }
func NewChainClient ¶
func NewChainClient( ctx client.Context, protoAddr string, options ...common.ClientOption, ) (ChainClient, error)
NewCosmosClient creates a new gRPC client that communicates with gRPC server at protoAddr. protoAddr must be in form "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock", protocol is required.
type DerivativeOrderData ¶ added in v1.34.0
type EncodingConfig ¶
type OrderCancelData ¶ added in v1.34.0
type SpotOrderData ¶ added in v1.34.0
Click to show internal directories.
Click to hide internal directories.