Documentation ¶
Overview ¶
Package ethapi implements the general Ethereum API functions.
Index ¶
- type AllCheckpointInfo
- type BLInfo
- type Backend
- type BlacklistAPI
- func (b *BlacklistAPI) BlacklistCollect(target common.Address, payer common.Address, password *string) (txhash common.Hash, err error)
- func (b *BlacklistAPI) BlacklistDrain(address common.Address, fee *hexutil.Big, payer common.Address, ...) (txhash common.Hash, err error)
- func (b *BlacklistAPI) BlacklistEnforce(address common.Address, fee *hexutil.Big, payer common.Address, ...) (txhash common.Hash, err error)
- func (b *BlacklistAPI) BlacklistInfo() (res []BLInfo, err error)
- func (b *BlacklistAPI) BlacklistRevoke(address common.Address, fee *hexutil.Big, payer common.Address, ...) (txhash common.Hash, err error)
- func (b *BlacklistAPI) CompensationInfo() (*BudgetInfo, error)
- func (b *BlacklistAPI) CompensationPropose(amount *hexutil.Big, ref_uuid string, period uint64, fee *hexutil.Big, ...) (txhash common.Hash, err error)
- type BudgetInfo
- type BudgetProposalInfo
- type CheckpointAdminAPI
- type CheckpointInfo
- type CheckpointRegistryAPI
- func (b *CheckpointRegistryAPI) CheckpointInfo() (res *AllCheckpointInfo, err error)
- func (b *CheckpointRegistryAPI) CheckpointPropose(number uint64, hash common.Hash, password *string) (txhash common.Hash, err error)
- func (b *CheckpointRegistryAPI) CheckpointRemove(number uint64, hash common.Hash, password *string) (txhash common.Hash, err error)
- func (b *CheckpointRegistryAPI) Checkpoints() ([]common.Address, error)
- type EphemeralAccount
- type EphemeralWallet
- func (ew *EphemeralWallet) Accounts() []accounts.Account
- func (ew *EphemeralWallet) Close() error
- func (ew *EphemeralWallet) Contains(account accounts.Account) bool
- func (ew *EphemeralWallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Account, error)
- func (ew *EphemeralWallet) IsUnlockedForStaking(account accounts.Account) bool
- func (ew *EphemeralWallet) Open(passphrase string) (err error)
- func (ew *EphemeralWallet) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader)
- func (ew *EphemeralWallet) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignHash(account accounts.Account, hash []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignHashWithPassphrase(account accounts.Account, passphrase string, hash []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignText(account accounts.Account, text []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error)
- func (ew *EphemeralWallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
- func (ew *EphemeralWallet) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, ...) (*types.Transaction, error)
- func (ew *EphemeralWallet) Status() (string, error)
- func (ew *EphemeralWallet) URL() accounts.URL
- type Gen2Coin
- type Gen2Key
- type Gen3Dest
- type GovernanceAPI
- func (g *GovernanceAPI) BudgetInfo() (*BudgetInfo, error)
- func (g *GovernanceAPI) BudgetPropose(amount *hexutil.Big, ref_uuid string, period uint64, fee *hexutil.Big, ...) (txhash common.Hash, err error)
- func (g *GovernanceAPI) UpgradeCollect(proxy common.Address, proposal common.Address, payer common.Address, ...) (txhash common.Hash, err error)
- func (g *GovernanceAPI) UpgradeInfo() *UpgradeProposals
- func (g *GovernanceAPI) UpgradePerform(proxy common.Address, proposal common.Address, payer common.Address, ...) (txhash common.Hash, err error)
- func (g *GovernanceAPI) UpgradePropose(proxy common.Address, new_impl common.Address, period uint64, fee *hexutil.Big, ...) (txhash common.Hash, err error)
- func (g *GovernanceAPI) VoteAccept(proposal common.Address, mn_owner common.Address, password *string) (txhash common.Hash, err error)
- func (g *GovernanceAPI) VoteReject(proposal common.Address, mn_owner common.Address, password *string) (txhash common.Hash, err error)
- func (g *GovernanceAPI) WithdrawFee(proposal common.Address, payer common.Address, password *string) (txhash common.Hash, err error)
- type HardforkInfo
- type HardforkRegistryAPI
- func (hf *HardforkRegistryAPI) HardforkEnumerate() (hardforks []*HardforkInfo, err error)
- func (hf *HardforkRegistryAPI) HardforkEnumerateActive() (hardforks []*HardforkInfo, err error)
- func (hf *HardforkRegistryAPI) HardforkEnumeratePending() (hardforks []*HardforkInfo, err error)
- func (hf *HardforkRegistryAPI) HardforkGet(name string) (info *HardforkInfo, err error)
- func (hf *HardforkRegistryAPI) HardforkIsActive(name string) (bool, error)
- type MNInfo
- type MasternodeAPI
- func (m *MasternodeAPI) Announce(owner common.Address, enode_url string, password *string) (txhash common.Hash, err error)
- func (m *MasternodeAPI) CollateralBalance(dst common.Address) (ret struct{ ... }, err error)
- func (m *MasternodeAPI) Denounce(owner common.Address, password *string) (txhash common.Hash, err error)
- func (m *MasternodeAPI) DepositCollateral(dst common.Address, amount *hexutil.Big, password *string) (txhash common.Hash, err error)
- func (m *MasternodeAPI) ListMasternodes() (res []MNInfo, err error)
- func (m *MasternodeAPI) MasternodeInfo(owner_or_mn common.Address) (res MNInfo, err error)
- func (m *MasternodeAPI) Stats() (res *MasternodeStats, err error)
- func (m *MasternodeAPI) WithdrawCollateral(dst common.Address, amount *hexutil.Big, password *string) (txhash common.Hash, err error)
- type MasternodeStats
- type MigrationAPI
- func (m *MigrationAPI) ClaimGen2CoinsCombined(password *string, dst common.Address, file string) (txhashes []common.Hash, err error)
- func (m *MigrationAPI) ClaimGen2CoinsDirect(password *string, dst common.Address, tkey string) (txhash common.Hash, err error)
- func (m *MigrationAPI) ClaimGen2CoinsImport(password string, file string) (txhashes []common.Hash, err error)
- func (m *MigrationAPI) CompensationProcess(payer common.Address, password *string) error
- func (m *MigrationAPI) ListGen2Coins() (coins []Gen2Coin, err error)
- func (m *MigrationAPI) SearchGen2Coins(owners []string, include_empty bool) (coins []Gen2Coin, err error)
- func (m *MigrationAPI) SearchGen3DestinationByGen2Address(gen2Owners []string, includeEmpty bool) ([]Gen3Dest, error)
- func (m *MigrationAPI) SearchRawGen2Coins(rawOwners []common.Address, include_empty bool) (coins []Gen2Coin, err error)
- type MigrationAdminAPI
- type ProposalInfo
- type UpgradeProposalInfo
- type UpgradeProposals
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllCheckpointInfo ¶
type AllCheckpointInfo struct { Registry []CheckpointInfo Active []CheckpointInfo }
type BLInfo ¶
type BLInfo struct { Target common.Address Enforce *ProposalInfo Revoke *ProposalInfo Drain *ProposalInfo Blocked bool }
type Backend ¶
type Backend interface { // General Ethereum API Downloader() *downloader.Downloader ProtocolVersion() int SuggestPrice(ctx context.Context) (*big.Int, error) ChainDb() ethdb.Database EventMux() *event.TypeMux AccountManager() *accounts.Manager RPCGasCap() *big.Int // global gas cap for eth_call over rpc: DoS protection // BlockChain API SetHead(number uint64) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error) GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error) GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error) GetTd(blockHash common.Hash) *big.Int GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription BlockChain() *core.BlockChain // TxPool API SendTx(ctx context.Context, signedTx *types.Transaction) error GetPoolTransactions() (types.Transactions, error) GetPoolTransaction(txHash common.Hash) *types.Transaction GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) Stats() (pending int, queued int) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription ChainConfig() *params.ChainConfig CurrentBlock() *types.Block AddLocalCheckpoint(num uint64, hash common.Hash) error ListCheckpoints() []core.CheckpointInfo CheckpointSignatures(cp core.Checkpoint) []core.CheckpointSignature IsPublicService() bool OnSyncedHeadUpdates(cb func()) }
Backend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.
type BlacklistAPI ¶
type BlacklistAPI struct {
// contains filtered or unexported fields
}
func NewBlacklistAPI ¶
func NewBlacklistAPI(b Backend) *BlacklistAPI
func (*BlacklistAPI) BlacklistCollect ¶
func (*BlacklistAPI) BlacklistDrain ¶
func (*BlacklistAPI) BlacklistEnforce ¶
func (*BlacklistAPI) BlacklistInfo ¶
func (b *BlacklistAPI) BlacklistInfo() (res []BLInfo, err error)
func (*BlacklistAPI) BlacklistRevoke ¶
func (*BlacklistAPI) CompensationInfo ¶
func (b *BlacklistAPI) CompensationInfo() (*BudgetInfo, error)
type BudgetInfo ¶
type BudgetInfo struct { Balance *hexutil.Big Proposals []BudgetProposalInfo }
type BudgetProposalInfo ¶
type CheckpointAdminAPI ¶
type CheckpointAdminAPI struct {
// contains filtered or unexported fields
}
func NewCheckpointAdminAPI ¶
func NewCheckpointAdminAPI(b Backend) *CheckpointAdminAPI
func (*CheckpointAdminAPI) CheckpointLocal ¶
func (b *CheckpointAdminAPI) CheckpointLocal( number uint64, hash common.Hash, ) error
type CheckpointInfo ¶
type CheckpointRegistryAPI ¶
type CheckpointRegistryAPI struct {
// contains filtered or unexported fields
}
func NewCheckpointRegistryAPI ¶
func NewCheckpointRegistryAPI(b Backend) *CheckpointRegistryAPI
func (*CheckpointRegistryAPI) CheckpointInfo ¶
func (b *CheckpointRegistryAPI) CheckpointInfo() (res *AllCheckpointInfo, err error)
returns all the checkpoints from cache (or contract)
func (*CheckpointRegistryAPI) CheckpointPropose ¶
func (b *CheckpointRegistryAPI) CheckpointPropose( number uint64, hash common.Hash, password *string, ) (txhash common.Hash, err error)
executes command to propose checkpoint
func (*CheckpointRegistryAPI) CheckpointRemove ¶
func (b *CheckpointRegistryAPI) CheckpointRemove( number uint64, hash common.Hash, password *string, ) (txhash common.Hash, err error)
executes command to propose checkpoint
func (*CheckpointRegistryAPI) Checkpoints ¶
func (b *CheckpointRegistryAPI) Checkpoints() ([]common.Address, error)
lists the existing checkpoint addresses from contract
type EphemeralAccount ¶
type EphemeralAccount struct {
// contains filtered or unexported fields
}
func NewEphemeralAccount ¶
func NewEphemeralAccount() (*EphemeralAccount, error)
func (*EphemeralAccount) Subscribe ¶
func (ea *EphemeralAccount) Subscribe(sink chan<- accounts.WalletEvent) event.Subscription
func (*EphemeralAccount) Wallets ¶
func (ea *EphemeralAccount) Wallets() []accounts.Wallet
type EphemeralWallet ¶
type EphemeralWallet struct{}
func (*EphemeralWallet) Accounts ¶
func (ew *EphemeralWallet) Accounts() []accounts.Account
func (*EphemeralWallet) Close ¶
func (ew *EphemeralWallet) Close() error
func (*EphemeralWallet) Contains ¶
func (ew *EphemeralWallet) Contains(account accounts.Account) bool
func (*EphemeralWallet) Derive ¶
func (ew *EphemeralWallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Account, error)
func (*EphemeralWallet) IsUnlockedForStaking ¶
func (ew *EphemeralWallet) IsUnlockedForStaking(account accounts.Account) bool
func (*EphemeralWallet) Open ¶
func (ew *EphemeralWallet) Open(passphrase string) (err error)
func (*EphemeralWallet) SelfDerive ¶
func (ew *EphemeralWallet) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader)
func (*EphemeralWallet) SignDataWithPassphrase ¶
func (ew *EphemeralWallet) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error)
SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed.
func (*EphemeralWallet) SignHashWithPassphrase ¶
func (*EphemeralWallet) SignText ¶
SignText implements accounts.Wallet, attempting to sign the hash of the given text with the given account.
func (*EphemeralWallet) SignTextWithPassphrase ¶
func (ew *EphemeralWallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error)
SignTextWithPassphrase implements accounts.Wallet, attempting to sign the hash of the given text with the given account using passphrase as extra authentication.
func (*EphemeralWallet) SignTx ¶
func (ew *EphemeralWallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
func (*EphemeralWallet) SignTxWithPassphrase ¶
func (ew *EphemeralWallet) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
func (*EphemeralWallet) Status ¶
func (ew *EphemeralWallet) Status() (string, error)
func (*EphemeralWallet) URL ¶
func (ew *EphemeralWallet) URL() accounts.URL
type GovernanceAPI ¶
type GovernanceAPI struct {
// contains filtered or unexported fields
}
func NewGovernanceAPI ¶
func NewGovernanceAPI(b Backend) *GovernanceAPI
func (*GovernanceAPI) BudgetInfo ¶
func (g *GovernanceAPI) BudgetInfo() (*BudgetInfo, error)
func (*GovernanceAPI) BudgetPropose ¶
func (*GovernanceAPI) UpgradeCollect ¶
func (*GovernanceAPI) UpgradeInfo ¶
func (g *GovernanceAPI) UpgradeInfo() *UpgradeProposals
func (*GovernanceAPI) UpgradePerform ¶
func (*GovernanceAPI) UpgradePropose ¶
func (*GovernanceAPI) VoteAccept ¶
func (*GovernanceAPI) VoteReject ¶
type HardforkInfo ¶
type HardforkInfo struct { Name string `json:"name"` BlockNumber *big.Int `json:"block_number"` BlockHash common.Hash `json:"block_hash,omitempty"` SWFeatures *big.Int `json:"sw_features"` SWVersion string `json:"sw_version"` }
HardforkInfo defines the hardfork payload information returned.
type HardforkRegistryAPI ¶
type HardforkRegistryAPI struct {
// contains filtered or unexported fields
}
HardforkRegistryAPI holds the data required to access the API. It has a cache that temporarily holds regularly accessed data.
func NewHardforkRegistryAPI ¶
func NewHardforkRegistryAPI(b Backend) *HardforkRegistryAPI
NewHardforkRegistryAPI returns a new HardforkRegistryAPI instance. It also pre-fetches the latest list of the hardforks available in the system.
func (*HardforkRegistryAPI) HardforkEnumerate ¶
func (hf *HardforkRegistryAPI) HardforkEnumerate() (hardforks []*HardforkInfo, err error)
func (*HardforkRegistryAPI) HardforkEnumerateActive ¶
func (hf *HardforkRegistryAPI) HardforkEnumerateActive() (hardforks []*HardforkInfo, err error)
func (*HardforkRegistryAPI) HardforkEnumeratePending ¶
func (hf *HardforkRegistryAPI) HardforkEnumeratePending() (hardforks []*HardforkInfo, err error)
func (*HardforkRegistryAPI) HardforkGet ¶
func (hf *HardforkRegistryAPI) HardforkGet(name string) (info *HardforkInfo, err error)
func (*HardforkRegistryAPI) HardforkIsActive ¶
func (hf *HardforkRegistryAPI) HardforkIsActive(name string) (bool, error)
type MasternodeAPI ¶
type MasternodeAPI struct {
// contains filtered or unexported fields
}
func NewMasternodeAPI ¶
func NewMasternodeAPI(b Backend) *MasternodeAPI
func (*MasternodeAPI) CollateralBalance ¶
func (*MasternodeAPI) DepositCollateral ¶
func (*MasternodeAPI) ListMasternodes ¶
func (m *MasternodeAPI) ListMasternodes() (res []MNInfo, err error)
func (*MasternodeAPI) MasternodeInfo ¶
func (m *MasternodeAPI) MasternodeInfo(owner_or_mn common.Address) (res MNInfo, err error)
func (*MasternodeAPI) Stats ¶
func (m *MasternodeAPI) Stats() (res *MasternodeStats, err error)
type MasternodeStats ¶
type MigrationAPI ¶
type MigrationAPI struct {
// contains filtered or unexported fields
}
func NewMigrationAPI ¶
func NewMigrationAPI(b Backend) *MigrationAPI
func (*MigrationAPI) ClaimGen2CoinsCombined ¶
func (*MigrationAPI) ClaimGen2CoinsDirect ¶
func (*MigrationAPI) ClaimGen2CoinsImport ¶
func (*MigrationAPI) CompensationProcess ¶
func (m *MigrationAPI) CompensationProcess( payer common.Address, password *string, ) error
NOTE: use of MigrationAPI is to simplify things and to minimize refactoring
func (*MigrationAPI) ListGen2Coins ¶
func (m *MigrationAPI) ListGen2Coins() (coins []Gen2Coin, err error)
func (*MigrationAPI) SearchGen2Coins ¶
func (m *MigrationAPI) SearchGen2Coins( owners []string, include_empty bool, ) (coins []Gen2Coin, err error)
func (*MigrationAPI) SearchGen3DestinationByGen2Address ¶
func (m *MigrationAPI) SearchGen3DestinationByGen2Address( gen2Owners []string, includeEmpty bool, ) ([]Gen3Dest, error)
SearchGen3DestinationByGen2Address returns the gen3 destination address(s) searched by the gen2 address owner(s).
func (*MigrationAPI) SearchRawGen2Coins ¶
type MigrationAdminAPI ¶
type MigrationAdminAPI struct {
// contains filtered or unexported fields
}
func NewMigrationAdminAPI ¶
func NewMigrationAdminAPI(b Backend) *MigrationAdminAPI
func (*MigrationAdminAPI) ValidateMigration ¶
func (b *MigrationAdminAPI) ValidateMigration( migration_file string, ) bool
type ProposalInfo ¶
type UpgradeProposalInfo ¶
type UpgradeProposalInfo struct { ProposalInfo Impl common.Address Proxy common.Address }
type UpgradeProposals ¶
type UpgradeProposals struct { Treasury []UpgradeProposalInfo MasternodeRegistry []UpgradeProposalInfo StakerReward []UpgradeProposalInfo BackboneReward []UpgradeProposalInfo SporkRegistry []UpgradeProposalInfo CheckpointRegistry []UpgradeProposalInfo BlacklistRegistry []UpgradeProposalInfo MasternodeToken []UpgradeProposalInfo HardforkRegistry []UpgradeProposalInfo }