asset

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: ISC Imports: 16 Imported by: 3

Documentation

Overview

SPDX-License-Identifier: ISC Copyright (c) 2014-2019 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.

SPDX-License-Identifier: ISC Copyright (c) 2014-2019 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.

SPDX-License-Identifier: ISC Copyright (c) 2014-2019 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidNameLength     = errors.New("property name not set or exceeds the maximum length (64 Unicode characters)")
	ErrInvalidMetadataLength = errors.New("property metadata exceeds the maximum length (1024 Unicode characters)")
	ErrEmptyContent          = errors.New("asset content is empty")
	ErrNullRegistrant        = errors.New("registrant is null")
)

Functions

func Register

func Register(params *RegistrationParams) (string, error)

Types

type Asset

type Asset struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Metadata    map[string]string `json:"metadata"`
	Fingerprint string            `json:"fingerprint"`
	Registrant  string            `json:"registrant"`
	Status      string            `json:"status"`
	BlockNumber int               `json:"block_number"`
	Offset      int               `json:"offset"`
	CreatedAt   *time.Time        `json:"created_at"`
}

func Get

func Get(assetID string) (*Asset, error)

func List

func List(builder *QueryParamsBuilder) ([]*Asset, error)

type QueryParamsBuilder

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

func NewQueryParamsBuilder

func NewQueryParamsBuilder() *QueryParamsBuilder

func (*QueryParamsBuilder) AssetIDs

func (qb *QueryParamsBuilder) AssetIDs(assetIDs []string) *QueryParamsBuilder

func (*QueryParamsBuilder) At

func (*QueryParamsBuilder) Build

func (qb *QueryParamsBuilder) Build() (string, error)

func (*QueryParamsBuilder) Limit

func (qb *QueryParamsBuilder) Limit(size int) *QueryParamsBuilder

func (*QueryParamsBuilder) Pending

func (qb *QueryParamsBuilder) Pending(pending bool) *QueryParamsBuilder

func (*QueryParamsBuilder) RegisteredBy

func (qb *QueryParamsBuilder) RegisteredBy(registrant string) *QueryParamsBuilder

func (*QueryParamsBuilder) To

type RegistrationParams

type RegistrationParams struct {
	Name        string `json:"name" pack:"utf8"`
	Fingerprint string `json:"fingerprint" pack:"utf8"`
	Metadata    string `json:"metadata" pack:"utf8"`
	Registrant  string `json:"registrant" pack:"account"`
	Signature   string `json:"signature"`
}

func NewRegistrationParams

func NewRegistrationParams(name string, metadata map[string]string) (*RegistrationParams, error)

func (*RegistrationParams) SetFingerprint

func (r *RegistrationParams) SetFingerprint(fingerprint string) error

func (*RegistrationParams) SetFingerprintFromData

func (r *RegistrationParams) SetFingerprintFromData(content []byte) error

func (*RegistrationParams) SetFingerprintFromFile

func (r *RegistrationParams) SetFingerprintFromFile(name string) error

func (*RegistrationParams) Sign

func (r *RegistrationParams) Sign(registrant account.Account) error

Jump to

Keyboard shortcuts

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