Documentation ¶
Index ¶
- Variables
- type BlockProcessor
- type Builder
- type Predicate
- type Proof
- type PubKey
- type SendOpts
- type TxHash
- type UnitID
- type Wallet
- func (w *Wallet) GetMaxBlockNumber(ctx context.Context) (uint64, error)
- func (w *Wallet) SendTransaction(ctx context.Context, tx *txsystem.Transaction, opts *SendOpts) error
- func (w *Wallet) Shutdown()
- func (w *Wallet) Sync(ctx context.Context, lastBlockNumber uint64) error
- func (w *Wallet) SyncToMaxBlockNumber(ctx context.Context, lastBlockNumber uint64) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockProcessor ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) SetABClientConf ¶
func (b *Builder) SetABClientConf(abcConf client.AlphabillClientConfig) *Builder
func (*Builder) SetBlockProcessor ¶
func (b *Builder) SetBlockProcessor(bp BlockProcessor) *Builder
type Proof ¶ added in v0.1.4
type Proof struct { BlockNumber uint64 `json:"blockNumber,string"` Tx *txsystem.Transaction `json:"tx"` Proof *block.BlockProof `json:"proof"` }
type SendOpts ¶ added in v0.1.1
type SendOpts struct { // RetryOnFullTxBuffer retries to send transaction when tx buffer is full RetryOnFullTxBuffer bool }
type Wallet ¶
type Wallet struct { BlockProcessor BlockProcessor AlphabillClient client.ABClient // contains filtered or unexported fields }
Wallet To synchronize wallet with a node call Sync. Shutdown needs to be called to release resources used by wallet.
func (*Wallet) GetMaxBlockNumber ¶
GetMaxBlockNumber queries the node for latest block number
func (*Wallet) SendTransaction ¶
func (w *Wallet) SendTransaction(ctx context.Context, tx *txsystem.Transaction, opts *SendOpts) error
SendTransaction broadcasts transaction to configured node. Returns nil if transaction was successfully accepted by node, otherwise returns error.
func (*Wallet) Shutdown ¶
func (w *Wallet) Shutdown()
Shutdown terminates connection to alphabill node and cancels any background goroutines.
func (*Wallet) Sync ¶
Sync synchronises wallet from the last known block number with the given alphabill node. The function blocks forever or until alphabill connection is terminated. Returns error if wallet is already synchronizing or any error occured during syncrohronization, otherwise returns nil.
func (*Wallet) SyncToMaxBlockNumber ¶
SyncToMaxBlockNumber synchronises wallet from the last known block number with the given alphabill node. The function blocks until maximum block height, calculated at the start of the process, is reached. Returns error if wallet is already synchronizing or any error occured during syncrohronization, otherwise returns nil.
Directories ¶
Path | Synopsis |
---|---|
backend
|
|
Package log implements a logger interface that is used for logging inside Alphabill Wallet SDK.
|
Package log implements a logger interface that is used for logging inside Alphabill Wallet SDK. |
backend
package twb implements token wallet backend
|
package twb implements token wallet backend |