Documentation ¶
Overview ¶
Package blockchain is a generated protocol buffer package. It is generated from these files: cmd/bnsd/x/nft/blockchain/codec.proto It has these top-level messages: BlockchainToken TokenDetails Chain IOV Config IssueTokenMsg
Package blockchain provides an NFT implementation for registering blochchains together with their configuration.
Index ¶
- Constants
- Variables
- func NewBlockchainToken(key []byte, owner weave.Address, approvals []nft.ActionApprovals) *orm.SimpleObj
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address, ...)
- type BlockchainToken
- func (m *BlockchainToken) Approvals() *nft.ApprovalOps
- func (m *BlockchainToken) Copy() orm.CloneableData
- func (*BlockchainToken) Descriptor() ([]byte, []int)
- func (m *BlockchainToken) GetBase() *nft.NonFungibleToken
- func (m *BlockchainToken) GetChain() Chain
- func (m *BlockchainToken) GetDetails() *TokenDetails
- func (m *BlockchainToken) GetIov() IOV
- func (m *BlockchainToken) Marshal() (dAtA []byte, err error)
- func (m *BlockchainToken) MarshalTo(dAtA []byte) (int, error)
- func (m *BlockchainToken) OwnerAddress() weave.Address
- func (*BlockchainToken) ProtoMessage()
- func (m *BlockchainToken) Reset()
- func (m *BlockchainToken) SetApprovals(a nft.Approvals)
- func (m *BlockchainToken) SetChain(actor weave.Address, chain Chain) error
- func (m *BlockchainToken) SetIov(actor weave.Address, iov IOV) error
- func (m *BlockchainToken) Size() (n int)
- func (m *BlockchainToken) String() string
- func (m *BlockchainToken) Transfer(newOwner weave.Address) error
- func (m *BlockchainToken) Unmarshal(dAtA []byte) error
- func (m *BlockchainToken) Validate() error
- type Bucket
- type Chain
- func (*Chain) Descriptor() ([]byte, []int)
- func (m *Chain) GetChainID() string
- func (m *Chain) GetEnabled() bool
- func (m *Chain) GetMainTickerID() []byte
- func (m *Chain) GetName() string
- func (m *Chain) GetNetworkID() string
- func (m *Chain) GetProduction() bool
- func (m *Chain) Marshal() (dAtA []byte, err error)
- func (m *Chain) MarshalTo(dAtA []byte) (int, error)
- func (*Chain) ProtoMessage()
- func (m *Chain) Reset()
- func (m *Chain) Size() (n int)
- func (m *Chain) String() string
- func (m *Chain) Unmarshal(dAtA []byte) error
- func (m Chain) Validate() error
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetChain() *Chain
- func (m *Config) GetCodecConfig() string
- func (m *Config) Marshal() (dAtA []byte, err error)
- func (m *Config) MarshalTo(dAtA []byte) (int, error)
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) Size() (n int)
- func (m *Config) String() string
- func (m *Config) Unmarshal(dAtA []byte) error
- type IOV
- func (*IOV) Descriptor() ([]byte, []int)
- func (m *IOV) GetCodec() string
- func (m *IOV) GetCodecConfig() string
- func (m *IOV) Marshal() (dAtA []byte, err error)
- func (m *IOV) MarshalTo(dAtA []byte) (int, error)
- func (*IOV) ProtoMessage()
- func (m *IOV) Reset()
- func (m *IOV) Size() (n int)
- func (m *IOV) String() string
- func (m *IOV) Unmarshal(dAtA []byte) error
- func (m IOV) Validate() error
- type Initializer
- type IssueHandler
- type IssueTokenMsg
- func (*IssueTokenMsg) Descriptor() ([]byte, []int)
- func (m *IssueTokenMsg) GetApprovals() []nft.ActionApprovals
- func (m *IssueTokenMsg) GetDetails() TokenDetails
- func (m *IssueTokenMsg) GetID() []byte
- func (m *IssueTokenMsg) GetOwner() []byte
- func (m *IssueTokenMsg) Marshal() (dAtA []byte, err error)
- func (m *IssueTokenMsg) MarshalTo(dAtA []byte) (int, error)
- func (*IssueTokenMsg) Path() string
- func (*IssueTokenMsg) ProtoMessage()
- func (m *IssueTokenMsg) Reset()
- func (m *IssueTokenMsg) Size() (n int)
- func (m *IssueTokenMsg) String() string
- func (m *IssueTokenMsg) Unmarshal(dAtA []byte) error
- func (i *IssueTokenMsg) Validate() error
- type Token
- type TokenDetails
- func (m *TokenDetails) Clone() *TokenDetails
- func (*TokenDetails) Descriptor() ([]byte, []int)
- func (m *TokenDetails) GetChain() Chain
- func (m *TokenDetails) GetIov() IOV
- func (m *TokenDetails) Marshal() (dAtA []byte, err error)
- func (m *TokenDetails) MarshalTo(dAtA []byte) (int, error)
- func (*TokenDetails) ProtoMessage()
- func (m *TokenDetails) Reset()
- func (m *TokenDetails) Size() (n int)
- func (m *TokenDetails) String() string
- func (m *TokenDetails) Unmarshal(dAtA []byte) error
- func (m *TokenDetails) Validate() error
Constants ¶
View Source
const (
BucketName = "bchnft"
)
Variables ¶
View Source
var ( ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") )
View Source
var ( //todo: revisit pattern IsValidCodec = regexp.MustCompile(`^[a-zA-Z0-9_.]{3,20}$`).MatchString )
View Source
var ( //todo: revisit pattern IsValidID = regexp.MustCompile(`^[a-zA-Z0-9_.-]{4,128}$`).MatchString )
Functions ¶
func NewBlockchainToken ¶
func RegisterQuery ¶
func RegisterQuery(qr weave.QueryRouter)
RegisterQuery will register this bucket as "/nft/blockchain"
func RegisterRoutes ¶
func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address, tickerBucket orm.Reader)
RegisterRoutes will instantiate and register all handlers in this package
Types ¶
type BlockchainToken ¶
type BlockchainToken struct { Base *nft.NonFungibleToken `protobuf:"bytes,1,opt,name=base" json:"base,omitempty"` Details *TokenDetails `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` }
func (*BlockchainToken) Approvals ¶
func (m *BlockchainToken) Approvals() *nft.ApprovalOps
func (*BlockchainToken) Copy ¶
func (m *BlockchainToken) Copy() orm.CloneableData
func (*BlockchainToken) Descriptor ¶
func (*BlockchainToken) Descriptor() ([]byte, []int)
func (*BlockchainToken) GetBase ¶
func (m *BlockchainToken) GetBase() *nft.NonFungibleToken
func (*BlockchainToken) GetChain ¶
func (m *BlockchainToken) GetChain() Chain
func (*BlockchainToken) GetDetails ¶
func (m *BlockchainToken) GetDetails() *TokenDetails
func (*BlockchainToken) GetIov ¶
func (m *BlockchainToken) GetIov() IOV
func (*BlockchainToken) Marshal ¶
func (m *BlockchainToken) Marshal() (dAtA []byte, err error)
func (*BlockchainToken) OwnerAddress ¶
func (m *BlockchainToken) OwnerAddress() weave.Address
func (*BlockchainToken) ProtoMessage ¶
func (*BlockchainToken) ProtoMessage()
func (*BlockchainToken) Reset ¶
func (m *BlockchainToken) Reset()
func (*BlockchainToken) SetApprovals ¶
func (m *BlockchainToken) SetApprovals(a nft.Approvals)
func (*BlockchainToken) SetChain ¶
func (m *BlockchainToken) SetChain(actor weave.Address, chain Chain) error
func (*BlockchainToken) SetIov ¶
func (m *BlockchainToken) SetIov(actor weave.Address, iov IOV) error
func (*BlockchainToken) Size ¶
func (m *BlockchainToken) Size() (n int)
func (*BlockchainToken) String ¶
func (m *BlockchainToken) String() string
func (*BlockchainToken) Unmarshal ¶
func (m *BlockchainToken) Unmarshal(dAtA []byte) error
func (*BlockchainToken) Validate ¶
func (m *BlockchainToken) Validate() error
type Chain ¶
type Chain struct { // Chain ID is the blockchain ID as referred in our system. ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Network ID can be used by a blockchain implementation to distinguish // between different instances of the same implementation. This value might // be called chain ID in other places. // // https://ethereum.stackexchange.com/questions/17051/how-to-select-a-network-id-or-is-there-a-list-of-network-ids NetworkID string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` // Name holds human redable name of the blockchain. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // Enabled is a flag used for soft delete. Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` Production bool `protobuf:"varint,5,opt,name=production,proto3" json:"production,omitempty"` // Main ticker ID links to the ticker (see ticker module) that is // considered the main ticker for given blockchain. A blockchain can have // any number of tickers registered. MainTickerID []byte `protobuf:"bytes,6,opt,name=main_ticker_id,json=mainTickerId,proto3" json:"main_ticker_id,omitempty"` }
Chain represents a blockchain information.
Name chain is used instead of blockchain to not repeat the same word everywhere.
func (*Chain) Descriptor ¶
func (*Chain) GetChainID ¶
func (*Chain) GetEnabled ¶
func (*Chain) GetMainTickerID ¶
func (*Chain) GetNetworkID ¶
func (*Chain) GetProduction ¶
func (*Chain) ProtoMessage ¶
func (*Chain) ProtoMessage()
type Config ¶
type Config struct { Chain *Chain `protobuf:"bytes,1,opt,name=chain" json:"chain,omitempty"` CodecConfig string `protobuf:"bytes,3,opt,name=codec_config,json=codecConfig,proto3" json:"codec_config,omitempty"` }
func (*Config) Descriptor ¶
func (*Config) GetCodecConfig ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
type IOV ¶
type IOV struct { Codec string `protobuf:"bytes,1,opt,name=codec,proto3" json:"codec,omitempty"` CodecConfig string `protobuf:"bytes,2,opt,name=codec_config,json=codecConfig,proto3" json:"codec_config,omitempty"` }
func (*IOV) Descriptor ¶
func (*IOV) GetCodecConfig ¶
func (*IOV) ProtoMessage ¶
func (*IOV) ProtoMessage()
type Initializer ¶
type Initializer struct { }
Initializer fulfils the InitStater interface to load data from the genesis file
func (*Initializer) FromGenesis ¶
FromGenesis will parse initial tokens information from the genesis and persist it in the database.
type IssueHandler ¶
type IssueHandler struct {
// contains filtered or unexported fields
}
func NewIssueHandler ¶
func NewIssueHandler(auth x.Authenticator, issuer weave.Address, bucket Bucket, tickerBucket orm.Reader) *IssueHandler
type IssueTokenMsg ¶
type IssueTokenMsg struct { Owner []byte `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Details TokenDetails `protobuf:"bytes,3,opt,name=details" json:"details"` Approvals []nft.ActionApprovals `protobuf:"bytes,4,rep,name=approvals" json:"approvals"` }
func (*IssueTokenMsg) Descriptor ¶
func (*IssueTokenMsg) Descriptor() ([]byte, []int)
func (*IssueTokenMsg) GetApprovals ¶
func (m *IssueTokenMsg) GetApprovals() []nft.ActionApprovals
func (*IssueTokenMsg) GetDetails ¶
func (m *IssueTokenMsg) GetDetails() TokenDetails
func (*IssueTokenMsg) GetID ¶
func (m *IssueTokenMsg) GetID() []byte
func (*IssueTokenMsg) GetOwner ¶
func (m *IssueTokenMsg) GetOwner() []byte
func (*IssueTokenMsg) Marshal ¶
func (m *IssueTokenMsg) Marshal() (dAtA []byte, err error)
func (*IssueTokenMsg) Path ¶
func (*IssueTokenMsg) Path() string
Path returns the routing path for this message
func (*IssueTokenMsg) ProtoMessage ¶
func (*IssueTokenMsg) ProtoMessage()
func (*IssueTokenMsg) Reset ¶
func (m *IssueTokenMsg) Reset()
func (*IssueTokenMsg) Size ¶
func (m *IssueTokenMsg) Size() (n int)
func (*IssueTokenMsg) String ¶
func (m *IssueTokenMsg) String() string
func (*IssueTokenMsg) Unmarshal ¶
func (m *IssueTokenMsg) Unmarshal(dAtA []byte) error
func (*IssueTokenMsg) Validate ¶
func (i *IssueTokenMsg) Validate() error
type Token ¶
type TokenDetails ¶
type TokenDetails struct { Chain Chain `protobuf:"bytes,1,opt,name=chain" json:"chain"` Iov IOV `protobuf:"bytes,2,opt,name=iov" json:"iov"` }
func (*TokenDetails) Clone ¶
func (m *TokenDetails) Clone() *TokenDetails
func (*TokenDetails) Descriptor ¶
func (*TokenDetails) Descriptor() ([]byte, []int)
func (*TokenDetails) GetChain ¶
func (m *TokenDetails) GetChain() Chain
func (*TokenDetails) GetIov ¶
func (m *TokenDetails) GetIov() IOV
func (*TokenDetails) Marshal ¶
func (m *TokenDetails) Marshal() (dAtA []byte, err error)
func (*TokenDetails) ProtoMessage ¶
func (*TokenDetails) ProtoMessage()
func (*TokenDetails) Reset ¶
func (m *TokenDetails) Reset()
func (*TokenDetails) Size ¶
func (m *TokenDetails) Size() (n int)
func (*TokenDetails) String ¶
func (m *TokenDetails) String() string
func (*TokenDetails) Unmarshal ¶
func (m *TokenDetails) Unmarshal(dAtA []byte) error
func (*TokenDetails) Validate ¶
func (m *TokenDetails) Validate() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.