Documentation
¶
Index ¶
- Variables
- type BlockTimestamp
- type BlockchainScanner
- type BoardingInput
- type BoardingInputsStore
- type ConfirmationSessions
- type ConfirmationSessionsStore
- type CurrentRoundStore
- type ForfeitTxsStore
- type Input
- type IntentStore
- type LiveStore
- type MusigSigningSession
- type Notifier
- type OffChainTxStore
- type RepoManager
- type SchedulerService
- type SignerService
- type SweepableOutput
- type TimeUnit
- type TimedIntent
- type TreeSigningSessionsStore
- type TxBuilder
- type TxDecoder
- type TxIn
- type TxInput
- type TxOut
- type Unlocker
- type ValidForfeitTx
- type VtxoWithValue
- type WalletService
- type WalletStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNonFinalBIP68 is returned when a transaction spending a CSV-locked output is not final. ErrNonFinalBIP68 = errors.New("non-final BIP68 sequence") )
Functions ¶
This section is empty.
Types ¶
type BlockTimestamp ¶
type BlockchainScanner ¶
type BlockchainScanner interface {
WatchScripts(ctx context.Context, scripts []string) error
UnwatchScripts(ctx context.Context, scripts []string) error
GetNotificationChannel(ctx context.Context) <-chan map[string][]VtxoWithValue
IsTransactionConfirmed(
ctx context.Context, txid string,
) (isConfirmed bool, blocknumber int64, blocktime int64, err error)
RescanUtxos(ctx context.Context, outpoints []wire.OutPoint) error
}
type BoardingInput ¶
type BoardingInputsStore ¶
type ConfirmationSessions ¶
type ConfirmationSessionsStore ¶
type ConfirmationSessionsStore interface {
Init(intentIDsHashes [][32]byte)
Confirm(intentId string) error
Get() *ConfirmationSessions
Reset()
Initialized() bool
SessionCompleted() <-chan struct{}
}
type CurrentRoundStore ¶
type ForfeitTxsStore ¶
type Input ¶
func (Input) OutputScript ¶ added in v0.8.0
type IntentStore ¶
type IntentStore interface {
Len() int64
Push(intent domain.Intent, boardingInputs []BoardingInput, cosignersPublicKeys []string) error
Pop(num int64) []TimedIntent
GetSelectedIntents() []TimedIntent
Update(intent domain.Intent, cosignersPublicKeys []string) error
Delete(ids []string) error
DeleteAll() error
DeleteVtxos()
ViewAll(ids []string) ([]TimedIntent, error)
View(id string) (*domain.Intent, bool)
IncludesAny(outpoints []domain.Outpoint) (bool, string)
}
type LiveStore ¶
type LiveStore interface {
Intents() IntentStore
ForfeitTxs() ForfeitTxsStore
OffchainTxs() OffChainTxStore
CurrentRound() CurrentRoundStore
ConfirmationSessions() ConfirmationSessionsStore
TreeSigingSessions() TreeSigningSessionsStore
BoardingInputs() BoardingInputsStore
}
type MusigSigningSession ¶
type MusigSigningSession struct {
NbCosigners int
Cosigners map[string]struct{}
Nonces map[string]tree.TreeNonces
Signatures map[string]tree.TreePartialSigs
}
MusigSigningSession holds the state of ephemeral nonces and signatures in order to coordinate the signing of the tree
type OffChainTxStore ¶
type OffChainTxStore interface {
Add(offchainTx domain.OffchainTx)
Remove(arkTxid string)
Get(arkTxid string) (domain.OffchainTx, bool)
Includes(outpoint domain.Outpoint) bool
}
type RepoManager ¶
type RepoManager interface {
Events() domain.EventRepository
Rounds() domain.RoundRepository
Vtxos() domain.VtxoRepository
ScheduledSession() domain.ScheduledSessionRepo
OffchainTxs() domain.OffchainTxRepository
Convictions() domain.ConvictionRepository
Close()
}
type SchedulerService ¶
type SignerService ¶ added in v0.7.1
type SignerService interface {
IsReady(ctx context.Context) (bool, error)
GetPubkey(ctx context.Context) (*btcec.PublicKey, error)
SignTransaction(ctx context.Context, partialTx string, extractRawTx bool) (string, error)
SignTransactionTapscript(
ctx context.Context, partialTx string, inputIndexes []int,
) (string, error)
}
type SweepableOutput ¶ added in v0.8.0
type SweepableOutput struct {
Amount int64
Hash chainhash.Hash
Index uint32
// Script is the tapscript that should be used to sweep the output
Script []byte
// ControlBlock is the control block associated with leaf script
ControlBlock []byte
// InternalKey is the internal key used to compute the control block
InternalKey *btcec.PublicKey
}
type TimedIntent ¶
type TimedIntent struct {
domain.Intent
BoardingInputs []BoardingInput
Timestamp time.Time
CosignersPublicKeys []string
}
func (TimedIntent) HashID ¶
func (t TimedIntent) HashID() [32]byte
type TreeSigningSessionsStore ¶
type TreeSigningSessionsStore interface {
New(roundId string, uniqueSignersPubKeys map[string]struct{}) *MusigSigningSession
Get(roundId string) (*MusigSigningSession, bool)
Delete(roundId string)
AddNonces(ctx context.Context, roundId string, pubkey string, nonces tree.TreeNonces) error
AddSignatures(
ctx context.Context, roundId, pubkey string, nonces tree.TreePartialSigs,
) error
NoncesCollected(roundId string) <-chan struct{}
SignaturesCollected(roundId string) <-chan struct{}
}
type TxBuilder ¶
type TxBuilder interface {
// BuildCommitmentTx builds a commitment tx for the given intents and boarding inputs
// It expects an optional list of connector addresses of expired batches from which selecting
// utxos as inputs of the transaction.
// Returns the commitment tx, the vtxo tree, the connector tree and its root address.
BuildCommitmentTx(
signerPubkey *btcec.PublicKey, intents domain.Intents,
boardingInputs []BoardingInput, connectorAddresses []string,
cosigners [][]string,
) (
commitmentTx string, vtxoTree *tree.TxTree,
connectorAddress string, connectors *tree.TxTree, err error,
)
// VerifyForfeitTxs verifies a list of forfeit txs against a set of VTXOs and
// connectors.
VerifyForfeitTxs(
vtxos []domain.Vtxo, connectors tree.FlatTxTree, txs []string,
) (valid map[domain.Outpoint]ValidForfeitTx, err error)
BuildSweepTx(inputs []SweepableOutput) (txid string, signedSweepTx string, err error)
GetSweepableBatchOutputs(vtxoTree *tree.TxTree) (
vtxoTreeExpiry *arklib.RelativeLocktime, batchOutputs SweepableOutput, err error,
)
FinalizeAndExtract(tx string) (txhex string, err error)
VerifyTapscriptPartialSigs(
tx string, mustIncludeSignerSig bool,
) (valid bool, ptx *psbt.Packet, err error)
VerifyAndCombinePartialTx(dest string, src string) (string, error)
CountSignedTaprootInputs(tx string) (int, error)
}
type ValidForfeitTx ¶
type VtxoWithValue ¶
type WalletService ¶
type WalletService interface {
BlockchainScanner
GetReadyUpdate(ctx context.Context) (<-chan struct{}, error)
GenSeed(ctx context.Context) (string, error)
Create(ctx context.Context, seed, password string) error
Restore(ctx context.Context, seed, password string) error
Unlock(ctx context.Context, password string) error
Lock(ctx context.Context) error
Status(ctx context.Context) (WalletStatus, error)
GetNetwork(ctx context.Context) (*arklib.Network, error)
GetForfeitPubkey(ctx context.Context) (*btcec.PublicKey, error)
DeriveConnectorAddress(ctx context.Context) (string, error)
DeriveAddresses(ctx context.Context, num int) ([]string, error)
SignTransaction(ctx context.Context, partialTx string, extractRawTx bool) (string, error)
SignTransactionTapscript(
ctx context.Context, partialTx string, inputIndexes []int,
) (string, error)
SelectUtxos(
ctx context.Context, asset string, amount uint64, confirmedOnly bool,
) ([]TxInput, uint64, error)
BroadcastTransaction(ctx context.Context, txs ...string) (string, error)
EstimateFees(ctx context.Context, psbt string) (uint64, error)
FeeRate(ctx context.Context) (uint64, error)
ListConnectorUtxos(ctx context.Context, connectorAddress string) ([]TxInput, error)
MainAccountBalance(ctx context.Context) (uint64, uint64, error)
ConnectorsAccountBalance(ctx context.Context) (uint64, uint64, error)
LockConnectorUtxos(ctx context.Context, utxos []domain.Outpoint) error
GetDustAmount(ctx context.Context) (uint64, error)
GetTransaction(ctx context.Context, txid string) (string, error)
GetOutpointStatus(ctx context.Context, outpoint domain.Outpoint) (spent bool, err error)
GetCurrentBlockTime(ctx context.Context) (*BlockTimestamp, error)
Withdraw(ctx context.Context, address string, amount uint64, all bool) (string, error)
LoadSignerKey(ctx context.Context, prvkey string) error
Close()
}
type WalletStatus ¶
Click to show internal directories.
Click to hide internal directories.