Documentation ¶
Index ¶
- type Builder
- func (txb *Builder) AddRequestBlock(reqBlk *sctransaction.RequestBlock) error
- func (txb *Builder) AddRequestBlockWithTransfer(reqBlk *sctransaction.RequestBlock, targetAddr *address.Address, ...) error
- func (txb *Builder) Build(useAllInputs bool) (*sctransaction.Transaction, error)
- func (txb *Builder) BuildValueTransactionOnly(useAllInputs bool) *valuetransaction.Transaction
- func (txb *Builder) Clone() *Builder
- func (txb *Builder) CreateOriginStateBlock(stateHash *hashing.HashValue, scAddress *address.Address) error
- func (txb *Builder) CreateStateBlock(color balance.Color) error
- func (txb *Builder) SetStateParams(stateIndex uint32, stateHash *hashing.HashValue, timestamp int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { *vtxbuilder.Builder // contains filtered or unexported fields }
func NewFromAddressBalances ¶
func NewFromOutputBalances ¶
func (*Builder) AddRequestBlock ¶
func (txb *Builder) AddRequestBlock(reqBlk *sctransaction.RequestBlock) error
AddRequestBlock adds new request block to the builder. It automatically handles request token
func (*Builder) AddRequestBlockWithTransfer ¶
func (txb *Builder) AddRequestBlockWithTransfer(reqBlk *sctransaction.RequestBlock, targetAddr *address.Address, bals map[balance.Color]int64) error
AddRequestBlockWithTransfer adds request block with the request token and adds respective outputs for the colored transfers
func (*Builder) Build ¶
func (txb *Builder) Build(useAllInputs bool) (*sctransaction.Transaction, error)
func (*Builder) BuildValueTransactionOnly ¶
func (txb *Builder) BuildValueTransactionOnly(useAllInputs bool) *valuetransaction.Transaction
ignores SC part
func (*Builder) CreateOriginStateBlock ¶
func (txb *Builder) CreateOriginStateBlock(stateHash *hashing.HashValue, scAddress *address.Address) error
CreateOriginStateBlock initalizes origin state transaction of the smart contract with address scAddress in the builder. It mints smart contract token, sets origin state hash It sets state index and timestamp to 0
func (*Builder) CreateStateBlock ¶
CreateStateBlock assumes txb contain balances of the smart contract with 'color'. It adds state block and moves smart contract token to the same address. State block will have 0 state index, 0 timestamp, nil stateHash The function is used by VM wrapper to create new state transaction