types

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitmentDataSize    = 33
	CommitmentHexDataSize = 66
	EmptyBlinder          = "0000000000000000000000000000000000000000000000000000000000000000"
)
View Source
const (
	DescriptorKeyNull DescriptorKeyType = iota
	DescriptorKeyPublic
	DescriptorKeyBip32
	DescriptorKeyBip32Priv
	DescriptorKeySchnorr

	DescriptorTypeNull DescriptorType = iota
	DescriptorTypeSh
	DescriptorTypeWsh
	DescriptorTypePk
	DescriptorTypePkh
	DescriptorTypeWpkh
	DescriptorTypeCombo
	DescriptorTypeMulti
	DescriptorTypeSortedMulti
	DescriptorTypeAddr
	DescriptorTypeRaw
	DescriptorTypeMiniscript
	DescriptorTypeTaproot
)
View Source
const (
	SequenceLockTimeFinal     uint32 = 0xffffffff
	SequenceLockTimeEnableMax uint32 = 0xfffffffe
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Address       string
	Network       NetworkType
	Type          AddressType
	LockingScript Script
}

Address ...

type AddressType

type AddressType int
const (
	// AddressType
	UnknownAddress AddressType = iota
	P2pkhAddress
	P2shAddress
	P2wpkhAddress
	P2wshAddress
	P2shP2wpkhAddress
	P2shP2wshAddress
	TaprootAddress
)

func NewAddressType

func NewAddressType(cfdAddressType int) AddressType

NewAddressType ...

func NewAddressTypeByHashType

func NewAddressTypeByHashType(hashType int) AddressType

NewAddressTypeByHashType ...

func NewAddressTypeByString

func NewAddressTypeByString(addressType string) AddressType

NewAddressTypeByString ...

func (AddressType) String

func (n AddressType) String() string

String ...

func (AddressType) ToCfdValue

func (n AddressType) ToCfdValue() int

ToCfdValue ...

func (AddressType) ToHashType

func (n AddressType) ToHashType() HashType

ToHashType ...

type BlindInputData

type BlindInputData struct {
	OutPoint         OutPoint // OutPoint
	Asset            string   // Asset
	AssetBlindFactor string   // Asset BlindFactor
	Amount           int64    // satoshi value
	ValueBlindFactor string   // Value BlindFactor
	IssuanceKey      *IssuanceBlindingKey
}

BlindInputData ...

type BlindOutputData

type BlindOutputData struct {
	Index               int    // txout index (-1: auto)
	ConfidentialAddress string // confidential or not address
	ConfidentialKey     string // (optional) confidential key
}

BlindOutputData ...

type BlindTxOption

type BlindTxOption struct {
	MinimumRangeValue int64 // blind minimum range value
	Exponent          int64 // blind exponent
	MinimumBits       int64 // blind minimum bits
	AppendDummyOutput bool  // add dummy output if txout is low
}

BlindTxOption BlindRawTransaction option data struct.

func NewBlindTxOption

func NewBlindTxOption() BlindTxOption

NewBlindTxOption ...

type Block

type Block struct {
	Hex string
}

Block ...

type BlockHeader

type BlockHeader struct {
	Version       uint32 // Version
	PrevBlockHash string // previous block hash
	MerkleRoot    string // merkleroot
	Time          uint32 // block time
	Bits          uint32 // bit flag
	Nonce         uint32 // nonce
}

BlockHeader block header information.

type ByteData

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

ByteData This struct holds a byte array.

func NewByteData

func NewByteData(data []byte) ByteData

NewByteData This function create a bytedata from a byte array.

func NewByteDataFromHex

func NewByteDataFromHex(hexStr string) (ByteData, error)

NewByteDataFromHex This function create a bytedata from a hex string.

func NewByteDataFromHexIgnoreError

func NewByteDataFromHexIgnoreError(hexStr string) *ByteData

NewByteDataFromHex This function create a bytedata from a hex string. On error, it returns nil.

