free

package
v0.0.0-...-b4d0711 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: LGPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58ToAddress

func Base58ToAddress(s string) string

func Freeze

func Freeze(client *client.GrpcClient, from, privateKeyHex, to string, resource core.ResourceCode, frozenBalance int64) (txID string, err error)

Freeze 冻结质押TRX 参数: * client *client.GrpcClient grc 客户端 * from string 质押来源钱包地址 * privateKeyHex string 质押来源钱包私钥 * to string 质押收益钱包 * resource core.ResourceCode 质押资源 * frozenBalance int64 质押金额,除以10^6是真正的金额 返回值: * error error 错误

func Resource

func Resource(client *client.GrpcClient, address string) (bandwidth, energy int64, err error)

Resource 账号资源 参数: * client *client.GrpcClient 客户端 * address string 地址 返回值: * bandwidth int64 带宽 * energy int64 能量 * err error 错误

func UnFreeze

func UnFreeze(client *client.GrpcClient, from, privateKeyHex, to string, resource core.ResourceCode) (txID string, err error)

UnFreeze 解冻质押TRX,解冻只能一次性解冻 参数: * client *client.GrpcClient grc 客户端 * from string 质押来源钱包地址 * privateKeyHex string 质押来源钱包私钥 * to string 质押收益钱包 * resource core.ResourceCode 质押资源 返回值: * error error 错误

Types

type DelegatedResource

type DelegatedResource struct {
	From                      string          `json:"from,omitempty"`                         // 来源,质押TRX的一方
	To                        string          `json:"to,omitempty"`                           // 获利的一方
	FrozenBalanceForBandwidth decimal.Decimal `json:"frozen_balance_for_bandwidth,omitempty"` // 用于获取带宽的冻结TRX
	FrozenBalanceForEnergy    decimal.Decimal `json:"frozen_balance_for_energy,omitempty"`    // 用于获取能量的冻结TRX
	ExpireTimeForBandwidth    time.Time       `json:"expire_time_for_bandwidth,omitempty"`    // 带宽过期时间
	ExpireTimeForEnergy       time.Time       `json:"expire_time_for_energy,omitempty"`       // 能量过期时间
}

DelegatedResource 代理/托管的资源

func FreezeResource

func FreezeResource(client *client.GrpcClient, address string) (resources []*DelegatedResource, err error)

func NewDelegatedResource

func NewDelegatedResource(from, to []byte, frozenBalanceForBandwidth, frozenBalanceForEnergy, expireTimeForBandwidth, expireTimeForEnergy int64) *DelegatedResource

Jump to

Keyboard shortcuts

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