graph

package
v0.0.0-...-e5993db Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressListen

func AddressListen(addresses []string, fn func(Tx) error, errorChan chan error) error

func Broadcast

func Broadcast(memoTx *memo.Tx) error

Types

type Date

type Date string

func (Date) GetGraphQLType

func (d Date) GetGraphQLType() string

func (Date) GetTime

func (d Date) GetTime() time.Time

type Follow

type Follow struct {
	Tx      Tx
	Tx_hash string
	Lock    struct {
		Address string
	}
	Address     string
	Follow_Lock struct {
		Address string
	}
	Follow_Address string
	Unfollow       bool
}

type Post

type Post struct {
	Tx      Tx
	Tx_hash string
	Lock    struct {
		Address string
	}
	Address string
	Text    string
	Likes   []struct {
		Tx  Tx
		Tip int64
	}
	//Parent is another post
	Parent struct {
		Tx      Tx
		Tx_hash string
		Address string
		Text    string
	}
	Replies []struct {
		Tx      Tx
		Tx_hash string
		Address string
		Text    string
	}
}

type Profile

type Profile struct {
	Lock struct {
		Address string
	}
	Address string
	Name    struct {
		Tx   Tx
		Name string
	}
	Profile struct {
		Tx   Tx
		Text string
	}
	Pic struct {
		Tx  Tx
		Pic string
	}
	Following []Follow `graphql:"following(start: $start)"`
	Followers []Follow `graphql:"followers(start: $start)"`
	Posts     []Post   `graphql:"posts()"`
}

type Profiles

type Profiles struct {
	Profiles []Profile `graphql:"profiles(addresses: [$address])"`
}

type Subscription

type Subscription struct {
	Addresses Tx `graphql:"addresses(addresses: $addresses)"`
}

type Tx

type Tx struct {
	Hash   string
	Seen   Date
	Raw    string
	Inputs []struct {
		Index     uint32
		PrevHash  string `graphql:"prev_hash"`
		PrevIndex uint32 `graphql:"prev_index"`
		Output    struct {
			Lock struct {
				Address string
			}
		}
	}
	Outputs []struct {
		Script string
		Amount int64
		Lock   struct {
			Address string
		}
	}
	Blocks []struct {
		BlockHash string `graphql:"block_hash"`
		Block     struct {
			Timestamp Date
			Height    int
		}
	}
}

func GetAddressUpdates

func GetAddressUpdates(address string, start time.Time) ([]Tx, error)

type UpdateQuery

type UpdateQuery struct {
	Address struct {
		Txs []Tx `graphql:"txs(start: $start)"`
	} `graphql:"address(address: $address)"`
}

Jump to

Keyboard shortcuts

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