codes

package
v0.0.0-...-446988d Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package codes is a helper package to help convert to transaction and operation result codes to strings used in orbitr.

Index

Constants

View Source
const (
	// OpSuccess is the string code used to specify the operation was successful
	OpSuccess = "op_success"
	// OpMalformed is the string code used to specify the operation was malformed
	// in some way.
	OpMalformed = "op_malformed"
	// OpUnderfunded is the string code used to specify the operation failed
	// due to a lack of funds.
	OpUnderfunded = "op_underfunded"
	// OpLowReserve is the string code used to specify the operation failed
	// because the account in question does not have enough balance to satisfy
	// what their new minimum balance would be.
	OpLowReserve = "op_low_reserve"
	// OpLineFull occurs when a payment would cause a destination account to
	// exceed their declared trust limit for the asset being sent.
	OpLineFull = "op_line_full"
	// OpNoIssuer occurs when a operation does not correctly specify an issuing
	// asset
	OpNoIssuer = "op_no_issuer"
	// OpNoTrust occurs when there is no trust line to a given asset
	OpNoTrust = "op_no_trust"
	// OpNotAuthorized occurs when a trust line is not authorized
	OpNotAuthorized = "op_not_authorized"
	// OpDoesNotExist occurs when claimable balance or sponsorship does not exist
	OpDoesNotExist = "op_does_not_exist"
)

Variables

View Source
var ErrUnknownCode = errors.New("Unknown result code")

ErrUnknownCode is returned when an unexepcted value is provided to `String`

Functions

func ForOperationResult

func ForOperationResult(opr xdr.OperationResult) (string, error)

ForOperationResult returns the strong representation used by orbitr for the error code `opr`

func String

func String(code interface{}) (string, error)

String returns the appropriate string representation of the provided result code

Types

This section is empty.

Jump to

Keyboard shortcuts

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