transaction

package
v0.0.0-...-208c1b2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	Nonce      uint64
	Permission AccessKeyPermission
}

AccessKey asdf.

type AccessKeyPermission

type AccessKeyPermission struct {
	Enum         borsh.Enum `borsh_enum:"true"`
	FunctionCall FunctionCallPermission
	FullAccess   FullAccessPermission
}

AccessKeyPermission asdf.

type Action

type Action struct {
	Enum           borsh.Enum `borsh_enum:"true"`
	CreateAccount  CreateAccount
	DeployContract DeployContract
	FunctionCall   FunctionCall
	Transfer       Transfer
	Stake          Stake
	AddKey         AddKey
	DeleteKey      DeleteKey
	DeleteAccount  DeleteAccount
}

Action asdf.

func AddKeyAction

func AddKeyAction(publicKey keys.PublicKey, accessKey AccessKey) Action

AddKeyAction is a helper to create a AddKey action.

func CreateAccountAction

func CreateAccountAction() Action

CreateAccountAction is a helper to create a CreateAccount action.

func DeleteAccountAction

func DeleteAccountAction(beneficiaryID string) Action

DeleteAccountAction is a helper to create a DeleteAccount action.

func DeleteKeyAction

func DeleteKeyAction(publicKey keys.PublicKey) Action

DeleteKeyAction is a helper to create a DeleteKey action.

func DeployContractAction

func DeployContractAction(code []byte) Action

DeployContractAction is a helper to create a DeployContract action.

func FunctionCallAction

func FunctionCallAction(methodName string, opts ...FunctionCallOpton) (*Action, error)

FunctionCallAction is a helper to create a FunctionCall action.

func StakeAction

func StakeAction(stake big.Int, publicKey keys.PublicKey) Action

StakeAction is a helper to create a Stake action.

func TransferAction

func TransferAction(deposit big.Int) Action

TransferAction is a helper to create a Transfer action.

type AddKey

type AddKey struct {
	PublicKey PublicKey
	AccessKey AccessKey
}

AddKey asdf.

type CreateAccount

type CreateAccount struct{}

CreateAccount asdf.

type DeleteAccount

type DeleteAccount struct {
	BeneficiaryID string
}

DeleteAccount asdf.

type DeleteKey

type DeleteKey struct {
	PublicKey PublicKey
}

DeleteKey asdf.

type DeployContract

type DeployContract struct {
	Code []byte
}

DeployContract asdf.

type FullAccessPermission

type FullAccessPermission struct{}

FullAccessPermission asdf.

type FunctionCall

type FunctionCall struct {
	MethodName string
	Args       []byte
	Gas        uint64
	Deposit    big.Int
}

FunctionCall asdf.

type FunctionCallOpton

type FunctionCallOpton func(*FunctionCall) error

FunctionCallOpton controls the behavior of a FunctionCall action.

func FunctionCallWithArgs

func FunctionCallWithArgs(args interface{}) FunctionCallOpton

FunctionCallWithArgs allows you to pass JSON encodable args.

func FunctionCallWithDeposit

func FunctionCallWithDeposit(deposit big.Int) FunctionCallOpton

FunctionCallWithDeposit allows you to attach a deposit.

func FunctionCallWithGas

func FunctionCallWithGas(gas uint64) FunctionCallOpton

FunctionCallWithGas allows you to specify a gas amount.

type FunctionCallPermission

type FunctionCallPermission struct {
	Allowance   *big.Int
	ReceiverID  string
	MethodNames []string
}

FunctionCallPermission asdf.

type PublicKey

type PublicKey struct {
	KeyType uint8
	Data    [32]byte
}

PublicKey asdf.

type Signature

type Signature struct {
	KeyType uint8
	Data    [64]byte
}

Signature asdf.

type SignedTransaction

type SignedTransaction struct {
	Transaction Transaction
	Signature   Signature
}

SignedTransaction asdf.

func SignTransaction

func SignTransaction(
	transaction Transaction,
	signer keys.KeyPair,
	accountID string,
	networkID string,
) ([]byte, *SignedTransaction, error)

SignTransaction serializes and signs a Transaction using the provided signer.

type Stake

type Stake struct {
	Stake     big.Int
	PublicKey PublicKey
}

Stake sadf.

type Transaction

type Transaction struct {
	SignerID   string
	PublicKey  PublicKey
	Nonce      uint64
	ReceiverID string
	BlockHash  [32]byte
	Actions    []Action
}

Transaction asdf.

func NewTransaction

func NewTransaction(
	signerID string,
	publicKey PublicKey,
	nonce uint64,
	receiverID string,
	blockHash []byte,
	actions []Action,
) *Transaction

NewTransaction creates a new Transaction.

type Transfer

type Transfer struct {
	Deposit big.Int
}

Transfer asdf.

Jump to

Keyboard shortcuts

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