Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentSigner ¶
type PaymentSigner struct {
Key *ecdsa.PrivateKey
}
PaymentSigner is used to signed payment messages and holds the ecdsa private key we used
func NewPaymentSigner ¶
func NewPaymentSigner(cfg *config.TemporalConfig) (*PaymentSigner, error)
NewPaymentSigner is used to generate our helper struct for signing payments keyFilePath is the path to a key as generated by geth
func (*PaymentSigner) GenerateSignedPaymentMessagePrefixed ¶
func (ps *PaymentSigner) GenerateSignedPaymentMessagePrefixed(ethAddress common.Address, paymentMethod uint8, paymentNumber, chargeAmountInWei *big.Int) (*SignedMessage, error)
GenerateSignedPaymentMessagePrefixed generates a signed payment message. The format is slightly different and involves generating the hash to sign first, prefixing with `"\x19Ethereum Signed Message:\n32"
type SignedMessage ¶
type SignedMessage struct { H [32]byte `json:"h"` R [32]byte `json:"r"` S [32]byte `json:"s"` V uint8 `json:"v"` Address common.Address `json:"address"` PaymentMethod uint8 `json:"payment_method"` PaymentNumber *big.Int `json:"payment_number"` ChargeAmount *big.Int `json:"charge_amount"` Hash []byte `json:"hash"` Sig []byte `json:"sig"` }
SignedMessage is the response to a message signing request
Click to show internal directories.
Click to hide internal directories.