alephium

package
v0.0.0-...-989067b Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const AttestTokenPayloadId = 2
View Source
const AttestTokenPayloadLength = 100
View Source
const BlockTimeMs = 64000
View Source
const HashLength = 32
View Source
const TransferTokenPayloadId = 1
View Source
const WormholeMessageEventIndex = 0
View Source
const WormholeMessageFieldSize = 6

Variables

This section is empty.

Functions

func HexToFixedSizeBytes

func HexToFixedSizeBytes(str string, length int) ([]byte, error)

func ToContractAddress

func ToContractAddress(contractId string) (*string, error)

func Uint16ToBytes

func Uint16ToBytes(value uint16) []byte

func Uint64ToBytes

func Uint64ToBytes(value uint64) []byte

Types

type Byte32

type Byte32 [32]byte
var ALPHTokenId Byte32

func HexToByte32

func HexToByte32(str string) (Byte32, error)

func ToContractId

func ToContractId(address string) (Byte32, error)

func (Byte32) ToHex

func (b Byte32) ToHex() string

type ChainIndex

type ChainIndex struct {
	FromGroup int32
	ToGroup   int32
}

type Client

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

func NewClient

func NewClient(endpoint string, apiKey string, timeout int) *Client

func (*Client) GetBlockHeader

func (c *Client) GetBlockHeader(ctx context.Context, hash string) (*sdk.BlockHeaderEntry, error)

func (*Client) GetContractEvents

func (c *Client) GetContractEvents(ctx context.Context, contractAddress string, from, group int32) (*sdk.ContractEvents, error)

func (*Client) GetContractEventsByRange

func (c *Client) GetContractEventsByRange(ctx context.Context, contractAddress string, from, limit, group int32) (*sdk.ContractEvents, error)

func (*Client) GetContractEventsCount

func (c *Client) GetContractEventsCount(ctx context.Context, contractAddress string) (*int32, error)

func (*Client) GetCurrentHeight

func (c *Client) GetCurrentHeight(ctx context.Context, chainIndex *ChainIndex) (*int32, error)

func (*Client) GetEventsByTxId

func (c *Client) GetEventsByTxId(ctx context.Context, txId string) (*sdk.ContractEventsByTxId, error)

func (*Client) GetNodeVersion

func (c *Client) GetNodeVersion(ctx context.Context) (*sdk.NodeVersion, error)

func (*Client) GetTokenInfo

func (c *Client) GetTokenInfo(ctx context.Context, tokenId Byte32) (*TokenInfo, error)

func (*Client) GetTransactionStatus

func (c *Client) GetTransactionStatus(ctx context.Context, txId string) (*sdk.TxStatus, error)

func (*Client) IsBlockInMainChain

func (c *Client) IsBlockInMainChain(ctx context.Context, hash string) (*bool, error)

func (*Client) IsCliqueSynced

func (c *Client) IsCliqueSynced(ctx context.Context) (*bool, error)

func (*Client) MultiCallContract

func (c *Client) MultiCallContract(ctx context.Context, multiCall *sdk.MultipleCallContract) (*sdk.MultipleCallContractResult, error)

type ConfirmedEvent

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

type Request

type Request[T any] interface {
	Execute() (T, *http.Response, error)
}

type TokenInfo

type TokenInfo struct {
	TokenId  Byte32
	Decimals uint8
	Symbol   string
	Name     string
}
var ALPHTokenInfo TokenInfo = TokenInfo{
	TokenId:  ALPHTokenId,
	Decimals: 18,
	Symbol:   "ALPH",
	Name:     "Alephium",
}

type UnconfirmedEvent

type UnconfirmedEvent struct {
	*sdk.ContractEvent
	// contains filtered or unexported fields
}

type UnconfirmedEventsPerBlock

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

type Watcher

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

func NewAlephiumWatcher

func NewAlephiumWatcher(
	url string,
	apiKey string,
	chainConfig *common.ChainConfig,
	readiness readiness.Component,
	messageEvents chan *common.MessagePublication,
	pollIntervalMs uint,
	obsvReqC chan *gossipv1.ObservationRequest,
) (*Watcher, error)

func (*Watcher) DisableBlockPoller

func (w *Watcher) DisableBlockPoller()

func (*Watcher) EnableBlockPoller

func (w *Watcher) EnableBlockPoller()

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context) error

type WormholeMessage

type WormholeMessage struct {
	Sequence uint64
	// contains filtered or unexported fields
}

func ToWormholeMessage

func ToWormholeMessage(fields []sdk.Val, txId string) (*WormholeMessage, error)

func (*WormholeMessage) GetID

func (w *WormholeMessage) GetID() *vaa.VAAID

func (*WormholeMessage) IsAttestTokenVAA

func (w *WormholeMessage) IsAttestTokenVAA() bool

func (*WormholeMessage) IsTransferTokenVAA

func (w *WormholeMessage) IsTransferTokenVAA() bool

Jump to

Keyboard shortcuts

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