assets

package
v0.13.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assets

type Assets struct {
	Log            *logger.L
	Limiter        *rate.Limiter
	Pool           storage.Handle
	IsNormalMode   func(mode.Mode) bool
	IsTestingChain func() bool
}

Assets - type for the RPC

func New

func New(log *logger.L, pools reservoir.Handles, isNormalMode func(mode.Mode) bool, isTestingChain func() bool) *Assets

func (*Assets) Get

func (assets *Assets) Get(arguments *GetArguments, reply *GetReply) error

Get - RPC to fetch asset data

type GetArguments

type GetArguments struct {
	Fingerprints []string `json:"fingerprints"`
}

GetArguments - arguments for RPC request

type GetReply

type GetReply struct {
	Assets []Record `json:"assets"`
}

GetReply - results from get RPC request

type Record

type Record struct {
	Record    string      `json:"record"`
	Confirmed bool        `json:"confirmed"`
	AssetId   interface{} `json:"id,omitempty"`
	Data      interface{} `json:"data"`
}

Record - structure of asset records in the response

type RegisterReply

type RegisterReply struct {
	Assets []Status `json:"assets"`
}

RegisterReply - results from RPC request

type Status

type Status struct {
	AssetId   *transactionrecord.AssetIdentifier `json:"id"`
	Duplicate bool                               `json:"duplicate"`
}

Status - arguments for RPC request

func Register

func Register(assets []*transactionrecord.AssetData, pool storage.Handle) ([]Status, []byte, error)

internal function to register some assets

Jump to

Keyboard shortcuts

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