func (*ByteData) ToHex

func (obj *ByteData) ToHex() string

ToHex This function return a hex string.

func (*ByteData) ToSlice

func (obj *ByteData) ToSlice() []byte

ToHex This function return a byte array.

type ConfidentialAddress

type ConfidentialAddress struct {
	ConfidentialAddress string
	Address             string
	Network             NetworkType
	Type                AddressType
	ConfidentialKey     *Pubkey
}

ConfidentialAddress ...

type ConfidentialTx

type ConfidentialTx struct {
	Hex string
}

ConfidentialTx ...

type ConfidentialTxIn

type ConfidentialTxIn struct {
	OutPoint                 OutPoint
	Sequence                 uint32
	ScriptSig                string
	Issuance                 IssuanceData
	WitnessStack             ScriptWitness
	PeginWitness             ScriptWitness
	IssuanceAmountRangeproof string
	InflationKeysRangeproof  string
}

ConfidentialTxIn confidential transaction input.

func NewConfidentialTxIn

func NewConfidentialTxIn(cfdTxin *cfd.ConfidentialTxIn) *ConfidentialTxIn

type ConfidentialTxOut

type ConfidentialTxOut struct {
	Amount          int64  // satoshi amount (unblind value)
	Asset           string // asset (or commitment asset)
	LockingScript   string // locking script
	Address         string // address or confidential address. (if locking script is usual hashtype.)
	CommitmentValue string // commitment value
	CommitmentNonce string // commitment nonce
	Surjectionproof string // surjectionprooof of asset
	Rangeproof      string // rangeproof of value
}

ConfidentialTxOut confidential transaction output.

func NewConfidentialTxOut

func NewConfidentialTxOut(cfdTxout *cfd.ConfidentialTxOut) *ConfidentialTxOut

func (ConfidentialTxOut) HasBlinding

func (c ConfidentialTxOut) HasBlinding() bool

type ConfidentialTxOutIndexMap

type ConfidentialTxOutIndexMap map[uint32]*ConfidentialTxOut

func (ConfidentialTxOutIndexMap) GetTotalAmount

func (c ConfidentialTxOutIndexMap) GetTotalAmount() int64

type ConfidentialTxOutSet

type ConfidentialTxOutSet []ConfidentialTxOut

func (ConfidentialTxOutSet) Filter

func (ConfidentialTxOutSet) FindByAddress

func (c ConfidentialTxOutSet) FindByAddress(address string) map[uint32]*ConfidentialTxOut

func (ConfidentialTxOutSet) FindByAddressFirst

func (c ConfidentialTxOutSet) FindByAddressFirst(address string) (*ConfidentialTxOut, uint32)

func (ConfidentialTxOutSet) FindByLockingScript

func (c ConfidentialTxOutSet) FindByLockingScript(lockingScript string) map[uint32]*ConfidentialTxOut

func (ConfidentialTxOutSet) FindByLockingScriptFirst

func (c ConfidentialTxOutSet) FindByLockingScriptFirst(lockingScript string) (*ConfidentialTxOut, uint32)

func (ConfidentialTxOutSet) GetFeeAmount

func (c ConfidentialTxOutSet) GetFeeAmount() int64

type Descriptor

type Descriptor struct {
	// Output Descriptor
	OutputDescriptor string
}

Descriptor This struct use for the output descriptor.

type DescriptorData

type DescriptorData struct {
	// depth (0 - )
	Depth uint32
	// script type. (CfdDescriptorScriptType)
	ScriptType int
	// locking script.
	LockingScript string
	// address string. (for ScriptType not KCfdDescriptorScriptRaw)
	Address string
	// hash type. (CfdHashType)
	HashType int
	// redeem script. (for ScriptType KCfdDescriptorScriptSh or KCfdDescriptorScriptWsh)
	RedeemScript string
	// key type. (see CfdDescriptorKeyData.KeyType)
	KeyType int
	// pubkey
	Pubkey string
	// extend pubkey
	ExtPubkey string
	// extend privkey
	ExtPrivkey string
	// schnorr pubkey
	SchnorrPubkey string
	// has multisig
	IsMultisig bool
	// number of multisig require signatures
	ReqSigNum uint32
	// Taproot ScriptTree string
	TreeString string
}

