entity

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 5 Imported by: 2

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"`
}

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"`
}

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.

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

type Wallet

type Wallet struct {
	TokenId  string
	Status   glossary.Status
	Balances string
	Base     `mapstructure:",squash"`
}

A wallet only contains 1 type of token and its balance.

Jump to

Keyboard shortcuts

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