Documentation ¶
Overview ¶
The entity package contains all structured entities that are defined in the Gringotts system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { // The document id in state database Id string // This is the Fabric transaction id where this entity is created. // Fabric allows us to search for specific block if we know the block number // or the transaction id in that block. This is very helpful if later we want // to query this block to check the Read/Write set for more details BlockChainId string // Timestamp of the transaction that created this entity CreatedAt string // Timestamp of the last transaction that updated this entity UpdatedAt string }
The base entity provides necessary fields that every other entities must contain.
type Enrollment ¶
type Enrollment struct { TokenId string FromWalletId string ToWalletId string Base `mapstructure:",squash"` }
func NewEnrollment ¶
func NewEnrollment(ctx ...contractapi.TransactionContextInterface) *Enrollment
type HealthCheckStruct ¶
type HealthCheckStruct struct {
Base `mapstructure:",squash"`
}
Healthcheck structure is just an arbitrary object. We just want to make a random transaction in the chain to see if it is working or not
type NFT ¶
type NFT struct { NFTId string GS1Number string MetaData string OwnerId string Base `mapstructure:",squash"` }
func NewNFT ¶
func NewNFT(ctx ...contractapi.TransactionContextInterface) *NFT
type Token ¶
type Token struct { Name string Rate float64 Status glossary.Status TickerToken string Base `mapstructure:",squash"` }
A Token structure will have the name of the token type, the conversion rate to the base unit, and status (active/inactive) the status is checked only when we create a new wallet.
func NewToken ¶
func NewToken(ctx ...contractapi.TransactionContextInterface) *Token
type Transaction ¶
type Transaction struct { SpenderWallet string FromWallet string ToWallet string Amount string TxType transaction.Type Status transaction.Status Base `mapstructure:",squash"` }
Transaction contains basic information relating to token transaction From, To, Amount, type of transaction and its status. The SpenderWallet is an additional field in case later on we want this is compatible with ERC20
func NewTransaction ¶
func NewTransaction(ctx ...contractapi.TransactionContextInterface) *Transaction