*

  • Descriptor data struct.

func NewDescriptorData

func NewDescriptorData(cfdData *cfd.CfdDescriptorData) *DescriptorData

type DescriptorKey

type DescriptorKey struct {
	// key type. (CfdDescriptorKeyType)
	// - KCfdDescriptorKeyNull
	// - KCfdDescriptorKeyPublic
	// - KCfdDescriptorKeyBip32
	// - KCfdDescriptorKeyBip32Priv
	// - KCfdDescriptorKeySchnorr
	KeyType DescriptorKeyType
	// pubkey
	Pubkey *Pubkey
	// extend pubkey
	ExtPubkey *ExtPubkey
	// extend privkey
	ExtPrivkey *ExtPrivkey
	// schnorr pubkey
	SchnorrPubkey string // TODO(k-matsuzawa): please wait
}

DescriptorKey stores a key data for descriptor.

func NewDescriptorKey

func NewDescriptorKey(keyType int, pubkey, extPubkey, extPrivkey, schnorrPubkey string) DescriptorKey

func (DescriptorKey) GetPublicKey

func (d DescriptorKey) GetPublicKey() string

type DescriptorKeyData

type DescriptorKeyData struct {
	// key type. (CfdDescriptorKeyType)
	// - KCfdDescriptorKeyNull
	// - KCfdDescriptorKeyPublic
	// - KCfdDescriptorKeyBip32
	// - KCfdDescriptorKeyBip32Priv
	// - KCfdDescriptorKeySchnorr
	KeyType int
	// pubkey
	Pubkey string
	// extend pubkey
	ExtPubkey string
	// extend privkey
	ExtPrivkey string
	// schnorr pubkey
	SchnorrPubkey string
}

*

  • Descriptor key data struct.

type DescriptorKeyType

type DescriptorKeyType int

func NewDescriptorKeyType

func NewDescriptorKeyType(keyType int) DescriptorKeyType

func (DescriptorKeyType) ToCfdValue

func (k DescriptorKeyType) ToCfdValue() int

ToCfdValue ...

func (DescriptorKeyType) Valid

func (k DescriptorKeyType) Valid() bool

Valid ...

type DescriptorKeys

type DescriptorKeys []DescriptorKey

func (DescriptorKeys) ExistPublicKey

func (d DescriptorKeys) ExistPublicKey(pubkey *Pubkey) bool

func (DescriptorKeys) Find

func (d DescriptorKeys) Find(key DescriptorKey) bool

func (DescriptorKeys) GetPublicKeys

func (d DescriptorKeys) GetPublicKeys() []string

type DescriptorMultisig

type DescriptorMultisig struct {
	ReqSigNum uint32         // number of multisig require signatures
	Keys      DescriptorKeys // Multisig keys
}

DescriptorMultisig stores the multisig data for descriptor.

func NewDescriptorMultisig

func NewDescriptorMultisig(reqSigNum uint32, keys []DescriptorKeyData) *DescriptorMultisig

type DescriptorParseFilter

type DescriptorParseFilter struct {
	EnableHashTypes            []HashType
	DisableHashTypes           []HashType
	IsMultisigOnlyOnScriptHash bool
	EnableRootDescriptorTypes  []DescriptorType
	DisableRootDescriptorTypes []DescriptorType
}

DescriptorParseFilter defines filter conditions for parsing output descriptors.

func (*DescriptorParseFilter) Check

type DescriptorRootData

