Documentation
¶
Index ¶
- Constants
- Variables
- func UnmarshalAuthorize(p *codec.Packer) (chain.Action, error)
- func UnmarshalClear(p *codec.Packer) (chain.Action, error)
- func UnmarshalIndex(p *codec.Packer) (chain.Action, error)
- func UnmarshalModify(p *codec.Packer) (chain.Action, error)
- func UnmarshalTransfer(p *codec.Packer) (chain.Action, error)
- func UnmarshalUnindex(p *codec.Packer) (chain.Action, error)
- type Authorize
- func (a *Authorize) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (a *Authorize) Marshal(p *codec.Packer)
- func (*Authorize) MaxUnits(chain.Rules) uint64
- func (a *Authorize) StateKeys(chain.Auth) [][]byte
- func (*Authorize) ValidRange(chain.Rules) (int64, int64)
- type Clear
- func (c *Clear) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (c *Clear) Marshal(p *codec.Packer)
- func (*Clear) MaxUnits(chain.Rules) uint64
- func (c *Clear) StateKeys(rauth chain.Auth) [][]byte
- func (*Clear) ValidRange(chain.Rules) (int64, int64)
- type Index
- func (i *Index) ContentID() ids.ID
- func (i *Index) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (i *Index) Marshal(p *codec.Packer)
- func (i *Index) MaxUnits(chain.Rules) uint64
- func (i *Index) StateKeys(rauth chain.Auth) [][]byte
- func (*Index) ValidRange(chain.Rules) (int64, int64)
- type Modify
- func (m *Modify) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (m *Modify) Marshal(p *codec.Packer)
- func (*Modify) MaxUnits(chain.Rules) uint64
- func (m *Modify) StateKeys(chain.Auth) [][]byte
- func (*Modify) ValidRange(chain.Rules) (int64, int64)
- type Transfer
- func (t *Transfer) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (t *Transfer) Marshal(p *codec.Packer)
- func (*Transfer) MaxUnits(chain.Rules) uint64
- func (t *Transfer) StateKeys(rauth chain.Auth) [][]byte
- func (*Transfer) ValidRange(chain.Rules) (int64, int64)
- type Unindex
- func (u *Unindex) Execute(ctx context.Context, r chain.Rules, db chain.Database, _ int64, ...) (*chain.Result, error)
- func (u *Unindex) Marshal(p *codec.Packer)
- func (*Unindex) MaxUnits(chain.Rules) uint64
- func (u *Unindex) StateKeys(rauth chain.Auth) [][]byte
- func (*Unindex) ValidRange(chain.Rules) (int64, int64)
Constants ¶
View Source
const ( // We restrict the [MaxContentSize] to be 768B such that any collection of // 1024 keys+values will never be more than [chain.NetworkSizeLimit]. // // TODO: relax this once merkleDB/sync can ensure range proof resolution does // not surpass [NetworkSizeLimit] MaxContentSize = 1_600 )
Variables ¶
View Source
var ( OutputContentEmpty = []byte("content empty") OutputContentMissing = []byte("content missing") OutputInvalidSchema = []byte("invalid schema") OutputInvalidContent = []byte("invalid content") OutputWrongOwner = []byte("wrong owner") OutputInvalidObject = []byte("invalid object") OutputServicerMissing = []byte("servicer missing") OutputInvalidBalance = []byte("invalid balance") OutputAccountNotEmpty = []byte("account not empty") OutputAccountEmpty = []byte("account empty") OutputPermissionsUseless = []byte("permissions useless") OutputActorMismatch = []byte("actor mismatch") OutputValueZero = []byte("value is zero") )
Functions ¶
Types ¶
type Authorize ¶
type Authorize struct { // Actor must be specified so we can enumerate read keys Actor crypto.PublicKey `json:"actor"` // Signer is the new permissions // // Any balance pull must come from actor to avoid being able to steal other's // money. Signer crypto.PublicKey `json:"signer"` // TODO: based on order of index in permissions // if 0, then remove all perms ActionPermissions uint8 `json:"actionPermissions"` MiscPermissions uint8 `json:"miscPermissions"` }
type Index ¶
type Index struct { // REQUIRED // // Schema of the content being indexed Schema ids.ID `json:"schema"` // Content is the indexed data that will be associated with the ID Content []byte `json:"content"` // OPTIONAL // // Royalty is the amount required to reference this object as a parent in // another [Index] // // If this value is > 0, the content will be registered to receive rewards // and the creator will need to lock up [Genesis.ContentStake]. To deregister an item // from receiving rewards and to receive their [Genesis.ContentStake] back, the creator must // issue an [UnindexTx]. // // If this value is 0, the content will not be registered to receive rewards. Royalty uint64 `json:"royalty"` // Parent of the content being indexed (this may be nested) // // This can also be empty if there is no parent (first reference) Parent ids.ID `json:"parent"` // Searcher is the owner of [Parent] // // We require this in the transaction so that the owner can be prefetched // during execution. Searcher crypto.PublicKey `json:"searcher"` // Servicer is the recipient of the [Invoice] payment // // This is not enforced anywhere on-chain and is up to the transaction signer // to populate correctly. If not populate correctly, it is likely that the // service provider will simply stop serving the user. Servicer crypto.PublicKey `json:"servicer"` // Commission is the value to send to [Servicer] for their work in surfacing // the content for interaction // // This field is not standardized and enforced by a [Servicer] to provide // user-level flexibility. For example, a [Servicer] may choose to offer // a discount after performing so many interactions per month. Commission uint64 `json:"commission"` }
func (*Index) ContentID ¶
ContentID is the canonical identifier of the indexed data. We include the minimum amount of info required to describe the item.
type Modify ¶
type Modify struct { // Content is the content to update Content ids.ID `json:"content"` // Royaly is the new value to apply to the content Royalty uint64 `json:"royalty"` }
Modify will update the Royalty of any claimed content or claim unclaimed content
This allows content creators to update previously indexed info without unindexing im.
type Transfer ¶
type Transfer struct { // To is the recipient of the [Value]. To crypto.PublicKey `json:"to"` // Amount are transferred to [To]. Value uint64 `json:"value"` }
Click to show internal directories.
Click to hide internal directories.