txbuilder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0, BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

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 NewFromAddressBalances(scAddress *address.Address, addressBalances map[valuetransaction.ID][]*balance.Balance) (*Builder, error)

func NewFromOutputBalances

func NewFromOutputBalances(outputBalances map[valuetransaction.OutputID][]*balance.Balance) (*Builder, error)

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) Clone

func (txb *Builder) Clone() *Builder

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

func (txb *Builder) CreateStateBlock(color balance.Color) error

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

func (*Builder) SetStateParams

func (txb *Builder) SetStateParams(stateIndex uint32, stateHash *hashing.HashValue, timestamp int64) error

Directories

Path Synopsis
package to build value transaction
package to build value transaction

Jump to

Keyboard shortcuts

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