Documentation ¶
Index ¶
- Constants
- Variables
- func Balance(ctx context.Context, client *ethclient.Client, addr string) (string, error)
- func BalanceNumber(client *ethclient.Client, addr string) (float64, error)
- func Sign(privatekey string, msg []byte) ([]byte, error)
- func ToPublic(priv string) (string, *ecdsa.PublicKey, error)
- func Verify(addr string, signature, dataHash []byte) (bool, error)
- type DiskKeyStore
- type KeyInfo
- type KeyStore
- type LocalWallet
- func (w *LocalWallet) CollateralSend(ctx context.Context, from, to string, amount string) (string, error)
- func (w *LocalWallet) CollateralWithdraw(ctx context.Context, address string, amount string, cpAccountAddress string, ...) (string, error)
- func (w *LocalWallet) CollateralWithdrawConfirm(ctx context.Context, address string, cpAccountAddress string, ...) (string, error)
- func (w *LocalWallet) CollateralWithdrawRequest(ctx context.Context, address string, amount string, cpAccountAddress string, ...) (string, error)
- func (w *LocalWallet) CollateralWithdrawView(ctx context.Context, cpAccountAddress string, withdrawType string) (models.WithdrawRequest, error)
- func (w *LocalWallet) CollateralWithdrawWithUbiZero(ctx context.Context, address string, amount string, cpAccountAddress string, ...) (string, error)
- func (w *LocalWallet) FindKey(addr string) (*KeyInfo, error)
- func (w *LocalWallet) SequencerDeposit(ctx context.Context, from string, amount string, cpAccountAddress string) (string, error)
- func (w *LocalWallet) SequencerWithdraw(ctx context.Context, address string, amount string, cpAccountAddress string) (string, error)
- func (w *LocalWallet) WalletCollateral(ctx context.Context, from string, amount string, cpAccountAddress string, ...) (string, error)
- func (w *LocalWallet) WalletDelete(ctx context.Context, addr string) error
- func (w *LocalWallet) WalletExport(ctx context.Context, addr string) (*KeyInfo, error)
- func (w *LocalWallet) WalletImport(ctx context.Context, ki *KeyInfo) (string, error)
- func (w *LocalWallet) WalletList(ctx context.Context, contractFlag bool) error
- func (w *LocalWallet) WalletNew(ctx context.Context) (string, error)
- func (w *LocalWallet) WalletSend(ctx context.Context, from, to string, amount string) (string, error)
- func (w *LocalWallet) WalletSign(ctx context.Context, addr string, msg []byte) (string, error)
- func (w *LocalWallet) WalletVerify(ctx context.Context, addr string, sigByte []byte, data string) (bool, error)
- type Signature
Constants ¶
View Source
const ( WalletRepo = "keystore" KNamePrefix = "wallet-" )
Variables ¶
View Source
var (
ErrKeyInfoNotFound = fmt.Errorf("key info not found")
)
Functions ¶
func BalanceNumber ¶ added in v0.6.2
func Sign ¶
Sign takes in signature type, private key and message. Returns a signature for that message.
Types ¶
type DiskKeyStore ¶
type DiskKeyStore struct {
// contains filtered or unexported fields
}
func OpenOrInitKeystore ¶
func OpenOrInitKeystore(p string) (*DiskKeyStore, error)
func (*DiskKeyStore) Close ¶ added in v0.4.7
func (dks *DiskKeyStore) Close() error
func (*DiskKeyStore) Delete ¶
func (dks *DiskKeyStore) Delete(key string) error
func (*DiskKeyStore) Get ¶
func (dks *DiskKeyStore) Get(name string) (KeyInfo, error)
Get gets a key out of keystore and returns KeyInfo coresponding to named key
func (*DiskKeyStore) List ¶
func (dks *DiskKeyStore) List() ([]string, error)
List lists all the keys stored in the KeyStore
type KeyInfo ¶
type KeyInfo struct {
PrivateKey string
}
KeyInfo is used for storing keys in KeyStore
type KeyStore ¶
type KeyStore interface { // List lists all the keys stored in the KeyStore List() ([]string, error) // Get gets a key out of keystore and returns KeyInfo corresponding to named key Get(string) (KeyInfo, error) // Put saves a key info under given name Put(string, KeyInfo) error // Delete removes a key from keystore Delete(string) error Close() error }
KeyStore is used for storing secret keys
type LocalWallet ¶
type LocalWallet struct {
*DiskKeyStore
}
func NewWallet ¶
func NewWallet(keystore *DiskKeyStore) *LocalWallet
func SetupWallet ¶
func SetupWallet(dir string) (*LocalWallet, error)
func (*LocalWallet) CollateralSend ¶ added in v0.5.0
func (*LocalWallet) CollateralWithdraw ¶
func (*LocalWallet) CollateralWithdrawConfirm ¶ added in v0.6.2
func (*LocalWallet) CollateralWithdrawRequest ¶ added in v0.6.2
func (*LocalWallet) CollateralWithdrawView ¶ added in v0.6.2
func (w *LocalWallet) CollateralWithdrawView(ctx context.Context, cpAccountAddress string, withdrawType string) (models.WithdrawRequest, error)
func (*LocalWallet) CollateralWithdrawWithUbiZero ¶ added in v1.0.0
func (*LocalWallet) SequencerDeposit ¶ added in v0.6.2
func (*LocalWallet) SequencerWithdraw ¶ added in v0.6.2
func (*LocalWallet) WalletCollateral ¶
func (*LocalWallet) WalletDelete ¶
func (w *LocalWallet) WalletDelete(ctx context.Context, addr string) error
func (*LocalWallet) WalletExport ¶
func (*LocalWallet) WalletImport ¶
func (*LocalWallet) WalletList ¶
func (w *LocalWallet) WalletList(ctx context.Context, contractFlag bool) error
func (*LocalWallet) WalletNew ¶
func (w *LocalWallet) WalletNew(ctx context.Context) (string, error)
func (*LocalWallet) WalletSend ¶
func (*LocalWallet) WalletSign ¶
func (*LocalWallet) WalletVerify ¶
Click to show internal directories.
Click to hide internal directories.