Documentation ¶
Index ¶
- Constants
- Variables
- func CallType(t string) bool
- func CreateType(t string) bool
- func StorageFee(amount uint64) *big.Int
- type Client
- func (ec *Client) Balance(ctx context.Context, account *RosettaTypes.AccountIdentifier, ...) (*RosettaTypes.AccountBalanceResponse, error)
- func (ec *Client) Block(ctx context.Context, blockIdentifier *RosettaTypes.PartialBlockIdentifier) (*RosettaTypes.Block, error)
- func (ec *Client) Call(ctx context.Context, request *RosettaTypes.CallRequest) (*RosettaTypes.CallResponse, error)
- func (ec *Client) ChainID() (uint32, error)
- func (ec *Client) Close()
- func (ec *Client) EpochNumber(ctx context.Context) (*big.Int, error)
- func (ec *Client) IsPivotBlock(block *cfxSdkTypes.Block) (bool, error)
- func (ec *Client) NetworkID() (uint32, error)
- func (ec *Client) PendingNonceAt(ctx context.Context, account cfxSdkTypes.Address) (*big.Int, error)
- func (ec *Client) SendTransaction(ctx context.Context, tx *cfxSdkTypes.SignedTransaction) error
- func (ec *Client) Status(_ context.Context) (*RosettaTypes.BlockIdentifier, int64, *RosettaTypes.SyncStatus, ...)
- func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- type JSONRPC
Constants ¶
View Source
const ( // NodeVersion is the version of conflux full node we are using. NodeVersion = "1.1.6" // Blockchain is conflux. Blockchain string = "Conflux" // MainnetNetwork is the value of the network // in MainnetNetworkIdentifier. MainnetNetwork string = "Mainnet" TestnetNetwork string = "Testnet" // Symbol is the symbol value // used in Currency. Symbol = "CFX" // Decimals is the decimals value // used in Currency. Decimals = 18 // MinerRewardOpType is used to describe // a miner block reward. MinerRewardOpType = "MINER_REWARD" PosRewardOpType = "POS_REWARD" // FeeOpType is used to represent fee operations. FeeOpType = "FEE" GasFeeOpType = "GAS_FEE" StorageCollaterlOpType = "STORAGE_COLLATERAL_FEE" StorageReleaseOpType = "STORAGE_RELEASE" // SelfDestructOpType is used to represent SELFDESTRUCT trace operations. SelfDestructOpType = "SELFDESTRUCT" // CallOpType is used to represent CALL trace operations. CallOpType = "CALL" // CallCodeOpType is used to represent CALLCODE trace operations. CallCodeOpType = "CALLCODE" // DelegateCallOpType is used to represent DELEGATECALL trace operations. DelegateCallOpType = "DELEGATECALL" // StaticCallOpType is used to represent STATICCALL trace operations. StaticCallOpType = "STATICCALL" // CreateOpType is used to represent CREATE trace operations. CreateOpType = cfxSdkTypes.CREATE_CREATE // Create2OpType is used to represent CREATE2 trace operations. Create2OpType = cfxSdkTypes.CREATE_CREATE2 InternalTransferActionOpType = "INTERNALTRANSFERACTION" // DestructOpType is a synthetic operation used to represent the // deletion of suicided accounts that still have funds at the end // of a transaction. DestructOpType = "DESTRUCT" // SuccessStatus is the status of any // conflux operation considered successful. SuccessStatus = "SUCCESS" // FailureStatus is the status of any // conflux operation considered unsuccessful. FailureStatus = "FAILURE" // HistoricalBalanceSupported is whether // historical balance is supported. HistoricalBalanceSupported = true // UnclesRewardMultiplier is the uncle reward // multiplier. UnclesRewardMultiplier = 32 // MaxUncleDepth is the maximum depth for // an uncle to be rewarded. MaxUncleDepth = 8 // GenesisBlockIndex is the index of the // genesis block. GenesisBlockIndex = int64(0) // TransferGasLimit is the gas limit // of a transfer. TransferGasLimit = int64(21000) //nolint:gomnd // TransferGasLimit is the gas limit // of a transfer. TransferStorageLimit = int64(0) //nolint:gomnd // IncludeMempoolCoins does not apply to rosetta-ethereum as it is not UTXO-based. IncludeMempoolCoins = false )
Variables ¶
View Source
var ( // ErrBlockOrphaned = errors.New("block orphaned") ErrCallParametersInvalid = errors.New("call parameters invalid") ErrCallOutputMarshal = errors.New("call output marshal") ErrCallMethodInvalid = errors.New("call method invalid") )
Client errors
View Source
var ( // MainnetGenesisBlockIdentifier is the *types.BlockIdentifier // of the mainnet genesis block. MainnetGenesisBlockIdentifier = &types.BlockIdentifier{ Hash: "0xf6cec5af1ee95f56038fc30589bcfeb4b960075c3c76b8a0eaa6d36e8e623b50", Index: GenesisBlockIndex, } TestnetGenesisBlockIdentifier = &types.BlockIdentifier{ Hash: "0x3fb9d350f95424c3c27fcf248d9a6f633a83c2a75c11ef887ea41540c85e7804", Index: GenesisBlockIndex, } // Currency is the *types.Currency for all // conflux networks. Currency = &types.Currency{ Symbol: Symbol, Decimals: Decimals, } // OperationTypes are all suppoorted operation types. OperationTypes = []string{ MinerRewardOpType, PosRewardOpType, string(CreateOpType), InternalTransferActionOpType, CallOpType, CallCodeOpType, DelegateCallOpType, StaticCallOpType, } // OperationStatuses are all supported operation statuses. OperationStatuses = []*types.OperationStatus{ { Status: SuccessStatus, Successful: true, }, { Status: FailureStatus, Successful: false, }, } // CallMethods are all supported call methods. CallMethods = []string{} )
Functions ¶
func CreateType ¶
CreateType returns a boolean indicating if the provided trace type is a create type.
func StorageFee ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Balance ¶
func (ec *Client) Balance(ctx context.Context, account *RosettaTypes.AccountIdentifier, block *RosettaTypes.PartialBlockIdentifier) (*RosettaTypes.AccountBalanceResponse, error)
func (*Client) Block ¶
func (ec *Client) Block(ctx context.Context, blockIdentifier *RosettaTypes.PartialBlockIdentifier) (*RosettaTypes.Block, error)
func (*Client) Call ¶
func (ec *Client) Call(ctx context.Context, request *RosettaTypes.CallRequest) (*RosettaTypes.CallResponse, error)
func (*Client) IsPivotBlock ¶
func (ec *Client) IsPivotBlock(block *cfxSdkTypes.Block) (bool, error)
func (*Client) PendingNonceAt ¶
func (*Client) SendTransaction ¶
func (ec *Client) SendTransaction(ctx context.Context, tx *cfxSdkTypes.SignedTransaction) error
func (*Client) Status ¶
func (ec *Client) Status(_ context.Context) (*RosettaTypes.BlockIdentifier, int64, *RosettaTypes.SyncStatus, []*RosettaTypes.Peer, error)
Click to show internal directories.
Click to hide internal directories.