Documentation ¶
Overview ¶
Package wallet provides the necessary components to use Stellar accounts for Perun payment channels.
Index ¶
- Constants
- Variables
- func NewRandomAddress(rng *rand.Rand) wallet.Address
- type Account
- type EphemeralWallet
- func (e *EphemeralWallet) AddAccount(acc *Account) error
- func (e *EphemeralWallet) AddNewAccount(rng *rand.Rand) (*Account, *keypair.Full, error)
- func (e *EphemeralWallet) DecrementUsage(address wallet.Address)
- func (e *EphemeralWallet) IncrementUsage(address wallet.Address)
- func (e *EphemeralWallet) LockAll()
- func (e *EphemeralWallet) Unlock(a wallet.Address) (wallet.Account, error)
Constants ¶
View Source
const SignatureLength = 64
SignatureLength is the length of a signature in bytes.
Variables ¶
View Source
var Backend = backend{}
Functions ¶
Types ¶
type Account ¶
type Account struct { // ParticipantAddress references the ParticipantAddress of the Participant this account belongs to. ParticipantAddress keypair.FromAddress // contains filtered or unexported fields }
Account is used for signing channel state.
func NewRandomAccount ¶
NewRandomAccount creates a new account with a random private key. It also creates a random key pair, using its address as the account'privateKey Account.ParticipantAddress.
func NewRandomAccountWithAddress ¶
NewRandomAccountWithAddress creates a new account with a random private key and the given address as Account.ParticipantAddress.
func (Account) Participant ¶
func (a Account) Participant() *types.Participant
type EphemeralWallet ¶
type EphemeralWallet struct {
// contains filtered or unexported fields
}
func NewEphemeralWallet ¶
func NewEphemeralWallet() *EphemeralWallet
func (*EphemeralWallet) AddAccount ¶
func (e *EphemeralWallet) AddAccount(acc *Account) error
func (*EphemeralWallet) AddNewAccount ¶
func (*EphemeralWallet) DecrementUsage ¶
func (e *EphemeralWallet) DecrementUsage(address wallet.Address)
func (*EphemeralWallet) IncrementUsage ¶
func (e *EphemeralWallet) IncrementUsage(address wallet.Address)
func (*EphemeralWallet) LockAll ¶
func (e *EphemeralWallet) LockAll()
Click to show internal directories.
Click to hide internal directories.