types

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

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const UninitializedStatusCode = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type CovenantParamsType

type CovenantParamsType struct {
	CovenantPubkeys []string
	Quorum          int
	Tag             string
	Version         int
}
var CovenantParams CovenantParamsType

func GetCovenantParamsVar

func GetCovenantParamsVar() CovenantParamsType

type CreateStakingRequestPayload

type CreateStakingRequestPayload struct {
	Nework                  string `json:"network"`
	StakerAddress           string `json:"staker_address"` //Btc Staker's address
	StakerPubkey            string `json:"staker_pubkey"`
	PublicKeyHex            string `json:"public_key_hex"`
	DstChainId              string `json:"dst_chain_id"` //UPDATE: New field
	DstSmartContractAddress string `json:"dst_smart_contract_address"`
	DstUserAddress          string `json:"dst_user_address"`
	StakingAmount           uint64 `json:"staking_amount"`
	MintingAmount           uint64 `json:"minting_amount"`
	ServicePubkey           string `json:"service_pubkey"`
	FeeRate                 string `json:"fee_rate"` //Expected fee rate
}

type CreateUnstakingRequestPayload

type CreateUnstakingRequestPayload struct {
	Nework          string `json:"network"`
	StakerAddress   string `json:"staker_address"`   //Btc Staker's address
	ReceiverAddress string `json:"receiver_address"` //Btc Receiver's address usually is staker's address
	VaultTxHex      string `json:"vault_tx_hex"`
}

type DelegationState

type DelegationState string
const (
	Active             DelegationState = "active"
	UnbondingRequested DelegationState = "unbonding_requested"
	Unbonding          DelegationState = "unbonding"
	Unbonded           DelegationState = "unbonded"
	Withdrawn          DelegationState = "withdrawn"
)

func FromStringToDelegationState

func FromStringToDelegationState(s string) (DelegationState, error)

func (DelegationState) ToString

func (s DelegationState) ToString() string

type Error

type Error struct {
	Err        error
	StatusCode int
	ErrorCode  ErrorCode
}

Error represents an error with an HTTP status code and an application-specific error code.

func NewError

func NewError(statusCode int, errorCode ErrorCode, err error) *Error

NewError creates a new Error with the provided status code, error code, and underlying error. If the status code is not provided (0), it defaults to http.StatusInternalServerError(500). If the error code is empty, it defaults to INTERNAL_SERVICE_ERROR.

func NewErrorWithMsg

func NewErrorWithMsg(statusCode int, errorCode ErrorCode, msg string) *Error

func NewInternalServiceError

func NewInternalServiceError(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode string
const (
	// 5XX
	InternalServiceError ErrorCode = "INTERNAL_SERVICE_ERROR"
	ValidationError      ErrorCode = "VALIDATION_ERROR"
	NotFound             ErrorCode = "NOT_FOUND"
	BadRequest           ErrorCode = "BAD_REQUEST"
	Forbidden            ErrorCode = "FORBIDDEN"
)

func (ErrorCode) String

func (e ErrorCode) String() string

type FinalityProviderDescription

type FinalityProviderDescription struct {
	Moniker         string `json:"moniker"`
	Identity        string `json:"identity"`
	Website         string `json:"website"`
	SecurityContact string `json:"security_contact"`
	Details         string `json:"details"`
}

type FinalityProviderDetails

type FinalityProviderDetails struct {
	Description FinalityProviderDescription `json:"description"`
	Commission  string                      `json:"commission"`
	BtcPk       string                      `json:"btc_pk"`
}

func NewFinalityProviders

func NewFinalityProviders(filePath string) ([]FinalityProviderDetails, error)

type FinalityProviders

type FinalityProviders struct {
	FinalityProviders []FinalityProviderDetails `json:"finality_providers"`
}

type GlobalParams

type GlobalParams = parser.GlobalParams

func NewGlobalParams

func NewGlobalParams(filePath string) (*GlobalParams, error)

type GmpPayload

type GmpPayload struct {
	From        int    `json:"from"`
	Size        int    `json:"size"`
	MessageID   string `json:"messageId"`
	TxHash      string `json:"txHash"`
	Granularity string `json:"granularity"`
}

type StakingPsbt

type StakingPsbt struct {
	Psbt string `json:"psbt"`
}

type StakingTxType

type StakingTxType string
const (
	ActiveTxType    StakingTxType = "active"
	UnbondingTxType StakingTxType = "unbonding"
)

func StakingTxTypeFromString

func StakingTxTypeFromString(s string) (StakingTxType, error)

func (StakingTxType) ToString

func (s StakingTxType) ToString() string

type UnstakingPsbt

type UnstakingPsbt struct {
	Psbt string `json:"psbt"`
}

type VaultPayload

type VaultPayload struct {
	StakerPubkey string `json:"stakerPubkey"` // 32 bytes
}

type VersionedGlobalParams

type VersionedGlobalParams = parser.VersionedGlobalParams

Jump to

Keyboard shortcuts

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