type DescriptorRootData struct {
	// depth (0 - )
	Depth uint32
	// script type. (CfdDescriptorScriptType)
	Type DescriptorType
	// address string. (for Type not KCfdDescriptorScriptRaw)
	Address Address
	// hash type.
	HashType HashType
	// redeem script. (for HashType P2sh,P2wsh,P2shP2wsh)
	RedeemScript *Script
	// key
	Key DescriptorKey
	// multisig
	Multisig *DescriptorMultisig
	// Taproot ScriptTree string
	TreeString string // TODO(k-matsuzawa): please wait
}

DescriptorRootData stores descriptor root data

func (DescriptorRootData) ExistPublicKey

func (d DescriptorRootData) ExistPublicKey(pubkey *Pubkey) bool

func (DescriptorRootData) GetAddress

func (d DescriptorRootData) GetAddress() string

func (DescriptorRootData) GetPublicKey

func (d DescriptorRootData) GetPublicKey() string

func (DescriptorRootData) GetPublicKeys

func (d DescriptorRootData) GetPublicKeys() []string

func (DescriptorRootData) GetRedeemScript

func (d DescriptorRootData) GetRedeemScript() string

func (DescriptorRootData) HasMultisig

func (d DescriptorRootData) HasMultisig() bool

type DescriptorType

type DescriptorType int

func NewDescriptorType

func NewDescriptorType(descType int) DescriptorType

func (DescriptorType) ToCfdValue

func (t DescriptorType) ToCfdValue() int

ToCfdValue ...

type DescriptorTypes

type DescriptorTypes []DescriptorType

func (DescriptorTypes) Find

func (d DescriptorTypes) Find(descType DescriptorType) bool

func (DescriptorTypes) IsValid

func (d DescriptorTypes) IsValid() bool

type ElementsUtxoData

type ElementsUtxoData struct {
	OutPoint          OutPoint             // OutPoint
	Asset             string               // Asset
	AssetBlindFactor  string               // Asset BlindFactor
	Amount            int64                // satoshi value
	ValueBlindFactor  string               // Value BlindFactor
	AmountCommitment  string               // Amount commitment
	Descriptor        string               // output descriptor
	ScriptSigTemplate string               // scriptsig template hex (require script hash estimate fee)
	IssuanceKey       *IssuanceBlindingKey // issuance key
	IsIssuance        bool                 // is issuance output
	IsBlindIssuance   bool                 // is blind issuance output
	PeginData         *PeginUtxoData       // pegin data
}

func (ElementsUtxoData) ConvertToCfdUtxo

func (u ElementsUtxoData) ConvertToCfdUtxo() cfd.CfdUtxo

func (ElementsUtxoData) HasBlindUtxo

func (u ElementsUtxoData) HasBlindUtxo() bool

type ExtPrivkey

type ExtPrivkey struct {
	Key string
}

ExtPrivkey xprv

type ExtPubkey

type ExtPubkey struct {
	Key string
}

ExtPubkey xpub

type ExtkeyData

type ExtkeyData struct {
	// version
	Version string
	// parent fingerprint
	Fingerprint string
	// chain code
	ChainCode string
	// depth
	Depth uint32
	// child number
	ChildNumber uint32
	// key type
	KeyType ExtkeyType
	// network
	Network NetworkType
}

type ExtkeyType

type ExtkeyType int

ExtkeyType ...

const (
	// ExtkeyType
	UnknownExtkeyType ExtkeyType = iota
	ExtPrivkeyType
	ExtPubkeyType
)

func NewExtkeyType

func NewExtkeyType(cfdExtkeyType int) ExtkeyType

NewExtkeyType ...

func NewExtkeyTypeByString

func NewExtkeyTypeByString(extkeyType string) ExtkeyType

NewExtkeyTypeByString ...

func (ExtkeyType) String

func (n ExtkeyType) String() string

String ...

func (ExtkeyType) ToCfdValue

func (n ExtkeyType) ToCfdValue() int

ToCfdValue ...

func (ExtkeyType) Valid

func (n ExtkeyType) Valid() bool

Valid ...

type FundRawTxOption

