Documentation
¶
Overview ¶
* This package contains intermediary events that are used only by the covenantless version * they let to sign the vtxo tree using musig2 algorithm * they are not included in domain because they don't mutate the Round state and should not be persisted
Index ¶
- type AdminService
- type ArkProviderBalance
- type Balance
- type Batch
- type ChainTx
- type ChainWithExpiry
- type CommitmentTxLeavesResp
- type CommitmentTxResp
- type ConnectorResp
- type ForfeitTxsResp
- type GetVtxosResp
- type IndexerService
- type NextMarketHour
- type Node
- type Outpoint
- type Page
- type PageResp
- type RedeemTransactionEvent
- type RoundDetails
- type RoundSigningNoncesGenerated
- type RoundSigningStarted
- type RoundTransactionEvent
- type ScheduledSweep
- type Service
- type ServiceInfo
- type SweepableOutput
- type SweptCommitmentTxResp
- type TransactionEvent
- type TransactionEventType
- type TxHistoryRecord
- type TxHistoryResp
- type TxRequestInfo
- type TxType
- type VOut
- type VirtualTxsResp
- type VtxoChainResp
- type VtxoTreeLeavesResp
- type VtxoTreeResp
- type WalletStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminService ¶
type AdminService interface {
Wallet() ports.WalletService
GetScheduledSweeps(ctx context.Context) ([]ScheduledSweep, error)
GetRoundDetails(ctx context.Context, roundId string) (*RoundDetails, error)
GetRounds(ctx context.Context, after int64, before int64) ([]string, error)
GetWalletAddress(ctx context.Context) (string, error)
GetWalletStatus(ctx context.Context) (*WalletStatus, error)
CreateNotes(ctx context.Context, amount uint32, quantity int) ([]string, error)
}
func NewAdminService ¶
func NewAdminService(walletSvc ports.WalletService, repoManager ports.RepoManager, txBuilder ports.TxBuilder, timeUnit ports.TimeUnit) AdminService
type ArkProviderBalance ¶
type ChainWithExpiry ¶
type CommitmentTxLeavesResp ¶
type CommitmentTxResp ¶
type ConnectorResp ¶
type ForfeitTxsResp ¶
type GetVtxosResp ¶
type IndexerService ¶
type IndexerService interface {
GetCommitmentTxInfo(ctx context.Context, txid string) (*CommitmentTxResp, error)
GetCommitmentTxLeaves(ctx context.Context, txid string, page *Page) (*CommitmentTxLeavesResp, error)
GetVtxoTree(ctx context.Context, batchOutpoint Outpoint, page *Page) (*VtxoTreeResp, error)
GetVtxoTreeLeaves(ctx context.Context, batchOutpoint Outpoint, page *Page) (*VtxoTreeLeavesResp, error)
GetForfeitTxs(ctx context.Context, txid string, page *Page) (*ForfeitTxsResp, error)
GetConnectors(ctx context.Context, txid string, page *Page) (*ConnectorResp, error)
GetVtxos(ctx context.Context, pubkeys []string, spendableOnly, spendOnly bool, page *Page) (*GetVtxosResp, error)
GetVtxosByOutpoint(ctx context.Context, outpoints []Outpoint, page *Page) (*GetVtxosResp, error)
GetTransactionHistory(ctx context.Context, pubkey string, start, end int64, page *Page) (*TxHistoryResp, error)
GetVtxoChain(ctx context.Context, vtxoKey Outpoint, page *Page) (*VtxoChainResp, error)
GetVirtualTxs(ctx context.Context, txids []string, page *Page) (*VirtualTxsResp, error)
GetSweptCommitmentTx(ctx context.Context, txid string) (*SweptCommitmentTxResp, error)
}
func NewIndexerService ¶
func NewIndexerService( pubkey *secp256k1.PublicKey, repoManager ports.RepoManager, ) IndexerService
type NextMarketHour ¶
type RedeemTransactionEvent ¶
type RedeemTransactionEvent struct {
RedeemTxid string
SpentVtxos []domain.Vtxo
SpendableVtxos []domain.Vtxo
TxHex string
}
func (RedeemTransactionEvent) GetSpendableVtxos ¶
func (r RedeemTransactionEvent) GetSpendableVtxos() []domain.Vtxo
func (RedeemTransactionEvent) GetSpentVtxos ¶
func (r RedeemTransactionEvent) GetSpentVtxos() []domain.Vtxo
func (RedeemTransactionEvent) GetTxId ¶
func (r RedeemTransactionEvent) GetTxId() string
func (RedeemTransactionEvent) Type ¶
func (a RedeemTransactionEvent) Type() TransactionEventType
type RoundDetails ¶
type RoundSigningNoncesGenerated ¶
type RoundSigningNoncesGenerated struct {
Id string
Nonces tree.TreeNonces // aggregated nonces
}
signer should react to this event by partially signing the vtxo tree transactions then, delete its ephemeral key
func (RoundSigningNoncesGenerated) IsEvent ¶
func (r RoundSigningNoncesGenerated) IsEvent()
func (RoundSigningNoncesGenerated) SerializeNonces ¶
func (e RoundSigningNoncesGenerated) SerializeNonces() (string, error)
type RoundSigningStarted ¶
type RoundSigningStarted struct {
Id string
UnsignedVtxoTree tree.TxTree
UnsignedRoundTx string
CosignersPubkeys []string
}
signer should react to this event by generating a musig2 nonce for each transaction in the tree
func (RoundSigningStarted) IsEvent ¶
func (r RoundSigningStarted) IsEvent()
implement domain.RoundEvent interface
type RoundTransactionEvent ¶
type RoundTransactionEvent struct {
RoundTxid string
SpentVtxos []domain.Vtxo
SpendableVtxos []domain.Vtxo
ClaimedBoardingInputs []domain.VtxoKey
TxHex string
}
func (RoundTransactionEvent) GetSpendableVtxos ¶
func (r RoundTransactionEvent) GetSpendableVtxos() []domain.Vtxo
func (RoundTransactionEvent) GetSpentVtxos ¶
func (r RoundTransactionEvent) GetSpentVtxos() []domain.Vtxo
func (RoundTransactionEvent) GetTxId ¶
func (r RoundTransactionEvent) GetTxId() string
func (RoundTransactionEvent) Type ¶
func (r RoundTransactionEvent) Type() TransactionEventType
type ScheduledSweep ¶
type ScheduledSweep struct {
RoundId string
SweepableOutputs []SweepableOutput
}
type Service ¶
type Service interface {
Start() error
Stop()
SpendNotes(ctx context.Context, notes []note.Note) (string, error)
RegisterIntent(ctx context.Context, bip322signature bip322.Signature, message tree.IntentMessage) (string, error)
SpendVtxos(ctx context.Context, inputs []ports.Input) (string, error)
ClaimVtxos(ctx context.Context, creds string, receivers []domain.Receiver, musig2Data *tree.Musig2) error
SignVtxos(ctx context.Context, forfeitTxs []string) error
SignRoundTx(ctx context.Context, roundTx string) error
GetRoundByTxid(ctx context.Context, roundTxid string) (*domain.Round, error)
GetRoundById(ctx context.Context, id string) (*domain.Round, error)
GetCurrentRound(ctx context.Context) (*domain.Round, error)
GetEventsChannel(ctx context.Context) <-chan domain.RoundEvent
UpdateTxRequestStatus(ctx context.Context, requestID string) error
ListVtxos(
ctx context.Context, address string,
) (spendableVtxos, spentVtxos []domain.Vtxo, err error)
GetInfo(ctx context.Context) (*ServiceInfo, error)
SubmitRedeemTx(ctx context.Context, redeemTx string) (signedRedeemTx, redeemTxid string, err error)
GetBoardingAddress(
ctx context.Context, userPubkey *secp256k1.PublicKey,
) (address string, scripts []string, err error)
// Tree signing methods
RegisterCosignerNonces(
ctx context.Context, roundID string,
pubkey *secp256k1.PublicKey, nonces string,
) error
RegisterCosignerSignatures(
ctx context.Context, roundID string,
pubkey *secp256k1.PublicKey, signatures string,
) error
GetTransactionEventsChannel(ctx context.Context) <-chan TransactionEvent
GetMarketHourConfig(ctx context.Context) (*domain.MarketHour, error)
UpdateMarketHourConfig(ctx context.Context, marketHourStartTime, marketHourEndTime time.Time, period, roundInterval time.Duration) error
GetTxRequestQueue(ctx context.Context, requestIds ...string) ([]TxRequestInfo, error)
DeleteTxRequests(ctx context.Context, requestIds ...string) error
// TODO remove this in v7
GetIndexerTxChannel(ctx context.Context) <-chan TransactionEvent
}
func NewService ¶
func NewService( network common.Network, roundInterval int64, vtxoTreeExpiry, unilateralExitDelay, boardingExitDelay common.RelativeLocktime, walletSvc ports.WalletService, repoManager ports.RepoManager, builder ports.TxBuilder, scanner ports.BlockchainScanner, scheduler ports.SchedulerService, noteUriPrefix string, marketHourStartTime, marketHourEndTime time.Time, marketHourPeriod, marketHourRoundInterval time.Duration, allowZeroFees bool, roundMaxParticipantsCount int64, utxoMaxAmount int64, utxoMinAmount int64, vtxoMaxAmount int64, vtxoMinAmount int64, ) (Service, error)
type ServiceInfo ¶
type SweepableOutput ¶
type SweptCommitmentTxResp ¶
type SweptCommitmentTxResp struct {
SweptBy []string
}
type TransactionEvent ¶
type TransactionEventType ¶
type TransactionEventType string
const ( RoundTransaction TransactionEventType = "round_tx" RedeemTransaction TransactionEventType = "redeem_tx" )
type TxHistoryRecord ¶
type TxHistoryResp ¶
type TxHistoryResp struct {
Records []TxHistoryRecord
Page PageResp
}
type TxRequestInfo ¶
type VirtualTxsResp ¶
type VtxoChainResp ¶
type VtxoChainResp struct {
Chain []ChainWithExpiry
Page PageResp
Depth int32
RootCommitmentTxid string
}
type VtxoTreeLeavesResp ¶
type VtxoTreeResp ¶
type WalletStatus ¶
Click to show internal directories.
Click to hide internal directories.