Documentation ¶
Index ¶
- Constants
- func Connect(protoAddr string) (net.Conn, error)
- func DialerFunc(ctx context.Context, addr string) (net.Conn, error)
- func ExecuteCall[Q any, R any](ctx context.Context, cookieAssistant CookieAssistant, call APICall[Q, R], ...) (*R, error)
- func ExecuteStreamCall[Q any, S grpc.ClientStream](ctx context.Context, cookieAssistant CookieAssistant, call APIStreamCall[Q, S], ...) (S, error)
- func HexToBytes(str string) ([]byte, error)
- func LoadTLSCert(path, serverName string) credentials.TransportCredentials
- func MsgResponse(data []byte) []*chaintypes.TxResponseGenericMessage
- func ProtocolAndAddress(listenAddr string) (protocol, address string)
- func RemoveExtraDecimals(value decimal.Decimal, decimalsToRemove int32) decimal.Decimal
- type APICall
- type APIStreamCall
- type BareMetalLoadBalancedCookieAssistant
- type ClientOption
- type ClientOptions
- type CookieAssistant
- type DisabledCookieAssistant
- type ExpiringCookieAssistant
- type MetadataProvider
- type Network
Constants ¶
View Source
const ( MainnetTokensListURL = "https://github.com/InjectiveLabs/injective-lists/raw/master/tokens/mainnet.json" // nolint:gosec // not credentials, just the link to the public tokens list TestnetTokensListURL = "https://github.com/InjectiveLabs/injective-lists/raw/master/tokens/testnet.json" // nolint:gosec // not credentials, just the link to the public tokens list DevnetTokensListURL = "https://github.com/InjectiveLabs/injective-lists/raw/master/tokens/devnet.json" // nolint:gosec // not credentials, just the link to the public tokens list )
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect dials the given address and returns a net.Conn. The protoAddr argument should be prefixed with the protocol, eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock"
func ExecuteCall ¶ added in v1.51.0
func ExecuteStreamCall ¶ added in v1.51.0
func ExecuteStreamCall[Q any, S grpc.ClientStream](ctx context.Context, cookieAssistant CookieAssistant, call APIStreamCall[Q, S], in *Q) (S, error)
func HexToBytes ¶
func LoadTLSCert ¶ added in v1.51.0
func LoadTLSCert(path, serverName string) credentials.TransportCredentials
func MsgResponse ¶ added in v1.38.0
func MsgResponse(data []byte) []*chaintypes.TxResponseGenericMessage
func ProtocolAndAddress ¶
ProtocolAndAddress splits an address into the protocol and address components. For instance, "tcp://127.0.0.1:8080" will be split into "tcp" and "127.0.0.1:8080". If the address has no protocol prefix, the default is "tcp".
Types ¶
type APIStreamCall ¶ added in v1.51.0
type APIStreamCall[Q any, S grpc.ClientStream] func(ctx context.Context, in *Q, opts ...grpc.CallOption) (S, error)
type BareMetalLoadBalancedCookieAssistant ¶ added in v1.48.0
type BareMetalLoadBalancedCookieAssistant struct {
// contains filtered or unexported fields
}
func (*BareMetalLoadBalancedCookieAssistant) Metadata ¶ added in v1.48.0
func (assistant *BareMetalLoadBalancedCookieAssistant) Metadata(provider MetadataProvider) (string, error)
func (*BareMetalLoadBalancedCookieAssistant) ProcessResponseMetadata ¶ added in v1.51.0
func (assistant *BareMetalLoadBalancedCookieAssistant) ProcessResponseMetadata(header metadata.MD)
func (*BareMetalLoadBalancedCookieAssistant) RealMetadata ¶ added in v1.51.0
func (assistant *BareMetalLoadBalancedCookieAssistant) RealMetadata() metadata.MD
type ClientOption ¶
type ClientOption func(opts *ClientOptions) error
func OptionGasPrices ¶
func OptionGasPrices(gasPrices string) ClientOption
func OptionTLSCert ¶
func OptionTLSCert(tlsCert credentials.TransportCredentials) ClientOption
func OptionTxFactory ¶ added in v1.47.12
func OptionTxFactory(txFactory *tx.Factory) ClientOption
type ClientOptions ¶
type ClientOptions struct { GasPrices string TLSCert credentials.TransportCredentials TxFactory *tx.Factory ShouldFixSequenceMismatch bool }
func DefaultClientOptions ¶
func DefaultClientOptions() *ClientOptions
type CookieAssistant ¶ added in v1.48.0
type DisabledCookieAssistant ¶ added in v1.48.0
type DisabledCookieAssistant struct{}
func (*DisabledCookieAssistant) Metadata ¶ added in v1.48.0
func (assistant *DisabledCookieAssistant) Metadata(provider MetadataProvider) (string, error)
func (*DisabledCookieAssistant) ProcessResponseMetadata ¶ added in v1.51.0
func (assistant *DisabledCookieAssistant) ProcessResponseMetadata(header metadata.MD)
func (*DisabledCookieAssistant) RealMetadata ¶ added in v1.51.0
func (assistant *DisabledCookieAssistant) RealMetadata() metadata.MD
type ExpiringCookieAssistant ¶ added in v1.48.0
type ExpiringCookieAssistant struct {
// contains filtered or unexported fields
}
func MainnetKubernetesCookieAssistant ¶ added in v1.48.0
func MainnetKubernetesCookieAssistant() ExpiringCookieAssistant
func TestnetKubernetesCookieAssistant ¶ added in v1.48.0
func TestnetKubernetesCookieAssistant() ExpiringCookieAssistant
func (*ExpiringCookieAssistant) Metadata ¶ added in v1.48.0
func (assistant *ExpiringCookieAssistant) Metadata(provider MetadataProvider) (string, error)
func (*ExpiringCookieAssistant) ProcessResponseMetadata ¶ added in v1.51.0
func (assistant *ExpiringCookieAssistant) ProcessResponseMetadata(header metadata.MD)
func (*ExpiringCookieAssistant) RealMetadata ¶ added in v1.51.0
func (assistant *ExpiringCookieAssistant) RealMetadata() metadata.MD
type MetadataProvider ¶ added in v1.48.0
type MetadataProvider struct {
// contains filtered or unexported fields
}
func NewMetadataProvider ¶ added in v1.48.0
func NewMetadataProvider(f func() metadata.MD) MetadataProvider
type Network ¶ added in v1.36.1
type Network struct { LcdEndpoint string TmEndpoint string ChainGrpcEndpoint string ChainStreamGrpcEndpoint string ChainTLSCert credentials.TransportCredentials ExchangeGrpcEndpoint string ExplorerGrpcEndpoint string ExchangeTLSCert credentials.TransportCredentials ExplorerTLSCert credentials.TransportCredentials ChainId string FeeDenom string Name string ChainCookieAssistant CookieAssistant ExchangeCookieAssistant CookieAssistant ExplorerCookieAssistant CookieAssistant OfficialTokensListURL string }
func LoadNetwork ¶
func NewNetwork ¶ added in v1.49.0
func NewNetwork() Network
NewNetwork returns a new Network instance with all cookie assistants disabled. It can be used to setup a custom environment from scratch.
Click to show internal directories.
Click to hide internal directories.