utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	AnyoneCanPayCodeHashOnLina   = "0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354"
	AnyoneCanPayCodeHashOnAggron = "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356"
)

Variables

This section is empty.

Functions

func GenerateSudtAmount added in v0.2.0

func GenerateSudtAmount(amount *big.Int) []byte

func ParseSudtAmount added in v0.2.0

func ParseSudtAmount(outputData []byte) (*big.Int, error)

Types

type CapacityCellProcessor

type CapacityCellProcessor struct {
	Max uint64
}

func NewCapacityCellProcessor

func NewCapacityCellProcessor(capacity uint64) *CapacityCellProcessor

func (*CapacityCellProcessor) Process

func (p *CapacityCellProcessor) Process(cell *types.Cell, result *CollectResult) (bool, error)

type CapacityLiveCellProcessor added in v0.2.0

type CapacityLiveCellProcessor struct {
	Max uint64
}

func NewCapacityLiveCellProcessor added in v0.2.0

func NewCapacityLiveCellProcessor(capacity uint64) *CapacityLiveCellProcessor

func (*CapacityLiveCellProcessor) Process added in v0.2.0

func (p *CapacityLiveCellProcessor) Process(liveCell *indexer.LiveCell, result *LiveCellCollectResult) (bool, error)

type CellCollector

type CellCollector struct {
	Client          rpc.Client
	LockScript      *types.Script
	TypeScript      *types.Script
	Processor       CellProcessor
	UseIndex        bool
	EmptyData       bool
	FromBlockNumber uint64
}

func NewCellCollector

func NewCellCollector(client rpc.Client, lockScript *types.Script, processor CellProcessor) *CellCollector

func (*CellCollector) Collect

func (c *CellCollector) Collect() (*CollectResult, error)

type CellProcessor

type CellProcessor interface {
	Process(*types.Cell, *CollectResult) (bool, error)
}

type CollectResult

type CollectResult struct {
	Cells    []*types.Cell
	Capacity uint64
	Options  map[string]interface{}
}

type LiveCellCollectResult added in v0.2.0

type LiveCellCollectResult struct {
	LiveCells []*indexer.LiveCell
	Capacity  uint64
	Options   map[string]interface{}
}

type LiveCellCollector added in v0.2.0

type LiveCellCollector struct {
	Client      rpc.Client
	SearchKey   *indexer.SearchKey
	SearchOrder indexer.SearchOrder
	Limit       uint64
	AfterCursor string
	Processor   LiveCellProcessor
	EmptyData   bool
	TypeScript  *types.Script
}

func NewLiveCellCollector added in v0.2.0

func NewLiveCellCollector(client rpc.Client, searchKey *indexer.SearchKey, searchOrder indexer.SearchOrder, limit uint64, afterCursor string, processor LiveCellProcessor) *LiveCellCollector

func (*LiveCellCollector) Collect added in v0.2.0

type LiveCellProcessor added in v0.2.0

type LiveCellProcessor interface {
	Process(*indexer.LiveCell, *LiveCellCollectResult) (bool, error)
}

type SystemScriptCell

type SystemScriptCell struct {
	CellHash types.Hash
	OutPoint *types.OutPoint
}

type SystemScripts

type SystemScripts struct {
	SecpSingleSigCell *SystemScriptCell
	SecpMultiSigCell  *SystemScriptCell
	DaoCell           *SystemScriptCell
}

func NewSystemScripts

func NewSystemScripts(client rpc.Client) (*SystemScripts, error)

Jump to

Keyboard shortcuts

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