types

package
v0.0.0-...-7d4c4c8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package types contains the types used by the indexer

Index

Constants

View Source
const InscriptionTypeContentGeneric = "inscriptions.v1.content.generic"
View Source
const InscriptionTypeContentNFT = "inscriptions.v1.content.nft"
View Source
const InscriptionTypeContentNFTCollection = "inscriptions.v1.content.nft.collection"
View Source
const InscriptionTypeMultipart = "inscriptions.v1.multipart"
View Source
const TransactionStateError = "error: "
View Source
const TransactionStatePending = "pending"
View Source
const TransactionStateSuccess = "success"

Variables

View Source
var File_inscription_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BalanceResponse

type BalanceResponse struct {
	Balance struct {
		Denom  string `json:"denom"`
		Amount string `json:"amount"`
	} `json:"balance"`
}

type CollectionMetadata

type CollectionMetadata struct {
	Name              string  `json:"name"`
	Description       string  `json:"description"`
	Mime              string  `json:"mime"`
	Symbol            string  `json:"symbol"`
	Minter            string  `json:"minter"`
	RoyaltyPercentage float32 `json:"royalty_percentage"`
	PaymentAddress    string  `json:"payment_address"`
}

type ContentGenericMetadata

type ContentGenericMetadata struct {
	Parent    InscriptionParent `json:"parent"`
	Multipart InscriptionParent `json:"part,omitempty"`
	Metadata  struct {
		Name        string `json:"name"`
		Description string `json:"description"`
		MIME        string `json:"mime"`
	} `json:"metadata"`
}

type ExtensionDataWrapper

type ExtensionDataWrapper struct {
	*Inscription
}

func (ExtensionDataWrapper) GetContent

func (ed ExtensionDataWrapper) GetContent() ([]byte, error)

func (ExtensionDataWrapper) GetMetadata

func (ed ExtensionDataWrapper) GetMetadata(v any) ([]byte, error)

func (ExtensionDataWrapper) GetMetadataBytes

func (ed ExtensionDataWrapper) GetMetadataBytes() ([]byte, error)

func (ExtensionDataWrapper) Type

func (ed ExtensionDataWrapper) Type() string

type ExtensionMsg

type ExtensionMsg interface {
	GetMetadata(v any) ([]byte, error)
	GetMetadataBytes() ([]byte, error)
	GetContent() ([]byte, error)
}

type Inscription

type Inscription struct {
	ParentType       string `protobuf:"bytes,1,opt,name=parent_type,json=parentType,proto3" json:"parent_type,omitempty"`
	ParentIdentifier string `protobuf:"bytes,2,opt,name=parent_identifier,json=parentIdentifier,proto3" json:"parent_identifier,omitempty"`
	Metadata         []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Content          []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*Inscription) Descriptor deprecated

func (*Inscription) Descriptor() ([]byte, []int)

Deprecated: Use Inscription.ProtoReflect.Descriptor instead.

func (*Inscription) GetContent

func (x *Inscription) GetContent() []byte

func (*Inscription) GetMetadata

func (x *Inscription) GetMetadata() []byte

func (*Inscription) GetParentIdentifier

func (x *Inscription) GetParentIdentifier() string

func (*Inscription) GetParentType

func (x *Inscription) GetParentType() string

func (*Inscription) ProtoMessage

func (*Inscription) ProtoMessage()

func (*Inscription) ProtoReflect

func (x *Inscription) ProtoReflect() protoreflect.Message

func (*Inscription) Reset

func (x *Inscription) Reset()

func (*Inscription) String

func (x *Inscription) String() string

type InscriptionMetadata

type InscriptionMetadata[T any] struct {
	Parent   InscriptionMetadataParent `json:"parent"`
	Metadata T                         `json:"metadata"`
}

type InscriptionMetadataParent

type InscriptionMetadataParent struct {
	Type       string `json:"type"`
	Identifier string `json:"identifier"`
}

