transaction

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CeloMethod

type CeloMethod string
var (
	CreateAccount      CeloMethod = "createAccount"
	LockGold           CeloMethod = "lock"
	UnlockGold         CeloMethod = "unlock"
	RelockGold         CeloMethod = "relock"
	WithdrawGold       CeloMethod = "withdraw"
	Vote               CeloMethod = "vote"
	ActivateVotes      CeloMethod = "activate"
	RevokePendingVotes CeloMethod = "revokePending"
	RevokeActiveVotes  CeloMethod = "revokeActive"
)

values taken from contract method names for ABI usage

func (CeloMethod) String

func (tt CeloMethod) String() string

type GenericMetadata

type GenericMetadata struct {
	From                common.Address
	Nonce               uint64          `json:"nonce"   `
	GasPrice            *big.Int        `json:"gasPrice"`
	GatewayFeeRecipient *common.Address `json:"gatewayFeeRecipient" rlp:"nil"` // nil means no gateway fee is paid
	GatewayFee          *big.Int        `json:"gatewayFee" rlp:"nil"`          // nil means no gateway fee is paid
}

[note]: non cGLD fee currencies currently unsupported

type OfflineBuilder

type OfflineBuilder struct {
	// contains filtered or unexported fields
}

func NewOfflineBuilder

func NewOfflineBuilder() *OfflineBuilder

type OnlineBuilder

type OnlineBuilder struct {
	*OfflineBuilder
	// contains filtered or unexported fields
}

func NewOnlineBuilder

func NewOnlineBuilder(client *client.CeloClient) (*OnlineBuilder, error)

func (*OnlineBuilder) FetchTransactionMetadata

func (b *OnlineBuilder) FetchTransactionMetadata(ctx context.Context, options *TransactionOptions) (*TransactionMetadata, error)

type TransactionMetadata

type TransactionMetadata struct {
	Generic *GenericMetadata
	To      *common.Address
	Value   *big.Int
	Gas     uint64
	Data    []byte
}

func (*TransactionMetadata) AsTransaction

func (tm *TransactionMetadata) AsTransaction() *types.Transaction

type TransactionOptions

type TransactionOptions struct {
	From   common.Address
	To     *common.Address // non-nil means exclusively cGLD transfer
	Value  *big.Int
	Method *CeloMethod // non-nil means celo registry contract invokation
	Args   []interface{}
}

Jump to

Keyboard shortcuts

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