client

package
v0.0.0-...-8e00526 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GrpcClient = "grpc"
	RestClient = "rest"
)

Variables

View Source
var (
	ErrConnectionClosedByServer = fmt.Errorf("connection closed by server")
)

Functions

This section is empty.

Types

type AcceptedOffchainTx

type AcceptedOffchainTx struct {
	Txid                string
	FinalArkTx          string
	SignedCheckpointTxs []string
}

type BatchEventChannel

type BatchEventChannel struct {
	Event      any
	Connection *types.StreamConnectionEvent
	Err        error
}

type BatchFailedEvent

type BatchFailedEvent struct {
	Id     string
	Reason string
}

type BatchFinalizationEvent

type BatchFinalizationEvent struct {
	Id string
	Tx string
}

type BatchFinalizedEvent

type BatchFinalizedEvent struct {
	Id   string
	Txid string
}

type BatchStartedEvent

type BatchStartedEvent struct {
	Id              string
	HashedIntentIds []string
	BatchExpiry     int64
}

type DeprecatedSigner

type DeprecatedSigner struct {
	PubKey     string
	CutoffDate int64
}

type Info

type Info struct {
	Version                   string
	SignerPubKey              string
	ForfeitPubKey             string
	UnilateralExitDelay       int64
	BoardingExitDelay         int64
	SessionDuration           int64
	Network                   string
	Dust                      uint64
	ForfeitAddress            string
	ScheduledSessionStartTime int64
	ScheduledSessionEndTime   int64
	ScheduledSessionPeriod    int64
	ScheduledSessionDuration  int64
	ScheduledSessionFees      types.FeeInfo
	UtxoMinAmount             int64
	UtxoMaxAmount             int64
	VtxoMinAmount             int64
	VtxoMaxAmount             int64
	CheckpointTapscript       string
	MaxTxWeight               int64
	MaxOpReturnOutputs        int64
	Fees                      types.FeeInfo
	DeprecatedSignerPubKeys   []DeprecatedSigner
	ServiceStatus             map[string]string
	Digest                    string
}

type StreamStartedEvent

type StreamStartedEvent struct {
	Id string
}

type TransactionEvent

type TransactionEvent struct {
	CommitmentTx *TxNotification
	ArkTx        *TxNotification
	SweepTx      *TxNotification
	Connection   *types.StreamConnectionEvent
	Err          error
}

type TransportClient

type TransportClient interface {
	GetInfo(ctx context.Context) (*Info, error)
	RegisterIntent(ctx context.Context, proof, message string) (string, error)
	DeleteIntent(ctx context.Context, proof, message string) error
	EstimateIntentFee(ctx context.Context, proof, message string) (int64, error)
	ConfirmRegistration(ctx context.Context, intentID string) error
	SubmitTreeNonces(
		ctx context.Context, batchId, cosignerPubkey string, nonces tree.TreeNonces,
	) error
	SubmitTreeSignatures(
		ctx context.Context, batchId, cosignerPubkey string, signatures tree.TreePartialSigs,
	) error
	SubmitSignedForfeitTxs(
		ctx context.Context, signedForfeitTxs []string, signedCommitmentTx string,
	) error
	GetEventStream(ctx context.Context, topics []string) (<-chan BatchEventChannel, func(), error)
	SubmitTx(ctx context.Context, signedArkTx string, checkpointTxs []string) (

		arkTxid, finalArkTx string, signedCheckpointTxs []string, err error,
	)
	FinalizeTx(ctx context.Context, arkTxid string, finalCheckpointTxs []string) error
	GetPendingTx(ctx context.Context, proof, message string) ([]AcceptedOffchainTx, error)
	GetTransactionsStream(ctx context.Context) (<-chan TransactionEvent, func(), error)
	ModifyStreamTopics(
		ctx context.Context, addTopics, removeTopics []string,
	) (addedTopics, removedTopics, allTopics []string, err error)
	OverwriteStreamTopics(
		ctx context.Context, topics []string,
	) (addedTopics, removedTopics, allTopics []string, err error)
	Close()
}

type TreeNoncesAggregatedEvent

type TreeNoncesAggregatedEvent struct {
	Id     string
	Nonces tree.TreeNonces
}

type TreeNoncesEvent

type TreeNoncesEvent struct {
	Id     string
	Topic  []string
	Txid   string
	Nonces map[string]*tree.Musig2Nonce
}

type TreeSignatureEvent

type TreeSignatureEvent struct {
	Id         string
	Topic      []string
	BatchIndex int32
	Txid       string
	Signature  string
}

type TreeSigningStartedEvent

type TreeSigningStartedEvent struct {
	Id                   string
	UnsignedCommitmentTx string
	CosignersPubkeys     []string
}

type TreeTxEvent

type TreeTxEvent struct {
	Id         string
	Topic      []string
	BatchIndex int32
	Node       tree.TxTreeNode
}

type TxData

type TxData struct {
	Txid string
	Tx   string
}

type TxNotification

type TxNotification struct {
	TxData
	SpentVtxos     []types.Vtxo
	SpendableVtxos []types.Vtxo
	CheckpointTxs  map[types.Outpoint]TxData
	SweptVtxos     []types.Outpoint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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