types

package
v0.0.0-...-3b18725 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	InMemoryStore = "inmemory"
	FileStore     = "file"
	KVStore       = "kv"
	SQLStore      = "sql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Tapscripts []string
	Address    string
}

type Asset

type Asset struct {
	AssetId string
	Amount  uint64
}

type AssetInfo

type AssetInfo struct {
	AssetId        string
	ControlAssetId string
	Metadata       []asset.Metadata
}

type Config

type Config struct {
	ServerUrl           string
	SignerPubKey        *btcec.PublicKey
	ForfeitPubKey       *btcec.PublicKey
	WalletType          string
	Network             arklib.Network
	SessionDuration     int64
	UnilateralExitDelay arklib.RelativeLocktime
	Dust                uint64
	BoardingExitDelay   arklib.RelativeLocktime
	ExplorerURL         string
	ForfeitAddress      string
	UtxoMinAmount       int64
	UtxoMaxAmount       int64
	VtxoMinAmount       int64
	VtxoMaxAmount       int64
	CheckpointTapscript string
	Fees                FeeInfo
}

func (Config) CheckpointExitPath

func (c Config) CheckpointExitPath() []byte

type ConfigStore

type ConfigStore interface {
	GetType() string
	GetDatadir() string
	AddData(ctx context.Context, data Config) error
	GetData(ctx context.Context) (*Config, error)
	CleanData(ctx context.Context) error
	Close()
}

type ControlAsset

type ControlAsset interface {
	// contains filtered or unexported methods
}

ControlAsset represents the control asset configuration for issuing new assets. Use either NewControlAsset to create a new control asset, or ExistingControlAsset

type DeprecatedSigner

type DeprecatedSigner struct {
	PubKey     *btcec.PublicKey
	CutoffDate time.Time
}

type ExistingControlAsset

type ExistingControlAsset struct {
	ID string
}

ExistingControlAsset references an existing control asset by its ID.

type FeeInfo

type FeeInfo struct {
	IntentFees arkfee.Config
	TxFeeRate  float64
}

type NewControlAsset

type NewControlAsset struct {
	Amount uint64
}

NewControlAsset creates a new control asset with the specified amount.

type OnchainAddressEvent

type OnchainAddressEvent struct {
	Error          error
	SpentUtxos     []OnchainOutput
	NewUtxos       []OnchainOutput
	ConfirmedUtxos []OnchainOutput
	Replacements   map[string]string // replacedTxid -> replacementTxid
}

type OnchainOutput

type OnchainOutput struct {
	Outpoint
	Script    string
	Amount    uint64
	CreatedAt time.Time
	Spent     bool
	SpentBy   string
}

type Outpoint

type Outpoint struct {
	Txid string
	VOut uint32
}

func (Outpoint) String

func (v Outpoint) String() string

type Receiver

type Receiver struct {
	To     string
	Amount uint64
	Assets []Asset
}

func (Receiver) IsOnchain

func (r Receiver) IsOnchain() bool

func (Receiver) ToArkFeeOutput

func (r Receiver) ToArkFeeOutput() arkfee.Output

func (Receiver) ToTxOut

func (o Receiver) ToTxOut() (*wire.TxOut, bool, error)

type Store

type Store interface {
	ConfigStore() ConfigStore
	Clean(ctx context.Context)
	Close()
}

type StreamConnectionEvent

type StreamConnectionEvent struct {
	State          StreamConnectionState
	At             time.Time
	DisconnectedAt time.Time
	Err            error
}

type StreamConnectionState

type StreamConnectionState string
const (
	StreamConnectionStateDisconnected StreamConnectionState = "DISCONNECTED"
	StreamConnectionStateReconnected  StreamConnectionState = "RECONNECTED"
	StreamConnectionStateReady        StreamConnectionState = "READY"
)

type SyncEvent

type SyncEvent struct {
	Synced bool
	Err    error
}

type Transaction

type Transaction struct {
	TransactionKey
	Amount      uint64
	Type        TxType
	CreatedAt   time.Time
	Hex         string
	SettledBy   string
	AssetPacket asset.Packet
}

func (Transaction) String

func (t Transaction) String() string

type TransactionEvent

type TransactionEvent struct {
	Type         TxEventType
	Txs          []Transaction
	Replacements map[string]string
}

type TransactionKey

type TransactionKey struct {
	BoardingTxid   string
	CommitmentTxid string
	ArkTxid        string
}

func (TransactionKey) String

func (t TransactionKey) String() string

type TxEventType

type TxEventType int
const (
	TxsAdded TxEventType = iota
	TxsSettled
	TxsConfirmed
	TxsReplaced
	TxsUpdated
)

func (TxEventType) String

func (e TxEventType) String() string

type TxType

type TxType string
const (
	TxSent     TxType = "SENT"
	TxReceived TxType = "RECEIVED"
)

type Utxo

type Utxo struct {
	Outpoint
	Amount      uint64
	Script      string
	Delay       arklib.RelativeLocktime
	SpendableAt time.Time
	CreatedAt   time.Time
	Tapscripts  []string
	Spent       bool
	SpentBy     string
	Tx          string
}

func (Utxo) IsConfirmed

func (u Utxo) IsConfirmed() bool

func (Utxo) Sequence

func (u Utxo) Sequence() (uint32, error)

func (Utxo) ToArkFeeInput

func (u Utxo) ToArkFeeInput() arkfee.OnchainInput

type UtxoEvent

type UtxoEvent struct {
	Type  UtxoEventType
	Utxos []Utxo
}

type UtxoEventType

type UtxoEventType int
const (
	UtxosAdded UtxoEventType = iota
	UtxosConfirmed
	UtxosReplaced
	UtxosSpent
)

func (UtxoEventType) String

func (e UtxoEventType) String() string

type Vtxo

type Vtxo struct {
	Outpoint
	Script          string
	Amount          uint64
	CommitmentTxids []string
	ExpiresAt       time.Time
	CreatedAt       time.Time
	Preconfirmed    bool
	Swept           bool
	Unrolled        bool
	Spent           bool
	SpentBy         string
	SettledBy       string
	ArkTxid         string
	Assets          []Asset
}

func (Vtxo) Address

func (v Vtxo) Address(server *btcec.PublicKey, net arklib.Network) (string, error)

func (Vtxo) IsRecoverable

func (v Vtxo) IsRecoverable() bool

func (Vtxo) String

func (v Vtxo) String() string

type VtxoEvent

type VtxoEvent struct {
	Type  VtxoEventType
	Vtxos []Vtxo
}

type VtxoEventType

type VtxoEventType int
const (
	VtxosAdded VtxoEventType = iota
	VtxosSpent
	VtxosUpdated
)

func (VtxoEventType) String

func (e VtxoEventType) String() string

type VtxoWithTapTree

type VtxoWithTapTree struct {
	Vtxo
	Tapscripts []string
}

func (VtxoWithTapTree) ToArkFeeInput

func (v VtxoWithTapTree) ToArkFeeInput() arkfee.OffchainInput

Jump to

Keyboard shortcuts

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