Versions in this module Expand all Collapse all v1 v1.0.1 Dec 6, 2022 Changes in this version + const DefaultBlockRange + const DefaultGasLimit + const DefaultGasPrice + const Plain + const X25519DeoxysII + const ZeroAddress + var ErrCallFailed = errors.New("call failed in module") + var ErrCallResultDecode = errors.New("could not decode call result") + var Networks = map[uint64]NetworkParams + func GetRuntimePublicKey(chainID uint64) (*[32]byte, error) + func PackCall(msg ethereum.CallMsg, cipher Cipher) (*ethereum.CallMsg, error) + func PackSignedCall(msg ethereum.CallMsg, cipher Cipher, sign SignerFn, chainID big.Int, ...) (*ethereum.CallMsg, error) + func PackTx(tx types.Transaction, cipher Cipher) (*types.Transaction, error) + type Body struct + Data []byte + Nonce []byte + PK []byte + type CallResult struct + Fail *Failure + OK []byte + Unknown *Unknown + type Cipher interface + Decrypt func(nonce []byte, ciphertext []byte) (plaintext []byte, err error) + DecryptCallResult func(result []byte) ([]byte, error) + DecryptEncoded func(result []byte) ([]byte, error) + Encrypt func(plaintext []byte) (ciphertext []byte, nonce []byte) + EncryptEncode func(plaintext []byte) []byte + Kind func() uint64 + func NewCipher(chainID uint64) (Cipher, error) + type Curve25519KeyPair struct + PublicKey [curve25519.PointSize]byte + SecretKey [curve25519.ScalarSize]byte + func NewCurve25519KeyPair() (*Curve25519KeyPair, error) + type Data struct + Body []byte + type DataEnvelope struct + Body []byte + Format uint64 + type EncryptedBodyEnvelope struct + Body Body + Format uint64 + type Error struct + Code int + Data interface{} + Message string + type Failure struct + Code uint64 + Message string + Module string + type Inner struct + Fail *Failure + OK []byte + type Kind uint64 + type Leash struct + BlockHash []byte + BlockNumber uint64 + BlockRange uint64 + Nonce uint64 + func NewLeash(nonce uint64, blockNumber uint64, blockHash []byte, blockRange uint64) Leash + type NetworkParams struct + ChainID big.Int + DefaultGateway string + Name string + RuntimeID string + type PlainCipher struct + func NewPlainCipher() PlainCipher + func (c PlainCipher) Decrypt(nonce []byte, ciphertext []byte) (plaintext []byte, err error) + func (c PlainCipher) DecryptCallResult(response []byte) ([]byte, error) + func (c PlainCipher) DecryptEncoded(response []byte) ([]byte, error) + func (c PlainCipher) Encrypt(plaintext []byte) (ciphertext []byte, nonce []byte) + func (c PlainCipher) EncryptEncode(plaintext []byte) []byte + func (c PlainCipher) EncryptEnvelope(plaintext []byte) *DataEnvelope + func (c PlainCipher) Kind() uint64 + type Request struct + ID int + Method string + Params interface{} + Version string + type Response struct + Error *Error + ID int + Result json.RawMessage + type SignedCallDataPack struct + Data Data + Leash Leash + Signature []byte + func NewDataPack(sign SignerFn, chainID uint64, caller, callee []byte, gasLimit uint64, ...) (*SignedCallDataPack, error) + func (p SignedCallDataPack) Encode() []byte + func (p SignedCallDataPack) EncryptEncode(cipher Cipher) []byte + type SignerFn = func(digest [32]byte) ([]byte, error) + type Unknown struct + Data []byte + Nonce []byte + type WrappedBackend struct + func NewWrappedBackend(backend bind.ContractBackend, chainID big.Int, cipher Cipher, sign SignerFn) WrappedBackend + func WrapClient(c ethclient.Client, sign SignerFn) (*WrappedBackend, error) + func (b WrappedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + func (b WrappedBackend) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) + func (b WrappedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) + func (b WrappedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) + func (b WrappedBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + func (b WrappedBackend) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + func (b WrappedBackend) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + func (b WrappedBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error + func (b WrappedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + func (b WrappedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) + func (b WrappedBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error) + func (b WrappedBackend) Transactor(from common.Address) *bind.TransactOpts + type X25519DeoxysIICipher struct + func NewX25519DeoxysIICipher(keypair Curve25519KeyPair, peerPublicKey [curve25519.PointSize]byte) (*X25519DeoxysIICipher, error) + func (c X25519DeoxysIICipher) Decrypt(nonce []byte, ciphertext []byte) ([]byte, error) + func (c X25519DeoxysIICipher) DecryptCallResult(response []byte) ([]byte, error) + func (c X25519DeoxysIICipher) DecryptEncoded(response []byte) ([]byte, error) + func (c X25519DeoxysIICipher) Encrypt(plaintext []byte) (ciphertext []byte, nonce []byte) + func (c X25519DeoxysIICipher) EncryptEncode(plaintext []byte) []byte + func (c X25519DeoxysIICipher) EncryptEnvelope(plaintext []byte) *EncryptedBodyEnvelope + func (c X25519DeoxysIICipher) Kind() uint64