type InscriptionMigrationData

type InscriptionMigrationData struct {
	Header     []string   `json:"header"`
	Rows       [][]string `json:"rows"`
	Collection string     `json:"collection"`
}

type InscriptionNftMetadata

type InscriptionNftMetadata struct {
	Parent   InscriptionMetadataParent `json:"parent"`
	Metadata NftMetadata               `json:"metadata"`
}

type InscriptionParent

type InscriptionParent struct {
	Type       string `json:"@type"`
	Identifier string `json:"identifier"`
}

type LCDBlock

type LCDBlock struct {
	BlockID struct {
		Hash          string `json:"hash"`
		PartSetHeader struct {
			Total int    `json:"total"`
			Hash  string `json:"hash"`
		} `json:"part_set_header"`
	} `json:"block_id"`
	Block struct {
		Header struct {
			Version struct {
				Block string `json:"block"`
				App   string `json:"app"`
			} `json:"version"`
			ChainID     string    `json:"chain_id"`
			Height      string    `json:"height"`
			Time        time.Time `json:"time"`
			LastBlockID struct {
				Hash          string `json:"hash"`
				PartSetHeader struct {
					Total int    `json:"total"`
					Hash  string `json:"hash"`
				} `json:"part_set_header"`
			} `json:"last_block_id"`
			LastCommitHash     string `json:"last_commit_hash"`
			DataHash           string `json:"data_hash"`
			ValidatorsHash     string `json:"validators_hash"`
			NextValidatorsHash string `json:"next_validators_hash"`
			ConsensusHash      string `json:"consensus_hash"`
			AppHash            string `json:"app_hash"`
			LastResultsHash    string `json:"last_results_hash"`
			EvidenceHash       string `json:"evidence_hash"`
			ProposerAddress    string `json:"proposer_address"`
		} `json:"header"`
		Data struct {
			Txs []string `json:"txs"`
		} `json:"data"`
		Evidence struct {
			Evidence []any `json:"evidence"`
		} `json:"evidence"`
		LastCommit struct {
			Height  string `json:"height"`
			Round   int    `json:"round"`
			BlockID struct {
				Hash          string `json:"hash"`
				PartSetHeader struct {
					Total int    `json:"total"`
					Hash  string `json:"hash"`
				} `json:"part_set_header"`
			} `json:"block_id"`
			Signatures []struct {
				BlockIDFlag      string    `json:"block_id_flag"`
				ValidatorAddress string    `json:"validator_address"`
				Timestamp        time.Time `json:"timestamp"`
				Signature        string    `json:"signature"`
			} `json:"signatures"`
		} `json:"last_commit"`
	} `json:"block"`
}

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Mime        string `json:"mime"`
}

type MultipartMetadata

type MultipartMetadata struct {
	Index uint `json:"index"`
	Total uint `json:"total"`
}

type NftMetadata

type NftMetadata struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Mime        string  `json:"mime"`
	Attributes  []Trait `json:"attributes"`
}

type RPCBlock

