Documentation ¶
Index ¶
- type EncryptedIdentity
- type LazyScryptIdentity
- type Openapi
- type PasswordEncryptScryptIdentity
- type Store
- func (s *Store) DeleteWalletByIndex(index int)
- func (s *Store) GetWalletByIndex(index int) (*Wallet, error)
- func (s *Store) GetWallets() []*Wallet
- func (s *Store) IsExistWalletByAlias(alias string) bool
- func (s *Store) IsExistWalletByIndex(index int) bool
- func (s *Store) ListWallets() error
- func (s *Store) NewWalletByIdentity(identity string, index int, config *nkn.WalletConfig) (*Wallet, error)
- func (s *Store) NewWalletByPassword(index int, config *nkn.WalletConfig) (*Wallet, error)
- func (s *Store) NewWalletByRecipient(recipient string, index int, config *nkn.WalletConfig) (*Wallet, error)
- func (s *Store) NewWalletByRecipientFile(file string, index int, config *nkn.WalletConfig) (*Wallet, error)
- func (s *Store) ParseIdentity(identity string) ([]age.Recipient, error)
- func (s *Store) ParseRecipient(recipient string) ([]age.Recipient, error)
- func (s *Store) ParseRecipientFile(file string) ([]age.Recipient, error)
- func (s *Store) PromptPassword(create bool) (string, error)
- func (s *Store) RestoreFromSeedByIdentity(seed []byte, identity string) (*Wallet, error)
- func (s *Store) RestoreFromSeedByPassword(seed []byte) (*Wallet, error)
- func (s *Store) SaveWallet(wallet *Wallet) error
- func (s *Store) SetAlias(wallet *Wallet, alias string) error
- func (s *Store) SetName(index int, alias string)
- func (s *Store) SetPassword(wallet *Wallet) error
- type Wallet
- func (w *Wallet) Account() *nkn.Account
- func (w *Wallet) Address() string
- func (w *Wallet) Balance() (*nkn.Amount, error)
- func (w *Wallet) BalanceByAddress(address string) (*nkn.Amount, error)
- func (w *Wallet) BalanceByAddressContext(ctx context.Context, address string) (*nkn.Amount, error)
- func (w *Wallet) BalanceContext(ctx context.Context) (*nkn.Amount, error)
- func (w *Wallet) DeleteName(name string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) DeleteNameContext(ctx context.Context, name string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) GetHeight() (int32, error)
- func (w *Wallet) GetHeightContext(ctx context.Context) (int32, error)
- func (w *Wallet) GetNonce(txPool bool) (int64, error)
- func (w *Wallet) GetNonceByAddress(address string, txPool bool) (int64, error)
- func (w *Wallet) GetNonceByAddressContext(ctx context.Context, address string, txPool bool) (int64, error)
- func (w *Wallet) GetNonceContext(ctx context.Context, txPool bool) (int64, error)
- func (w *Wallet) GetRegistrant(name string) (*nkn.Registrant, error)
- func (w *Wallet) GetRegistrantContext(ctx context.Context, name string) (*nkn.Registrant, error)
- func (w *Wallet) GetSubscribers(topic string, offset, limit int, meta, txPool bool, ...) (*nkn.Subscribers, error)
- func (w *Wallet) GetSubscribersContext(ctx context.Context, topic string, offset, limit int, meta, txPool bool, ...) (*nkn.Subscribers, error)
- func (w *Wallet) GetSubscribersCount(topic string, subscriberHashPrefix []byte) (int, error)
- func (w *Wallet) GetSubscribersCountContext(ctx context.Context, topic string, subscriberHashPrefix []byte) (int, error)
- func (w *Wallet) GetSubscription(topic string, subscriber string) (*nkn.Subscription, error)
- func (w *Wallet) GetSubscriptionContext(ctx context.Context, topic string, subscriber string) (*nkn.Subscription, error)
- func (w *Wallet) NewNanoPay(recipientAddress, fee string, duration int) (*nkn.NanoPay, error)
- func (w *Wallet) NewNanoPayClaimer(recipientAddress string, claimIntervalMs, lingerMs int32, ...) (*nkn.NanoPayClaimer, error)
- func (w *Wallet) OpenAPI() *Openapi
- func (w *Wallet) ProgramHash() common.Uint160
- func (w *Wallet) PubKey() []byte
- func (w *Wallet) RegisterName(name string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) RegisterNameContext(ctx context.Context, name string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) Seed() []byte
- func (w *Wallet) SendRawTransaction(txn *transaction.Transaction) (string, error)
- func (w *Wallet) SendRawTransactionContext(ctx context.Context, txn *transaction.Transaction) (string, error)
- func (w *Wallet) ShowSeed() string
- func (w *Wallet) SignTransaction(tx *transaction.Transaction) error
- func (w *Wallet) Subscribe(identifier, topic string, duration int, meta string, ...) (string, error)
- func (w *Wallet) SubscribeContext(ctx context.Context, identifier, topic string, duration int, meta string, ...) (string, error)
- func (w *Wallet) Transfer(address, amount string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) TransferContext(ctx context.Context, address, amount string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) TransferName(name string, recipientPubKey []byte, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) TransferNameContext(ctx context.Context, name string, recipientPubKey []byte, ...) (string, error)
- func (w *Wallet) Unsubscribe(identifier, topic string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) UnsubscribeContext(ctx context.Context, identifier, topic string, config *nkn.TransactionConfig) (string, error)
- func (w *Wallet) VerifyPassword(password []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedIdentity ¶
type EncryptedIdentity struct { Contents []byte Passphrase func() (string, error) NoMatchWarning func() // contains filtered or unexported fields }
func (*EncryptedIdentity) Recipients ¶
func (i *EncryptedIdentity) Recipients() ([]age.Recipient, error)
type LazyScryptIdentity ¶
LazyScryptIdentity is an age.Identity that requests a passphrase only if it encounters an scrypt stanza. After obtaining a passphrase, it delegates to ScryptIdentity.
type Openapi ¶
type Openapi struct {
// contains filtered or unexported fields
}
func (*Openapi) GetTransactions ¶
func (o *Openapi) GetTransactions() (*client.ResponseGetAddressTransaction, error)
type PasswordEncryptScryptIdentity ¶
type PasswordEncryptScryptIdentity struct {
// contains filtered or unexported fields
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteWalletByIndex ¶
func (*Store) GetWallets ¶
func (*Store) IsExistWalletByAlias ¶
func (*Store) IsExistWalletByIndex ¶
func (*Store) ListWallets ¶
func (*Store) NewWalletByIdentity ¶
func (*Store) NewWalletByPassword ¶
func (*Store) NewWalletByRecipient ¶
func (*Store) NewWalletByRecipientFile ¶
func (*Store) ParseIdentity ¶
func (*Store) ParseRecipient ¶
func (*Store) ParseRecipientFile ¶
func (*Store) RestoreFromSeedByIdentity ¶
func (*Store) RestoreFromSeedByPassword ¶
func (*Store) SaveWallet ¶
func (*Store) SetPassword ¶
type Wallet ¶
type Wallet struct { ID int `json:"id"` Type string `json:"type"` NKNAddress string `json:"address"` Armor string `json:"armor"` Alias string `json:"alias,omitempty"` // contains filtered or unexported fields }
func (*Wallet) Account ¶
func (w *Wallet) Account() *nkn.Account
Account returns the account of the wallet.
func (*Wallet) BalanceByAddress ¶
BalanceByAddress wraps BalanceByAddressContext with background context.
func (*Wallet) BalanceByAddressContext ¶
BalanceByAddressContext is the same as package level GetBalanceContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) BalanceContext ¶
BalanceContext is the same as package level GetBalanceContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) DeleteName ¶
DeleteName wraps DeleteNameContext with background context.
func (*Wallet) DeleteNameContext ¶
func (w *Wallet) DeleteNameContext(ctx context.Context, name string, config *nkn.TransactionConfig) (string, error)
DeleteNameContext is a shortcut for DeleteNameContext using this wallet as SignerRPCClient.
func (*Wallet) GetHeightContext ¶
GetHeightContext is the same as package level GetHeightContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) GetNonceByAddress ¶
GetNonceByAddress wraps GetNonceByAddressContext with background context.
func (*Wallet) GetNonceByAddressContext ¶
func (w *Wallet) GetNonceByAddressContext(ctx context.Context, address string, txPool bool) (int64, error)
GetNonceByAddressContext is the same as package level GetNonceContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) GetNonceContext ¶
GetNonceContext is the same as package level GetNonceContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) GetRegistrant ¶
GetRegistrant wraps GetRegistrantContext with background context.
func (*Wallet) GetRegistrantContext ¶
GetRegistrantContext is the same as package level GetRegistrantContext, but this wallet's SeedRPCServerAddr.
func (*Wallet) GetSubscribers ¶
func (w *Wallet) GetSubscribers(topic string, offset, limit int, meta, txPool bool, subscriberHashPrefix []byte) (*nkn.Subscribers, error)
GetSubscribers wraps GetSubscribersContext with background context.
func (*Wallet) GetSubscribersContext ¶
func (w *Wallet) GetSubscribersContext(ctx context.Context, topic string, offset, limit int, meta, txPool bool, subscriberHashPrefix []byte) (*nkn.Subscribers, error)
GetSubscribersContext is the same as package level GetSubscribersContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) GetSubscribersCount ¶
GetSubscribersCount wraps GetSubscribersCountContext with background context.
func (*Wallet) GetSubscribersCountContext ¶
func (w *Wallet) GetSubscribersCountContext(ctx context.Context, topic string, subscriberHashPrefix []byte) (int, error)
GetSubscribersCountContext is the same as package level GetSubscribersCountContext, but this wallet's SeedRPCServerAddr.
func (*Wallet) GetSubscription ¶
GetSubscription wraps GetSubscriptionContext with background context.
func (*Wallet) GetSubscriptionContext ¶
func (w *Wallet) GetSubscriptionContext(ctx context.Context, topic string, subscriber string) (*nkn.Subscription, error)
GetSubscriptionContext is the same as package level GetSubscriptionContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) NewNanoPay ¶
NewNanoPay is a shortcut for NewNanoPay using this wallet as sender.
Duration is changed to signed int for gomobile compatibility.
func (*Wallet) NewNanoPayClaimer ¶
func (w *Wallet) NewNanoPayClaimer(recipientAddress string, claimIntervalMs, lingerMs int32, minFlushAmount string, onError *nkn.OnError) (*nkn.NanoPayClaimer, error)
NewNanoPayClaimer is a shortcut for NewNanoPayClaimer using this wallet as RPC client.
func (*Wallet) ProgramHash ¶
ProgramHash returns the program hash of this wallet's account.
func (*Wallet) RegisterName ¶
RegisterName wraps RegisterNameContext with background context.
func (*Wallet) RegisterNameContext ¶
func (w *Wallet) RegisterNameContext(ctx context.Context, name string, config *nkn.TransactionConfig) (string, error)
RegisterNameContext is a shortcut for RegisterNameContext using this wallet as SignerRPCClient.
func (*Wallet) Seed ¶
Seed returns the secret seed of the wallet. Secret seed can be used to create client/wallet with the same key pair and should be kept secret and safe.
func (*Wallet) SendRawTransaction ¶
func (w *Wallet) SendRawTransaction(txn *transaction.Transaction) (string, error)
SendRawTransaction wraps SendRawTransactionContext with background context.
func (*Wallet) SendRawTransactionContext ¶
func (w *Wallet) SendRawTransactionContext(ctx context.Context, txn *transaction.Transaction) (string, error)
SendRawTransactionContext is the same as package level SendRawTransactionContext, but using this wallet's SeedRPCServerAddr.
func (*Wallet) SignTransaction ¶
func (w *Wallet) SignTransaction(tx *transaction.Transaction) error
SignTransaction signs an unsigned transaction using this wallet's key pair.
func (*Wallet) Subscribe ¶
func (w *Wallet) Subscribe(identifier, topic string, duration int, meta string, config *nkn.TransactionConfig) (string, error)
Subscribe wraps SubscribeContext with background context.
func (*Wallet) SubscribeContext ¶
func (w *Wallet) SubscribeContext(ctx context.Context, identifier, topic string, duration int, meta string, config *nkn.TransactionConfig) (string, error)
SubscribeContext is a shortcut for SubscribeContext using this wallet as SignerRPCClient.
Duration is changed to signed int for gomobile compatibility.
func (*Wallet) TransferContext ¶
func (w *Wallet) TransferContext(ctx context.Context, address, amount string, config *nkn.TransactionConfig) (string, error)
TransferContext is a shortcut for TransferContext using this wallet as SignerRPCClient.
func (*Wallet) TransferName ¶
func (w *Wallet) TransferName(name string, recipientPubKey []byte, config *nkn.TransactionConfig) (string, error)
TransferName wraps TransferNameContext with background context.
func (*Wallet) TransferNameContext ¶
func (w *Wallet) TransferNameContext(ctx context.Context, name string, recipientPubKey []byte, config *nkn.TransactionConfig) (string, error)
TransferNameContext is a shortcut for TransferNameContext using this wallet as SignerRPCClient.
func (*Wallet) Unsubscribe ¶
func (w *Wallet) Unsubscribe(identifier, topic string, config *nkn.TransactionConfig) (string, error)
Unsubscribe wraps UnsubscribeContext with background context.
func (*Wallet) UnsubscribeContext ¶
func (w *Wallet) UnsubscribeContext(ctx context.Context, identifier, topic string, config *nkn.TransactionConfig) (string, error)
UnsubscribeContext is a shortcut for UnsubscribeContext using this wallet as SignerRPCClient.
func (*Wallet) VerifyPassword ¶
VerifyPassword returns nil if provided password is the correct password of account