txbuilder

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMultiSignWitnessArgs

func GenerateMultiSignWitnessArgs(firstN uint8, signatures [][]byte, sortArgsList [][]byte) *types.WitnessArgs

Types

type BuildTransactionParams

type BuildTransactionParams struct {
	CellDeps       []*types.CellDep    `json:"cell_deps"`
	HeadDeps       []types.Hash        `json:"head_deps"`
	Inputs         []*types.CellInput  `json:"inputs"`
	Outputs        []*types.CellOutput `json:"outputs"`
	OutputsData    [][]byte            `json:"outputs_data"`
	Witnesses      [][]byte            `json:"witnesses"`
	OtherWitnesses [][]byte            `json:"other_witnesses"`
	LatestWitness  [][]byte
}

func BuildAccountCellTxForEditOwner added in v1.2.0

func BuildAccountCellTxForEditOwner(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildAccountCellTxForEditRecords added in v1.2.0

func BuildAccountCellTxForEditRecords(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildAccountCellTxForRenew added in v1.2.0

func BuildAccountCellTxForRenew(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTx added in v1.2.0

func BuildDidCellTx(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForEditOwner added in v1.2.0

func BuildDidCellTxForEditOwner(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForEditOwnerFromAccountCell added in v1.2.0

func BuildDidCellTxForEditOwnerFromAccountCell(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForEditRecords added in v1.2.0

func BuildDidCellTxForEditRecords(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForRecycle added in v1.2.0

func BuildDidCellTxForRecycle(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForRenew added in v1.2.0

func BuildDidCellTxForRenew(p DidCellTxParams) (*BuildTransactionParams, error)

func BuildDidCellTxForUpgrade added in v1.2.0

func BuildDidCellTxForUpgrade(p DidCellTxParams) (*BuildTransactionParams, error)

func DeepCopyTxParams added in v1.2.0

func DeepCopyTxParams(src interface{}) (*BuildTransactionParams, error)

type CheckTxFeeParam added in v1.2.0

type CheckTxFeeParam struct {
	TxParams      *BuildTransactionParams
	DasCache      *dascache.DasCache
	TxFee         uint64
	FeeLock       *types.Script
	TxBuilderBase *DasTxBuilderBase
	DasCore       *core.DasCore
}

type DasMMJson

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

type DasTxBuilder

type DasTxBuilder struct {
	*DasTxBuilderBase        // for base
	*DasTxBuilderTransaction // for tx
	DasMMJson                // for mmjson
	// contains filtered or unexported fields
}

func CheckTxFee added in v1.2.0

func CheckTxFee(checkTxFeeParam *CheckTxFeeParam) (*DasTxBuilder, error)

func NewDasTxBuilderFromBase

func NewDasTxBuilderFromBase(base *DasTxBuilderBase, tx *DasTxBuilderTransaction) *DasTxBuilder

func (*DasTxBuilder) AddMultiSignatureForTx

func (d *DasTxBuilder) AddMultiSignatureForTx(group []int, firstN uint8, signatures [][]byte, sortArgsList [][]byte) error

func (*DasTxBuilder) AddSignatureForTx

func (d *DasTxBuilder) AddSignatureForTx(signData []SignData) error

func (*DasTxBuilder) BuildMMJsonObj

func (d *DasTxBuilder) BuildMMJsonObj(evmChainId int64) (*common.MMJsonObj, error)

func (*DasTxBuilder) BuildTransaction

func (d *DasTxBuilder) BuildTransaction(p *BuildTransactionParams) error

func (*DasTxBuilder) BuildTransactionWithCheckInputs

func (d *DasTxBuilder) BuildTransactionWithCheckInputs(p *BuildTransactionParams, notCheckInputs bool) error

func (*DasTxBuilder) GenerateDigestListFromTx

func (d *DasTxBuilder) GenerateDigestListFromTx(skipGroups []int) ([]SignData, error)

func (*DasTxBuilder) GenerateMultiSignDigest

func (d *DasTxBuilder) GenerateMultiSignDigest(group []int, firstN uint8, signatures [][]byte, sortArgsList [][]byte) ([]byte, error)

func (*DasTxBuilder) GetDasTxBuilderTransactionString

func (d *DasTxBuilder) GetDasTxBuilderTransactionString() string

func (*DasTxBuilder) SendTransaction

func (d *DasTxBuilder) SendTransaction() (*types.Hash, error)

func (*DasTxBuilder) SendTransactionWithCheck

func (d *DasTxBuilder) SendTransactionWithCheck(needCheck bool) (*types.Hash, error)

func (*DasTxBuilder) TxString

func (d *DasTxBuilder) TxString() string

type DasTxBuilderBase

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

func NewDasTxBuilderBase

func NewDasTxBuilderBase(ctx context.Context, dasCore *core.DasCore, handle sign.HandleSignCkbMessage, serverArgs string) *DasTxBuilderBase

type DasTxBuilderTransaction

type DasTxBuilderTransaction struct {
	Transaction     *types.Transaction               `json:"transaction"`
	MapInputsCell   map[string]*types.CellWithStatus `json:"map_inputs_cell"`
	ServerSignGroup []int                            `json:"server_sign_group"`
}

type DidCellTxParams added in v1.2.0

type DidCellTxParams struct {
	DasCore             *core.DasCore
	DasCache            *dascache.DasCache
	Action              common.DidCellAction
	DidCellOutPoint     *types.OutPoint
	AccountCellOutPoint *types.OutPoint

	EditRecords   []witness.Record
	EditOwnerLock *types.Script

	RenewYears       int
	NormalCellScript *types.Script
}

func (DidCellTxParams) GetNormalCellCapacity added in v1.2.0

func (d DidCellTxParams) GetNormalCellCapacity() uint64

type OutputsIncomeCell added in v1.2.0

type OutputsIncomeCell struct {
	Cell    *types.CellOutput
	Data    []byte
	Witness []byte
}

func GenIncomeCell added in v1.2.0

func GenIncomeCell(dc *core.DasCore, serverScript *types.Script, capacity uint64, index uint32) (*OutputsIncomeCell, error)

type SignData

type SignData struct {
	SignType common.DasAlgorithmId `json:"sign_type"`
	SignMsg  string                `json:"sign_msg"`
}

func GenerateDigestListFromTx added in v1.0.1

func GenerateDigestListFromTx(cli rpc.Client, txJson string, skipGroups []int) ([]SignData, error)

Jump to

Keyboard shortcuts

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