type RPCBlock struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  struct {
		BlockID struct {
			Hash  string `json:"hash"`
			Parts struct {
				Total int    `json:"total"`
				Hash  string `json:"hash"`
			} `json:"parts"`
		} `json:"block_id"`
		Block struct {
			Header struct {
				Version struct {
					Block string `json:"block"`
				} `json:"version"`
				ChainID     string    `json:"chain_id"`
				Height      string    `json:"height"`
				Time        time.Time `json:"time"`
				LastBlockID struct {
					Hash  string `json:"hash"`
					Parts struct {
						Total int    `json:"total"`
						Hash  string `json:"hash"`
					} `json:"parts"`
				} `json:"last_block_id"`
				LastCommitHash     string `json:"last_commit_hash"`
				DataHash           string `json:"data_hash"`
				ValidatorsHash     string `json:"validators_hash"`
				NextValidatorsHash string `json:"next_validators_hash"`
				ConsensusHash      string `json:"consensus_hash"`
				AppHash            string `json:"app_hash"`
				LastResultsHash    string `json:"last_results_hash"`
				EvidenceHash       string `json:"evidence_hash"`
				ProposerAddress    string `json:"proposer_address"`
			} `json:"header"`
			Data struct {
				Txs []string `json:"txs"`
			} `json:"data"`
			Evidence struct {
				Evidence []any `json:"evidence"`
			} `json:"evidence"`
			LastCommit struct {
				Height  string `json:"height"`
				Round   int    `json:"round"`
				BlockID struct {
					Hash  string `json:"hash"`
					Parts struct {
						Total int    `json:"total"`
						Hash  string `json:"hash"`
					} `json:"parts"`
				} `json:"block_id"`
				Signatures []struct {
					BlockIDFlag      int       `json:"block_id_flag"`
					ValidatorAddress string    `json:"validator_address"`
					Timestamp        time.Time `json:"timestamp"`
					Signature        string    `json:"signature"`
				} `json:"signatures"`
			} `json:"last_commit"`
		} `json:"block"`
	} `json:"result"`
}

type RPCBlockResult

type RPCBlockResult struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  struct {
		Height           string     `json:"height"`
		TxsResults       []TxResult `json:"txs_results"`
		BeginBlockEvents []struct {
			Type       string `json:"type"`
			Attributes []struct {
				Key   string `json:"key"`
				Value string `json:"value"`
				Index bool   `json:"index"`
			} `json:"attributes"`
		} `json:"begin_block_events"`
		EndBlockEvents        any `json:"end_block_events"`
		ValidatorUpdates      any `json:"validator_updates"`
		ConsensusParamUpdates struct {
			Block struct {
				MaxBytes string `json:"max_bytes"`
				MaxGas   string `json:"max_gas"`
			} `json:"block"`
			Evidence struct {
				MaxAgeNumBlocks string `json:"max_age_num_blocks"`
				MaxAgeDuration  string `json:"max_age_duration"`
				MaxBytes        string `json:"max_bytes"`
			} `json:"evidence"`
			Validator struct {
				PubKeyTypes []string `json:"pub_key_types"`
			} `json:"validator"`
		} `json:"consensus_param_updates"`
	} `json:"result"`
}

type RPCStatus

type RPCStatus struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  struct {
		NodeInfo struct {
			ProtocolVersion struct {
				P2P   string `json:"p2p"`
				Block string `json:"block"`
				App   string `json:"app"`
			} `json:"protocol_version"`
			ID         string `json:"id"`
			ListenAddr string `json:"listen_addr"`
			Network    string `json:"network"`
			Version    string `json:"version"`
			Channels   string `json:"channels"`
			Moniker    string `json:"moniker"`
			Other      struct {
				TxIndex    string `json:"tx_index"`
				RPCAddress string `json:"rpc_address"`
			} `json:"other"`
		} `json:"node_info"`
		SyncInfo struct {
			LatestBlockHash     string    `json:"latest_block_hash"`
			LatestAppHash       string    `json:"latest_app_hash"`
			LatestBlockHeight   string    `json:"latest_block_height"`
			LatestBlockTime     time.Time `json:"latest_block_time"`
			EarliestBlockHash   string    `json:"earliest_block_hash"`
			EarliestAppHash     string    `json:"earliest_app_hash"`
			EarliestBlockHeight string    `json:"earliest_block_height"`
			EarliestBlockTime   time.Time `json:"earliest_block_time"`
			CatchingUp          bool      `json:"catching_up"`
		} `json:"sync_info"`
		ValidatorInfo struct {
			Address string `json:"address"`
			PubKey  struct {
				Type  string `json:"type"`
				Value string `json:"value"`
			} `json:"pub_key"`
			VotingPower string `json:"voting_power"`
		} `json:"validator_info"`
	} `json:"result"`
}

type RawExtension

type RawExtension struct {
	json.RawMessage
}

func (RawExtension) UnmarshalData

func (re RawExtension) UnmarshalData() (ExtensionMsg, error)

type RawExtensionData

type RawExtensionData struct {
	MsgType         string `json:"@type"`
	Data            []byte `json:"data"`
	ProtocolId      string `json:"protocol_id"`
	ProtocolVersion string `json:"protocol_version"`
}

type RawGenericMsg

type RawGenericMsg struct {
	Type string `json:"@type"`
}

type RawMsgRevoke

type RawMsgRevoke struct {
	MsgType    string `json:"@type"`
	Granter    string `json:"granter"`
	Grantee    string `json:"grantee"`
	MsgTypeURL string `json:"msg_type_url"`
}

func (RawMsgRevoke) GetContent

func (msg RawMsgRevoke) GetContent() ([]byte, error)

func (RawMsgRevoke) GetMetadata

func (msg RawMsgRevoke) GetMetadata(v any) ([]byte, error)

func (RawMsgRevoke) GetMetadataBytes

func (msg RawMsgRevoke) GetMetadataBytes() ([]byte, error)

type RawTransaction

type RawTransaction struct {
	Hash string `json:"hash"`
	Body struct {
		Messages []struct {
			Type        string `json:"@type"`
			FromAddress string `json:"from_address"`
			ToAddress   string `json:"to_address"`
			Amount      []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"amount"`
			Receiver      string `json:"receiver"`
			Sender        string `json:"sender"`
			SourceChannel string `json:"source_channel"`
			Token         struct {
				Amount string `json:"amount"`
				Denom  string `json:"denom"`
			} `json:"token"`
		} `json:"messages"`
		Memo                        string         `json:"memo"`
		TimeoutHeight               string         `json:"timeout_height"`
		ExtensionOptions            []any          `json:"extension_options"`
		NonCriticalExtensionOptions []RawExtension `json:"non_critical_extension_options"`
	} `json:"body"`
	AuthInfo struct {
		SignerInfos []struct {
			PublicKey struct {
				Type string `json:"@type"`
				Key  string `json:"key"`
			} `json:"public_key"`
			ModeInfo struct {
				Single struct {
					Mode string `json:"mode"`
				} `json:"single"`
			} `json:"mode_info"`
			Sequence string `json:"sequence"`
		} `json:"signer_infos"`
		Fee struct {
			Amount []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"amount"`
			GasLimit string `json:"gas_limit"`
			Payer    string `json:"payer"`
			Granter  string `json:"granter"`
		} `json:"fee"`
	} `json:"auth_info"`
	Signatures []string `json:"signatures"`
}

func (RawTransaction) GetSenderAddress

func (tx RawTransaction) GetSenderAddress() (string, error)

func (RawTransaction) GetTxByteSize

func (tx RawTransaction) GetTxByteSize() int

func (RawTransaction) ToJSON

func (tx RawTransaction) ToJSON() string

func (RawTransaction) ValidateBasic

func (tx RawTransaction) ValidateBasic() error

ValidateBasic checks if the transaction contains a MsgSend as part of messages a memo that contains "urn:"

type Trait

type Trait struct {
	TraitType string `json:"trait_type"`
	Value     string `json:"value"`
}

func GetTraits

func GetTraits(attributeNames []string, row []string) []Trait

type Tx

type Tx struct {
	Hash     string
	RawTx    string
	ParsedTx string
}

type TxResult

type TxResult struct {
	Code      int    `json:"code"`
	Data      string `json:"data"`
	Log       string `json:"log"`
	Info      string `json:"info"`
	GasWanted string `json:"gas_wanted"`
	GasUsed   string `json:"gas_used"`
	Events    []struct {
		Type       string `json:"type"`
		Attributes []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
			Index bool   `json:"index"`
		} `json:"attributes"`
	} `json:"events"`
	Codespace string `json:"codespace"`
}

Jump to

Keyboard shortcuts

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