receipt

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0, MIT Imports: 24 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyReceipt

type AnyReceipt Receipt[ipld.Node, ipld.Node]

func Extract added in v0.6.2

func Extract(b []byte) (AnyReceipt, error)

func Issue

func Issue[O, X ipld.Builder](issuer ucan.Signer, out result.Result[O, X], ran ran.Ran, opts ...Option) (AnyReceipt, error)

func NewAnyReceipt added in v0.6.0

func NewAnyReceipt(root ipld.Link, blocks blockstore.BlockReader, opts ...bindnode.Option) (AnyReceipt, error)

type Option

type Option func(cfg *receiptConfig) error

Option is an option configuring a UCAN delegation.

func WithFork

func WithFork(forks ...fx.Effect) Option

WithFork configures the forks for the receipt.

func WithJoin

func WithJoin(join fx.Effect) Option

WithJoin configures the join for the receipt.

func WithMeta

func WithMeta(meta map[string]any) Option

WithMeta configures the metadata for the receipt.

func WithProofs

func WithProofs(prf delegation.Proofs) Option

WithProofs configures the proofs for the receipt. If the `issuer` of this `Receipt` is not the resource owner / service provider, for the delegated capabilities, the `proofs` must contain valid `Proof`s containing delegations to the `issuer`.

type Receipt

type Receipt[O, X any] interface {
	ipld.View
	Ran() ran.Ran
	Out() result.Result[O, X]
	Fx() fx.Effects
	Meta() map[string]any
	Issuer() ucan.Principal
	Proofs() delegation.Proofs
	Signature() signature.SignatureView
	VerifySignature(verifier signature.Verifier) (bool, error)
	Archive() io.Reader
	Export() iter.Seq2[block.Block, error]
	Clone() (Receipt[O, X], error)
	AttachInvocation(invocation invocation.Invocation) error
}

Receipt represents a view of the invocation receipt. This interface provides an ergonomic API and allows you to reference linked IPLD objects if they are included in the source DAG.

func NewReceipt

func NewReceipt[O, X any](root ipld.Link, blocks blockstore.BlockReader, typ schema.Type, opts ...bindnode.Option) (Receipt[O, X], error)

func Rebind added in v0.3.0

func Rebind[O, X any](from AnyReceipt, successType schema.Type, errorType schema.Type, opts ...bindnode.Option) (Receipt[O, X], error)

type ReceiptReader

type ReceiptReader[O, X any] interface {
	Read(rcpt ipld.Link, blks iter.Seq2[block.Block, error]) (Receipt[O, X], error)
}

func NewAnyReceiptReader added in v0.3.1

func NewAnyReceiptReader(opts ...bindnode.Option) ReceiptReader[ipld.Node, ipld.Node]

func NewReceiptReader

func NewReceiptReader[O, X any](resultschema []byte, opts ...bindnode.Option) (ReceiptReader[O, X], error)

func NewReceiptReaderFromTypes

func NewReceiptReaderFromTypes[O, X any](successType schema.Type, errType schema.Type, opts ...bindnode.Option) (ReceiptReader[O, X], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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