Documentation ¶
Index ¶
- Constants
- Variables
- func GetOperations(fa string, els []*EventLog, lastOpIndex int64) []*types.Operation
- func GetUserStep(from string, stepDetails map[string]*common.HexInt) *big.Int
- func HexIntAdd(x *common.HexInt, y *common.HexInt) *big.Int
- func MakeBaseOperations() (*types.Operation, error)
- func MapNetwork(n string) *common.HexInt64
- func MarshalJSONMap(i interface{}) (map[string]interface{}, error)
- func NewHttpError(r *http.Response) error
- func ParseBlock(raw map[string]interface{}) (*types.Block, error)
- func ParseBlock01a(blk *Block01a) (*types.Block, error)
- func ParseBlock03(blk *Block03) (*types.Block, error)
- func ParseGenesisBlock(blk *Block01a) (*types.Block, error)
- func ParseGenesisOperationsV2(tx GenesisTransaction) ([]*types.Operation, error)
- func ParseGenesisTransaction(txArray []json.RawMessage) ([]*types.Transaction, error)
- func ParseOperationsV2(transaction Transaction) ([]*types.Operation, error)
- func ParseOperationsV3(transaction Transaction) ([]*types.Operation, error)
- func ParseTransactionV2(transaction Transaction) (*types.Transaction, error)
- func ParseTransactionV3(transaction Transaction) (*types.Transaction, error)
- func ParseTransactions(txArray []json.RawMessage) ([]*types.Transaction, error)
- func UnmarshalJSONMap(m map[string]interface{}, i interface{}) error
- type BalanceRPCRequest
- type BalanceWithBlockId
- type Block01a
- type Block03
- type BlockRPCRequest
- type ClientV3
- func (c *ClientV3) EstimateStep(req interface{}) (*Response, error)
- func (c *ClientV3) GetBalance(param *BalanceRPCRequest) (*types.AccountBalanceResponse, error)
- func (c *ClientV3) GetBlock(param *BlockRPCRequest) (*types.Block, error)
- func (c *ClientV3) GetBlockReceipts(param *BlockRPCRequest) ([]*TransactionResult, error)
- func (c *ClientV3) GetMainPReps() (*map[string]interface{}, error)
- func (c *ClientV3) GetPRep(prep string) (*map[string]interface{}, error)
- func (c *ClientV3) GetTotalSupply() (*jsonrpc.HexInt, error)
- func (c *ClientV3) GetTransaction(param *TransactionRPCRequest) (*types.Transaction, error)
- func (c *ClientV3) GetTransactionResult(param *TransactionRPCRequest) (*TransactionResult, error)
- func (c *ClientV3) MakeBlockWithReceipts(block *types.Block, trsArray []*TransactionResult) (*types.Block, error)
- func (c *ClientV3) MakeTransactionWithReceipt(tx *types.Transaction, txResult *TransactionResult) (*types.Transaction, error)
- func (c *ClientV3) SendTransaction(req interface{}) error
- type DebugAccount
- type EventLog
- type GenesisAccount
- type GenesisTransaction
- type HttpError
- type JsonRpcClient
- type Response
- type Transaction
- func (tx *Transaction) CalcHash() ([]byte, error)
- func (tx *Transaction) FeeValue() string
- func (tx *Transaction) FromAddr() string
- func (tx *Transaction) GetDataType() string
- func (tx *Transaction) MetaV2() map[string]interface{}
- func (tx *Transaction) MetaV3() map[string]interface{}
- func (tx *Transaction) StepValues() string
- func (tx *Transaction) ToAddr() string
- func (tx *Transaction) ToJSON() (map[string]interface{}, error)
- func (tx *Transaction) TxHash() []byte
- func (tx *Transaction) Values() string
- func (tx *Transaction) VerifySignature() error
- type TransactionRPCRequest
- type TransactionResult
Constants ¶
View Source
const ( // Blockchain is ICON. Blockchain string = "ICON" // MainnetNetwork is the value of the network // in MainnetNetworkIdentifier. MainnetNetwork string = "Mainnet" // TestnetNetwork is the value of the network // in TestnetNetworkIdentifier. TestnetNetwork string = "Testnet" ZiconNetwork string = "ZiconNet" // for develop DevelopNetwork string = "Devnet" ICXSymbol = "ICX" ICXDecimals = 18 GenesisBlockIndex = int64(0) HistoricalBalanceSupported = false TreasuryAddress = "hx1000000000000000000000000000000000000000" SystemScoreAddress = "cx0000000000000000000000000000000000000000" GenesisOpType = "GENESIS" TransferOpType = "TRANSFER" FeeOpType = "FEE" BaseOpType = "BASE" BurnOpType = "BURN" WithdrawnType = "WITHDRAWN" ICXTransferOpType = "ICXTRANSFER" ClaimOpType = "CLAIM" IssueOpType = "ISSUE" MessageOpType = "MESSAGE" BaseDataType = "base" SuccessStatus = "SUCCESS" FailureStatus = "FAIL" )
Variables ¶
View Source
var ( ICXCurrency = &types.Currency{ Symbol: ICXSymbol, Decimals: ICXDecimals, } OperationTypes = []string{ GenesisOpType, TransferOpType, FeeOpType, BaseOpType, IssueOpType, BurnOpType, ICXTransferOpType, ClaimOpType, MessageOpType, } // OperationStatuses are all supported operation statuses. OperationStatuses = []*types.OperationStatus{ { Status: SuccessStatus, Successful: true, }, { Status: FailureStatus, Successful: false, }, } MiddlewareVersion = "0.0.1" RosettaVersion = "1.4.0" NodeVersion = "1.8.0" StepPrice = big.NewInt(12500000000) TransferStepCost = big.NewInt(100000) )
Functions ¶
func GetOperations ¶
func MakeBaseOperations ¶
func MapNetwork ¶
func MarshalJSONMap ¶
func NewHttpError ¶
func ParseGenesisOperationsV2 ¶
func ParseGenesisOperationsV2(tx GenesisTransaction) ([]*types.Operation, error)
func ParseGenesisTransaction ¶
func ParseGenesisTransaction(txArray []json.RawMessage) ([]*types.Transaction, error)
func ParseOperationsV2 ¶
func ParseOperationsV2(transaction Transaction) ([]*types.Operation, error)
func ParseOperationsV3 ¶
func ParseOperationsV3(transaction Transaction) ([]*types.Operation, error)
func ParseTransactionV2 ¶
func ParseTransactionV2(transaction Transaction) (*types.Transaction, error)
func ParseTransactionV3 ¶
func ParseTransactionV3(transaction Transaction) (*types.Transaction, error)
func ParseTransactions ¶
func ParseTransactions(txArray []json.RawMessage) ([]*types.Transaction, error)
func UnmarshalJSONMap ¶
Types ¶
type BalanceRPCRequest ¶
type BalanceWithBlockId ¶
type BalanceWithBlockId struct { ID common.HexBytes `json:"block_hash"` Height common.HexInt64 `json:"height"` }
func (*BalanceWithBlockId) Hash ¶
func (info *BalanceWithBlockId) Hash() string
func (*BalanceWithBlockId) Number ¶
func (info *BalanceWithBlockId) Number() int64
type Block01a ¶
type Block01a struct { ID common.HexBytes `json:"block_hash"` Version string `json:"version"` Height common.HexInt64 `json:"height"` Timestamp common.HexInt64 `json:"time_stamp"` Proposer common.Address `json:"peer_id"` PrevID common.HexBytes `json:"prev_block_hash"` MerkleTreeRootHash common.HexBytes `json:"merkle_tree_root_hash"` Signature common.Signature `json:"signature"` NextLeader common.Address `json:"next_leader"` Transactions []json.RawMessage `json:"confirmed_transaction_list" ` }
func (*Block01a) GenesisMeta ¶
func (*Block01a) TimestampMilli ¶
type Block03 ¶
type Block03 struct { ID common.HexBytes `json:"hash"` Version string `json:"version"` Height common.HexInt64 `json:"height"` Timestamp common.HexInt64 `json:"timestamp"` Leader common.Address `json:"leader"` PrevID common.HexBytes `json:"prevHash"` TransactionsHash common.HexBytes `json:"transactionsHash"` Signature *common.Signature `json:"signature,omitempty"` NextLeader common.Address `json:"nextLeader"` Transactions []json.RawMessage `json:"transactions"` StateHash common.HexBytes `json:"stateHash"` ReceiptsHash common.HexBytes `json:"receiptsHash"` RepsHash common.HexBytes `json:"repsHash"` NextRepsHash common.HexBytes `json:"nextRepsHash"` LeaderVotesHash common.HexBytes `json:"leaderVotesHash"` PrevVotesHash common.HexBytes `json:"prevVotesHash"` LogsBloom common.HexBytes `json:"logsBloom"` }
func (*Block03) TimestampMilli ¶
type BlockRPCRequest ¶
type ClientV3 ¶
type ClientV3 struct { *JsonRpcClient DebugEndPoint string }
func NewClientV3 ¶
func (*ClientV3) EstimateStep ¶
func (*ClientV3) GetBalance ¶
func (c *ClientV3) GetBalance(param *BalanceRPCRequest) (*types.AccountBalanceResponse, error)
func (*ClientV3) GetBlock ¶
func (c *ClientV3) GetBlock(param *BlockRPCRequest) (*types.Block, error)
func (*ClientV3) GetBlockReceipts ¶
func (c *ClientV3) GetBlockReceipts(param *BlockRPCRequest) ([]*TransactionResult, error)
func (*ClientV3) GetMainPReps ¶
func (*ClientV3) GetTransaction ¶
func (c *ClientV3) GetTransaction(param *TransactionRPCRequest) (*types.Transaction, error)
func (*ClientV3) GetTransactionResult ¶
func (c *ClientV3) GetTransactionResult(param *TransactionRPCRequest) (*TransactionResult, error)
func (*ClientV3) MakeBlockWithReceipts ¶
func (*ClientV3) MakeTransactionWithReceipt ¶
func (c *ClientV3) MakeTransactionWithReceipt(tx *types.Transaction, txResult *TransactionResult) (*types.Transaction, error)
func (*ClientV3) SendTransaction ¶
type DebugAccount ¶
type DebugAccount struct { Coin coin `json:"coin"` Stake stake `json:"stake"` }
func (*DebugAccount) Balance ¶
func (da *DebugAccount) Balance() string
type GenesisAccount ¶
type GenesisAccount struct { Name string `json:"name"` Address common.Address `json:"address"` Balance *common.HexInt `json:"balance"` }
func (*GenesisAccount) Addr ¶
func (ga *GenesisAccount) Addr() string
func (*GenesisAccount) Balances ¶
func (ga *GenesisAccount) Balances() string
type GenesisTransaction ¶
type GenesisTransaction struct { Accounts []GenesisAccount `json:"accounts"` Message string `json:"message"` }
type JsonRpcClient ¶
type JsonRpcClient struct { Endpoint string CustomHeader map[string]string Pre func(req *http.Request) error // contains filtered or unexported fields }
func NewJsonRpcClient ¶
func NewJsonRpcClient(hc *http.Client, endpoint string) *JsonRpcClient
func (*JsonRpcClient) Do ¶
func (c *JsonRpcClient) Do(method string, reqPtr, respPtr interface{}) (jrResp *Response, err error)
type Response ¶
type Response struct { Version string `json:"jsonrpc"` Result json.RawMessage `json:"result"` Error *jsonrpc.Error `json:"error,omitempty"` ID interface{} `json:"id"` }
type Transaction ¶
type Transaction struct { Version common.HexUint16 `json:"version"` From common.Address `json:"from"` To common.Address `json:"to"` Value *common.HexInt `json:"value,omitempty"` StepLimit common.HexInt `json:"stepLimit"` Timestamp common.HexInt64 `json:"timestamp"` NID *common.HexInt64 `json:"nid"` Nonce *common.HexInt `json:"nonce,omitempty"` Signature *common.Signature `json:"signature,omitempty"` DataType *string `json:"dataType,omitempty"` Data json.RawMessage `json:"data,omitempty"` Fee *common.HexInt `json:"fee,omitempty"` TxHashV3 common.HexBytes `json:"txHash,omitempty"` TxHashV2 common.HexBytes `json:"tx_hash,omitempty"` Method string `json:"method,omitempty"` }
func ParseV3JSON ¶
func ParseV3JSON(js []byte) (*Transaction, error)
func (*Transaction) CalcHash ¶
func (tx *Transaction) CalcHash() ([]byte, error)
func (*Transaction) FeeValue ¶
func (tx *Transaction) FeeValue() string
func (*Transaction) FromAddr ¶
func (tx *Transaction) FromAddr() string
func (*Transaction) GetDataType ¶
func (tx *Transaction) GetDataType() string
func (*Transaction) MetaV2 ¶
func (tx *Transaction) MetaV2() map[string]interface{}
func (*Transaction) MetaV3 ¶
func (tx *Transaction) MetaV3() map[string]interface{}
func (*Transaction) StepValues ¶
func (tx *Transaction) StepValues() string
func (*Transaction) ToAddr ¶
func (tx *Transaction) ToAddr() string
func (*Transaction) ToJSON ¶
func (tx *Transaction) ToJSON() (map[string]interface{}, error)
func (*Transaction) TxHash ¶
func (tx *Transaction) TxHash() []byte
func (*Transaction) Values ¶
func (tx *Transaction) Values() string
func (*Transaction) VerifySignature ¶
func (tx *Transaction) VerifySignature() error
type TransactionRPCRequest ¶
type TransactionRPCRequest struct {
Hash string `json:"txHash"`
}
type TransactionResult ¶
type TransactionResult struct { StatusFlag string Status json.RawMessage `json:"status"` BlockHeight *json.RawMessage `json:"blockHeight"` BlockHash *json.RawMessage `json:"blockHash"` TxHash *json.RawMessage `json:"txHash"` TxIndex *json.RawMessage `json:"txIndex"` To *json.RawMessage `json:"to"` ScoreAddress *json.RawMessage `json:"scoreAddress"` StepUsed *common.HexInt `json:"stepUsed"` CumulativeStepUsed *common.HexInt `json:"cumulativeStepUsed"` StepPrice *common.HexInt `json:"stepPrice"` LogsBloom *json.RawMessage `json:"logsBloom"` EventLogs []*EventLog `json:"eventLogs"` Failure *json.RawMessage `json:"failure"` StepDetails map[string]*common.HexInt `json:"stepUsedDetails"` }
func ParseTransactionResult ¶
func ParseTransactionResult(tx interface{}) (*TransactionResult, error)
func ParseTransactionResults ¶
func ParseTransactionResults(trsRaws *[]interface{}) ([]*TransactionResult, error)
Click to show internal directories.
Click to hide internal directories.