transaction

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Methods and types to interact with native Züs transactions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction interface {
	ExecuteSmartContract(ctx context.Context, address, funcName string, input interface{}, val uint64) (string, error)
	Verify(ctx context.Context) error
	GetScheme() zcncore.TransactionScheme
	GetCallback() TransactionCallbackAwaitable
	GetTransactionOutput() string
	GetHash() string
	SetHash(string)
}

Transaction interface describes transaction entity.

func AddAuthorizer added in v1.8.3

func AddAuthorizer(ctx context.Context, input *zcncore.AddAuthorizerPayload) (Transaction, error)

AddAuthorizer adds authorizer to the bridge

  • ctx is the context of the request.
  • input is the payload of the request.

func AuthorizerHealthCheck added in v1.8.14

func AuthorizerHealthCheck(ctx context.Context, input *zcncore.AuthorizerHealthCheckPayload) (Transaction, error)

AuthorizerHealthCheck performs health check of the authorizer

  • ctx is the context of the request.
  • input is the payload of the request.

func NewTransactionEntity

func NewTransactionEntity(txnFee uint64) (Transaction, error)

NewTransactionEntity creates Transaction with initialized fields. Sets version, client ID, creation date, public key and creates internal zcncore.TransactionScheme.

func Verify added in v1.8.3

func Verify(ctx context.Context, hash string) (Transaction, error)

Verify checks including of transaction in the blockchain.

type TransactionCallbackAwaitable added in v1.11.0

type TransactionCallbackAwaitable interface {
	zcncore.TransactionCallback

	WaitCompleteCall(ctx context.Context) error
	WaitVerifyCall(ctx context.Context) error
}

TransactionCallbackAwaitable extends zcncore.TransactionCallback with synchronization methods

func NewStatus added in v1.8.0

func NewStatus() TransactionCallbackAwaitable

type TransactionProvider added in v1.11.0

type TransactionProvider interface {
	NewTransactionEntity(txnFee uint64) (Transaction, error)
}

TransactionProvider ...

func NewTransactionProvider added in v1.11.0

func NewTransactionProvider() TransactionProvider

type TxnStatus

type TxnStatus int

TxnStatus represented zcncore.TransactionCallback operations statuses.

const (
	// StatusSuccess represent zcncore.StatusSuccess.
	StatusSuccess TxnStatus = iota
	// StatusNetworkError represent zcncore.StatusNetworkError.
	StatusNetworkError
	// StatusError represent zcncore.StatusError.
	StatusError
	// StatusRejectedByUser represent zcncore.StatusRejectedByUser.
	StatusRejectedByUser
	// StatusInvalidSignature represent zcncore.StatusInvalidSignature.
	StatusInvalidSignature
	// StatusAuthError represent zcncore.StatusAuthError.
	StatusAuthError
	// StatusAuthVerifyFailed represent zcncore.StatusAuthVerifyFailed.
	StatusAuthVerifyFailed
	// StatusAuthTimeout represent zcncore.StatusAuthTimeout.
	StatusAuthTimeout
	// StatusUnknown represent zcncore.StatusUnknown.
	StatusUnknown = -1
)

func (TxnStatus) String

func (ts TxnStatus) String() string

String returns represented in string format TxnStatus.

Directories

Path Synopsis
AUTOGENERATED! Do not use.
AUTOGENERATED! Do not use.

Jump to

Keyboard shortcuts

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