Documentation ¶
Index ¶
- Constants
- func ChecksumToSarafuAddress(address string) (string, error)
- func SarafuAddressToChecksum(address string) string
- type ERC20TokenMetadata
- type Provider
- func (p *Provider) BuildGasTransferTx(privateKey *ecdsa.PrivateKey, txData TransactionData, value *big.Int) (*types.Transaction, error)
- func (p *Provider) BuildKitabuTx(privateKey *ecdsa.PrivateKey, txData TransactionData) (*types.Transaction, error)
- func (p *Provider) Close() error
- func (p *Provider) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address) (ERC20TokenMetadata, error)
- func (p *Provider) NetworkNonce(ctx context.Context, address common.Address) (uint64, error)
- func (p *Provider) TokensBalance(ctx context.Context, ownerAddress common.Address, ...) ([]*big.Int, error)
- type TransactionData
Constants ¶
const (
KitabuChainId = 6060
)
KitabuChainId represents the mainnet chain ID and Network ID.
Variables ¶
This section is empty.
Functions ¶
func ChecksumToSarafuAddress ¶
ChecksumToSarafuAddress returns a lowercased 40 len hex address representation compatible with cic-stack database schemas
0x02b0DF387A3A68AA3134668752dd82bE70B7dE1C -> 02b0df387a3a68aa3134668752dd82be70b7de1c
func SarafuAddressToChecksum ¶
SarafuAddressToChecksum returns a checksumed address from a lowercased sarafu address representations ready to be used with w3.A()
02b0df387a3a68aa3134668752dd82be70b7de1c -> 0x02b0DF387A3A68AA3134668752dd82bE70B7dE1C
Types ¶
type ERC20TokenMetadata ¶
type ERC20TokenMetadata struct { Name string Symbol string Decimals big.Int TotalSupply big.Int Owner common.Address DemurrageToken bool SinkAddress common.Address DemurrageAmount big.Int DemurrageTimestamp big.Int PeriodStart big.Int PeriodDuration big.Int TaxLevel big.Int }
ERC20TokenMetadata represents a tokens's metadata
type Provider ¶
Provider returns an RPC client and a legacy signer compatible with the Kitabu Chain.
func NewProvider ¶
NewProvider returns a new RPC provider given an RPC endpoint.
func (*Provider) BuildGasTransferTx ¶ added in v0.2.0
func (p *Provider) BuildGasTransferTx(privateKey *ecdsa.PrivateKey, txData TransactionData, value *big.Int) (*types.Transaction, error)
BuildGasTransferTx returns a signed transaction compatible with Kitabu chain, it is specific to gas transfers
func (*Provider) BuildKitabuTx ¶
func (p *Provider) BuildKitabuTx(privateKey *ecdsa.PrivateKey, txData TransactionData) (*types.Transaction, error)
BuildKitabuTx returns a signed transaction compatible with Kitabu chain, it is specific to contrtact execution
func (*Provider) ERC20TokenInfo ¶
func (p *Provider) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address) (ERC20TokenMetadata, error)
ERC20TokenInfo returns all getter only token metadata that requires no args, also includes all demurrage token info if applicable
func (*Provider) NetworkNonce ¶
NetworkNonce returns the nonce for the given address