type FundRawTxOption struct {
	// fee asset
	FeeAsset string
	// use blind tx
	IsBlindTx bool
	// effective feerate
	EffectiveFeeRate float64
	// longterm feerate
	LongTermFeeRate float64
	// dust feerate
	DustFeeRate float64
	// knapsack min change value. knapsack logic's threshold. Recommended value is 1.
	KnapsackMinChange int64
	// blind exponent. default is 0.
	Exponent int64
	// blind minimum bits. default is -1 (cfd-go auto).
	MinimumBits int64
}

*

  • FundRawTransaction option data struct.

func NewCfdFundRawTxOption

func NewCfdFundRawTxOption(networkType NetworkType) FundRawTxOption

type HashType

type HashType int
const (
	// HashType
	UnknownType HashType = iota
	P2pkh
	P2sh
	P2wpkh
	P2wsh
	P2shP2wpkh
	P2shP2wsh
	Taproot
)

func NewHashType

func NewHashType(cfdHashType int) HashType

NewHashType ...

func NewHashTypeByString

func NewHashTypeByString(hashType string) HashType

NewHashTypeByString ...

func (HashType) IsP2shSegwit

func (n HashType) IsP2shSegwit() bool

IsP2shSegwit ...

func (HashType) IsPubkeyHash

func (n HashType) IsPubkeyHash() bool

IsPubkeyHash ...

func (HashType) IsScriptHash

func (n HashType) IsScriptHash() bool

IsScriptHash ...

func (HashType) IsWitness

func (n HashType) IsWitness() bool

IsWitness ...

func (HashType) IsWitnessV1OrLater

func (n HashType) IsWitnessV1OrLater() bool

IsWitnessV1OrLater ...

func (HashType) String

func (n HashType) String() string

String ...

func (HashType) ToCfdValue

func (n HashType) ToCfdValue() int

ToCfdValue ...

type HashTypes

type HashTypes []HashType

func (HashTypes) Find

func (d HashTypes) Find(hashType HashType) bool

func (HashTypes) IsValid

func (d HashTypes) IsValid() bool

type HdWallet

type HdWallet struct {
	Seed string
}

HdWallet seed

type InputConfidentialTxIn

type InputConfidentialTxIn struct {
	OutPoint   OutPoint
	Sequence   uint32
	PeginInput *InputPeginData
}

InputConfidentialTxIn ...

type InputConfidentialTxOut

type InputConfidentialTxOut struct {
	Amount        int64  // satoshi amount (unblind value)
	Asset         string // asset (or commitment asset)
	LockingScript string // locking script
	Address       string // address or confidential address. (if locking script is usual hashtype.)
	Nonce         string // direct nonce
	PegoutInput   *InputPegoutData
	IsDestroy     bool
	IsFee         bool
}

InputConfidentialTxOut ...

type InputPeginData

type InputPeginData struct {
	BitcoinTransaction      string
	BitcoinGenesisBlockHash string
	BitcoinAssetId          string
	ClaimScript             string
	TxOutProof              string
}

InputPeginData ...

type InputPegoutData

type InputPegoutData struct {
	BitcoinGenesisBlockHash string
	OnlineKey               string
	BitcoinOutputDescriptor string
	Bip32Counter            uint32
	Whitelist               string
}

InputPegoutData ...

type InputTxIn

type InputTxIn struct {
	OutPoint OutPoint
	Sequence uint32
}

type InputTxOut

type InputTxOut struct {
	Amount        int64  // satoshi amount (unblind value)
	LockingScript string // locking script
	Address       string // address or confidential address. (if locking script is usual hashtype.)
}

type IssuanceBlindingKey

type IssuanceBlindingKey struct {
	AssetBlindingKey string // (option) Asset blinding key
	TokenBlindingKey string // (option) Token blinding key
}

IssuanceBlindingKey ...

type IssuanceData

