service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextTimeout

func ContextTimeout(sec int) (context.Context, context.CancelFunc)

新版

Types

type GrpcClient

type GrpcClient struct {
	Address string
	Conn    *grpc.ClientConn
	Client  api.WalletClient
}

func NewGrpcClient

func NewGrpcClient(address string) *GrpcClient

func (*GrpcClient) CreateAccount

func (g *GrpcClient) CreateAccount(ownerKey *ecdsa.PrivateKey,
	accountAddress string) (*api.Return, error)

func (*GrpcClient) CreateAssetIssue

func (g *GrpcClient) CreateAssetIssue(ownerKey *ecdsa.PrivateKey,
	name, description, urlStr string, totalSupply, startTime, endTime,
	FreeAssetNetLimit,
	PublicFreeAssetNetLimit int64, trxNum,
	icoNum, voteScore int32, frozenSupply map[string]string) (*api.Return, error)

func (*GrpcClient) FreezeBalance

func (g *GrpcClient) FreezeBalance(ownerKey *ecdsa.PrivateKey,
	frozenBalance, frozenDuration int64) (*api.Return, error)

func (*GrpcClient) GetAccount

func (g *GrpcClient) GetAccount(address string) (*core.Account, error)

func (*GrpcClient) GetAccountNet

func (g *GrpcClient) GetAccountNet(address string) (*api.AccountNetMessage, error)

func (*GrpcClient) GetAssetIssueByAccount

func (g *GrpcClient) GetAssetIssueByAccount(address string) (*api.AssetIssueList, error)

func (*GrpcClient) GetAssetIssueByName

func (g *GrpcClient) GetAssetIssueByName(name string) (*core.AssetIssueContract, error)

func (*GrpcClient) GetAssetIssueList

func (g *GrpcClient) GetAssetIssueList() (*api.AssetIssueList, error)

func (*GrpcClient) GetBlockById

func (g *GrpcClient) GetBlockById(id string) (*core.Block, error)

func (*GrpcClient) GetBlockByLatestNum

func (g *GrpcClient) GetBlockByLatestNum(num int64) (*api.BlockListExtention, error)

func (*GrpcClient) GetBlockByLimitNext

func (g *GrpcClient) GetBlockByLimitNext(start, end int64) (*api.BlockListExtention, error)

func (*GrpcClient) GetBlockByNum

func (g *GrpcClient) GetBlockByNum(num int64) (*api.BlockExtention, error)

func (*GrpcClient) GetConstantResultOfContract

func (g *GrpcClient) GetConstantResultOfContract(ownerKey *ecdsa.PrivateKey, Contract string, data []byte) ([][]byte, error)

func (*GrpcClient) GetNextMaintenanceTime

func (g *GrpcClient) GetNextMaintenanceTime() (*api.NumberMessage, error)

func (*GrpcClient) GetNodeInfo

func (g *GrpcClient) GetNodeInfo() (*core.NodeInfo, error)

func (*GrpcClient) GetNowBlock

func (g *GrpcClient) GetNowBlock() (*api.BlockExtention, error)

func (*GrpcClient) GetTransactionById

func (g *GrpcClient) GetTransactionById(id string) (*core.Transaction, error)

func (*GrpcClient) GetTransactionInfoById

func (g *GrpcClient) GetTransactionInfoById(id string) (*core.TransactionInfo, error)

func (*GrpcClient) ListNodes

func (g *GrpcClient) ListNodes() (*api.NodeList, error)

func (*GrpcClient) ListWitnesses

func (g *GrpcClient) ListWitnesses() (*api.WitnessList, error)

func (*GrpcClient) Start

func (g *GrpcClient) Start() error

func (*GrpcClient) TotalTransaction

func (g *GrpcClient) TotalTransaction() (*api.NumberMessage, error)

func (*GrpcClient) Transfer

func (g *GrpcClient) Transfer(ownerKey *ecdsa.PrivateKey, toAddress string, amount int64) (string, error)

func (*GrpcClient) TransferAsset

func (g *GrpcClient) TransferAsset(ownerKey *ecdsa.PrivateKey, AssetName, toAddress string, amount int64) (string, error)

func (*GrpcClient) TransferContract

func (g *GrpcClient) TransferContract(ownerKey *ecdsa.PrivateKey, Contract string, data []byte, feeLimit int64) (string, error)

func (*GrpcClient) UnfreezeBalance

func (g *GrpcClient) UnfreezeBalance(ownerKey *ecdsa.PrivateKey) (*api.Return, error)

func (*GrpcClient) UpdateAccount

func (g *GrpcClient) UpdateAccount(ownerKey *ecdsa.PrivateKey,
	accountName string) (*api.Return, error)

func (*GrpcClient) UpdateAssetIssue

func (g *GrpcClient) UpdateAssetIssue(ownerKey *ecdsa.PrivateKey,
	description, urlStr string,
	newLimit, newPublicLimit int64) (*api.Return, error)

Jump to

Keyboard shortcuts

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