sdk

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMultiAddress

func ConvertMultiAddress(receiver string) (types.MultiAddress, error)

func ConvertToBondAmount

func ConvertToBondAmount(input int64) *big.Int

func CreateChannel

func CreateChannel() chan types.Hash

func EncodeToHex

func EncodeToHex(hash interface{}) (string, error)

func EventParser

func EventParser(api *SubstrateAPI, h types.Hash, eventParse string)

func ExistentialDeposit

func ExistentialDeposit(api *SubstrateAPI)

func FormatBN

func FormatBN(n BigInt) string

func GetData

func GetData(hash types.Hash, api *SubstrateAPI, txHash types.Hash) error

func KeyringFromSeed

func KeyringFromSeed(seed string) (signature.KeyringPair, error)

func KeyringPairFromSecret

func KeyringPairFromSecret(seed string, keyType uint16) (signature.KeyringPair, error)

func NewCall

func NewCall(api *SubstrateAPI, callName string, args ...interface{}) (types.Call, error)

func NewExtrinsic

func NewExtrinsic(api *SubstrateAPI, ext_call string, keyring signature.KeyringPair, AppID int, arg ...interface{}) (types.Hash, error)

func NewExtrinsicWatch

func NewExtrinsicWatch(api *SubstrateAPI, ext_call string, keyring signature.KeyringPair, final chan types.Hash, txHash chan types.Hash, AppID int, WaitForInclusion WaitFor, arg ...interface{}) error

func NewHashFromHexString

func NewHashFromHexString(hexStr string) (types.Hash, error)

func NewMultiAddressFromAccountID

func NewMultiAddressFromAccountID(accountID []byte) (types.MultiAddress, error)

func NewMultiAddressFromHexAccountID

func NewMultiAddressFromHexAccountID(hexStr string) (types.MultiAddress, error)

func NewU128

func NewU128(value *big.Int) types.U128

func NewU256

func NewU256(value *big.Int) types.U256

func NewU32

func NewU32(value uint32) types.U32

func NewU64

func NewU64(value uint64) types.U64

func NewU8

func NewU8(value uint8) types.U8

func ParseDataSubmitted

func ParseDataSubmitted(events []*parser.Event)

func RandToken

func RandToken(n int) (string, error)

Types

type BigInt

type BigInt struct {
	*big.Int
}

func (*BigInt) UnmarshalJSON

func (bi *BigInt) UnmarshalJSON(data []byte) error

UnmarshalJSON defines custom unmarshalling for BigInt.

type Bytes

type Bytes []byte

func NewBytes

func NewBytes(b []byte) Bytes

type DispatchFeeModifier

type DispatchFeeModifier struct {
	WeightMaximumFee    types.U128
	WeightFeeDivider    types.U32
	WeightFeeMultiplier types.U32
}

func (*DispatchFeeModifier) Decode

func (d *DispatchFeeModifier) Decode(decoder scale.Decoder) error

Decode implements scale.Decodeable

func (DispatchFeeModifier) Encode

func (d DispatchFeeModifier) Encode(encoder scale.Encoder) error

Encode implements scale.Encodeable

type Payee

type Payee uint8

func (Payee) EnumIndex

func (w Payee) EnumIndex() uint8

EnumIndex - Creating common behavior - give the type a EnumIndex function

func (Payee) String

func (w Payee) String() string

type SubstrateAPI

type SubstrateAPI struct {
	RPC    *rpc.RPC
	Client client.Client
}

func NewSDK

func NewSDK(url string) (*SubstrateAPI, error)

func (*SubstrateAPI) Close

func (api *SubstrateAPI) Close()

type WaitFor

type WaitFor int
const (
	BlockInclusion WaitFor = iota + 1
	BlockFinalization
)
const (
	Staked WaitFor = iota
	Stash
	Controller
	Account
	None
)

func (WaitFor) EnumIndex

func (w WaitFor) EnumIndex() int

EnumIndex - Creating common behavior - give the type a EnumIndex function

func (WaitFor) String

func (w WaitFor) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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