cw

package
v0.0.0-...-cb07b45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SignatureHeader is the header that contains the signature of the request
	SignatureHeader = "X-Signature"
	// PubKeyHeader is used for encrypting the response
	PubKeyHeader = "X-PubKey"
	// AddressHeader is the header that contains the address of the sender
	AddressHeader = "X-Address"
)

Variables

This section is empty.

Functions

func GetAddressFromContext

func GetAddressFromContext(ctx context.Context) (string, bool)

get address from context if exists

func GetPubKeyFromContext

func GetPubKeyFromContext(ctx context.Context) (string, bool)

get pub key from context if exists

Types

type ChainConfig

type ChainConfig struct {
	Name           string              `json:"name"`
	Chain          string              `json:"chain"`
	Icon           string              `json:"icon"`
	RPC            []string            `json:"rpc"`
	Features       []ChainFeature      `json:"features"`
	Faucets        []string            `json:"faucets"`
	NativeCurrency ChainNativeCurrency `json:"nativeCurrency"`
	InfoURL        string              `json:"infoURL"`
	ShortName      string              `json:"shortName"`
	ChainID        int                 `json:"chainId"`
	NetworkID      int                 `json:"networkId"`
	Slip44         int                 `json:"slip44"`
	ENS            ChainENS            `json:"ens"`
	Explorers      []ChainExplorer     `json:"explorers"`
}

ChainConfig is the configuration for a chain

func GetChain

func GetChain(path string) (*ChainConfig, error)

GetChain returns the chain config for the local chain.json file

type ChainENS

type ChainENS struct {
	Registry string `json:"registry"`
}

type ChainExplorer

type ChainExplorer struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Standard string `json:"standard"`
}

type ChainFeature

type ChainFeature struct {
	Name string `json:"name"`
}

type ChainNativeCurrency

type ChainNativeCurrency struct {
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	Decimals int    `json:"decimals"`
}

type ContextKey

type ContextKey string
const (
	ContextKeyPubKey  ContextKey = PubKeyHeader
	ContextKeyAddress ContextKey = AddressHeader
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL