Documentation ¶
Index ¶
- Constants
- Variables
- func ChecksumAddress(address string) string
- func HexToAddress(hexAddress string) common.Address
- type ContractExecutionTxOpts
- type GasTransferTxOpts
- type Provider
- func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Address) (map[string]common.Address, error)
- func (p *Provider) SignContractExecutionTx(privateKey *ecdsa.PrivateKey, txData ContractExecutionTxOpts) (*types.Transaction, error)
- func (p *Provider) SignGasTransferTx(privateKey *ecdsa.PrivateKey, txData GasTransferTxOpts) (*types.Transaction, error)
- type ProviderOpts
Constants ¶
View Source
const ( CeloContractMainnet = "0x471EcE3750Da237f93B8E339c536989b8978a438" CeloContractTestnet = "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9" CUSDContractMainnet = "0x765DE816845861e75A25fCA122bb6898B8B1282a" CUSDContractTestnet = "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1" MinGasContractMainnet = "0xDfca3a8d7699D8bAfe656823AD60C17cb8270ECC" MinGasContractTestnet = "0xd0Bf87a5936ee17014a057143a494Dc5C5d51E5e" )
View Source
const ( MainnetChainId int64 = 42220 TestnetChainId int64 = 44787 )
View Source
const ( AccountIndex = "AccountIndex" CustodialProxy = "CustodialRegistrationProxy" GasFaucet = "GasFaucet" TrainingVoucher = "TrainingVoucher" TokenIndex = "TokenIndex" )
View Source
const ( ErrInsufficientGas = "w3: call failed: insufficient funds for gas * price + value + gatewayFee" ErrGasPriceLow = "w3: call failed: gasprice is less than gas price minimum floor" ErrNonceLow = "w3: call failed: nonce too low" )
Common error strings returned by v1 of celo-blockchain nodes.
Variables ¶
View Source
var ( // SafeGasLimit is set to 350k gas units. SafeGasLimit = 350000 // SafeGasFeeCap is set to 2x the current MinBaseFee of 5 gwei. SafeGasFeeCap = big.NewInt(10000000000) // SafeGasTipCap is set to 5 wei. SafeGasTipCap = big.NewInt(5) )
Functions ¶
func ChecksumAddress ¶ added in v1.1.1
ChecksumAddress converts a mixed case hex address string to a checksumed one.
func HexToAddress ¶ added in v1.1.0
HexToAddress is similar to common.HexToAddress but converts to a checksumed address first. It is necessary to perform an address validation first before using HexToAddress e.g. with go-playground/validator.
Types ¶
type ContractExecutionTxOpts ¶
type GasTransferTxOpts ¶
type Provider ¶
func NewProvider ¶
func NewProvider(o ProviderOpts) (*Provider, error)
func (*Provider) RegistryMap ¶ added in v1.2.0
func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Address) (map[string]common.Address, error)
RegistryMap auto-loads all well known custodial related smart contract addresses through the CICRegistry pointer contract.
func (*Provider) SignContractExecutionTx ¶
func (p *Provider) SignContractExecutionTx(privateKey *ecdsa.PrivateKey, txData ContractExecutionTxOpts) (*types.Transaction, error)
func (*Provider) SignGasTransferTx ¶
func (p *Provider) SignGasTransferTx(privateKey *ecdsa.PrivateKey, txData GasTransferTxOpts) (*types.Transaction, error)
type ProviderOpts ¶
Click to show internal directories.
Click to hide internal directories.