Documentation ¶
Index ¶
- func CheckValueEnough(value *big.Int, gasPrice *big.Int, gasLimit uint64, ether *big.Int) bool
- func GetKey(path, auth string) (*crypto.Key, error)
- func NewKey() (key *crypto.Key)
- func NewKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *crypto.Key
- func StoreKey(keyfilepath string, key *crypto.Key, auth string) (path string, err error)
- type Asset
- type Wallet
- func (w *Wallet) AllPartyIDs() party.IDSlice
- func (w *Wallet) AllPartyNicks() []string
- func (w *Wallet) Balance() uint64
- func (w *Wallet) BalanceForDisplay(assetID string) string
- func (ew *Wallet) ConstructEtherscanUrl(networkName, txid string) string
- func (ew *Wallet) CreateNormalTransaction(to *common.Address, value *big.Int, data []byte, gasPrice *big.Int, ...) (*types.Transaction, error)
- func (ew *Wallet) FetchBalance() error
- func (w *Wallet) FormatAmount(asset Asset, amt uint64) string
- func (w *Wallet) FormatTxURL(txID string) string
- func (w *Wallet) GetAsset(assetID string) Asset
- func (ew *Wallet) GetBalance() (*big.Int, error)
- func (w *Wallet) GetCommonAddress() common.Address
- func (w *Wallet) GetFormattedAddress() string
- func (ew *Wallet) GetGasLimit(tx *types.TransactionRequest) (uint64, error)
- func (ew *Wallet) GetGasPrice() (*big.Int, error)
- func (w *Wallet) GetName() string
- func (ew *Wallet) GetNonce(param types.BlockParam) (uint64, error)
- func (w *Wallet) GetUnwrappedKeyData() mpsconfig.Config
- func (w *Wallet) Initialize(keydata []byte)
- func (w *Wallet) IsFetching() bool
- func (w *Wallet) MpcSigToEthSig(hashedmsg []byte, mpcsig *mpsecdsa.Signature) ([]byte, error)
- func (w *Wallet) OtherPartyIDs() party.IDSlice
- func (w *Wallet) PublicKeyEth() stdecdsa.PublicKey
- func (w *Wallet) PublicKeyMpsPoint() curve.Point
- func (ew *Wallet) PublishTx(rawTx string) (txid string, err error)
- func (ew *Wallet) SendRawTransaction(raw string) (string, error)
- func (w *Wallet) SetName(name string)
- func (ew *Wallet) ToCommonAddress(address string) common.Address
- func (w *Wallet) UnmarshalJSON(data []byte) error
- func (w *Wallet) VerifyHash(hashedmsg []byte, mpssig *mpsecdsa.Signature) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckValueEnough ¶
func NewKeyFromECDSA ¶
func NewKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *crypto.Key
Types ¶
type Wallet ¶
type Wallet struct { Name string Threshold int Me user.User Others []user.User KeyData []byte // Public address computed from the MPC config and stored here so it shows up in the persisted JSON for reference Address string // Config params for a blockchain Config constants.ChainConfig CreatedAt time.Time Key *ethcrypto.Key // contains filtered or unexported fields }
func NewEmptyWallet ¶
func NewEmptyWallet(network string, name string, threshold int, me user.User, others []user.User) *Wallet
NewWallet returns a new Goerli Wallet
func (*Wallet) AllPartyIDs ¶
All signers as partyIDs (required by the MSP library)
func (*Wallet) AllPartyNicks ¶
All signers as an array of string nicknames
func (*Wallet) BalanceForDisplay ¶
func (*Wallet) ConstructEtherscanUrl ¶
func (*Wallet) CreateNormalTransaction ¶
func (*Wallet) FetchBalance ¶
Run in a Go routine, as well as called directly
func (*Wallet) FormatTxURL ¶
func (*Wallet) GetCommonAddress ¶
func (*Wallet) GetFormattedAddress ¶
func (*Wallet) GetGasLimit ¶
func (ew *Wallet) GetGasLimit(tx *types.TransactionRequest) (uint64, error)
func (*Wallet) GetUnwrappedKeyData ¶
Unmarshal the MPC config which contains the key data
func (*Wallet) Initialize ¶
func (*Wallet) IsFetching ¶
func (*Wallet) MpcSigToEthSig ¶
Convert the signature generated by the MPC protocol into an eth recoverable signature
func (*Wallet) OtherPartyIDs ¶
All signers excluding me
func (*Wallet) PublicKeyEth ¶
From the MPC key data, convert to an eth public key
func (*Wallet) PublicKeyMpsPoint ¶
func (*Wallet) SendRawTransaction ¶
func (*Wallet) UnmarshalJSON ¶
Do the funky chicken to unmarshal then init the struct TODO is this really best way init an unmarshaled struct?
Click to show internal directories.
Click to hide internal directories.