Documentation
¶
Index ¶
- Constants
- Variables
- func WithRecoverableVtxos(o interface{}) error
- func WithSignAll(o interface{}) error
- func WithoutWalletSigner(o interface{}) error
- type ArkClient
- type Balance
- type CoinSelectOptions
- type InitArgs
- type InitWithWalletArgs
- type LockedOnchainBalance
- type OffchainBalance
- type OnchainBalance
- type Option
- type Receiver
- type SettleOptions
- type VtxoDetails
Constants ¶
View Source
const ( // transport GrpcClient = client.GrpcClient RestClient = client.RestClient // wallet SingleKeyWallet = wallet.SingleKeyWallet // store FileStore = types.FileStore InMemoryStore = types.InMemoryStore // explorer BitcoinExplorer = explorer.BitcoinExplorer )
Variables ¶
View Source
var ( ErrAlreadyInitialized = fmt.Errorf("client already initialized") ErrNotInitialized = fmt.Errorf("client not initialized") )
Functions ¶
func WithRecoverableVtxos ¶
func WithRecoverableVtxos(o interface{}) error
func WithSignAll ¶
func WithSignAll(o interface{}) error
WithSignAll sets the signing type to ALL instead of the default BRANCH
func WithoutWalletSigner ¶
func WithoutWalletSigner(o interface{}) error
WithoutWalletSigner disables the wallet signer
Types ¶
type ArkClient ¶
type ArkClient interface {
GetConfigData(ctx context.Context) (*types.Config, error)
Init(ctx context.Context, args InitArgs) error
InitWithWallet(ctx context.Context, args InitWithWalletArgs) error
IsLocked(ctx context.Context) bool
Unlock(ctx context.Context, password string) error
Lock(ctx context.Context) error
Balance(ctx context.Context, computeExpiryDetails bool) (*Balance, error)
Receive(ctx context.Context) (offchainAddr, boardingAddr string, err error)
SendOffChain(
ctx context.Context, withExpiryCoinselect bool, receivers []Receiver,
withZeroFees bool,
) (string, error)
Settle(ctx context.Context, opts ...Option) (string, error)
CollaborativeExit(
ctx context.Context, addr string, amount uint64, withExpiryCoinselect bool,
opts ...Option,
) (string, error)
StartUnilateralExit(ctx context.Context) error
CompleteUnilateralExit(ctx context.Context, to string) (string, error)
OnboardAgainAllExpiredBoardings(ctx context.Context) (string, error)
WithdrawFromAllExpiredBoardings(ctx context.Context, to string) (string, error)
ListVtxos(ctx context.Context) (spendable, spent []client.Vtxo, err error)
Dump(ctx context.Context) (seed string, err error)
GetTransactionHistory(ctx context.Context) ([]types.Transaction, error)
GetTransactionEventChannel(ctx context.Context) chan types.TransactionEvent
GetVtxoEventChannel(ctx context.Context) chan types.VtxoEvent
RedeemNotes(ctx context.Context, notes []string, opts ...Option) (string, error)
SignTransaction(ctx context.Context, tx string) (string, error)
NotifyIncomingFunds(ctx context.Context, address string) ([]types.Vtxo, error)
Reset(ctx context.Context)
Stop()
}
func LoadArkClientWithWallet ¶
type Balance ¶
type Balance struct {
OnchainBalance OnchainBalance `json:"onchain_balance"`
OffchainBalance OffchainBalance `json:"offchain_balance"`
}
type CoinSelectOptions ¶
type CoinSelectOptions struct {
// If true, coin selector will select coins closest to expiry first.
WithExpirySorting bool
// If specified, coin selector will select only coins in the list.
OutpointsFilter []client.Outpoint
// If true, coin selector will select recoverable (swept but unspent) vtxos first.
SelectRecoverableVtxos bool
}
type InitWithWalletArgs ¶
type LockedOnchainBalance ¶
type OffchainBalance ¶
type OffchainBalance struct {
Total uint64 `json:"total"`
NextExpiration string `json:"next_expiration,omitempty"`
Details []VtxoDetails `json:"details"`
}
type OnchainBalance ¶
type OnchainBalance struct {
SpendableAmount uint64 `json:"spendable_amount"`
LockedAmount []LockedOnchainBalance `json:"locked_amount,omitempty"`
}
type Option ¶
type Option func(options interface{}) error
func WithEventsCh ¶
func WithEventsCh(ch chan<- client.RoundEvent) Option
func WithExtraSigner ¶
func WithExtraSigner(signerSessions ...tree.SignerSession) Option
WithExtraSigner allows to use a set of custom signer for the vtxo tree signing process
type Receiver ¶
func NewBitcoinReceiver ¶
type SettleOptions ¶
type SettleOptions struct {
ExtraSignerSessions []tree.SignerSession
SigningType *tree.SigningType
WalletSignerDisabled bool
SelectRecoverableVtxos bool
EventsCh chan<- client.RoundEvent
}
SettleOptions is only available for covenantless clients it allows to customize the vtxo signing process
type VtxoDetails ¶
Click to show internal directories.
Click to hide internal directories.