forceio

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PushActions

func PushActions(api *API, actions ...*eos.Action) (*eos.PushTransactionFullResp, error)

PushActions push action to chain

func ToSHA256Bytes

func ToSHA256Bytes(in string) (eos.SHA256Bytes, error)

ToSHA256Bytes from string to sha256

Types

type API

type API struct {
	*eos.API
	Cfg Config
	// contains filtered or unexported fields
}

API client api to forceio chain

func (*API) Asset

func (api *API) Asset(a *types.Asset) interface{}

func (*API) GetBlockDataByID

func (api *API) GetBlockDataByID(id string) (*types.BlockGeneralInfo, error)

func (*API) GetBlockDataByNum

func (api *API) GetBlockDataByNum(num uint32) (*types.BlockGeneralInfo, error)

func (*API) GetInfoData

func (api *API) GetInfoData() (*types.InfoResp, error)

func (*API) Init

func (api *API) Init(cfg *config.ConfigData) error

Init init api by config

func (*API) Name

func (api *API) Name(n string) interface{}

func (*API) PushActions

func (api *API) PushActions(actions ...*types.Action) (*types.PushTransactionFullResp, error)

func (*API) Switcher

func (api *API) Switcher() types.SwitcherInterface

func (*API) Type

func (api *API) Type() types.ClientType

type Config

type Config struct {
	ChainID eos.SHA256Bytes
	URL     string
	Keys    map[string]accountKey
	Prikeys []ecc.PrivateKey
	IsDebug bool
}

Config config to codex-go

func (*Config) Parse

func (c *Config) Parse(data *config.ConfigData) error

Parse parse cfg from data

type ConfigSigner

type ConfigSigner struct {
	Keys []ecc.PrivateKey `json:"keys"`
	// contains filtered or unexported fields
}

ConfigSigner singer with use config keys

func NewConfigSigner

func NewConfigSigner(api *API) *ConfigSigner

NewConfigSigner create config signer with keys in config in api

func (*ConfigSigner) AvailableKeys

func (c *ConfigSigner) AvailableKeys() (out []ecc.PublicKey, err error)

AvailableKeys imp Signer interface

func (*ConfigSigner) ImportPrivateKey

func (c *ConfigSigner) ImportPrivateKey(wifPrivKey string) (err error)

ImportPrivateKey imp Signer interface

func (*ConfigSigner) Sign

func (c *ConfigSigner) Sign(tx *eos.SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*eos.SignedTransaction, error)

Sign imp Signer interface

Jump to

Keyboard shortcuts

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