Documentation ¶
Index ¶
- Constants
- type Account
- type Balance
- type BlockInfo
- type BuildData
- type CustomPeriod
- type Deposit
- type FragmenterReply
- type Market
- type MarketCollectedFees
- type MarketFee
- type MarketInfo
- type MarketPrice
- type MarketReport
- type MarketStrategy
- type MarketVolume
- type Notification
- type Page
- type PredefinedPeriod
- type PriceFeed
- type PriceFeedInfo
- type PriceFeeder
- type PubSubStore
- type RepoManager
- type SecurePubSub
- type Subscription
- type SwapAccept
- type SwapComplete
- type SwapFail
- type SwapRequest
- type TimeRange
- type Trade
- type TradeFeeInfo
- type TradePreview
- type TradeStatus
- type TradeType
- type Transaction
- type TxInput
- type TxOutput
- type UnblindedInput
- type Utxo
- type UtxoKey
- type UtxoStatus
- type Wallet
- type WalletAccount
- type WalletInfo
- type WalletService
- type WalletStatus
- type WalletTxEventType
- type WalletTxNotification
- type WalletUtxoEventType
- type WalletUtxoNotification
- type Webhook
- type WebhookEvent
- type WebhookInfo
- type Withdrawal
Constants ¶
View Source
const AnyTopic = "*"
View Source
const UnspecifiedTopic = ""
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v1.0.0
type Account interface { CreateAccount( ctx context.Context, accountName string, isMarket bool, ) (WalletAccount, error) DeriveAddresses( ctx context.Context, accountName string, num int, ) ([]string, error) DeriveChangeAddresses( ctx context.Context, accountName string, num int, ) ([]string, error) ListAddresses(ctx context.Context, accountName string) ([]string, error) GetBalance( ctx context.Context, accountName string, ) (map[string]Balance, error) ListUtxos( ctx context.Context, accountName string, ) ([]Utxo, []Utxo, error) DeleteAccount(ctx context.Context, accountName string) error }
type CustomPeriod ¶ added in v1.0.0
type FragmenterReply ¶ added in v1.0.0
type MarketCollectedFees ¶ added in v1.0.0
type MarketCollectedFees interface { GetBaseAmount() uint64 GetQuoteAmount() uint64 GetTradeFeeInfo() []TradeFeeInfo GetStartDate() string GetEndDate() string }
type MarketInfo ¶ added in v1.0.0
type MarketPrice ¶ added in v1.0.0
type MarketReport ¶ added in v1.0.0
type MarketReport interface { GetMarket() Market GetCollectedFees() MarketCollectedFees GetTotalVolume() MarketVolume GetVolumesPerFrame() []MarketVolume }
type MarketStrategy ¶ added in v1.0.0
type MarketVolume ¶ added in v1.0.0
type Notification ¶ added in v1.0.0
type Notification interface { GetTxNotifications() chan WalletTxNotification GetUtxoNotifications() chan WalletUtxoNotification }
type PredefinedPeriod ¶ added in v1.0.0
type PriceFeed ¶ added in v1.0.0
type PriceFeed interface { GetMarket() Market GetPrice() MarketPrice }
type PriceFeedInfo ¶ added in v1.0.0
type PriceFeeder ¶ added in v1.0.0
type PriceFeeder interface { // AddPriceFeed adds a new price feed for the target market. AddPriceFeed( ctx context.Context, market Market, source, ticker string, ) (string, error) // StartFeed starts forwarding price feeds from the given source to the // target market. StartPriceFeed(ctx context.Context, id string) (chan PriceFeed, error) // StopFeed stops updating the target price feed. StopPriceFeed(ctx context.Context, id string) error // UpdatePriceFeed updates an existing price feed. UpdatePriceFeed(ctx context.Context, id, source, ticker string) error // RemovePriceFeed removes an existing price feed. RemovePriceFeed(ctx context.Context, id string) error // GetPriceFeed returns info about the target price feed. GetPriceFeed(ctx context.Context, id string) (PriceFeedInfo, error) // ListPriceFeeds returns the list of price feeds. ListPriceFeeds(ctx context.Context) ([]PriceFeedInfo, error) // ListSources returns the list of supported price sources. ListSources(ctx context.Context) []string Close() }
type PubSubStore ¶ added in v0.4.0
type PubSubStore interface { // Init initialize the store with an optional encryption password. Init(password string) error // IsLocked returns whether the store is locked. IsLocked() bool // Lock locks the store. Lock() // UnlockStore unlocks the internal store. Unlock(password string) error // ChangePassword allows to change the encryption password. ChangePassword(oldPwd, newPwd string) error // Close should be used to gracefully close the connection with the store. Close() error }
PubSubStore defines the methods to manage the internal store of a SecurePubSub service.
type RepoManager ¶ added in v0.3.1
type RepoManager interface { MarketRepository() domain.MarketRepository TradeRepository() domain.TradeRepository DepositRepository() domain.DepositRepository WithdrawalRepository() domain.WithdrawalRepository Close() }
RepoManager interface defines the methods for swap, price and unspent.
type SecurePubSub ¶ added in v0.4.0
type SecurePubSub interface { // Store returns the internal store. Store() PubSubStore // Subscribe adds a new subscription for the requested topic. Subscribe(topic, endpoint, secret string) (string, error) // SubscribeWithID adds a subscription for the requested topic by using the // given id instead of assinging a new one. SubscribeWithID(id, topic, endpoint, secret string) (string, error) // Unsubscribe removes some client defined by its id for a topic. Unsubscribe(topic, id string) error // ListSubscriptionsForTopic returns the info of all clients subscribed for // a certain topic. ListSubscriptionsForTopic(topic string) []Subscription // Publish publishes a message for a certain topic. All clients subscribed // for such topic will receive the message. Publish(topic string, message string) error }
SecurePubSub defines the methods of a pubsub service and its internal store. This service might need to store some data in memory or on the disk, for this reason along with the typical methods of a pubsub service, allows to manage an internal optionally encrypted storage.
type Subscription ¶ added in v0.4.0
type SwapAccept ¶ added in v1.0.0
type SwapAccept interface { GetId() string GetRequestId() string GetTransaction() string GetUnblindedInputs() []UnblindedInput }
type SwapComplete ¶ added in v1.0.0
type SwapRequest ¶ added in v1.0.0
type TimeRange ¶ added in v1.0.0
type TimeRange interface { GetPredefinedPeriod() PredefinedPeriod GetCustomPeriod() CustomPeriod }
type Trade ¶ added in v1.0.0
type Trade interface { GetId() string GetType() TradeType GetStatus() TradeStatus GetSwapInfo() SwapRequest GetSwapFailInfo() SwapFail GetRequestTimestamp() int64 GetAcceptTimestamp() int64 GetCompleteTimestamp() int64 GetSettleTimestamp() int64 GetExpiryTimestamp() int64 GetMarket() Market GetMarketPercentageFee() MarketFee GetMarketFixedFee() MarketFee GetMarketPrice() MarketPrice GetTxid() string GetTxHex() string GetFeeAsset() string GetFeeAmount() uint64 }
type TradeFeeInfo ¶ added in v1.0.0
type TradePreview ¶ added in v1.0.0
type TradeStatus ¶ added in v1.0.0
type Transaction ¶
type Transaction interface { GetTransaction(ctx context.Context, txid string) (string, error) EstimateFees( ctx context.Context, ins []TxInput, outs []TxOutput, msatsPerByte uint64, ) (uint64, error) SelectUtxos( ctx context.Context, accountName, asset string, amount uint64, ) ([]Utxo, uint64, int64, error) CreatePset( ctx context.Context, ins []TxInput, outs []TxOutput, ) (string, error) UpdatePset( ctx context.Context, pset string, ins []TxInput, outs []TxOutput, ) (string, error) BlindPset( ctx context.Context, pset string, extraUnblindedIns []UnblindedInput, ) (string, error) SignPset( ctx context.Context, pset string, extractRawTx bool, ) (string, error) Transfer( ctx context.Context, accountName string, outs []TxOutput, msatsPerByte uint64, ) (string, error) BroadcastTransaction(ctx context.Context, txHex string) (string, error) }
type UnblindedInput ¶ added in v1.0.0
type Utxo ¶ added in v1.0.0
type Utxo interface { UtxoKey GetAsset() string GetValue() uint64 GetScript() string GetAssetBlinder() string GetValueBlinder() string GetConfirmedStatus() UtxoStatus GetSpentStatus() UtxoStatus GetRedeemScript() string }
type UtxoStatus ¶ added in v1.0.0
type Wallet ¶ added in v1.0.0
type Wallet interface { GenSeed(ctx context.Context) ([]string, error) InitWallet(ctx context.Context, mnemonic []string, password string) error RestoreWallet(ctx context.Context, mnemonic []string, password string) error Unlock(ctx context.Context, password string) error Lock(ctx context.Context, password string) error ChangePassword(ctx context.Context, oldPwd, newPwd string) error Status(ctx context.Context) (WalletStatus, error) Info(ctx context.Context) (WalletInfo, error) Auth(ctx context.Context, password string) (bool, error) }
type WalletAccount ¶ added in v1.0.0
type WalletInfo ¶ added in v1.0.0
type WalletService ¶ added in v1.0.0
type WalletService interface { Wallet() Wallet Account() Account Transaction() Transaction Notification() Notification Close() }
type WalletStatus ¶ added in v1.0.0
type WalletTxEventType ¶ added in v1.0.0
type WalletTxNotification ¶ added in v1.0.0
type WalletTxNotification interface { GetEventType() WalletTxEventType GetAccountNames() []string GetTxHex() string GetBlockDetails() BlockInfo }
type WalletUtxoEventType ¶ added in v1.0.0
type WalletUtxoNotification ¶ added in v1.0.0
type WalletUtxoNotification interface { GetEventType() WalletUtxoEventType GetUtxos() []Utxo }
type Webhook ¶ added in v1.0.0
type Webhook interface { GetId() string GetEvent() WebhookEvent GetEndpoint() string GetSecret() string }
type WebhookEvent ¶ added in v1.0.0
type WebhookInfo ¶ added in v1.0.0
type WebhookInfo interface { GetId() string GetEvent() WebhookEvent GetEndpoint() string IsSecured() bool }
Click to show internal directories.
Click to hide internal directories.