type IssuanceData struct {
	Entropy     string
	Nonce       string
	AssetAmount int64
	AssetValue  string
	TokenAmount int64
	TokenValue  string
}

IssuanceData confidential transaction issuance input.

type NetworkType

type NetworkType int
const (
	// NetworkType
	Unknown NetworkType = iota
	Mainnet
	Testnet
	Regtest
	LiquidV1
	ElementsRegtest
)

func NewNetworkType

func NewNetworkType(cfdNetworkType int) NetworkType

NewNetworkType ...

func NewNetworkTypeByString

func NewNetworkTypeByString(networkType string) NetworkType

NewNetworkTypeByString ...

func (NetworkType) IsBitcoin

func (n NetworkType) IsBitcoin() bool

IsBitcoin ...

func (NetworkType) IsElements

func (n NetworkType) IsElements() bool

IsElements ...

func (NetworkType) IsMainnet

func (n NetworkType) IsMainnet() bool

IsMainnet ...

func (NetworkType) String

func (n NetworkType) String() string

String ...

func (NetworkType) ToBitcoinType

func (n NetworkType) ToBitcoinType() NetworkType

ToBitcoinType ...

func (NetworkType) ToBitcoinTypePointer

func (n NetworkType) ToBitcoinTypePointer() *NetworkType

ToBitcoinTypePointer ...

func (NetworkType) ToCfdValue

func (n NetworkType) ToCfdValue() int

ToCfdValue ...

func (NetworkType) Valid

func (n NetworkType) Valid() bool

Valid ...

type OutPoint

type OutPoint struct {
	// txid
	Txid string
	// vout
	Vout uint32
}

OutPoint : utxo outpoint struct.

func (OutPoint) Equal

func (o OutPoint) Equal(target OutPoint) bool

String This function return outpoint's string.

func (OutPoint) String

func (o OutPoint) String() string

String This function return outpoint's string.

type PeginTxOption

type PeginTxOption struct {
	// fee asset
	FeeAsset string
	// use blind tx
	IsBlindTx bool
	// effective feerate
	EffectiveFeeRate float64
	// longterm feerate
	LongTermFeeRate float64
	// dust feerate
	DustFeeRate float64
	// knapsack min change value. knapsack logic's threshold. Recommended value is 1.
	KnapsackMinChange int64
	// blind minimum range value
	MinimumRangeValue int64
	// blind exponent. default is 0.
	Exponent int64
	// blind minimum bits. default is -1 (cfd-go auto).
	MinimumBits int64
}

PeginTxOption ...

func NewPeginTxOption

func NewPeginTxOption() PeginTxOption

NewPeginTxOption ...

type PeginUtxoData

type PeginUtxoData struct {
	BitcoinTransaction string
	TxOutProof         string
	ClaimScript        string
}

type PegoutTxOption

type PegoutTxOption struct {
	// fee asset
	FeeAsset string
	// use blind tx
	IsBlindTx bool
	// effective feerate
	EffectiveFeeRate float64
	// longterm feerate
	LongTermFeeRate float64
	// dust feerate
	DustFeeRate float64
	// knapsack min change value. knapsack logic's threshold. Recommended value is 1.
	KnapsackMinChange int64
	// blind minimum range value
	MinimumRangeValue int64
	// blind exponent. default is 0.
	Exponent int64
	// blind minimum bits. default is -1 (cfd-go auto).
	MinimumBits int64
	// subtract fee by pegout amount.
	SubtractFee bool
}

PegoutTxOption ...

func NewPegoutTxOption

func NewPegoutTxOption() PegoutTxOption

NewPegoutTxOption ...

type Privkey

type Privkey struct {
	Hex                string
	Wif                string
	Network            NetworkType
	IsCompressedPubkey bool
}

Privkey ...

type Pubkey

type Pubkey struct {
	Hex string
}

Pubkey ...

type Script

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

Script This struct holds a script.

func NewScript

func NewScript(data []byte) Script

NewScript This function create a script from a byte array.

func NewScriptFromAsm

