Documentation
¶
Overview ¶
Package wallet provides multi-chain wallet implementation.
Index ¶
- Variables
- type TransferInput
- type TransferOutput
- type TransferTx
- type UTXO
- type Wallet
- func (w *Wallet) AddUTXO(utxo *UTXO)
- func (w *Wallet) CreateTransferTx(to ids.ShortID, assetID ids.ID, amount uint64, memo []byte) (*TransferTx, error)
- func (w *Wallet) GenerateKey() (ids.ShortID, error)
- func (w *Wallet) GetAddress() (ids.ShortID, error)
- func (w *Wallet) GetAllAddresses() []ids.ShortID
- func (w *Wallet) GetBLSKey() (*bls.SecretKey, error)
- func (w *Wallet) GetBalance(assetID ids.ID) uint64
- func (w *Wallet) GetUTXOs(assetID ids.ID, amount uint64) ([]*UTXO, uint64, error)
- func (w *Wallet) ImportKey(privateKey crypto.PrivateKey) (ids.ShortID, error)
- func (w *Wallet) RemoveUTXO(utxoID ids.ID)
- func (w *Wallet) SetBLSKey(key *bls.SecretKey)
- func (w *Wallet) Sign(ctx context.Context, tx chain.Transaction) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TransferInput ¶
TransferInput represents an input to a transfer transaction
type TransferOutput ¶
TransferOutput represents an output from a transfer transaction
type TransferTx ¶
type TransferTx struct {
NetworkID uint32
ChainID ids.ID
Inputs []TransferInput
Outputs []TransferOutput
Memo []byte
}
TransferTx represents a transfer transaction
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet manages keys and transactions for personal usage
func (*Wallet) CreateTransferTx ¶
func (w *Wallet) CreateTransferTx( to ids.ShortID, assetID ids.ID, amount uint64, memo []byte, ) (*TransferTx, error)
CreateTransferTx creates a transfer transaction
func (*Wallet) GenerateKey ¶
GenerateKey generates a new key and adds it to the wallet
func (*Wallet) GetAddress ¶
GetAddress returns a wallet address
func (*Wallet) GetAllAddresses ¶
GetAllAddresses returns all wallet addresses
func (*Wallet) GetBalance ¶
GetBalance returns the balance for a specific asset
func (*Wallet) RemoveUTXO ¶
RemoveUTXO removes a UTXO from the wallet
Directories
¶
| Path | Synopsis |
|---|---|
|
chain
|
|
|
c
Package c provides C-Chain wallet backend implementation.
|
Package c provides C-Chain wallet backend implementation. |
|
p
Package p provides P-Chain wallet backend implementation.
|
Package p provides P-Chain wallet backend implementation. |
|
p/builder
Package builder provides P-Chain transaction builder implementation.
|
Package builder provides P-Chain transaction builder implementation. |
|
p/signer
Package signer provides P-Chain transaction signing implementation.
|
Package signer provides P-Chain transaction signing implementation. |
|
p/wallet
Package wallet provides P-Chain wallet implementation.
|
Package wallet provides P-Chain wallet implementation. |
|
x
Package x provides X-Chain wallet backend implementation.
|
Package x provides X-Chain wallet backend implementation. |
|
x/builder
Package builder provides X-Chain transaction builder implementation.
|
Package builder provides X-Chain transaction builder implementation. |
|
x/signer
Package signer provides X-Chain transaction signing implementation.
|
Package signer provides X-Chain transaction signing implementation. |
|
Package crypto provides cryptographic interfaces for wallet signing.
|
Package crypto provides cryptographic interfaces for wallet signing. |
|
classic
Package classic provides classic cryptographic signing implementation.
|
Package classic provides classic cryptographic signing implementation. |
|
pqc
Package pqc provides post-quantum cryptography signing implementation.
|
Package pqc provides post-quantum cryptography signing implementation. |
|
Package primary provides primary network wallet operations.
|
Package primary provides primary network wallet operations. |
|
common
Package common provides common wallet utilities.
|
Package common provides common wallet utilities. |
|
common/utxotest
Package utxotest provides UTXO testing utilities.
|
Package utxotest provides UTXO testing utilities. |
Click to show internal directories.
Click to hide internal directories.