tx

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDeleteProof

type BlockDeleteProof struct {
	Id    string `json:"id"` // 存证哈希
	Note  string `json:"note"`
	Force bool   `json:"force"`
}

BlockDeleteProof 上链数据格式

type BlockProof

type BlockProof struct {
	Data    string `json:"data"`
	Version string `json:"version"`
	Option  string `json:"option"`
	Note    string `json:"note"`
	Ext     string `json:"ext"`
}

type BlockProofOption

type BlockProofOption struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

区块链上链的option字段

type BlockTemplate

type BlockTemplate struct {
	Name string `json:"name"`
	Data string `json:"data"`
}

模板上链格式

type BlockUserConfig

type BlockUserConfig struct {
	Op               string `json:"op"`
	Organization     string `json:"organization"`
	Role             string `json:"role"`
	Address          string `json:"address"`
	MemberNote       string `json:"member_note"`
	OrganizationNote string `json:"organization_note"`
}

type Chain

type Chain struct {
	FeePrikey string // 代扣私钥字符串
	FeeAddr   string // 代扣地址
	Title     string // 虚拟平行链
	BaseExec  string `json:",default=none"`  // 代扣执行器
	CoinExec  string `json:",default=coins"` // 平行链币消耗执行器
	TokenExec string `json:",default=token"` // 平行链币消耗执行器
	Coin      string // 需要额外消耗的coin

	ReceiveCoinAddr        string // 收费地址
	ReceiveCoinAmount      int64  `json:",default=100000000"` // 收费数量
	BwalletReceiveCoinAddr string // 接收币钱包支付的地址
}

type ChainClient

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

func MustNewChainClient

func MustNewChainClient(c *Config) *ChainClient

MustNewChainClient 新建上链客户端

func NewChainClient

func NewChainClient(c *Config) (*ChainClient, error)

NewChainClient 新建上链客户端

func (*ChainClient) GetRealTx

func (c *ChainClient) GetRealTx(hash string) (*chainTypes.TransactionDetail, error)

func (*ChainClient) QueryHash

func (c *ChainClient) QueryHash(hash string) (*chainTypes.TransactionDetail, error)

type Config

type Config struct {
	Chain   Chain
	Grpc    Grpc
	Encrypt Encrypt
}

Config 上链服务相关配置

type Encrypt

type Encrypt struct {
	Seed     string
	SignType int32 `json:",default=1"` // 交易签名方式 	Invalid=0,SECP256K1=1,ED25519=2,SM2=3
}

type GenAddressAndPrikeyRes

type GenAddressAndPrikeyRes struct {
	Address string `json:"address"`
	Pubkey  string `json:"pubkey"`
	Prikey  string `json:"prikey"`
}

type Grpc

type Grpc struct {
	BlockChainAddr string
}

type QueryProof

type QueryProof struct {
	Id     int64
	Hash   string
	IsBase bool
}

type ReqChainProofMember

type ReqChainProofMember struct {
	Address []string
}

type ReqChainProofs

type ReqChainProofs struct {
	Hashs []string `json:"hash"`
}

type RespChainProofMember

type RespChainProofMember struct {
	Address      string `json:"address"`
	Role         string `json:"role"`
	Organization string `json:"organization"`
	Note         string `json:"note"`
	Height       int64  `json:"height"`
	Ts           int64  `json:"ts"`
	BlockHash    string `json:"block_hash"`
	Index        int64  `json:"index"`
	Send         string `json:"send"`
	TxHash       string `json:"tx_hash"`
	HeightIndex  int64  `json:"height_index"`
}

type RespChainProofs

type RespChainProofs struct {
	BaseHash          string `json:"basehash"`
	PreHash           string `json:"prehash"`
	ProofBlockHash    string `json:"proof_block_hash"`
	ProofBlockTime    int64  `json:"proof_block_time"`
	ProofData         string `json:"proof_data"`
	ProofDeleted      string `json:"proof_deleted"`
	ProofDeletedNote  string `json:"proof_deleted_note"`
	ProofHeight       int64  `json:"proof_height"`
	ProofHeightIndex  int64  `json:"proof_height_index"`
	ProofId           string `json:"proof_id"`
	ProofNote         string `json:"proof_note"`
	ProofOrganization string `json:"proof_organization"`
	ProofSender       string `json:"proof_sender"`
	ProofTxHash       string `json:"proof_tx_hash"`
}

type TxInfo

type TxInfo struct {
	Exec    string
	Payload []byte
	FeeRate int64
	Prikey  string
}

Jump to

Keyboard shortcuts

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