kiln

package
v0.0.0-...-2e449e2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	CreatedAt   time.Time `json:"created_at"`
}

type BatchValidatorKeys

type BatchValidatorKeys struct {
	Format                string   `json:"format"`
	PubKeys               []string `json:"pubkeys"`
	WithdrawalCredentials []string `json:"withdrawal_credentials"`
	Signatures            []string `json:"signatures"`
	DepositDataRoots      []string `json:"deposit_data_roots"`
}

BatchDepositData structure to hold batch deposit information

type Client

type Client struct {
	Chain  string
	Url    string
	ApiKey string
}

func NewClient

func NewClient(chain, url, apiKey string) (*Client, error)

func (*Client) CreateValidatorKeys

func (cli *Client) CreateValidatorKeys(accountId string, address string, count int) (*CreateValidatorKeysResponse, error)

func (*Client) GenerateStakeTransaction

func (cli *Client) GenerateStakeTransaction(accountId string, address string, amount xc.AmountBlockchain) (*GenerateTransactionResponse, error)

func (*Client) Get

func (cli *Client) Get(path string, response any) error

func (*Client) GetAllStakesByOwner

func (cli *Client) GetAllStakesByOwner(address string) ([]StakeAccount, error)

func (*Client) GetAndPrint

func (cli *Client) GetAndPrint(path string) error

func (*Client) GetStakesByOwner

func (cli *Client) GetStakesByOwner(address string) (*GetStakesResponse, error)

func (*Client) GetStakesByValidator

func (cli *Client) GetStakesByValidator(validator string) (*GetStakesResponse, error)

func (*Client) OperationsByOwner

func (cli *Client) OperationsByOwner(address string) (*OperationsResponse, error)

func (*Client) Post

func (cli *Client) Post(path string, requestBody any, response any) error

func (*Client) ResolveAccount

func (cli *Client) ResolveAccount(accountIdMaybe string) (*Account, error)

func (*Client) Send

func (cli *Client) Send(method string, path string, requestBody any, response any) error

type CreateValidatorKeysRequest

type CreateValidatorKeysRequest struct {
	Format              DepositFormat `json:"format"`
	AccountID           string        `json:"account_id"`
	WithdrawalAddress   string        `json:"withdrawal_address"`
	FeeRecipientAddress string        `json:"fee_recipient_address"`
	Number              int           `json:"number"`
}

Deposit structure to hold deposit information

type CreateValidatorKeysResponse

type CreateValidatorKeysResponse struct {
	Response1 *CreateValidatorKeysResponse1
	Response2 *CreateValidatorKeysResponse2
}

type CreateValidatorKeysResponse1

type CreateValidatorKeysResponse1 struct {
	Data []ValidatorKey `json:"data"`
}

Root structure to hold the data array

type CreateValidatorKeysResponse2

type CreateValidatorKeysResponse2 struct {
	Data BatchValidatorKeys `json:"data"`
}

type DepositFormat

type DepositFormat string
var BatchDeposit DepositFormat = "batch_deposit"

type Error

type Error struct {
	Message string `json:"message"`
}

type GenerateTransactionRequest

type GenerateTransactionRequest struct {
	AccountID string `json:"account_id"`
	Wallet    string `json:"wallet"`
	AmountWei string `json:"amount_wei"`
}

type GenerateTransactionResponse

type GenerateTransactionResponse struct {
	Data TransactionData `json:"data"`
}

Root structure to hold the data object

type GetAccountResponse

type GetAccountResponse struct {
	Data Account `json:"data"`
}

type GetAccountsResponse

type GetAccountsResponse struct {
	Data []Account `json:"data"`
}

type GetStakesResponse

type GetStakesResponse struct {
	Data       []StakeAccount `json:"data"`
	Pagination Pagination     `json:"pagination"`
}

type Operation

type Operation struct {
	Type                  OperationType `json:"type"`
	Time                  time.Time     `json:"time"`
	ValidatorAddress      string        `json:"validator_address"`
	ValidatorIndex        int           `json:"validator_index"`
	TxHash                string        `json:"tx_hash"`
	TxGasUsed             string        `json:"tx_gas_used"`
	TxEffectiveGasPrice   string        `json:"tx_effective_gas_price"`
	TxSender              string        `json:"tx_sender"`
	Proxies               []string      `json:"proxies"`
	Slot                  int           `json:"slot"`
	Block                 int           `json:"block"`
	BlockBaseFee          string        `json:"block_base_fee"`
	WithdrawalCredentials string        `json:"withdrawal_credentials"`
	Amount                string        `json:"amount"`
	FeeRecipient          string        `json:"fee_recipient,omitempty"` // Optional field for consensus_withdrawal
}

type OperationType

type OperationType string
const DepositOperation OperationType = "deposit"
const WithdrawalOperation OperationType = "consensus_withdrawal"

type OperationsResponse

type OperationsResponse struct {
	Data []Operation `json:"data"`
}

type Pagination

type Pagination struct {
	CurrentPage  int `json:"current_page"`
	PageSize     int `json:"page_size"`
	TotalPages   int `json:"total_pages"`
	TotalEntries int `json:"total_entries"`
}

type StakeAccount

type StakeAccount struct {
	ValidatorAddress      string    `json:"validator_address"`
	State                 string    `json:"state"`
	DelegatedBlock        int       `json:"delegated_block"`
	DelegatedAt           time.Time `json:"delegated_at"`
	ConsensusRewards      string    `json:"consensus_rewards"`
	ExecutionRewards      string    `json:"execution_rewards"`
	Rewards               string    `json:"rewards"`
	DepositTxSender       string    `json:"deposit_tx_sender"`
	WithdrawalCredentials string    `json:"withdrawal_credentials"`
	IsKiln                bool      `json:"is_kiln"`
	UpdatedAt             time.Time `json:"updated_at"`
}

type TransactionData

type TransactionData struct {
	UnsignedTxHash          string `json:"unsigned_tx_hash"`
	UnsignedTxSerialized    string `json:"unsigned_tx_serialized"`
	To                      string `json:"to"`
	ContractCallData        string `json:"contract_call_data"`
	AmountWei               string `json:"amount_wei"`
	Nonce                   int    `json:"nonce"`
	GasLimit                int    `json:"gas_limit"`
	MaxPriorityFeePerGasWei string `json:"max_priority_fee_per_gas_wei"`
	MaxFeePerGasWei         string `json:"max_fee_per_gas_wei"`
	ChainID                 int    `json:"chain_id"`
}

TransactionData structure to hold transaction information

type ValidatorKey

type ValidatorKey struct {
	Format                string `json:"format"`
	PubKey                string `json:"pubkey"`
	WithdrawalCredentials string `json:"withdrawal_credentials"`
	Amount                int64  `json:"amount"`
	Signature             string `json:"signature"`
	DepositMessageRoot    string `json:"deposit_message_root"`
	DepositDataRoot       string `json:"deposit_data_root"`
	ForkVersion           string `json:"fork_version"`
	NetworkName           string `json:"network_name"`
	DepositCLIVersion     string `json:"deposit_cli_version"`
}

DepositData structure to hold individual deposit information

Jump to

Keyboard shortcuts

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