Documentation ¶
Overview ¶
Package nft is a generated protocol buffer package.
It is generated from these files:
x/nft/codec.proto
It has these top-level messages:
NonFungibleToken ActionApprovals Approval ApprovalOptions AddApprovalMsg RemoveApprovalMsg
Index ¶
- Constants
- Variables
- func ErrDuplicateEntry(id []byte) error
- func ErrInvalidCodec(codec string) error
- func ErrInvalidEntry(id []byte) error
- func ErrInvalidHost() error
- func ErrInvalidID(id []byte) error
- func ErrInvalidJson() error
- func ErrInvalidLength() error
- func ErrInvalidPort() error
- func ErrInvalidProtocol() error
- func ErrMissingEntry() error
- func ErrUnknownID(id []byte) error
- func ErrUnsupportedTokenType() error
- func FindActor(auth x.Authenticator, ctx weave.Context, t BaseNFT, action string) weave.Address
- func WithOwnerIndex(bucket orm.Bucket) orm.Bucket
- type Action
- type ActionApprovals
- func (m ActionApprovals) Clone() ActionApprovals
- func (*ActionApprovals) Descriptor() ([]byte, []int)
- func (m *ActionApprovals) GetAction() string
- func (m *ActionApprovals) GetApprovals() []Approval
- func (m *ActionApprovals) Marshal() (dAtA []byte, err error)
- func (m *ActionApprovals) MarshalTo(dAtA []byte) (int, error)
- func (*ActionApprovals) ProtoMessage()
- func (m *ActionApprovals) Reset()
- func (m *ActionApprovals) Size() (n int)
- func (m *ActionApprovals) String() string
- func (m *ActionApprovals) Unmarshal(dAtA []byte) error
- type AddApprovalMsg
- func (*AddApprovalMsg) Descriptor() ([]byte, []int)
- func (m *AddApprovalMsg) GetAction() string
- func (m *AddApprovalMsg) GetAddress() []byte
- func (m *AddApprovalMsg) GetId() []byte
- func (m *AddApprovalMsg) GetOptions() ApprovalOptions
- func (m *AddApprovalMsg) GetT() string
- func (m *AddApprovalMsg) Marshal() (dAtA []byte, err error)
- func (m *AddApprovalMsg) MarshalTo(dAtA []byte) (int, error)
- func (*AddApprovalMsg) Path() string
- func (*AddApprovalMsg) ProtoMessage()
- func (m *AddApprovalMsg) Reset()
- func (m *AddApprovalMsg) Size() (n int)
- func (m *AddApprovalMsg) String() string
- func (m *AddApprovalMsg) Unmarshal(dAtA []byte) error
- func (m AddApprovalMsg) Validate() error
- type Approval
- func (a Approval) AsAddress() weave.Address
- func (m Approval) Clone() Approval
- func (*Approval) Descriptor() ([]byte, []int)
- func (a Approval) Equals(o Approval) bool
- func (m *Approval) GetAddress() []byte
- func (m *Approval) GetOptions() ApprovalOptions
- func (m *Approval) Marshal() (dAtA []byte, err error)
- func (m *Approval) MarshalTo(dAtA []byte) (int, error)
- func (*Approval) ProtoMessage()
- func (m *Approval) Reset()
- func (m *Approval) Size() (n int)
- func (m *Approval) String() string
- func (m *Approval) Unmarshal(dAtA []byte) error
- func (m Approval) Validate() error
- type ApprovalMeta
- type ApprovalMsg
- type ApprovalOps
- type ApprovalOptions
- func (*ApprovalOptions) Descriptor() ([]byte, []int)
- func (a ApprovalOptions) Equals(o ApprovalOptions) bool
- func (a ApprovalOptions) EqualsAfterUse(used ApprovalOptions) bool
- func (m *ApprovalOptions) GetCount() int64
- func (m *ApprovalOptions) GetImmutable() bool
- func (m *ApprovalOptions) GetUntilBlockHeight() int64
- func (m *ApprovalOptions) Marshal() (dAtA []byte, err error)
- func (m *ApprovalOptions) MarshalTo(dAtA []byte) (int, error)
- func (*ApprovalOptions) ProtoMessage()
- func (m *ApprovalOptions) Reset()
- func (m *ApprovalOptions) Size() (n int)
- func (m *ApprovalOptions) String() string
- func (m *ApprovalOptions) Unmarshal(dAtA []byte) error
- func (a ApprovalOptions) Validate() error
- type Approvals
- func (m Approvals) Add(action string, approval Approval) Approvals
- func (m Approvals) AsPersistable() []ActionApprovals
- func (m Approvals) Filter(obsolete Approvals) Approvals
- func (m Approvals) FilterExpired(blockHeight int64) Approvals
- func (m Approvals) ForAction(action string) Approvals
- func (m Approvals) ForAddress(addr weave.Address) Approvals
- func (m Approvals) Intersect(others Approvals) Approvals
- func (m Approvals) IsEmpty() bool
- func (m Approvals) MergeUsed(used Approvals) Approvals
- func (m Approvals) MetaByAction(action string) ApprovalMeta
- func (m Approvals) UseCount() Approvals
- func (m Approvals) Validate(actionMaps ...map[string]int32) error
- type BaseNFT
- type BucketAccess
- type BucketDispatcher
- type Identified
- type NonFungibleToken
- func (m *NonFungibleToken) Approvals() *ApprovalOps
- func (m *NonFungibleToken) Clone() *NonFungibleToken
- func (m *NonFungibleToken) Copy() orm.CloneableData
- func (*NonFungibleToken) Descriptor() ([]byte, []int)
- func (m *NonFungibleToken) GetActionApprovals() []ActionApprovals
- func (m *NonFungibleToken) GetId() []byte
- func (m *NonFungibleToken) GetOwner() []byte
- func (m *NonFungibleToken) HasApproval(actor weave.Address, action string) bool
- func (m *NonFungibleToken) Marshal() (dAtA []byte, err error)
- func (m *NonFungibleToken) MarshalTo(dAtA []byte) (int, error)
- func (u *NonFungibleToken) OwnerAddress() weave.Address
- func (*NonFungibleToken) ProtoMessage()
- func (m *NonFungibleToken) Reset()
- func (m *NonFungibleToken) SetApprovals(a Approvals)
- func (m *NonFungibleToken) Size() (n int)
- func (m *NonFungibleToken) String() string
- func (m *NonFungibleToken) Unmarshal(dAtA []byte) error
- func (m *NonFungibleToken) Validate() error
- type Owned
- type RemoveApprovalMsg
- func (*RemoveApprovalMsg) Descriptor() ([]byte, []int)
- func (m *RemoveApprovalMsg) GetAction() string
- func (m *RemoveApprovalMsg) GetAddress() []byte
- func (m *RemoveApprovalMsg) GetId() []byte
- func (m *RemoveApprovalMsg) GetT() string
- func (m *RemoveApprovalMsg) Marshal() (dAtA []byte, err error)
- func (m *RemoveApprovalMsg) MarshalTo(dAtA []byte) (int, error)
- func (*RemoveApprovalMsg) Path() string
- func (*RemoveApprovalMsg) ProtoMessage()
- func (m *RemoveApprovalMsg) Reset()
- func (m *RemoveApprovalMsg) Size() (n int)
- func (m *RemoveApprovalMsg) String() string
- func (m *RemoveApprovalMsg) Unmarshal(dAtA []byte) error
- func (m RemoveApprovalMsg) Validate() error
- type Validation
Constants ¶
View Source
const ( CodeUnsupportedTokenType uint32 = 500 CodeInvalidID uint32 = 501 CodeDuplicateEntry uint32 = 502 CodeMissingEntry uint32 = 503 CodeInvalidEntry uint32 = 504 CodeUnknownID uint32 = 505 CodeInvalidLength uint32 = 506 CodeInvalidHost uint32 = 507 CodeInvalidPort uint32 = 508 CodeInvalidProtocol uint32 = 509 CodeInvalidCodec uint32 = 510 CodeInvalidJson uint32 = 511 )
nft and subpackages reserves 500~600
View Source
const ( PathAddApprovalMsg = "nft/approval/add" PathRemoveApprovalMsg = "nft/approval/remove" )
View Source
const OwnerIndexName = "owner"
OwnerIndexName is the index to query nft by owner
View Source
const UnlimitedCount = -1
Variables ¶
View Source
var ( ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") )
View Source
var Action_name = map[int32]string{
0: "ActionUpdateDetails",
1: "ActionTransfer",
2: "ActionUpdateApprovals",
}
View Source
var Action_value = map[string]int32{
"ActionUpdateDetails": 0,
"ActionTransfer": 1,
"ActionUpdateApprovals": 2,
}
Functions ¶
func ErrDuplicateEntry ¶
func ErrInvalidCodec ¶
func ErrInvalidEntry ¶
func ErrInvalidHost ¶
func ErrInvalidHost() error
func ErrInvalidID ¶
func ErrInvalidJson ¶
func ErrInvalidJson() error
func ErrInvalidLength ¶
func ErrInvalidLength() error
func ErrInvalidPort ¶
func ErrInvalidPort() error
func ErrInvalidProtocol ¶
func ErrInvalidProtocol() error
func ErrMissingEntry ¶
func ErrMissingEntry() error
func ErrUnknownID ¶
func ErrUnsupportedTokenType ¶
func ErrUnsupportedTokenType() error
ErrUnsupportedTokenType is when the type passed does not match the expected token type.
Types ¶
type ActionApprovals ¶
type ActionApprovals struct { Action string `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` Approvals []Approval `protobuf:"bytes,2,rep,name=approvals" json:"approvals"` }
func (ActionApprovals) Clone ¶
func (m ActionApprovals) Clone() ActionApprovals
func (*ActionApprovals) Descriptor ¶
func (*ActionApprovals) Descriptor() ([]byte, []int)
func (*ActionApprovals) GetAction ¶
func (m *ActionApprovals) GetAction() string
func (*ActionApprovals) GetApprovals ¶
func (m *ActionApprovals) GetApprovals() []Approval
func (*ActionApprovals) Marshal ¶
func (m *ActionApprovals) Marshal() (dAtA []byte, err error)
func (*ActionApprovals) ProtoMessage ¶
func (*ActionApprovals) ProtoMessage()
func (*ActionApprovals) Reset ¶
func (m *ActionApprovals) Reset()
func (*ActionApprovals) Size ¶
func (m *ActionApprovals) Size() (n int)
func (*ActionApprovals) String ¶
func (m *ActionApprovals) String() string
func (*ActionApprovals) Unmarshal ¶
func (m *ActionApprovals) Unmarshal(dAtA []byte) error
type AddApprovalMsg ¶
type AddApprovalMsg struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` Options ApprovalOptions `protobuf:"bytes,4,opt,name=options" json:"options"` T string `protobuf:"bytes,5,opt,name=t,proto3" json:"t,omitempty"` }
func (*AddApprovalMsg) Descriptor ¶
func (*AddApprovalMsg) Descriptor() ([]byte, []int)
func (*AddApprovalMsg) GetAction ¶
func (m *AddApprovalMsg) GetAction() string
func (*AddApprovalMsg) GetAddress ¶
func (m *AddApprovalMsg) GetAddress() []byte
func (*AddApprovalMsg) GetId ¶
func (m *AddApprovalMsg) GetId() []byte
func (*AddApprovalMsg) GetOptions ¶
func (m *AddApprovalMsg) GetOptions() ApprovalOptions
func (*AddApprovalMsg) GetT ¶
func (m *AddApprovalMsg) GetT() string
func (*AddApprovalMsg) Marshal ¶
func (m *AddApprovalMsg) Marshal() (dAtA []byte, err error)
func (*AddApprovalMsg) Path ¶
func (*AddApprovalMsg) Path() string
func (*AddApprovalMsg) ProtoMessage ¶
func (*AddApprovalMsg) ProtoMessage()
func (*AddApprovalMsg) Reset ¶
func (m *AddApprovalMsg) Reset()
func (*AddApprovalMsg) Size ¶
func (m *AddApprovalMsg) Size() (n int)
func (*AddApprovalMsg) String ¶
func (m *AddApprovalMsg) String() string
func (*AddApprovalMsg) Unmarshal ¶
func (m *AddApprovalMsg) Unmarshal(dAtA []byte) error
func (AddApprovalMsg) Validate ¶
func (m AddApprovalMsg) Validate() error
type Approval ¶
type Approval struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Options ApprovalOptions `protobuf:"bytes,2,opt,name=options" json:"options"` }
func (*Approval) Descriptor ¶
func (*Approval) GetAddress ¶
func (*Approval) GetOptions ¶
func (m *Approval) GetOptions() ApprovalOptions
func (*Approval) ProtoMessage ¶
func (*Approval) ProtoMessage()
type ApprovalMeta ¶
type ApprovalMeta []Approval
func (ApprovalMeta) Clone ¶
func (m ApprovalMeta) Clone() ApprovalMeta
func (ApprovalMeta) Validate ¶
func (m ApprovalMeta) Validate() error
type ApprovalMsg ¶
type ApprovalMsg interface { GetT() string Identified }
type ApprovalOps ¶
type ApprovalOps struct {
// contains filtered or unexported fields
}
func NewApprovalOps ¶
func NewApprovalOps(owner weave.Address, approvals *[]ActionApprovals) *ApprovalOps
TODO: Sort errors and their codes TODO: Figure out what we need to do with counts for the next iteration
func (*ApprovalOps) Grant ¶
func (o *ApprovalOps) Grant(action string, to weave.Address, op ApprovalOptions, blockHeight int64, actionMaps ...map[string]int32) error
TODO: Figure out whether we need wildcard approvals, might be wise to add an ApprovalOptions flag
func (*ApprovalOps) List ¶
func (o *ApprovalOps) List() Approvals
type ApprovalOptions ¶
type ApprovalOptions struct { UntilBlockHeight int64 `protobuf:"varint,1,opt,name=untilBlockHeight,proto3" json:"untilBlockHeight,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` Immutable bool `protobuf:"varint,3,opt,name=immutable,proto3" json:"immutable,omitempty"` }
func (*ApprovalOptions) Descriptor ¶
func (*ApprovalOptions) Descriptor() ([]byte, []int)
func (ApprovalOptions) Equals ¶
func (a ApprovalOptions) Equals(o ApprovalOptions) bool
func (ApprovalOptions) EqualsAfterUse ¶ added in v0.9.1
func (a ApprovalOptions) EqualsAfterUse(used ApprovalOptions) bool
func (*ApprovalOptions) GetCount ¶
func (m *ApprovalOptions) GetCount() int64
func (*ApprovalOptions) GetImmutable ¶
func (m *ApprovalOptions) GetImmutable() bool
func (*ApprovalOptions) GetUntilBlockHeight ¶
func (m *ApprovalOptions) GetUntilBlockHeight() int64
func (*ApprovalOptions) Marshal ¶
func (m *ApprovalOptions) Marshal() (dAtA []byte, err error)
func (*ApprovalOptions) ProtoMessage ¶
func (*ApprovalOptions) ProtoMessage()
func (*ApprovalOptions) Reset ¶
func (m *ApprovalOptions) Reset()
func (*ApprovalOptions) Size ¶
func (m *ApprovalOptions) Size() (n int)
func (*ApprovalOptions) String ¶
func (m *ApprovalOptions) String() string
func (*ApprovalOptions) Unmarshal ¶
func (m *ApprovalOptions) Unmarshal(dAtA []byte) error
func (ApprovalOptions) Validate ¶
func (a ApprovalOptions) Validate() error
type Approvals ¶
type Approvals map[string]ApprovalMeta
func (Approvals) AsPersistable ¶
func (m Approvals) AsPersistable() []ActionApprovals
func (Approvals) FilterExpired ¶
func (Approvals) MetaByAction ¶
func (m Approvals) MetaByAction(action string) ApprovalMeta
type BaseNFT ¶
type BaseNFT interface { Owned //GetId() []byte Approvals() *ApprovalOps //Set new approvals SetApprovals(Approvals) }
type BucketAccess ¶
type BucketAccess interface { Get(db weave.ReadOnlyKVStore, key []byte) (orm.Object, error) Save(db weave.KVStore, model orm.Object) error }
TODO: Better name?
type BucketDispatcher ¶
type BucketDispatcher interface { Register(t string, bucket BucketAccess) error AssertRegistered(types ...string) Get(t string) (BucketAccess, error) }
func GetBucketDispatcher ¶
func GetBucketDispatcher() BucketDispatcher
TODO: if we ever want to support concurrency here then we might be better of with a separate Init() method or similar
type NonFungibleToken ¶
type NonFungibleToken struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Owner []byte `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` ActionApprovals []ActionApprovals `protobuf:"bytes,3,rep,name=actionApprovals" json:"actionApprovals"` }
func NewNonFungibleToken ¶
func NewNonFungibleToken(key []byte, owner weave.Address, approvals []ActionApprovals) *NonFungibleToken
func (*NonFungibleToken) Approvals ¶
func (m *NonFungibleToken) Approvals() *ApprovalOps
func (*NonFungibleToken) Clone ¶
func (m *NonFungibleToken) Clone() *NonFungibleToken
func (*NonFungibleToken) Copy ¶
func (m *NonFungibleToken) Copy() orm.CloneableData
func (*NonFungibleToken) Descriptor ¶
func (*NonFungibleToken) Descriptor() ([]byte, []int)
func (*NonFungibleToken) GetActionApprovals ¶
func (m *NonFungibleToken) GetActionApprovals() []ActionApprovals
func (*NonFungibleToken) GetId ¶
func (m *NonFungibleToken) GetId() []byte
func (*NonFungibleToken) GetOwner ¶
func (m *NonFungibleToken) GetOwner() []byte
func (*NonFungibleToken) HasApproval ¶
func (m *NonFungibleToken) HasApproval(actor weave.Address, action string) bool
func (*NonFungibleToken) Marshal ¶
func (m *NonFungibleToken) Marshal() (dAtA []byte, err error)
func (*NonFungibleToken) OwnerAddress ¶
func (u *NonFungibleToken) OwnerAddress() weave.Address
func (*NonFungibleToken) ProtoMessage ¶
func (*NonFungibleToken) ProtoMessage()
func (*NonFungibleToken) Reset ¶
func (m *NonFungibleToken) Reset()
func (*NonFungibleToken) SetApprovals ¶ added in v0.9.1
func (m *NonFungibleToken) SetApprovals(a Approvals)
func (*NonFungibleToken) Size ¶
func (m *NonFungibleToken) Size() (n int)
func (*NonFungibleToken) String ¶
func (m *NonFungibleToken) String() string
func (*NonFungibleToken) Unmarshal ¶
func (m *NonFungibleToken) Unmarshal(dAtA []byte) error
func (*NonFungibleToken) Validate ¶
func (m *NonFungibleToken) Validate() error
type RemoveApprovalMsg ¶
type RemoveApprovalMsg struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` T string `protobuf:"bytes,4,opt,name=t,proto3" json:"t,omitempty"` }
func (*RemoveApprovalMsg) Descriptor ¶
func (*RemoveApprovalMsg) Descriptor() ([]byte, []int)
func (*RemoveApprovalMsg) GetAction ¶
func (m *RemoveApprovalMsg) GetAction() string
func (*RemoveApprovalMsg) GetAddress ¶
func (m *RemoveApprovalMsg) GetAddress() []byte
func (*RemoveApprovalMsg) GetId ¶
func (m *RemoveApprovalMsg) GetId() []byte
func (*RemoveApprovalMsg) GetT ¶
func (m *RemoveApprovalMsg) GetT() string
func (*RemoveApprovalMsg) Marshal ¶
func (m *RemoveApprovalMsg) Marshal() (dAtA []byte, err error)
func (*RemoveApprovalMsg) MarshalTo ¶
func (m *RemoveApprovalMsg) MarshalTo(dAtA []byte) (int, error)
func (*RemoveApprovalMsg) Path ¶
func (*RemoveApprovalMsg) Path() string
func (*RemoveApprovalMsg) ProtoMessage ¶
func (*RemoveApprovalMsg) ProtoMessage()
func (*RemoveApprovalMsg) Reset ¶
func (m *RemoveApprovalMsg) Reset()
func (*RemoveApprovalMsg) Size ¶
func (m *RemoveApprovalMsg) Size() (n int)
func (*RemoveApprovalMsg) String ¶
func (m *RemoveApprovalMsg) String() string
func (*RemoveApprovalMsg) Unmarshal ¶
func (m *RemoveApprovalMsg) Unmarshal(dAtA []byte) error
func (RemoveApprovalMsg) Validate ¶
func (m RemoveApprovalMsg) Validate() error
type Validation ¶
type Validation struct { }
func (*Validation) IsValidAction ¶
func (*Validation) IsValidAction(action string) bool
func (*Validation) IsValidTokenID ¶
func (*Validation) IsValidTokenID(id []byte) bool
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package blockchain is a generated protocol buffer package.
|
Package blockchain is a generated protocol buffer package. |
Package bootstrap_node is a generated protocol buffer package.
|
Package bootstrap_node is a generated protocol buffer package. |
Package ticker is a generated protocol buffer package.
|
Package ticker is a generated protocol buffer package. |
Package username is a generated protocol buffer package.
|
Package username is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.