authorizer

package
v1.3.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEthereumMintPayload

func CreateEthereumMintPayload(hash string) (*ethereum.MintPayload, error)

func CreateZChainMintPayload

func CreateZChainMintPayload(hash string) (*zcnsc.MintPayload, error)

CreateZChainMintPayload gets burn ticket and creates mint payload to be minted in the ZChain

Types

type Authorizer

type Authorizer struct {
}

type JobError

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

JobError result of internal request wrapped in authorizer job

func (*JobError) MarshalJSON

func (e *JobError) MarshalJSON() ([]byte, error)

func (*JobError) UnmarshalJSON

func (e *JobError) UnmarshalJSON(buf []byte) error

type JobResult

type JobResult interface {
	// Error = Status of Authorizer job
	Error() error
	// Data returns the actual result
	Data() interface{}
	// SetAuthorizerID Assigns authorizer ID to the Job
	SetAuthorizerID(ID string)
	// GetAuthorizerID returns authorizer ID
	GetAuthorizerID() string
}

JobResult = Authorizer task result, it wraps actual result of the query inside authorizer

type JobStatus

type JobStatus uint

JobStatus = Ethereum transaction status

type Node

type Node struct {
	ID        string `json:"id"`
	PublicKey string `json:"public_key"`
	URL       string `json:"url"`
}

type Nodes

type Nodes struct {
	NodeMap map[string]*Node `json:"node_map"`
}

func GetAuthorizers

func GetAuthorizers() (*Nodes, error)

GetAuthorizers Returns authorizers

type ProofEthereumBurn

type ProofEthereumBurn struct {
	TxnID             string `json:"ethereum_txn_id"`
	Nonce             int64  `json:"nonce"`
	Amount            int64  `json:"amount"`
	ReceivingClientID string `json:"receiving_client_id"` // 0ZCN address
	Signature         string `json:"signature"`
}

ProofEthereumBurn Authorizer returns this type for Ethereum transaction

type ProofZCNBurn

type ProofZCNBurn struct {
	AuthorizerID    string `json:"authorizer_id,omitempty"`
	TxnID           string `json:"0chain_txn_id"`
	Nonce           int64  `json:"nonce"`
	Amount          int64  `json:"amount"`
	EthereumAddress string `json:"ethereum_address"`
	Signature       string `json:"signatures"`
}

ProofZCNBurn Authorizer returns this type for ZCN transaction

func (*ProofZCNBurn) Data

func (r *ProofZCNBurn) Data() interface{}

func (*ProofZCNBurn) Error

func (r *ProofZCNBurn) Error() error

func (*ProofZCNBurn) GetAuthorizerID

func (r *ProofZCNBurn) GetAuthorizerID() string

func (*ProofZCNBurn) SetAuthorizerID

func (r *ProofZCNBurn) SetAuthorizerID(ID string)

type WZCNBurnEvent

type WZCNBurnEvent struct {
	// 	AuthorizerID Authorizer ID
	AuthorizerID string `json:"authorizer_id,omitempty"`
	// BurnTicket Returns burn ticket
	BurnTicket *ProofEthereumBurn `json:"ticket,omitempty"`
	// Err gives error of job on server side
	Err *JobError `json:"err,omitempty"`
	// Status gives job status on server side (authoriser)
	Status JobStatus `json:"status,omitempty"`
}

WZCNBurnEvent returned from burn ticket handler of: /v1/ether/burnticket/get

func (*WZCNBurnEvent) Data

func (r *WZCNBurnEvent) Data() interface{}

func (*WZCNBurnEvent) Error

func (r *WZCNBurnEvent) Error() error

func (*WZCNBurnEvent) GetAuthorizerID

func (r *WZCNBurnEvent) GetAuthorizerID() string

func (*WZCNBurnEvent) SetAuthorizerID

func (r *WZCNBurnEvent) SetAuthorizerID(ID string)

Jump to

Keyboard shortcuts

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