external

package
v1.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalBackend

type ExternalBackend struct {
	// contains filtered or unexported fields
}

func NewExternalBackend

func NewExternalBackend(endpoint string) (*ExternalBackend, error)

func (*ExternalBackend) Subscribe

func (eb *ExternalBackend) Subscribe(sink chan<- accounts.WalletEvent) event.Subscription

func (*ExternalBackend) Wallets

func (eb *ExternalBackend) Wallets() []accounts.Wallet

type ExternalSigner

type ExternalSigner struct {
	// contains filtered or unexported fields
}

ExternalSigner provides an API to interact with an external signer (clef) It proxies request to the external signer while forwarding relevant request headers

func NewExternalSigner

func NewExternalSigner(endpoint string) (*ExternalSigner, error)

func (*ExternalSigner) Accounts

func (api *ExternalSigner) Accounts() []accounts.Account

func (*ExternalSigner) Close

func (api *ExternalSigner) Close() error

func (*ExternalSigner) Contains

func (api *ExternalSigner) Contains(account accounts.Account) bool

func (*ExternalSigner) Derive

func (api *ExternalSigner) Derive(path accounts.DerivationPath, pin bool) (accounts.Account, error)

func (*ExternalSigner) Open

func (api *ExternalSigner) Open(passphrase string) error

func (*ExternalSigner) SelfDerive

func (api *ExternalSigner) SelfDerive(bases []accounts.DerivationPath, chain client.ChainStateReader)

func (*ExternalSigner) SignData

func (api *ExternalSigner) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error)

SignData signs keccak256(data). The mimetype parameter describes the type of data being signed

func (*ExternalSigner) SignDataWithPassphrase

func (api *ExternalSigner) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error)

func (*ExternalSigner) SignText

func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]byte, error)

func (*ExternalSigner) SignTextWithPassphrase

func (api *ExternalSigner) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error)

func (*ExternalSigner) SignTx

func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

SignTx sends the transaction to the external signer. If chainID is nil, or tx.ChainID is zero, the chain ID will be assigned by the external signer. For non-legacy transactions, the chain ID of the transaction overrides the chainID parameter.

func (*ExternalSigner) SignTxWithPassphrase

func (api *ExternalSigner) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

func (*ExternalSigner) Status

func (api *ExternalSigner) Status() (string, error)

func (*ExternalSigner) URL

func (api *ExternalSigner) URL() accounts.URL

type SendTxArgs

type SendTxArgs struct {
	From                 common.MixedcaseAddress  `json:"from"`
	To                   *common.MixedcaseAddress `json:"to"`
	Gas                  hexutil.Uint64           `json:"gas"`
	GasPrice             *hexutil.Big             `json:"gasPrice"`
	MaxFeePerGas         *hexutil.Big             `json:"maxFeePerGas"`
	MaxPriorityFeePerGas *hexutil.Big             `json:"maxPriorityFeePerGas"`
	Value                hexutil.Big              `json:"value"`
	Nonce                hexutil.Uint64           `json:"nonce"`

	// We accept "data" and "input" for backwards-compatibility reasons.
	// "input" is the newer name and should be preferred by clients.
	// Issue detail: https://github.com/simplechain-org/client/issues/15628
	Data  *hexutil.Bytes `json:"data"`
	Input *hexutil.Bytes `json:"input,omitempty"`

	// For non-legacy transactions
	AccessList *types.AccessList `json:"accessList,omitempty"`
	ChainID    *hexutil.Big      `json:"chainId,omitempty"`
}

SendTxArgs represents the arguments to submit a transaction This struct is identical to ethapi.TransactionArgs, except for the usage of common.MixedcaseAddress in From and To

func (SendTxArgs) String

func (args SendTxArgs) String() string

func (*SendTxArgs) ToTransaction

func (args *SendTxArgs) ToTransaction() *types.Transaction

ToTransaction converts the arguments to a transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL