terra

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeltaswapTerraTx

type DeltaswapTerraTx struct {
	Type  string `json:"type"`
	Value struct {
		Fee struct {
			Gas    string `json:"gas"`
			Amount []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"amount"`
		} `json:"fee"`
		Msg []struct {
			Type  string `json:"type"`
			Value struct {
				Coins      []any  `json:"coins"`
				Sender     string `json:"sender"`
				Contract   string `json:"contract"`
				ExecuteMsg struct {
					SubmitVaa struct {
						Data []byte `json:"data"`
					} `json:"submit_vaa"`
				} `json:"execute_msg"`
			} `json:"value"`
		} `json:"msg"`
		Memo       string `json:"memo"`
		Signatures []struct {
			PubKey struct {
				Type  string `json:"type"`
				Value string `json:"value"`
			} `json:"pub_key"`
			Signature string `json:"signature"`
		} `json:"signatures"`
		TimeoutHeight string `json:"timeout_height"`
	} `json:"value"`
}

type DeltaswapTerraTxLog

type DeltaswapTerraTxLog struct {
	Log struct {
		Tax string `json:"tax"`
	} `json:"log"`
	Events []struct {
		Type       string `json:"type"`
		Attributes []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
		} `json:"attributes"`
	} `json:"events"`
	MsgIndex int `json:"msg_index"`
}

type LastBlockResponse

type LastBlockResponse struct {
	Block struct {
		Header struct {
			Height string `json:"height"`
		} `json:"header"`
	} `json:"block"`
}

type TerraSDK

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

TerraSDK is a client for the Terra blockchain.

func NewTerraSDK

func NewTerraSDK(url string, rl ratelimit.Limiter, metrics metrics.Metrics) *TerraSDK

NewTerraSDK creates a new TerraSDK.

func (*TerraSDK) GetLastBlock

func (t *TerraSDK) GetLastBlock(ctx context.Context) (int64, error)

GetLastBlock returns the last block height.

func (*TerraSDK) GetTransactionsByBlockHeight

func (t *TerraSDK) GetTransactionsByBlockHeight(ctx context.Context, height int64, offset *int) (*TxByBlockResponse, error)

GetTransactionsByBlockHeight returns the transactions for a given block height.

type TerraTrx

type TerraTrx struct {
}

TerraTrx is a transaction on the Terra blockchain.

type Tx

type Tx struct {
	ID        int        `json:"id"`
	Tx        any        `json:"tx"`
	Logs      any        `json:"logs"`
	Code      int        `json:"code"`
	Height    string     `json:"height"`
	Txhash    string     `json:"txhash"`
	RawLog    string     `json:"raw_log"`
	Timestamp *time.Time `json:"timestamp"`
}

type TxByBlockResponse

type TxByBlockResponse struct {
	Limit      int  `json:"limit"`
	NextOffset *int `json:"next"`
	Txs        []Tx `json:"txs"`
}

Jump to

Keyboard shortcuts

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