Documentation ¶
Index ¶
- Constants
- Variables
- func Address2pubk(address string) (string, error)
- func CalcTxid(symbol, rawTx string) (string, error)
- func DecodeSymbolTX(symbol, rawTX string) (string, error)
- func NewSymbolBip44Deriver(symbol string, bip44Path string, bip44Key string, seed []byte) (bip44.Deriver, error)
- func NewSymbolCoin(symbol string, path string, bip44Key string, seed []byte) (core.Coin, error)
- func SymbolSignWithPrivateKey(symbol, rawTX, templateData, privateKey string) (string, error)
- type KeyInfo
- type TemplateInfo
- type TxBuilder
- func (b *TxBuilder) AddInput(txid string, vout int8) *TxBuilder
- func (b *TxBuilder) AddTemplateData(tplData string) *TxBuilder
- func (b *TxBuilder) Build() (string, error)
- func (b *TxBuilder) ExcludeAnchor() *TxBuilder
- func (b *TxBuilder) SetAddress(add string) *TxBuilder
- func (b *TxBuilder) SetAmount(amount float64) *TxBuilder
- func (b *TxBuilder) SetAnchor(anchor string) *TxBuilder
- func (b *TxBuilder) SetData(data []byte) *TxBuilder
- func (b *TxBuilder) SetDataWithUUID(_uuid string, timestamp int64, data string) *TxBuilder
- func (b *TxBuilder) SetFee(fee float64) *TxBuilder
- func (b *TxBuilder) SetLockUntil(lockUntil int) *TxBuilder
- func (b *TxBuilder) SetStringData(data string) *TxBuilder
- func (b *TxBuilder) SetTimestamp(timestamp int) *TxBuilder
- func (b *TxBuilder) SetType(v int) *TxBuilder
- func (b *TxBuilder) SetVersion(v int) *TxBuilder
Constants ¶
View Source
const ( SymbolBBC = internal.SymbolBBC SymbolMKF = internal.SymbolMKF )
.
Variables ¶
View Source
var FullnameMap = map[string]string{ SymbolBBC: "BigBang Core", SymbolMKF: "MarketFinance", }
FullnameMap .
Functions ¶
func DecodeSymbolTX ¶
DecodeSymbolTX 解析原始交易(使用JSON RPC createtransaction 创建的交易),symbol: BBC | MKF
func NewSymbolBip44Deriver ¶
func NewSymbolBip44Deriver(symbol string, bip44Path string, bip44Key string, seed []byte) (bip44.Deriver, error)
NewSymbolBip44Deriver symbol: BBC | MKF 获取bip44推导
func NewSymbolCoin ¶
NewSymbolCoin symbol 支持 兼容BBC的币种(比如MKF)
func SymbolSignWithPrivateKey ¶
SymbolSignWithPrivateKey 指定币种使用私钥对交易签名
Types ¶
type KeyInfo ¶
type KeyInfo struct {
PrivateKey, PublicKey, Address string
}
KeyInfo 私钥,公钥,地址
func ParsePrivateKey ¶
ParsePrivateKey 解析私钥,返回 privateKey,publicKey,address
type TemplateInfo ¶
type TemplateInfo struct { //Type 类型 Type int //Address 地址 Address string //RawHex hex编码的原始数据(TemplateData) RawHex string }
TemplateInfo 简要模版信息
type TxBuilder ¶
TxBuilder transaction builder
func (*TxBuilder) AddTemplateData ¶
AddTemplateData 添加模版原始数据,多个模版时需要自行确保顺序
func (*TxBuilder) ExcludeAnchor ¶
ExcludeAnchor MKF需要调用该函数(使得序列化时不会处理anchor字段)
func (*TxBuilder) SetAddress ¶
SetAddress 转账地址,目前只支持公钥地址
func (*TxBuilder) SetDataWithUUID ¶
SetDataWithUUID 指定uuid,timestamp,data
func (*TxBuilder) SetLockUntil ¶
SetLockUntil lock until
func (*TxBuilder) SetStringData ¶
SetStringData 自动编码数据,自动生成uuid和时间戳
func (*TxBuilder) SetTimestamp ¶
SetTimestamp 交易时间戳
Click to show internal directories.
Click to hide internal directories.