Documentation
¶
Index ¶
Constants ¶
const DefaultName = "cess-sdk-go"
const Version = "0.7.0"
SDK Version
Variables ¶
var DefaultRpcAddrs = func(cfg *Config) error { rpcAddrs := []string{ "wss://testnet-rpc.cess.network/ws/", } return cfg.Apply(ConnectRpcAddrs(rpcAddrs)) }
DefaultRpcAddrs configures the default rpc address
var DefaultSDKName = func(cfg *Config) error { return cfg.Apply(Name(DefaultName)) }
DefaultTimeout configures the default transaction waiting timeout
var DefaultTimeout = func(cfg *Config) error { return cfg.Apply(TransactionTimeout(time.Second * 18)) }
DefaultTimeout configures the default transaction waiting timeout
Functions ¶
func New ¶
NewDefault constructs a new SDK client using the given options and default options.
If no rpc endpoint are provided, use the default: “wss://testnet-rpc.cess.network/ws/”
If no transaction timeout are provided, use the default timeout: 18s
If no name are provided, use the default name: cess-sdk-go
func NewWithoutDefaults ¶
New constructs a new sdk client with the given options.
If no rpc endpoint are provided, the CESS blockchain network cannot be accessed.
If no account mnemonic are provided, block transactions cannot be conducted.
Types ¶
type Config ¶
Config describes a set of settings for a client
type Option ¶
Option is a client config option that can be given to the client constructor
var FallbackDefaults Option = func(cfg *Config) error { for _, def := range defaults { if !def.fallback(cfg) { continue } if err := cfg.Apply(def.opt); err != nil { return err } } return nil }
FallbackDefaults Default options are used if and only if no other relevant options apply.
func ConnectRpcAddrs ¶
ConnectRpcAddrs configuration rpc address
func TransactionTimeout ¶
TransactionTimeout configures the waiting timeout for a transaction