pkg

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CERE = 10_000_000_000
)

Variables

This section is empty.

Functions

func DecodeAccountIDFromSS58 added in v0.1.4

func DecodeAccountIDFromSS58(address string) (types.AccountID, error)

func GetContractData added in v0.1.4

func GetContractData(method []byte, args ...interface{}) ([]byte, error)

Types

type BlockchainClient added in v0.1.4

type BlockchainClient interface {
	CallToReadEncoded(contractAddressSS58 string, fromAddress string, method []byte, args ...interface{}) (string, error)
	CallToExec(ctx context.Context, contractCall ContractCall) (types.Hash, error)
	Deploy(ctx context.Context, deployCall DeployCall) (types.AccountID, error)
	SetEventDispatcher(contractAddressSS58 string, dispatcher map[types.Hash]ContractEventDispatchEntry) error
}

func CreateBlockchainClient added in v0.1.4

func CreateBlockchainClient(apiUrl string) BlockchainClient

type ContractCall added in v0.1.4

type ContractCall struct {
	ContractAddress     types.AccountID
	ContractAddressSS58 string
	From                signature.KeyringPair
	Value               float64
	GasLimit            float64
	Method              []byte
	Args                []interface{}
}

type ContractEventDispatchEntry added in v0.1.5

type ContractEventDispatchEntry struct {
	ArgumentType reflect.Type
	Handler      ContractEventHandler
}

type ContractEventHandler added in v0.1.5

type ContractEventHandler func(interface{})

type DeployCall added in v0.1.6

type DeployCall struct {
	Code     []byte
	Salt     []byte
	From     signature.KeyringPair
	Value    float64
	GasLimit float64
	Method   []byte
	Args     []interface{}
}

type Request added in v0.1.4

type Request struct {
	Origin    string `json:"origin"`
	Dest      string `json:"dest"`
	GasLimit  uint   `json:"gasLimit"`
	InputData string `json:"inputData"`
	Value     int    `json:"value"`
}

type Response added in v0.1.4

type Response struct {
	DebugMessage string `json:"debugMessage"`
	GasConsumed  int    `json:"gasConsumed"`
	Result       struct {
		Ok struct {
			Data  string `json:"data"`
			Flags int    `json:"flags"`
		} `json:"Ok"`
	} `json:"result"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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