action

package
v0.0.0-...-b9e1d45 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: LGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKeyFunctionCallPermission

type AccessKeyFunctionCallPermission struct {
	Allowance   *types.Balance  `json:"allowance"`
	ReceiverID  types.AccountID `json:"receiver_id"`
	MethodNames []string        `json:"method_names"`
}

func (AccessKeyFunctionCallPermission) String

type AccessKeyPermission

type AccessKeyPermission struct {
	Enum borsh.Enum `borsh_enum:"true"`

	FunctionCallPermission AccessKeyFunctionCallPermission
	FullAccessPermission   struct{}
}

func NewFullAccessPermission

func NewFullAccessPermission() AccessKeyPermission

func NewFunctionCallPermission

func NewFunctionCallPermission(allowance types.Balance, receiverID types.AccountID, methodNames []string) AccessKeyPermission

func NewFunctionCallUnlimitedAllowancePermission

func NewFunctionCallUnlimitedAllowancePermission(receiverID types.AccountID, methodNames []string) AccessKeyPermission

func (*AccessKeyPermission) IsFullAccess

func (a *AccessKeyPermission) IsFullAccess() bool

func (*AccessKeyPermission) IsFunctionCall

func (a *AccessKeyPermission) IsFunctionCall() bool

func (AccessKeyPermission) MarshalJSON

func (a AccessKeyPermission) MarshalJSON() (b []byte, err error)

func (AccessKeyPermission) String

func (a AccessKeyPermission) String() string

func (*AccessKeyPermission) UnmarshalJSON

func (a *AccessKeyPermission) UnmarshalJSON(b []byte) (err error)

type Action

type Action struct {
	Enum borsh.Enum `borsh_enum:"true"`

	CreateAccount  ActionCreateAccount
	DeployContract ActionDeployContract
	FunctionCall   ActionFunctionCall
	Transfer       ActionTransfer
	Stake          ActionStake
	AddKey         ActionAddKey
	DeleteKey      ActionDeleteKey
	DeleteAccount  ActionDeleteAccount
}

func NewAddKey

func NewAddKey(publicKey key.PublicKey, nonce types.Nonce, permission AccessKeyPermission) Action

func NewCreateAccount

func NewCreateAccount() Action

Create an (sub)account using a transaction `receiver_id` as an ID for a new account

func NewDeleteAccount

func NewDeleteAccount(beneficiaryID types.AccountID) Action

func NewDeleteKey

func NewDeleteKey(publicKey key.PublicKey) Action

func NewDeployContract

func NewDeployContract(code []byte) Action

func NewFunctionCall

func NewFunctionCall(methodName string, args []byte, gas types.Gas, deposit types.Balance) Action

func NewStake

func NewStake(stake types.Balance, publicKey key.PublicKey) Action

func NewTransfer

func NewTransfer(deposit types.Balance) Action

func (*Action) DepositBalance

func (a *Action) DepositBalance() types.Balance

func (*Action) PrepaidGas

func (a *Action) PrepaidGas() types.Gas

func (Action) String

func (a Action) String() string

func (*Action) UnderlyingValue

func (a *Action) UnderlyingValue() interface{}

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(b []byte) (err error)

type ActionAddKey

type ActionAddKey struct {
	PublicKey key.PublicKey         `json:"public_key"`
	AccessKey ActionAddKeyAccessKey `json:"access_key"`
}

func (ActionAddKey) MarshalJSON

func (a ActionAddKey) MarshalJSON() (b []byte, err error)

func (*ActionAddKey) UnmarshalJSON

func (a *ActionAddKey) UnmarshalJSON(b []byte) (err error)

type ActionAddKeyAccessKey

type ActionAddKeyAccessKey struct {
	Nonce      types.Nonce         `json:"nonce"`
	Permission AccessKeyPermission `json:"permission"`
}

type ActionCreateAccount

type ActionCreateAccount struct {
}

type ActionDeleteAccount

type ActionDeleteAccount struct {
	BeneficiaryID types.AccountID `json:"beneficiary_id"`
}

type ActionDeleteKey

type ActionDeleteKey struct {
	PublicKey key.PublicKey `json:"public_key"`
}

func (ActionDeleteKey) MarshalJSON

func (a ActionDeleteKey) MarshalJSON() (b []byte, err error)

func (*ActionDeleteKey) UnmarshalJSON

func (a *ActionDeleteKey) UnmarshalJSON(b []byte) (err error)

type ActionDeployContract

type ActionDeployContract struct {
	Code []byte `json:"code"`
}

type ActionFunctionCall

type ActionFunctionCall struct {
	MethodName string        `json:"method_name"`
	Args       []byte        `json:"args"`
	Gas        types.Gas     `json:"gas"`
	Deposit    types.Balance `json:"deposit"`
}

func (ActionFunctionCall) String

func (f ActionFunctionCall) String() string

type ActionStake

type ActionStake struct {
	// Amount of tokens to stake.
	Stake types.Balance `json:"stake"`
	// Validator key which will be used to sign transactions on behalf of singer_id
	PublicKey key.PublicKey `json:"public_key"`
}

type ActionTransfer

type ActionTransfer struct {
	Deposit types.Balance `json:"deposit"`
}

func (ActionTransfer) String

func (t ActionTransfer) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