alby

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const ALBY_ACCOUNT_APP_NAME = "getalby.com"

Variables

This section is empty.

Functions

func NewAlbyOAuthService

func NewAlbyOAuthService(db *gorm.DB, cfg config.Config, keys keys.Keys, eventPublisher events.EventPublisher) *albyOAuthService

Types

type AlbyBalance

type AlbyBalance struct {
	Balance  int64  `json:"balance"`
	Unit     string `json:"unit"`
	Currency string `json:"currency"`
}

type AlbyBalanceResponse

type AlbyBalanceResponse struct {
	Sats int64 `json:"sats"`
}

type AlbyInfo added in v1.8.0

type AlbyInfo struct {
	Hub              AlbyInfoHub        `json:"hub"`
	Status           string             `json:"status"`
	Healthy          bool               `json:"healthy"`
	AccountAvailable bool               `json:"accountAvailable"` // false if country is blocked (can still use Alby Hub without an Alby Account)
	Incidents        []AlbyInfoIncident `json:"incidents"`
}

type AlbyInfoHub added in v1.8.0

type AlbyInfoHub struct {
	LatestVersion      string `json:"latestVersion"`
	LatestReleaseNotes string `json:"latestReleaseNotes"`
}

type AlbyInfoIncident added in v1.13.0

type AlbyInfoIncident struct {
	Name    string `json:"name"`
	Started string `json:"started"`
	Status  string `json:"status"`
	Impact  string `json:"impact"`
	Url     string `json:"url"`
}

type AlbyLinkAccountRequest added in v1.1.0

type AlbyLinkAccountRequest struct {
	Budget  uint64 `json:"budget"`
	Renewal string `json:"renewal"`
}

type AlbyMe

type AlbyMe struct {
	Identifier       string             `json:"identifier"`
	NPub             string             `json:"nostr_pubkey"`
	LightningAddress string             `json:"lightning_address"`
	Email            string             `json:"email"`
	Name             string             `json:"name"`
	Avatar           string             `json:"avatar"`
	KeysendPubkey    string             `json:"keysend_pubkey"`
	SharedNode       bool               `json:"shared_node"`
	Hub              AlbyMeHub          `json:"hub"`
	Subscription     AlbyMeSubscription `json:"subscription"`
}

type AlbyMeHub added in v1.1.0

type AlbyMeHub struct {
	Name string `json:"name"`
}

type AlbyMeSubscription added in v1.11.0

type AlbyMeSubscription struct {
	// PlanCode string `json:"plan_code"`
	Buzz bool `json:"buzz"`
}

type AlbyOAuthService

type AlbyOAuthService interface {
	events.EventSubscriber
	GetInfo(ctx context.Context) (*AlbyInfo, error)
	GetChannelPeerSuggestions(ctx context.Context) ([]ChannelPeerSuggestion, error)
	GetBitcoinRate(ctx context.Context) (*BitcoinRate, error)
	GetAuthUrl() string
	GetUserIdentifier() (string, error)
	GetLightningAddress() (string, error)
	IsConnected(ctx context.Context) bool
	LinkAccount(ctx context.Context, lnClient lnclient.LNClient, budget uint64, renewal string) error
	CallbackHandler(ctx context.Context, code string, lnClient lnclient.LNClient) error
	GetBalance(ctx context.Context) (*AlbyBalance, error)
	GetMe(ctx context.Context) (*AlbyMe, error)
	SendPayment(ctx context.Context, invoice string) error
	DrainSharedWallet(ctx context.Context, lnClient lnclient.LNClient) error
	UnlinkAccount(ctx context.Context) error
	RequestAutoChannel(ctx context.Context, lnClient lnclient.LNClient, isPublic bool) (*AutoChannelResponse, error)
	GetVssAuthToken(ctx context.Context, nodeIdentifier string) (string, error)
	RemoveOAuthAccessToken() error
}

type AlbyPayRequest

type AlbyPayRequest struct {
	Invoice string `json:"invoice"`
}

type AutoChannelRequest added in v1.3.0

type AutoChannelRequest struct {
	IsPublic bool `json:"isPublic"`
}

type AutoChannelResponse added in v1.3.0

type AutoChannelResponse struct {
	Invoice     string `json:"invoice"`
	ChannelSize uint64 `json:"channelSize"`
	Fee         uint64 `json:"fee"`
}

type BitcoinRate added in v1.14.0

type BitcoinRate struct {
	Code      string  `json:"code"`
	Symbol    string  `json:"symbol"`
	Rate      string  `json:"rate"`
	RateFloat float64 `json:"rate_float"`
	RateCents int64   `json:"rate_cents"`
}

type ChannelPeerSuggestion

type ChannelPeerSuggestion struct {
	Network               string `json:"network"`
	PaymentMethod         string `json:"paymentMethod"`
	Pubkey                string `json:"pubkey"`
	Host                  string `json:"host"`
	MinimumChannelSize    uint64 `json:"minimumChannelSize"`
	MaximumChannelSize    uint64 `json:"maximumChannelSize"`
	Name                  string `json:"name"`
	Image                 string `json:"image"`
	BrokenLspUrl          string `json:"lsp_url"`
	BrokenLspType         string `json:"lsp_type"`
	LspUrl                string `json:"lspUrl"`
	LspType               string `json:"lspType"`
	Note                  string `json:"note"`
	PublicChannelsAllowed bool   `json:"publicChannelsAllowed"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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