cli

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagProofs      = "proofs"
	FlagIndex       = "index"
	FlagStartHeight = "start-height"
	FlagEndHeight   = "end-height"
	FlagAmount      = "amount"
	FlagDenom       = "denom"
)

Variables

This section is empty.

Functions

func FlagClaimMerkledrop

func FlagClaimMerkledrop() *flag.FlagSet

func FlagsCreate

func FlagsCreate() *flag.FlagSet

func GetCmdClaim

func GetCmdClaim() *cobra.Command

func GetCmdCreate

func GetCmdCreate() *cobra.Command

func GetCmdQueryIndexClaimed

func GetCmdQueryIndexClaimed() *cobra.Command

func GetCmdQueryMerkledrop

func GetCmdQueryMerkledrop() *cobra.Command

func GetCmdQueryParams

func GetCmdQueryParams() *cobra.Command

GetCmdQueryParams implements the query fantoken related param command.

func GetCmdUpdateMerkledropFees

func GetCmdUpdateMerkledropFees() *cobra.Command

func GetQueryCmd

func GetQueryCmd() *cobra.Command

GetQueryCmd returns the query commands for the nft module.

func NewTxCmd

func NewTxCmd() *cobra.Command

NewTxCmd returns the transaction commands for the merkledrop module.

func ProofBytesToString

func ProofBytesToString(proof [][]byte) []string

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func AccountsFromMap

func AccountsFromMap(accMap map[string]string) ([]*Account, error)

type ClaimInfo

type ClaimInfo struct {
	Index  uint64   `json:"index"`
	Amount string   `json:"amount"`
	Proof  []string `json:"proof"`
}

type Tree

type Tree [][][]byte

func CreateDistributionList

func CreateDistributionList(accounts []*Account) (Tree, map[string]ClaimInfo, sdk.Int, error)

func NewTree

func NewTree(leafs ...[]byte) Tree

NewTree builds and returns a new merkle tree with the given leaf nodes. Each input leaf is hashed before the tree is built

func (Tree) Height

func (t Tree) Height() int

func (Tree) LeafIndex

func (t Tree) LeafIndex(leaf []byte) int

LeafIndex returns the index of the given leaf and a -1 if the leaf is not found

func (Tree) Leafs

func (t Tree) Leafs() [][]byte

Leafs returns the leafs in the tree. This is the hashes of the original input data

func (Tree) Proof

func (t Tree) Proof(leaf []byte) (out [][]byte)

Proof returns the proof of a given leaf node.

func (Tree) Root

func (t Tree) Root() []byte

Root returns the root of the merkle tree i.e the merkle root

Jump to

Keyboard shortcuts

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