crosschain

package
v0.0.0-...-fa9a987 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceApiKeyHeader = "x-service-api-key"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Asset           xc.ITask
	URL             string
	Http            *http.Client
	Network         xc.NetworkSelector
	StakingProvider xc.StakingProvider
	ApiKey          string
	ServiceApiKey   string
}

Client for Template

func NewClient

func NewClient(cfgI xc.ITask, apiKey string) (*Client, error)

NewClient returns a new Crosschain Client

func NewStakingClient

func NewStakingClient(cfgI xc.ITask, apiKey string, serviceApiKey config.Secret, provider xc.StakingProvider) (*Client, error)

func (*Client) ApiCallWithUrl

func (client *Client) ApiCallWithUrl(ctx context.Context, method string, url string, data interface{}) ([]byte, error)

func (*Client) CompleteManualUnstaking

func (cli *Client) CompleteManualUnstaking(ctx context.Context, unstake *xcclient.Unstake) error

func (client *Client) FetchWithdrawInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.WithdrawTxInput, error) {

func (*Client) FetchBalance

func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)

FetchBalance fetches token balance from a Crosschain endpoint

func (*Client) FetchLegacyTxInfo

func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)

FetchLegacyTxInfo returns tx info from a Crosschain endpoint

func (*Client) FetchLegacyTxInput

func (client *Client) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)

func (*Client) FetchNativeBalance

func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)

FetchNativeBalance fetches account balance from a Crosschain endpoint

func (*Client) FetchStakeBalance

func (client *Client) FetchStakeBalance(ctx context.Context, args xcclient.StakedBalanceArgs) ([]*xcclient.StakedBalance, error)

func (*Client) FetchStakingInput

func (client *Client) FetchStakingInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.StakeTxInput, error)

func (*Client) FetchTransferInput

func (client *Client) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)

FetchLegacyTxInput returns tx input from a Crosschain endpoint

func (*Client) FetchTxInfo

func (client *Client) FetchTxInfo(ctx context.Context, txHashStr xc.TxHash) (xclient.TxInfo, error)

func (*Client) FetchUnstakingInput

func (client *Client) FetchUnstakingInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.UnstakeTxInput, error)

func (*Client) FetchWithdrawInput

func (client *Client) FetchWithdrawInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.WithdrawTxInput, error)

func (*Client) SubmitTx

func (client *Client) SubmitTx(ctx context.Context, txInput xc.Tx) error

SubmitTx submits via a Crosschain endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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