xchain

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

package xchain is related to xchain operation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Xchain

type Xchain struct {
	Cfg *config.CommConfig
	//	To     string
	//	Amount string
	ToAddressAndAmount map[string]string
	TotalToAmount      string
	Fee                string
	//	DescFile              string
	Desc                  string
	FrozenHeight          int64
	InvokeRPCReq          *pb.InvokeRPCRequest
	PreSelUTXOReq         *pb.PreExecWithSelectUTXORequest
	Initiator             string
	AuthRequire           []string
	Account               *account.Account
	PlatformAccount       *account.Account
	ChainName             string
	XchainSer             string
	ContractAccount       string
	IsNeedComplianceCheck bool
}

Xchain xchain struct

func (*Xchain) ComplianceCheck

func (xc *Xchain) ComplianceCheck(tx *pb.Transaction, fee *pb.Transaction) (
	*pb.SignatureInfo, error)

ComplianceCheck whether the transaction complies with the rule

func (*Xchain) GenCompleteTxAndPost

func (xc *Xchain) GenCompleteTxAndPost(preExeResp *pb.PreExecWithSelectUTXOResponse, hdPublicKey string) (string, error)

GenCompleteTxAndPost generate comlete tx and post tx

func (*Xchain) GenComplianceCheckTx

func (xc *Xchain) GenComplianceCheckTx(response *pb.PreExecWithSelectUTXOResponse) (
	*pb.Transaction, error)

GenComplianceCheckTx generate complianceTx to pay for compliance check

func (*Xchain) GenRealTx

func (xc *Xchain) GenRealTx(response *pb.PreExecWithSelectUTXOResponse,
	complianceCheckTx *pb.Transaction, hdPublicKey string) (*pb.Transaction, error)

GenRealTx generate really effective transaction

func (*Xchain) GenRealTxOnly added in v1.1.0

func (xc *Xchain) GenRealTxOnly(response *pb.PreExecWithSelectUTXOResponse, hdPublicKey string) (*pb.Transaction, error)

GenRealTxOnly generate really effective transaction

func (*Xchain) GenerateMultiTxOutputs added in v1.1.0

func (xc *Xchain) GenerateMultiTxOutputs(selfAmount string) ([]*pb.TxOutput, error)

GenerateTxOutput generate txoutput part

func (*Xchain) GeneratePureTxInputs added in v1.1.0

func (xc *Xchain) GeneratePureTxInputs(utxoOutputs *pb.UtxoOutput) (
	[]*pb.TxInput, error)

func (*Xchain) GenerateTxInput

func (xc *Xchain) GenerateTxInput(utxoOutputs *pb.UtxoOutput, totalNeed *big.Int) (
	[]*pb.TxInput, *pb.TxOutput, error)

GenerateTxInput generate txinput part

func (*Xchain) GenerateTxOutput

func (xc *Xchain) GenerateTxOutput(to, amount, fee string) ([]*pb.TxOutput, error)

GenerateTxOutput generate txoutput part

func (*Xchain) GetBalanceDetail

func (xc *Xchain) GetBalanceDetail() (string, error)

GetBalanceDetail get unfrozen balance and frozen balance

func (*Xchain) PostTx

func (xc *Xchain) PostTx(tx *pb.Transaction) (string, error)

PostTx posttx

func (*Xchain) PreExec

func (xc *Xchain) PreExec() (*pb.InvokeRPCResponse, error)

PreExec pre exec

func (*Xchain) PreExecWithSelecUTXO

func (xc *Xchain) PreExecWithSelecUTXO() (*pb.PreExecWithSelectUTXOResponse, error)

PreExecWithSelecUTXO preExec and selectUTXO

func (*Xchain) QueryTx

func (xc *Xchain) QueryTx(txid string) (*pb.TxStatus, error)

QueryTx get tx's status

Jump to

Keyboard shortcuts

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