Documentation ¶
Index ¶
- Variables
- func AddInputsForTransaction(transaction *types.Transaction, inputs []*types.CellInput, ...) ([]int, *types.WitnessArgs, error)
- func CalculateTransactionFee(tx *types.Transaction, feeRate uint64) uint64
- func MsgFromTxForMultiSig(transaction *types.Transaction, group []int, multisigScript []byte) ([]byte, error)
- func MultiSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, ...) error
- func NewEmptyWitnessArg(LockScriptLength uint) *types.WitnessArgs
- func NewSecp256k1HybirdSigTx(scripts *utils.SystemScripts) *types.Transaction
- func NewSecp256k1MultiSigTx(scripts *utils.SystemScripts) *types.Transaction
- func NewSecp256k1SingleSigTx(scripts *utils.SystemScripts) *types.Transaction
- func SingleSegmentSignMessage(transaction *types.Transaction, start int, end int, ...) ([]byte, error)
- func SingleSegmentSignTransaction(transaction *types.Transaction, start int, end int, ...) error
- func SingleSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, ...) error
- type Context
- type Contexts
- type ScriptGroup
- type ScriptType
- type TransactionWithScriptGroups
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Secp256k1EmptyWitnessArg = NewEmptyWitnessArg(65) Secp256k1EmptyWitnessArgPlaceholder = make([]byte, 85) Secp256k1SignaturePlaceholder = make([]byte, 65) )
Functions ¶
func AddInputsForTransaction ¶
func AddInputsForTransaction(transaction *types.Transaction, inputs []*types.CellInput, signatureLengthInBytes uint) ([]int, *types.WitnessArgs, error)
func CalculateTransactionFee ¶
func CalculateTransactionFee(tx *types.Transaction, feeRate uint64) uint64
func MsgFromTxForMultiSig ¶
func MultiSignTransaction ¶
func MultiSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, serialize []byte, signatures ...[]byte) error
func NewEmptyWitnessArg ¶
func NewEmptyWitnessArg(LockScriptLength uint) *types.WitnessArgs
func NewSecp256k1HybirdSigTx ¶
func NewSecp256k1HybirdSigTx(scripts *utils.SystemScripts) *types.Transaction
func NewSecp256k1MultiSigTx ¶
func NewSecp256k1MultiSigTx(scripts *utils.SystemScripts) *types.Transaction
func NewSecp256k1SingleSigTx ¶
func NewSecp256k1SingleSigTx(scripts *utils.SystemScripts) *types.Transaction
func SingleSegmentSignMessage ¶
func SingleSegmentSignMessage(transaction *types.Transaction, start int, end int, witnessArgs *types.WitnessArgs) ([]byte, error)
func SingleSegmentSignTransaction ¶
func SingleSegmentSignTransaction(transaction *types.Transaction, start int, end int, witnessArgs *types.WitnessArgs, key crypto.Key) error
func SingleSignTransaction ¶
func SingleSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, key crypto.Key) error
group is an array, which content is the index of input after grouping
Types ¶
type Context ¶
type Context struct { Key *secp256k1.Secp256k1Key Payload interface{} }
func NewContext ¶
func NewContextWithPayload ¶
type Contexts ¶
type Contexts []*Context
func NewContexts ¶
func NewContexts() Contexts
func (*Contexts) AddByPrivateKeys ¶
type ScriptGroup ¶
type ScriptGroup struct { Script *types.Script `json:"script"` GroupType ScriptType `json:"group_type"` InputIndices []uint32 `json:"input_indices"` OutputIndices []uint32 `json:"output_indices"` }
func (*ScriptGroup) UnmarshalJSON ¶
func (r *ScriptGroup) UnmarshalJSON(input []byte) error
type ScriptType ¶
type ScriptType string
const ( ScriptTypeLock ScriptType = "lock" ScriptTypeType ScriptType = "type" )
func (*ScriptType) UnmarshalJSON ¶
func (r *ScriptType) UnmarshalJSON(input []byte) error
type TransactionWithScriptGroups ¶
type TransactionWithScriptGroups struct { TxView *types.Transaction `json:"tx_view"` ScriptGroups []*ScriptGroup `json:"script_groups"` }
Click to show internal directories.
Click to hide internal directories.