Documentation ¶
Index ¶
- Constants
- Variables
- func ChecksumAddress(address string) string
- func HexToAddress(hexAddress string) common.Address
- func PrepareContractBytecodeData(contractBin string, contractABIJSON string, constructorArgs []any) ([]byte, error)
- type BatchIterator
- type ContractExecutionTxOpts
- type ContractPublishTxOpts
- type GERegistry
- type GESmartContracts
- type GasTransferTxOpts
- type Option
- type Provider
- func (p *Provider) GetGESmartContracts(ctx context.Context, registries []string) (GESmartContracts, error)
- func (p *Provider) NewBatchIterator(ctx context.Context, index common.Address) (*BatchIterator, error)
- func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Address) (GERegistry, error)
- func (p *Provider) SignContractExecutionTx(privateKey *ecdsa.PrivateKey, txData ContractExecutionTxOpts) (*types.Transaction, error)
- func (p *Provider) SignContractPublishTx(privateKey *ecdsa.PrivateKey, txData ContractPublishTxOpts) (*types.Transaction, error)
- func (p *Provider) SignGasTransferTx(privateKey *ecdsa.PrivateKey, txData GasTransferTxOpts) (*types.Transaction, error)
- func (p *Provider) SimulateRevertedTx(ctx context.Context, txHash common.Hash, blockNumber *big.Int) (string, error)
- func (p *Provider) TokensBalance(ctx context.Context, owner common.Address, tokenAddresses []common.Address) (TokenBalances, error)
- type TokenBalances
Constants ¶
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" CeloContractMainnet = "0x471EcE3750Da237f93B8E339c536989b8978a438" CeloContractTestnet = "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9" CUSDContractMainnet = "0x765DE816845861e75A25fCA122bb6898B8B1282a" CUSDContractTestnet = "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1" MinGasContractMainnet = "0xDfca3a8d7699D8bAfe656823AD60C17cb8270ECC" MinGasContractTestnet = "0xd0Bf87a5936ee17014a057143a494Dc5C5d51E5e" )
Common error strings returned by v1 of celo-blockchain nodes.
View Source
const ( EthereumMainnet int64 = 1 EthereumSepolia int64 = 11155111 OPMainnet int64 = 10 OPSepolia int64 = 11155420 CeloMainnet int64 = 42220 CeloAlfajores int64 = 44787 CeloBaklava int64 = 62320 )
View Source
const ( AccountIndex = "AccountIndex" CustodialProxy = "CustodialRegistrationProxy" GasFaucet = "GasFaucet" TrainingVoucher = "TrainingVoucher" TokenIndex = "TokenIndex" PoolIndex = "PoolIndex" )
View Source
const (
BalanceScannerContractAddress = "0xF62107c53a5b18646E823a21ed531ED934B1CE9E"
)
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 ¶
ChecksumAddress converts a mixed case hex address string to a checksumed one.
func HexToAddress ¶
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 BatchIterator ¶ added in v1.2.0
type BatchIterator struct {
// contains filtered or unexported fields
}
type ContractExecutionTxOpts ¶
type ContractPublishTxOpts ¶
type GERegistry ¶
type GESmartContracts ¶
type GasTransferTxOpts ¶
type Provider ¶
func (*Provider) GetGESmartContracts ¶
func (*Provider) NewBatchIterator ¶ added in v1.2.0
func (*Provider) RegistryMap ¶
func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Address) (GERegistry, 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) SignContractPublishTx ¶
func (p *Provider) SignContractPublishTx(privateKey *ecdsa.PrivateKey, txData ContractPublishTxOpts) (*types.Transaction, error)
func (*Provider) SignGasTransferTx ¶
func (p *Provider) SignGasTransferTx(privateKey *ecdsa.PrivateKey, txData GasTransferTxOpts) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.