profile

package
v0.0.0-...-fd63c1f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TzProfileV0 uint64 = 0x30794422432f1557
	TzProfileV1 uint64 = 0x60ad2404b71de830
)

Variables

View Source
var (
	StorageType = m.MustParseType(`{"prim":"pair","args":[{"prim":"pair","args":[{"prim":"set","annots":["%claims"],"args":[{"prim":"pair","args":[{"prim":"pair","args":[{"prim":"string","annots":["%url"]},{"prim":"bytes","annots":["%sign"]}]},{"prim":"string"}]}]},{"prim":"string","annots":["%contract_type"]}]},{"prim":"pair","args":[{"prim":"big_map","annots":["%metadata"],"args":[{"prim":"string"},{"prim":"bytes"}]},{"prim":"address","annots":["%owner"]}]}]}`)
	ParamsType  = m.MustParseType(`{"prim":"pair","args":[{"prim":"list","args":[{"prim":"pair","args":[{"prim":"pair","args":[{"prim":"string"},{"prim":"bytes"}]},{"prim":"string"}]}]},{"prim":"bool"}]}`)
)

Functions

func NewDecoder

func NewDecoder(_ uint64) metadata.Decoder

Types

type Claim

type Claim struct {
	Url  string         `json:"url"   prim:"url,path=0/0"`
	Sign tezos.HexBytes `json:"sign"  prim:"sign,path=0/1"`
}

type Decoder

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

func (*Decoder) DecodeParams

func (d *Decoder) DecodeParams(buf []byte) (p Params, err error)

func (*Decoder) DecodeStorage

func (d *Decoder) DecodeStorage(buf []byte) (c Storage, err error)

func (*Decoder) Namespace

func (d *Decoder) Namespace() string

func (*Decoder) OnOperation

func (d *Decoder) OnOperation(_ context.Context, op *model.Op) ([]*metadata.Event, error)

func (*Decoder) OnTaskComplete

func (d *Decoder) OnTaskComplete(ctx context.Context, meta *model.Metadata, res *task.TaskResult) ([]*metadata.Event, error)

process resolved claims flag == 1: update from claim, on error do nothing flag == 0: remove from claim, on error remove all

type Params

type Params struct {
	Claims   []Claim `prim:"claims,path=0"`
	IsUpdate bool    `prim:"updated,path=1"`
}

type Storage

type Storage struct {
	Claims       []Claim       `json:"claims"`
	ContractType string        `json:"contract_type"`
	Owner        tezos.Address `json:"owner"`
}

Jump to

Keyboard shortcuts

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