Documentation
¶
Index ¶
- Constants
- func AddressToScriptPubKey(address string, network string) (string, error)
- func NewAccount() signing.AccountHandler
- func NewAccountFromMnemonic(mnemonic, path, network string) (signing.AccountHandler, error)
- func NewAccountFromPrivateKey(privateKey []byte, network string) (signing.AccountHandler, error)
- func NewAccountFromPrivateKeyHex(privateKey, network string) (signing.AccountHandler, error)
- func PrivateKeyHexToWIF(privateKey string) (string, error)
- func PrivateKeyWIFToHex(privateKey string) (string, error)
- func PublicKey2Address(publicKey []byte, network string) string
- func ToBigEndianHash(hash string) string
- func ValidAddress(address, network string) bool
- func ValidAddressForBTC(address string) bool
- func ValidAddressForDOGE(address string) bool
- func ValidAddressForLTC(address string) bool
- func ValidAddressForSYS(address string) bool
- type Account
- func (a *Account) Address() string
- func (a *Account) PrivateKey() []byte
- func (a *Account) PrivateKeyHex() string
- func (a *Account) PublicKey() []byte
- func (a *Account) PublicKeyHex() string
- func (a *Account) SignData(data []byte) ([]byte, error)
- func (a *Account) VerifySignData(data, sig []byte) bool
- func (a *Account) Wipe()
- type Ingredient
- type TxBuilder
- func (tx *TxBuilder) Build() error
- func (tx *TxBuilder) ConcatSignature(signature string, isDerFormat bool) (string, error)
- func (tx *TxBuilder) GetSigHash() []string
- func (tx *TxBuilder) GetTxHash() string
- func (tx *TxBuilder) GetUnsignedHex() string
- func (tx *TxBuilder) SetSigHash(sigHash []string)
- func (tx *TxBuilder) SetUnsignedHex(unsignedHex string)
- func (tx *TxBuilder) Sign(privateKey []byte) (string, error)
Constants ¶
View Source
const ( NetworkEnumForBTC string = "0" NetworkEnumForLTC string = "1" NetworkEnumForDOGE string = "2" NetworkEnumForBTCP2TR string = "3" NetworkEnumForSYS string = "4" )
View Source
const DefaultDust = 546
View Source
const DefaultInputBytes = 148
types
View Source
const DefaultOutputBytes = 34
Variables ¶
This section is empty.
Functions ¶
func AddressToScriptPubKey ¶
func NewAccount ¶
func NewAccount() signing.AccountHandler
func NewAccountFromMnemonic ¶
func NewAccountFromMnemonic(mnemonic, path, network string) (signing.AccountHandler, error)
func NewAccountFromPrivateKey ¶
func NewAccountFromPrivateKey(privateKey []byte, network string) (signing.AccountHandler, error)
func NewAccountFromPrivateKeyHex ¶
func NewAccountFromPrivateKeyHex(privateKey, network string) (signing.AccountHandler, error)
func PrivateKeyHexToWIF ¶
func PrivateKeyWIFToHex ¶
func PublicKey2Address ¶
func ToBigEndianHash ¶
func ValidAddress ¶
func ValidAddressForBTC ¶
func ValidAddressForDOGE ¶
func ValidAddressForLTC ¶
func ValidAddressForSYS ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) PrivateKey ¶
func (*Account) PrivateKeyHex ¶
func (*Account) PublicKeyHex ¶
func (*Account) VerifySignData ¶
type Ingredient ¶
type Ingredient struct {
TxType string `json:"txType" validate:"required,oneof=0 1 2 3 4 5 6"`
ContractAddress string `json:"contractAddress" validate:"required,native"`
Sender string `json:"sender" validate:"required"`
SenderPublicKey string `json:"senderPublicKey" validate:"required,hex_str"`
Recipient string `json:"recipient" validate:"required"`
Amount string `json:"amount" validate:"required,i64"`
ByteFee string `json:"byteFee" validate:"required,i64"`
Utxos *signing.UtxoList `json:"utxos" validate:"required"`
IsPSBT bool `json:"isPSBT,omitempty" validate:"omitempty,bool_hex"`
InscriptionIdsForHash map[string]string `json:"inscriptionIdsForHash,omitempty"`
Memo string `json:"memo,omitempty" validate:"omitempty,hex_str"`
}
type TxBuilder ¶
type TxBuilder struct {
*Ingredient
// contains filtered or unexported fields
}
func NewTxBuilder ¶
func NewTxBuilder(ti *Ingredient, network string) *TxBuilder
func (*TxBuilder) ConcatSignature ¶
func (*TxBuilder) GetSigHash ¶
func (*TxBuilder) GetUnsignedHex ¶
func (*TxBuilder) SetSigHash ¶
func (*TxBuilder) SetUnsignedHex ¶
Click to show internal directories.
Click to hide internal directories.