func NewScriptFromAsm(scriptAsm string) (Script, error)

NewScriptFromAsm This function create a script from an asm string.

func NewScriptFromAsmList

func NewScriptFromAsmList(scriptAsmList []string) (Script, error)

NewScriptFromAsmList This function create a script from the asm string list.

func NewScriptFromHex

func NewScriptFromHex(hexStr string) (Script, error)

NewScriptFromHex This function create a script from a hex string.

func NewScriptFromHexIgnoreError

func NewScriptFromHexIgnoreError(hexStr string) *Script

NewScriptFromHex This function create a script from a hex string. On error, it returns nil.

func (*Script) IsEmpty

func (obj *Script) IsEmpty() bool

IsEmpty This function return a empty or not.

func (*Script) Parse

func (obj *Script) Parse() (scriptItems []string, err error)

Parse This function return a parsing script.

func (*Script) ToHex

func (obj *Script) ToHex() string

ToHex This function return a hex string.

func (*Script) ToSlice

func (obj *Script) ToSlice() []byte

ToHex This function return a byte array.

type ScriptWitness

type ScriptWitness struct {
	// witness stack by hex.
	Stack []string
}

ScriptWitness : witness stack.

type SigHashType

type SigHashType struct {
	Type         int
	AnyoneCanPay bool
	Rangeproof   bool
}

SigHashType This struct use for the sighashtype utility function.

var SigHashTypeAll SigHashType = *NewSigHashType(1)
var SigHashTypeDefault SigHashType = *NewSigHashType(0)
var SigHashTypeNone SigHashType = *NewSigHashType(2)
var SigHashTypeSingle SigHashType = *NewSigHashType(3)

func NewSigHashType

func NewSigHashType(sighashType int) *SigHashType

NewSigHashType This function return a SigHashType.

func (*SigHashType) GetValue

func (obj *SigHashType) GetValue() int

ToHex This function return a sighashtype byte value.

func (*SigHashType) String

func (obj *SigHashType) String() string

String ...

type SignParameter

type SignParameter struct {
	Data          Script
	IsDerEncode   bool
	SigHashType   SigHashType
	RelatedPubkey *Pubkey
}

func NewSignParameterFromString

func NewSignParameterFromString(derSignature, relatedPubkey string) *SignParameter

type Transaction

type Transaction struct {
	Hex string
}

Transaction ...

type TransactionData

type TransactionData struct {
	// txid
	Txid string
	// witness txid
	Wtxid string
	// witness hash
	WitHash string
	// size
	Size uint32
	// virtual size
	Vsize uint32
	// weight
	Weight uint32
	// version
	Version uint32
	// locktime
	LockTime uint32
}

*

  • TransactionData data struct.

type TxIn

type TxIn struct {
	// utxo outpoint.
	OutPoint OutPoint
	// sequence number.
	Sequence uint32
	// script sig.
	ScriptSig string
	// witness stack.
	WitnessStack ScriptWitness
}

TxIn : transaction input.

type TxOut

type TxOut struct {
	// satoshi amount.
	Amount int64
	// locking script.
	LockingScript string
	// address (if locking script is usual hashtype.)
	Address string
}

TxOut : transaction output.

type UnblindData

type UnblindData struct {
	Asset            string // Asset
	AssetBlindFactor string // Asset BlindFactor
	Amount           int64  // satoshi value
	ValueBlindFactor string // Value BlindFactor
}

type UtxoData

type UtxoData struct {
	OutPoint          OutPoint // OutPoint
	Amount            int64    // satoshi value
	Descriptor        string   // output descriptor
	ScriptSigTemplate string   // scriptsig template hex (require script hash estimate fee)
	Asset             string   // Asset
	AmountCommitment  string   // Amount commitment
}

func (UtxoData) ConvertToCfdUtxo

func (u UtxoData) ConvertToCfdUtxo() cfd.CfdUtxo

Jump to

Keyboard shortcuts

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