Documentation
¶
Index ¶
- func DecodeEnvelope(envelopeXdr string) (*xdr.TransactionEnvelope, error)
- func DecodeResultXDR(resultXDR string) (string, error)
- func DecodeXDRBase64AsDiagnosticEvent(data string) (*xdr.DiagnosticEvent, error)
- func DecodeXDRBase64AsLedgerEntry(data string) (*xdr.LedgerEntry, error)
- func Example()
- func ExampleSuggestionEngine()
- func FormatSuggestions(suggestions []Suggestion) string
- func FormatTransactionResult(result xdr.TransactionResult) string
- func PrintEnvelope(d *DecodedEnvelope)
- func SummarizeXDRObject(data interface{}) string
- type CallNode
- type DecodedEnvelope
- type DecodedEvent
- type ErrorPattern
- type FormatType
- type OperationResultCodeInfo
- type Suggestion
- type SuggestionEngine
- type TransactionResultCodeInfo
- type XDRFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeEnvelope ¶
func DecodeEnvelope(envelopeXdr string) (*xdr.TransactionEnvelope, error)
DecodeEnvelope decodes a base64-encoded XDR transaction envelope
func DecodeResultXDR ¶
DecodeResultXDR decodes a base64-encoded TransactionResult XDR and returns human-readable output
func DecodeXDRBase64AsDiagnosticEvent ¶
func DecodeXDRBase64AsDiagnosticEvent(data string) (*xdr.DiagnosticEvent, error)
func DecodeXDRBase64AsLedgerEntry ¶
func DecodeXDRBase64AsLedgerEntry(data string) (*xdr.LedgerEntry, error)
func ExampleSuggestionEngine ¶
func ExampleSuggestionEngine()
ExampleSuggestionEngine demonstrates how to use the suggestion engine
func FormatSuggestions ¶
func FormatSuggestions(suggestions []Suggestion) string
FormatSuggestions formats suggestions for display
func FormatTransactionResult ¶
func FormatTransactionResult(result xdr.TransactionResult) string
FormatTransactionResult formats a complete transaction result with human-readable errors
func PrintEnvelope ¶
func PrintEnvelope(d *DecodedEnvelope)
func SummarizeXDRObject ¶
func SummarizeXDRObject(data interface{}) string
Types ¶
type CallNode ¶
type CallNode struct {
ContractID string `json:"contract_id"`
Function string `json:"function,omitempty"`
Events []DecodedEvent `json:"events,omitempty"`
SubCalls []*CallNode `json:"sub_calls,omitempty"`
CPUInstructions uint64 `json:"cpu,omitempty"`
MemoryBytes uint64 `json:"mem,omitempty"`
// contains filtered or unexported fields
}
CallNode represents a node in the execution call tree
func DecodeDiagnosticEvents ¶
func DecodeDiagnosticEvents(events []simulator.DiagnosticEvent, maxDepth int) (*CallNode, error)
DecodeDiagnosticEvents builds a call hierarchy from a list of decoded simulator DiagnosticEvents
type DecodedEnvelope ¶
type DecodedEnvelope struct {
Type string
Source string
Fee int64
Operations []xdr.Operation
InnerTx *DecodedEnvelope // for FeeBump
}
func AnalyzeEnvelope ¶
func AnalyzeEnvelope(b64 string) (*DecodedEnvelope, error)
func DecodeEnvelopeFromInner ¶
func DecodeEnvelopeFromInner(inner xdr.FeeBumpTransactionInnerTx) (*DecodedEnvelope, error)
type DecodedEvent ¶
type DecodedEvent struct {
ContractID string `json:"contract_id"`
Topics []string `json:"topics"`
Data string `json:"data"`
CPU uint64 `json:"cpu,omitempty"`
Memory uint64 `json:"mem,omitempty"`
}
DecodedEvent is a human-friendly representation of a DiagnosticEvent
type ErrorPattern ¶
type ErrorPattern struct {
Name string
Keywords []string
EventChecks []func(DecodedEvent) bool
Suggestion Suggestion
}
ErrorPattern defines a heuristic rule for error detection
type FormatType ¶
type FormatType string
const ( FormatJSON FormatType = "json" FormatTable FormatType = "table" )
type OperationResultCodeInfo ¶
OperationResultCodeInfo contains human-readable information about an operation result code
func DecodeCreateAccountResultCode ¶
func DecodeCreateAccountResultCode(code xdr.CreateAccountResultCode) OperationResultCodeInfo
DecodeCreateAccountResultCode decodes CreateAccount operation specific codes
func DecodeOperationResultCode ¶
func DecodeOperationResultCode(code xdr.OperationResultCode) OperationResultCodeInfo
DecodeOperationResultCode converts an OperationResultCode to human-readable format
func DecodePaymentResultCode ¶
func DecodePaymentResultCode(code xdr.PaymentResultCode) OperationResultCodeInfo
DecodePaymentResultCode decodes Payment operation specific codes
type Suggestion ¶
type Suggestion struct {
Rule string
Description string
Confidence string // Derived from match specificity: "high", "medium", "low"
}
Suggestion represents a potential fix for a Soroban error
type SuggestionEngine ¶
type SuggestionEngine struct {
// contains filtered or unexported fields
}
SuggestionEngine provides heuristic-based error suggestions
func NewSuggestionEngine ¶
func NewSuggestionEngine() *SuggestionEngine
NewSuggestionEngine creates a new suggestion engine with predefined rules
func (*SuggestionEngine) AddCustomRule ¶
func (e *SuggestionEngine) AddCustomRule(pattern ErrorPattern)
AddCustomRule allows adding custom heuristic rules
func (*SuggestionEngine) AnalyzeCallTree ¶
func (e *SuggestionEngine) AnalyzeCallTree(root *CallNode) []Suggestion
AnalyzeCallTree analyzes a call tree and returns suggestions
func (*SuggestionEngine) AnalyzeEvents ¶
func (e *SuggestionEngine) AnalyzeEvents(events []DecodedEvent) []Suggestion
AnalyzeEvents analyzes decoded events and returns suggestions
type TransactionResultCodeInfo ¶
TransactionResultCodeInfo contains human-readable information about a transaction result code
func DecodeTransactionResultCode ¶
func DecodeTransactionResultCode(code xdr.TransactionResultCode) TransactionResultCodeInfo
DecodeTransactionResultCode converts a TransactionResultCode to human-readable format
type XDRFormatter ¶
type XDRFormatter struct {
// contains filtered or unexported fields
}
func NewXDRFormatter ¶
func NewXDRFormatter(format FormatType) *XDRFormatter
func (*XDRFormatter) Format ¶
func (f *XDRFormatter) Format(data interface{}) (string, error)