errors

package module
v0.0.0-...-44a6596 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AMOUNT_TOO_HIGH = Code[AmountTooHighMetadata]{14, "AMOUNT_TOO_HIGH", grpccodes.InvalidArgument}
View Source
var AMOUNT_TOO_LOW = Code[AmountTooLowMetadata]{15, "AMOUNT_TOO_LOW", grpccodes.InvalidArgument}
View Source
var ARK_TX_INPUT_NOT_SIGNED = Code[InputMetadata]{
	12,
	"ARK_TX_INPUT_NOT_SIGNED",
	grpccodes.InvalidArgument,
}
View Source
var ARK_TX_MISMATCH = Code[ArkTxMismatchMetadata]{17, "ARK_TX_MISMATCH", grpccodes.InvalidArgument}
View Source
var CHECKPOINT_MISMATCH = Code[CheckpointMismatchMetadata]{
	16,
	"CHECKPOINT_MISMATCH",
	grpccodes.InvalidArgument,
}
View Source
var CONFIRMATION_SESSION_NOT_STARTED = Code[any]{
	25,
	"CONFIRMATION_SESSION_NOT_STARTED",
	grpccodes.InvalidArgument,
}
View Source
var FORFEIT_CLOSURE_LOCKED = Code[ForfeitClosureLockedMetadata]{
	11,
	"FORFEIT_CLOSURE_LOCKED",
	grpccodes.FailedPrecondition,
}
View Source
var INTENT_FEE_EVALUATION_FAILED = Code[any]{33, "INTENT_FEE_EVALUATION_FAILED", grpccodes.Internal}
View Source
var INTENT_INSUFFICIENT_FEE = Code[IntentInsufficientFeeMetadata]{
	31,
	"INTENT_INSUFFICIENT_FEE",
	grpccodes.InvalidArgument,
}
View Source
var INTERNAL_ERROR = Code[map[string]any]{0, "INTERNAL_ERROR", grpccodes.Internal}
View Source
var INVALID_ARK_PSBT = Code[PsbtMetadata]{1, "INVALID_ARK_PSBT", grpccodes.InvalidArgument}
View Source
var INVALID_BOARDING_INPUT_SIG = Code[InvalidBoardingInputSigMetadata]{
	27,
	"INVALID_BOARDING_INPUT_SIG",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_CHECKPOINT_PSBT = Code[PsbtMetadata]{
	2,
	"INVALID_CHECKPOINT_PSBT",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_FORFEIT_TXS = Code[InvalidForfeitTxsMetadata]{
	26,
	"INVALID_FORFEIT_TXS",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_INTENT_MESSAGE = Code[InvalidIntentMessageMetadata]{
	21,
	"INVALID_INTENT_MESSAGE",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_INTENT_PROOF = Code[InvalidIntentProofMetadata]{
	23,
	"INVALID_INTENT_PROOF",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_INTENT_PSBT = Code[PsbtMetadata]{22, "INVALID_INTENT_PSBT", grpccodes.InvalidArgument}
View Source
var INVALID_INTENT_TIMERANGE = Code[IntentTimeRangeMetadata]{
	20,
	"INVALID_INTENT_TIMERANGE",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_PKSCRIPT = Code[InvalidPkScriptMetadata]{
	24,
	"INVALID_PKSCRIPT",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_PSBT_INPUT = Code[InputMetadata]{
	5,
	"INVALID_PSBT_INPUT",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_PSBT_MISSING_INPUT = Code[PsbtInputMetadata]{
	3,
	"INVALID_PSBT_MISSING_INPUT",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_SIGNATURE = Code[InvalidSignatureMetadata]{
	18,
	"INVALID_SIGNATURE",
	grpccodes.InvalidArgument,
}
View Source
var INVALID_VTXO_SCRIPT = Code[InvalidVtxoScriptMetadata]{
	10,
	"INVALID_VTXO_SCRIPT",
	grpccodes.InvalidArgument,
}
View Source
var MALFORMED_ARK_TX = Code[PsbtMetadata]{13, "MALFORMED_ARK_TX", grpccodes.InvalidArgument}
View Source
var OFFCHAIN_TX_INSUFFICIENT_FEE = Code[OffchainTxInsufficientFeeMetadata]{
	32,
	"OFFCHAIN_TX_INSUFFICIENT_FEE",
	grpccodes.InvalidArgument,
}
View Source
var OFFCHAIN_TX_SPENDING_NOTE = Code[VtxoMetadata]{
	9,
	"OFFCHAIN_TX_SPENDING_NOTE",
	grpccodes.InvalidArgument,
}
View Source
var SIGNING_SESSION_TIMED_OUT = Code[any]{28, "SIGNING_SESSION_TIMED_OUT", grpccodes.Internal}
View Source
var TX_NOT_FOUND = Code[TxNotFoundMetadata]{19, "TX_NOT_FOUND", grpccodes.NotFound}
View Source
var VTXO_ALREADY_REGISTERED = Code[VtxoMetadata]{
	4,
	"VTXO_ALREADY_REGISTERED",
	grpccodes.AlreadyExists,
}
View Source
var VTXO_ALREADY_SPENT = Code[VtxoMetadata]{6, "VTXO_ALREADY_SPENT", grpccodes.InvalidArgument}
View Source
var VTXO_ALREADY_UNROLLED = Code[VtxoMetadata]{7, "VTXO_ALREADY_UNROLLED", grpccodes.InvalidArgument}
View Source
var VTXO_BANNED = Code[VtxoMetadata]{29, "VTXO_BANNED", grpccodes.InvalidArgument}
View Source
var VTXO_NOT_FOUND = Code[VtxoNotFoundMetadata]{30, "VTXO_NOT_FOUND", grpccodes.NotFound}
View Source
var VTXO_RECOVERABLE = Code[VtxoMetadata]{8, "VTXO_RECOVERABLE", grpccodes.InvalidArgument}

Functions

This section is empty.

Types

type AmountTooHighMetadata

type AmountTooHighMetadata struct {
	OutputIndex int `json:"output_index"`
	Amount      int `json:"amount"`
	MaxAmount   int `json:"max_amount"`
}

type AmountTooLowMetadata

type AmountTooLowMetadata struct {
	OutputIndex int `json:"output_index"`
	Amount      int `json:"amount"`
	MinAmount   int `json:"min_amount"`
}

type ArkTxMismatchMetadata

type ArkTxMismatchMetadata struct {
	ExpectedTxid string `json:"expected_txid"`
	GotTxid      string `json:"got_txid"`
}

type CheckpointMismatchMetadata

type CheckpointMismatchMetadata struct {
	ExpectedTxid string `json:"expected_txid"`
}

type Code

type Code[MT any] struct {
	Code     uint16
	Name     string
	GrpcCode grpccodes.Code
}

Code is the type representing a namespace error code.

func (Code[MT]) New

func (c Code[MT]) New(msg string, args ...any) TypedError[MT]

New creates a new error with the given code and the message

func (Code[MT]) String

func (c Code[MT]) String() string

func (Code[MT]) Wrap

func (c Code[MT]) Wrap(cause error) TypedError[MT]

Wrap creates a new Error with the given code and the cause error

type Error

type Error interface {
	error
	Log() *log.Entry
	Code() uint16
	CodeName() string
	GrpcCode() grpccodes.Code
	Metadata() map[string]string
}

type ErrorImpl

type ErrorImpl[MT any] struct {
	// contains filtered or unexported fields
}

ErrorImpl is the default concrete implementation of TypedError.

func (*ErrorImpl[MT]) Code

func (e *ErrorImpl[MT]) Code() uint16

func (*ErrorImpl[MT]) CodeName

func (e *ErrorImpl[MT]) CodeName() string

func (*ErrorImpl[MT]) Error

func (e *ErrorImpl[MT]) Error() string

Error() implements the error interface.

func (*ErrorImpl[MT]) GrpcCode

func (e *ErrorImpl[MT]) GrpcCode() grpccodes.Code

func (*ErrorImpl[MT]) Log

func (e *ErrorImpl[MT]) Log() *log.Entry

func (*ErrorImpl[MT]) Metadata

func (e *ErrorImpl[MT]) Metadata() map[string]string

func (*ErrorImpl[MT]) WithMetadata

func (e *ErrorImpl[MT]) WithMetadata(metadata MT) TypedError[MT]

type ForfeitClosureLockedMetadata

type ForfeitClosureLockedMetadata struct {
	Locktime        int    `json:"locktime"`
	CurrentLocktime int    `json:"current_locktime"`
	Type            string `json:"type"`
}

type InputMetadata

type InputMetadata struct {
	Txid       string `json:"txid"`
	InputIndex int    `json:"input_index"`
}

type IntentInsufficientFeeMetadata

type IntentInsufficientFeeMetadata struct {
	MinFee    int `json:"min_fee"`
	ActualFee int `json:"actual_fee"`
}

type IntentTimeRangeMetadata

type IntentTimeRangeMetadata struct {
	ValidAt  int64 `json:"valid_at"`
	ExpireAt int64 `json:"expire_at"`
	Now      int64 `json:"now"`
}

type InvalidBoardingInputSigMetadata

type InvalidBoardingInputSigMetadata struct {
	SignedCommitmentTx string `json:"signed_commitment_tx"`
}

type InvalidForfeitTxsMetadata

type InvalidForfeitTxsMetadata struct {
	ForfeitTxs []string `json:"forfeit_txs"`
}

type InvalidIntentMessageMetadata

type InvalidIntentMessageMetadata struct {
	Message intent.BaseMessage `json:"message"`
}

type InvalidIntentProofMetadata

type InvalidIntentProofMetadata struct {
	Proof   string `json:"proof"`
	Message string `json:"message"`
}

type InvalidPkScriptMetadata

type InvalidPkScriptMetadata struct {
	Script string `json:"script"`
}

type InvalidSignatureMetadata

type InvalidSignatureMetadata struct {
	Tx string `json:"tx"`
}

type InvalidVtxoScriptMetadata

type InvalidVtxoScriptMetadata struct {
	Tapscripts []string `json:"tapscripts"`
}

type OffchainTxInsufficientFeeMetadata

type OffchainTxInsufficientFeeMetadata struct {
	ExpectedFee         int            `json:"expected_fee"`
	ActualFee           int            `json:"actual_fee"`
	InputThrottledUntil map[string]any `json:"input_throttled_until"`
}

type PsbtInputMetadata

type PsbtInputMetadata struct {
	Txid string `json:"txid"`
}

type PsbtMetadata

type PsbtMetadata struct {
	Tx string `json:"tx"`
}

type TxNotFoundMetadata

type TxNotFoundMetadata struct {
	Txid string `json:"txid"`
}

type TypedError

type TypedError[MT any] interface {
	Error
	WithMetadata(MT) TypedError[MT]
}

type VtxoMetadata

type VtxoMetadata struct {
	VtxoOutpoint string `json:"vtxo_outpoint"`
}

type VtxoNotFoundMetadata

type VtxoNotFoundMetadata struct {
	VtxoOutpoints []string `json:"vtxo_outpoints"`
	GotVtxos      []string `json:"got_vtxos"`
}

Jump to

Keyboard shortcuts

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