model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressesToArrays

func AddressesToArrays(addresses []Address) [][25]byte

func HashesToArrays

func HashesToArrays(hashes []Hash) [][32]byte

func MarshalAddress

func MarshalAddress(address Address) graphql.Marshaler

func MarshalBytes

func MarshalBytes(bytes Bytes) graphql.Marshaler

func MarshalDate

func MarshalDate(date Date) graphql.Marshaler

func MarshalHash

func MarshalHash(hash Hash) graphql.Marshaler

func MarshalUint8

func MarshalUint8(ui Uint8) graphql.Marshaler

Types

type Address

type Address [25]byte

func UnmarshalAddress

func UnmarshalAddress(v interface{}) (Address, error)

func (Address) String

func (a Address) String() string

type Block

type Block struct {
	Hash      Hash       `json:"hash"`
	Raw       Bytes      `json:"raw"`
	Timestamp Date       `json:"timestamp"`
	Height    *int       `json:"height"`
	Size      int64      `json:"size"`
	TxCount   int        `json:"tx_count"`
	Txs       []*TxBlock `json:"txs"`
}

type Bytes

type Bytes []byte

func UnmarshalBytes

func UnmarshalBytes(v interface{}) (Bytes, error)

type Date

type Date time.Time

func UnmarshalDate

func UnmarshalDate(v interface{}) (Date, error)

type Follow

type Follow struct {
	TxHash        Hash    `json:"tx_hash"`
	Address       Address `json:"address"`
	FollowAddress Address `json:"follow_address"`
	Unfollow      bool    `json:"unfollow"`
	Lock          *Lock   `json:"lock"`
	FollowLock    *Lock   `json:"follow_lock"`
	Tx            *Tx     `json:"tx"`
}

type Hash

type Hash [32]byte

func UnmarshalHash

func UnmarshalHash(v interface{}) (Hash, error)

func (Hash) String

func (h Hash) String() string

type HashIndex

type HashIndex struct {
	Hash  string
	Index uint32
}

type Like

type Like struct {
	TxHash     Hash    `json:"tx_hash"`
	Address    Address `json:"address"`
	PostTxHash Hash    `json:"post_tx_hash"`
	Tip        int64   `json:"tip"`
}

type Lock

type Lock struct {
	Address Address  `json:"address"`
	Balance int64    `json:"balance"`
	Profile *Profile `json:"profile"`
	Txs     []*Tx    `json:"txs"`
}

type Post

type Post struct {
	TxHash  Hash    `json:"tx_hash"`
	Address Address `json:"address"`
	Text    string  `json:"text"`
}

type Profile

type Profile struct {
	Address Address     `json:"address"`
	Name    *SetName    `json:"name"`
	Profile *SetProfile `json:"profile"`
	Pic     *SetPic     `json:"pic"`
}

type Room

type Room struct {
	Name      string        `json:"name"`
	Posts     []*Post       `json:"posts"`
	Followers []*RoomFollow `json:"followers"`
}

type RoomFollow

type RoomFollow struct {
	Name     string  `json:"name"`
	Address  Address `json:"address"`
	Unfollow bool    `json:"unfollow"`
	TxHash   Hash    `json:"tx_hash"`
	Room     *Room   `json:"room"`
	Lock     *Lock   `json:"lock"`
	Tx       *Tx     `json:"tx"`
}

type SetName

type SetName struct {
	TxHash  Hash    `json:"tx_hash"`
	Address Address `json:"address"`
	Name    string  `json:"name"`
}

type SetPic

type SetPic struct {
	TxHash  Hash    `json:"tx_hash"`
	Address Address `json:"address"`
	Pic     string  `json:"pic"`
}

type SetProfile

type SetProfile struct {
	TxHash  Hash    `json:"tx_hash"`
	Address Address `json:"address"`
	Text    string  `json:"text"`
}

type SlpBaton

type SlpBaton struct {
	Hash      Hash        `json:"hash"`
	Index     uint32      `json:"index"`
	TokenHash Hash        `json:"token_hash"`
	Genesis   *SlpGenesis `json:"genesis"`
	Output    *TxOutput   `json:"output"`
}

type SlpGenesis

type SlpGenesis struct {
	Hash       Hash       `json:"hash"`
	TokenType  Uint8      `json:"token_type"`
	Decimals   Uint8      `json:"decimals"`
	BatonIndex uint32     `json:"baton_index"`
	Ticker     string     `json:"ticker"`
	Name       string     `json:"name"`
	DocURL     string     `json:"doc_url"`
	DocHash    string     `json:"doc_hash"`
	Tx         *Tx        `json:"tx"`
	Output     *SlpOutput `json:"output"`
	Baton      *SlpBaton  `json:"baton"`
}

type SlpOutput

type SlpOutput struct {
	Hash      Hash        `json:"hash"`
	Index     uint32      `json:"index"`
	TokenHash Hash        `json:"token_hash"`
	Amount    uint64      `json:"amount"`
	Genesis   *SlpGenesis `json:"genesis"`
	Output    *TxOutput   `json:"output"`
}

type Tx

type Tx struct {
	Hash     Hash        `json:"hash"`
	Raw      Bytes       `json:"raw"`
	Seen     Date        `json:"seen"`
	Version  int32       `json:"version"`
	LockTime uint32      `json:"locktime"`
	Inputs   []*TxInput  `json:"inputs"`
	Outputs  []*TxOutput `json:"outputs"`
	Blocks   []*TxBlock  `json:"blocks"`
}

type TxBlock

type TxBlock struct {
	TxHash    Hash   `json:"tx_hash"`
	BlockHash Hash   `json:"block_hash"`
	Tx        *Tx    `json:"tx"`
	Block     *Block `json:"block"`
	Index     uint32 `json:"index"`
}

type TxInput

type TxInput struct {
	Hash      Hash      `json:"hash"`
	Index     uint32    `json:"index"`
	PrevHash  Hash      `json:"prev_hash"`
	PrevIndex uint32    `json:"prev_index"`
	Script    Bytes     `json:"script"`
	Sequence  uint32    `json:"sequence"`
	Tx        *Tx       `json:"tx"`
	Output    *TxOutput `json:"output"`
}

type TxOutput

type TxOutput struct {
	Hash     Hash       `json:"hash"`
	Index    uint32     `json:"index"`
	Amount   int64      `json:"amount"`
	Script   Bytes      `json:"script"`
	Tx       *Tx        `json:"tx"`
	Lock     *Lock      `json:"lock"`
	Spends   []*TxInput `json:"spends"`
	Slp      *SlpOutput `json:"slp"`
	SlpBaton *SlpBaton  `json:"slp_baton"`
}

type Uint32

type Uint32 uint32

func UnmarshalUint32

func UnmarshalUint32(v interface{}) (Uint32, error)

type Uint8

type Uint8 uint8

func UnmarshalUint8

func UnmarshalUint8(v interface{}) (Uint8, error)

Jump to

Keyboard shortcuts

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