{"modulePath":"github.com/chainopen/matrixchaincode","version":"v0.0.0-20190924071332-ddf2b42e220f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package manapi\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nPackage manapi implements the general Matrix API functions.\n\n## Functions\n\n```go\nfunc CheckCrc8(strData string) bool\n```\n\n```go\nfunc CheckCurrency(strData string) bool\n```\n\n```go\nfunc CheckFormat(strData string) bool\n```\n\n```go\nfunc CheckParams(strData string) error\n```\n\n```go\nfunc GetAPIs(apiBackend Backend) []rpc.API\n```\n\n```go\nfunc GetPassword() (string, error)\n```\n\n```go\nfunc MakeJsonInferface(value interface{}) interface{}\n```\n\n```go\nfunc MarshalInterface(value interface{}) (text []byte, err error)\n```\n\n## Types\n\n```go\ntype AddrLocker struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (l *AddrLocker) LockAddr(address common.Address)\n```\nLockAddr locks an account's mutex. This is used to prevent another tx getting the same nonce until the lock is released. The mutex prevents the (an identical nonce) from being read again during the time that the first transaction is being signed.\n\n```go\nfunc (l *AddrLocker) UnlockAddr(address common.Address)\n```\nUnlockAddr unlocks the mutex of the given account.\n\n```go\ntype Backend interface {\n\t// General Matrix API\n\tDownloader() *downloader.Downloader\n\tProtocolVersion() int\n\tSuggestPrice(ctx context.Context) (*big.Int, error)\n\tChainDb() mandb.Database\n\tEventMux() *event.TypeMux\n\tAccountManager() *accounts.Manager\n\n\t// BlockChain API\n\tSetHead(number uint64)\n\tHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)\n\tBlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)\n\tStateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDBManage, *types.Header, error)\n\tGetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error)\n\tGetReceipts(ctx context.Context, blockHash common.Hash) ([]types.CoinReceipts, error)\n\tGetTd(blockHash common.Hash) *big.Int\n\tGetEVM(ctx context.Context, msg txinterface.Message, state *state.StateDBManage, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error)\n\tSubscribeChainEvent(ch chan\u003c- core.ChainEvent) event.Subscription\n\tSubscribeChainHeadEvent(ch chan\u003c- core.ChainHeadEvent) event.Subscription\n\tSubscribeChainSideEvent(ch chan\u003c- core.ChainSideEvent) event.Subscription\n\tImportSuperBlock(ctx context.Context, filePath string) (common.Hash, error)\n\tGetState() (*state.StateDBManage, error)\n\n\t// TxPool API\n\tSendTx(ctx context.Context, signedTx types.SelfTransaction) error\n\tGetPoolTransactions() (types.SelfTransactions, error)\n\tGetPoolTransaction(txHash common.Hash) types.SelfTransaction\n\tGetPoolNonce(cointyp string, ctx context.Context, addr common.Address) (uint64, error)\n\tStats() (pending int, queued int)\n\tGetTxNmap() map[uint32]*types.Transaction\n\tTxPoolContent() (map[common.Address]types.SelfTransactions, map[common.Address]types.SelfTransactions)\n\tSubscribeNewTxsEvent(chan core.NewTxsEvent) event.Subscription //Y\n\n\tSignTx(signedTx types.SelfTransaction, chainID *big.Int, blkHash common.Hash, signHeight uint64, usingEntrust bool) (types.SelfTransaction, error) //\n\tSendBroadTx(ctx context.Context, signedTx types.SelfTransaction, bType bool) error                                                                 //\n\tFetcherNotify(hash common.Hash, number uint64)                                                                                                     //\n\n\tChainConfig() *params.ChainConfig\n\t//Config() *man.Config\n\tNetWorkID() uint64\n\tSyncMode() downloader.SyncMode\n\tNetRPCService() *PublicNetAPI\n\tCurrentBlock() *types.Block\n\tGetDepositAccount(signAccount common.Address, blockHash common.Hash) (common.Address, error)\n\tGetFutureRewards(*state.StateDBManage, rpc.BlockNumber) (interface{}, error)\n\tGenesis() *types.Block\n}\n```\nBackend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.\n\n```go\ntype CallArgs struct {\n\tFrom     common.Address  `json:\"from\"`\n\tTo       *common.Address `json:\"to\"`\n\tCurrency *string         `json:\"currency\"    gencodec:\"required\"`\n\tGas      hexutil.Uint64  `json:\"gas\"`\n\tGasPrice hexutil.Big     `json:\"gasPrice\"`\n\tValue    hexutil.Big     `json:\"value\"`\n\tData     hexutil.Bytes   `json:\"data\"`\n\tExtraTo  []*ExtraTo_Mx   `json:\"extra_to\"` //\n}\n```\nCallArgs represents the arguments for a call.\n\n```go\nfunc ManArgsToCallArgs(manargs ManCallArgs) (args CallArgs, err error)\n```\n\n```go\ntype DepositDetail struct {\n\tAddress     string\n\tSignAddress string\n\tDeposit     *big.Int\n\tWithdrawH   *big.Int\n\tOnlineTime  *big.Int\n\tRole        *big.Int\n}\n```\n\n```go\ntype ExecutionResult struct {\n\tGas         uint64         `json:\"gas\"`\n\tFailed      bool           `json:\"failed\"`\n\tReturnValue string         `json:\"returnValue\"`\n\tStructLogs  []StructLogRes `json:\"structLogs\"`\n}\n```\nExecutionResult groups all structured logs emitted by the EVM while replaying a transaction in debug mode as well as transaction execution status, the amount of gas used and the return value\n\n```go\ntype ExtraTo_Mx struct {\n\tTo2    *common.Address `json:\"to\"`\n\tValue2 *hexutil.Big    `json:\"value\"`\n\tInput2 *hexutil.Bytes  `json:\"input\"`\n}\n```\n\n```go\ntype ExtraTo_Mx1 struct {\n\tTo2    *string        `json:\"to\"`\n\tValue2 *hexutil.Big   `json:\"value\"`\n\tInput2 *hexutil.Bytes `json:\"input\"`\n}\n```\n\n```go\ntype ManCallArgs struct {\n\tFrom     string         `json:\"from\"`\n\tTo       *string        `json:\"to\"`\n\tCurrency *string        `json:\"currency\"`\n\tGas      hexutil.Uint64 `json:\"gas\"`\n\tGasPrice hexutil.Big    `json:\"gasPrice\"`\n\tValue    hexutil.Big    `json:\"value\"`\n\tData     hexutil.Bytes  `json:\"data\"`\n\tExtraTo  []*ExtraTo_Mx1 `json:\"extra_to\"` //\n}\n```\n\n```go\ntype NodeInfo struct {\n\tAccount  string `json:\"account\"`\n\tOnline   bool   `json:\"online\"`\n\tPosition uint16 `json:\"position\"`\n}\n```\n\n```go\ntype PrivateAccountAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateAccountAPI provides an API to access accounts managed by this node. It offers methods to create, (un)lock en list accounts. Some methods accept passwords and are therefore considered private by default.\n\n```go\nfunc NewPrivateAccountAPI(b Backend, nonceLock *AddrLocker) *PrivateAccountAPI\n```\nNewPrivateAccountAPI create a new PrivateAccountAPI.\n\n```go\nfunc (s *PrivateAccountAPI) DeriveAccount(url string, path string, pin *bool) (accounts.Account, error)\n```\nDeriveAccount requests a HD wallet to derive a new account, optionally pinning it for later reuse.\n\n```go\nfunc (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Bytes) (common.Address, error)\n```\nEcRecover returns the address for the account that was used to create the signature. Note, this function is compatible with man\\_sign and personal\\_sign. As such it recovers the address of: hash = keccak256(\"\\\\x19Matrix Signed Message:\\\\n\"${message length}${message}) addr = ecrecover(hash, signature)\n\nNote, the signature must conform to the secp256k1 curve R, S and V values, where the V value must be be 27 or 28 for legacy reasons.\n\n[https://github.com/MatrixAINetwork/go-matrix/wiki/Management-APIs#personal\\_ecRecover](https://github.com/MatrixAINetwork/go-matrix/wiki/Management-APIs#personal_ecRecover)\n\n```go\nfunc (s *PrivateAccountAPI) ImportRawKey(privkey string, password string) (string, error)\n```\nImportRawKey stores the given hex encoded ECDSA key into the key directory, encrypting it with the passphrase.\n\n```go\nfunc (s *PrivateAccountAPI) ListAccounts() []common.Address\n```\nListAccounts will return a list of addresses for accounts this node manages.\n\n```go\nfunc (s *PrivateAccountAPI) ListWallets() []rawWallet\n```\nListWallets will return a list of wallets this node manages.\n\n```go\nfunc (s *PrivateAccountAPI) LockAccount(strAddr string) bool\n```\nLockAccount will lock the account associated with the given address when it's unlocked.\n\n```go\nfunc (s *PrivateAccountAPI) NewAccount(password string) (string, error)\n```\nNewAccount will create a new account and returns the address for the new account.\n\n\tfunc (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) {\n\t\tacc, err := fetchKeystore(s.am).NewAccount(password)\n\t\tif err == nil {\n\t\t\treturn acc.Address, nil\n\t\t}\n\t\treturn common.Address{}, err\n\t}\n\n```go\nfunc (s *PrivateAccountAPI) OpenWallet(url string, passphrase *string) error\n```\nOpenWallet initiates a hardware wallet opening procedure, establishing a USB connection and attempting to authenticate via the provided passphrase. Note, the method may return an extra challenge requiring a second open (e.g. the Trezor PIN matrix challenge).\n\n```go\nfunc (s *PrivateAccountAPI) SendTransaction(ctx context.Context, args1 SendTxArgs1, passwd string) (common.Hash, error)\n```\nSendTransaction will create a transaction from the given arguments and tries to sign it with the key associated with args.To. If the given passwd isn't able to decrypt the key it fails.\n\n```go\nfunc (s *PrivateAccountAPI) SetEntrustSignAccount(path string, password string) (string, error)\n```\n\n```go\nfunc (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, strAddr string, passwd string) (hexutil.Bytes, error)\n```\nSign calculates an Matrix ECDSA signature for: keccack256(\"\\\\x19Matrix Signed Message:\\\\n\" + len(message) + message))\n\nNote, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons.\n\nThe key used to calculate the signature is decrypted with the given password.\n\n[https://github.com/MatrixAINetwork/go-matrix/wiki/Management-APIs#personal\\_sign](https://github.com/MatrixAINetwork/go-matrix/wiki/Management-APIs#personal_sign)\n\n```go\nfunc (s *PrivateAccountAPI) SignAndSendTransaction(ctx context.Context, args SendTxArgs1, passwd string) (common.Hash, error)\n```\nSignAndSendTransaction was renamed to SendTransaction. This method is deprecated and will be removed in the future. It primary goal is to give clients time to update.\n\n```go\nfunc (s *PrivateAccountAPI) SignTransaction(ctx context.Context, args SendTxArgs, passwd string) (*SignTransactionResult, error)\n```\nSignTransaction will create a transaction from the given arguments and tries to sign it with the key associated with args.To. If the given passwd isn't able to decrypt the key it fails. The transaction is returned in RLP-form, not broadcast to other nodes\n\n```go\nfunc (s *PrivateAccountAPI) UnlockAccount(strAddr string, password string, duration *uint64) (bool, error)\n```\nUnlockAccount will unlock the account associated with the given address with the given password for duration seconds. If duration is nil it will use a default of 300 seconds. It returns an indication if the account was unlocked.\n\n```go\ntype PrivateDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateDebugAPI is the collection of Matrix APIs exposed over the private debugging endpoint.\n\n```go\nfunc NewPrivateDebugAPI(b Backend) *PrivateDebugAPI\n```\nNewPrivateDebugAPI creates a new API definition for the private debug methods of the Matrix service.\n\n```go\nfunc (api *PrivateDebugAPI) ChaindbCompact() error\n```\n\n```go\nfunc (api *PrivateDebugAPI) ChaindbProperty(property string) (string, error)\n```\nChaindbProperty returns leveldb properties of the chain database.\n\n```go\nfunc (api *PrivateDebugAPI) SetHead(number hexutil.Uint64)\n```\nSetHead rewinds the head of the blockchain to a previous block.\n\n```go\ntype PublicAccountAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicAccountAPI provides an API to access accounts managed by this node. It offers only methods that can retrieve accounts.\n\n```go\nfunc NewPublicAccountAPI(b Backend) *PublicAccountAPI\n```\nNewPublicAccountAPI creates a new PublicAccountAPI.\n\n```go\nfunc (s *PublicAccountAPI) Accounts() [][]string\n```\nAccounts returns the collection of accounts this node manages\n\n```go\ntype PublicBlockChainAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicBlockChainAPI provides an API to access the Matrix blockchain. It offers only methods that operate on public data that is freely available to anyone.\n\n```go\nfunc NewPublicBlockChainAPI(b Backend) *PublicBlockChainAPI\n```\nNewPublicBlockChainAPI creates a new Matrix blockchain API.\n\n```go\nfunc (s *PublicBlockChainAPI) BlockNumber() *big.Int\n```\nBlockNumber returns the block number of the chain head.\n\n```go\nfunc (s *PublicBlockChainAPI) Call(ctx context.Context, manargs ManCallArgs, blockNr rpc.BlockNumber) (hexutil.Bytes, error)\n```\nCall executes the given transaction on the state for the given block number. It doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.\n\n```go\nfunc (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, manargs ManCallArgs) (hexutil.Uint64, error)\n```\nEstimateGas returns an estimate of the amount of gas needed to execute the given transaction against the current pending block.\n\n```go\nfunc (s *PublicBlockChainAPI) GetAuthFrom(strEntrustFrom string, height uint64) string\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetAuthFromByTime(strEntrustFrom string, time uint64) string\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetAuthGasAddress(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) (string, error)\n```\n钱包调用，根据块高查询委托gas授权地址\n\n```go\nfunc (s *PublicBlockChainAPI) GetBalance(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) ([]RPCBalanceType, error)\n```\nGetBalance returns the amount of wei for the given address in the state of the given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.\n\n```go\nfunc (s *PublicBlockChainAPI) GetBlackList() []string\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetBlockByHash(ctx context.Context, blockHash common.Hash, fullTx bool) (map[string]interface{}, error)\n```\nGetBlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, blockNr rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)\n```\nGetBlockByNumber returns the requested block. When blockNr is -1 the chain head is returned. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetCode(ctx context.Context, manAddress string, cointype string, blockNr rpc.BlockNumber) (hexutil.Bytes, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetDeposit(ctx context.Context, blockNr rpc.BlockNumber) ([]DepositDetail, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetDepositByAddr(ctx context.Context, straddr string, blockNr rpc.BlockNumber) (*RpcDepositBase, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetDestroyBalance(ctx context.Context, blockNr rpc.BlockNumber) (*big.Int, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetEntrustFrom(strAuthFrom string, height uint64) []string\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetEntrustFromByTime(strAuthFrom string, time uint64) []string\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetEntrustList(strAuthFrom string) []common.EntrustType\n```\n钱包调用\n\n```go\nfunc (api *PublicBlockChainAPI) GetFutureRewards(ctx context.Context, number rpc.BlockNumber) (interface{}, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetGasPrice() *big.Int\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetIPFSblock(strhash string)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetIPFSfirstcache()\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetIPFSsecondcache(strhash string)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetIPFSsnap(str string)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetInterest(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) (*hexutil.Big, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetMatrixCoin(ctx context.Context, blockNr rpc.BlockNumber) ([]string, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetMatrixCoinConfig(ctx context.Context, cointpy string, blockNr rpc.BlockNumber) ([]common.CoinConfig, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetMatrixStateByNum(ctx context.Context, key string, blockNr rpc.BlockNumber) (interface{}, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetSelfLevel() int\n```\nGetSelfLevel get self level from ca, including top node, buckets number and default.\n\n```go\nfunc (s *PublicBlockChainAPI) GetSignAccountsByHash(ctx context.Context, hash common.Hash) ([]common.VerifiedSign1, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetSignAccountsByNumber(ctx context.Context, blockNr rpc.BlockNumber) ([]common.VerifiedSign1, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetSlash(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) (*hexutil.Big, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, manAddress string, key string, cointype string, blockNr rpc.BlockNumber) (hexutil.Bytes, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetTopologyStatusByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*TopologyStatus, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (map[string]interface{}, error)\n```\nGetUncleByBlockHashAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)\n```\nGetUncleByBlockNumberAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint\n```\nGetUncleCountByBlockHash returns number of uncles in the block for the given block hash\n\n```go\nfunc (s *PublicBlockChainAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint\n```\nGetUncleCountByBlockNumber returns number of uncles in the block for the given block number\n\n```go\nfunc (s *PublicBlockChainAPI) GetUpTime(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) (*big.Int, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) GetValidatorGroupInfo(ctx context.Context, blockNr rpc.BlockNumber) (interface{}, error)\n```\n\n```go\nfunc (s *PublicBlockChainAPI) ImportSuperBlock(ctx context.Context, filePath string) (common.Hash, error)\n```\n\n```go\ntype PublicDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicDebugAPI is the collection of Matrix APIs exposed over the public debugging endpoint.\n\n```go\nfunc NewPublicDebugAPI(b Backend) *PublicDebugAPI\n```\nNewPublicDebugAPI creates a new API definition for the public debug methods of the Matrix service.\n\n```go\nfunc (api *PublicDebugAPI) GetAllChainInfo() map[string]interface{}\n```\n\n```go\nfunc (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (string, error)\n```\nGetBlockRlp retrieves the RLP encoded for of a single block.\n\n```go\nfunc (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (string, error)\n```\nPrintBlock retrieves a block and returns its pretty printed form.\n\n```go\nfunc (api *PublicDebugAPI) SeedHash(ctx context.Context, number uint64) (string, error)\n```\nSeedHash retrieves the seed hash of a block.\n\n```go\ntype PublicMatrixAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicMatrixAPI provides an API to access Matrix related information. It offers only methods that operate on public data that is freely available to anyone.\n\n```go\nfunc NewPublicMatrixAPI(b Backend) *PublicMatrixAPI\n```\nNewPublicMatrixAPI creates a new Matrix protocol API.\n\n```go\nfunc (s *PublicMatrixAPI) GasPrice(ctx context.Context) (*big.Int, error)\n```\nGasPrice returns a suggestion for a gas price.\n\n```go\nfunc (s *PublicMatrixAPI) ProtocolVersion() hexutil.Uint\n```\nProtocolVersion returns the current Matrix protocol version this node supports\n\n```go\nfunc (s *PublicMatrixAPI) Syncing() (interface{}, error)\n```\nSyncing returns false in case the node is currently not syncing with the network. It can be up to date or has not yet received the latest block headers from its pears. In case it is synchronizing: - startingBlock: block number this node started to synchronise from - currentBlock:  block number this node is currently importing - highestBlock:  block number of the highest block header this node has received from peers - pulledStates:  number of state entries processed until now - knownStates:   number of known state entries that still need to be pulled\n\n```go\ntype PublicNetAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicNetAPI offers network related RPC methods\n\n```go\nfunc NewPublicNetAPI(net *p2p.Server, networkVersion uint64) *PublicNetAPI\n```\nNewPublicNetAPI creates a new net API instance.\n\n```go\nfunc (s *PublicNetAPI) Listening() bool\n```\nListening returns an indication if the node is listening for network connections.\n\n```go\nfunc (s *PublicNetAPI) PeerCount() hexutil.Uint\n```\nPeerCount returns the number of connected peers\n\n```go\nfunc (s *PublicNetAPI) Version() string\n```\nVersion returns the current matrix protocol version.\n\n```go\ntype PublicTransactionPoolAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicTransactionPoolAPI exposes methods for the RPC interface\n\n```go\nfunc NewPublicTransactionPoolAPI(b Backend, nonceLock *AddrLocker) *PublicTransactionPoolAPI\n```\nNewPublicTransactionPoolAPI creates a new RPC service with methods specific for the transaction pool.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint\n```\nGetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint\n```\nGetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint, cointy string) hexutil.Bytes\n```\nGetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint, cointy string) hexutil.Bytes\n```\nGetRawTransactionByBlockNumberAndIndex returns the bytes of the transaction for the given block number and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)\n```\nGetRawTransactionByHash returns the bytes of the transaction for the given hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint, cointy string) *RPCTransaction1\n```\nGetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint, cointy string) *RPCTransaction1\n```\nGetTransactionByBlockNumberAndIndex returns the transaction for the given block number and index.\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) *RPCTransaction1\n```\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, strAddress string, blockNr rpc.BlockNumber) (*hexutil.Uint64, error)\n```\nGetTransactionCount returns the number of transactions the given address has sent for the given block number\n\n```go\nfunc (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)\n```\nGetTransactionReceipt returns the transaction receipt for the given transaction hash.\n\n```go\nfunc (s *PublicTransactionPoolAPI) PendingTransactions() ([]*RPCTransaction, error)\n```\nPendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages.\n\n```go\nfunc (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs1 SendTxArgs1, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64) (common.Hash, error)\n```\nResend accepts an existing transaction and a new gas price and limit. It will remove the given transaction from the pool and reinsert it with the new gas price and limit.\n\n```go\nfunc (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, args1 SendTxArgs1) (common.Hash, error)\n```\nSendRawTransaction will add the signed transaction to the transaction pool. The sender is responsible for signing the transaction and using the correct nonce.\n\n```go\nfunc (s *PublicTransactionPoolAPI) SendRawTransaction_old(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)\n```\n\n```go\nfunc (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args1 SendTxArgs1) (common.Hash, error)\n```\nSendTransaction creates a transaction for the given argument, sign it and submit it to the transaction pool.\n\n```go\nfunc (s *PublicTransactionPoolAPI) Sign(strAddr string, data hexutil.Bytes) (hexutil.Bytes, error)\n```\nSign calculates an ECDSA signature for: keccack256(\"\\\\x19Matrix Signed Message:\\\\n\" + len(message) + message).\n\nNote, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons.\n\nThe account associated with addr must be unlocked.\n\n[https://github.com/MatrixAINetwork/wiki/wiki/JSON-RPC#man\\_sign](https://github.com/MatrixAINetwork/wiki/wiki/JSON-RPC#man_sign)\n\n```go\nfunc (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args1 SendTxArgs1) (*SignTransactionResult, error)\n```\nSignTransaction will sign the given transaction with the from account. The node needs to have the private key of the account corresponding with the given from address and it needs to be unlocked.\n\n```go\ntype PublicTxPoolAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicTxPoolAPI offers and API for the transaction pool. It only operates on data that is non confidential.\n\n```go\nfunc NewPublicTxPoolAPI(b Backend) *PublicTxPoolAPI\n```\nNewPublicTxPoolAPI creates a new tx pool service that gives information about the transaction pool.\n\n```go\nfunc (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransaction\n```\nContent returns the transactions contained within the transaction pool.\n\n```go\nfunc (s *PublicTxPoolAPI) GetTxNmap() map[uint32]common.Hash\n```\n\n```go\nfunc (s *PublicTxPoolAPI) Inspect() map[string]map[string]map[string]string\n```\nInspect retrieves the content of the transaction pool and flattens it into an easily inspectable list.\n\n```go\nfunc (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint\n```\nStatus returns the number of pending and queued transaction in the pool.\n\n```go\ntype RPCBalanceType struct {\n\tAccountType uint32       `json:\"accountType\"`\n\tBalance     *hexutil.Big `json:\"balance\"`\n}\n```\n\n```go\ntype RPCTransaction struct {\n\tBlockHash        common.Hash     `json:\"blockHash\"`\n\tBlockNumber      *hexutil.Big    `json:\"blockNumber\"`\n\tFrom             common.Address  `json:\"from\"`\n\tGas              hexutil.Uint64  `json:\"gas\"`\n\tGasPrice         *hexutil.Big    `json:\"gasPrice\"`\n\tHash             common.Hash     `json:\"hash\"`\n\tInput            hexutil.Bytes   `json:\"input\"`\n\tNonce            hexutil.Uint64  `json:\"nonce\"`\n\tTo               *common.Address `json:\"to\"`\n\tTransactionIndex hexutil.Uint    `json:\"transactionIndex\"`\n\tValue            *hexutil.Big    `json:\"value\"`\n\tV                *hexutil.Big    `json:\"v\"`\n\tR                *hexutil.Big    `json:\"r\"`\n\tS                *hexutil.Big    `json:\"s\"`\n\tTxEnterType      byte            `json:\"TxEnterType\"`\n\tIsEntrustTx      bool            `json:\"IsEntrustTx\"`\n\tCurrency         string          `json:\"Currency\"`\n\tCommitTime       hexutil.Uint64  `json:\"CommitTime\"`\n\tMatrixType       byte            `json:\"matrixType\"`\n\tExtraTo          []*ExtraTo_Mx   `json:\"extra_to\"`\n}\n```\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\* RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction\n\n```go\ntype RPCTransaction1 struct {\n\tBlockHash        common.Hash    `json:\"blockHash\"`\n\tBlockNumber      *hexutil.Big   `json:\"blockNumber\"`\n\tFrom             string         `json:\"from\"`\n\tGas              hexutil.Uint64 `json:\"gas\"`\n\tGasPrice         *hexutil.Big   `json:\"gasPrice\"`\n\tHash             common.Hash    `json:\"hash\"`\n\tInput            hexutil.Bytes  `json:\"input\"`\n\tNonce            hexutil.Uint64 `json:\"nonce\"`\n\tTo               *string        `json:\"to\"`\n\tTransactionIndex hexutil.Uint   `json:\"transactionIndex\"`\n\tValue            *hexutil.Big   `json:\"value\"`\n\tV                *hexutil.Big   `json:\"v\"`\n\tR                *hexutil.Big   `json:\"r\"`\n\tS                *hexutil.Big   `json:\"s\"`\n\tTxEnterType      byte           `json:\"TxEnterType\"`\n\tIsEntrustTx      bool           `json:\"IsEntrustTx\"`\n\tCurrency         string         `json:\"Currency\"`\n\tCommitTime       hexutil.Uint64 `json:\"CommitTime\"`\n\tMatrixType       byte           `json:\"matrixType\"`\n\tExtraTo          []*ExtraTo_Mx1 `json:\"extra_to\"`\n}\n```\n\n```go\nfunc RPCTransactionToString(data *RPCTransaction) *RPCTransaction1\n```\n\n```go\ntype RpcDepositBase struct {\n\tAddressA0     string\n\tAddressA1     string\n\tOnlineTime    *hexutil.Big\n\tRole          *hexutil.Big\n\tPositionNonce uint64\n\tDpstmsg       []RpcDepositMsg\n}\n```\n\n```go\ntype RpcDepositMsg struct {\n\tDepositType      uint64 //0-活期,1-定期1个月,3-定期3个月,6-定期6个月\n\tDepositAmount    *hexutil.Big\n\tInterest         *hexutil.Big\n\tSlash            *hexutil.Big\n\tBeginTime        uint64 //定期起始时间，为当前确认时间(evm.Time)\n\tEndTime          uint64 //定期到期时间，(BeginTime+定期时长)\n\tPosition         uint64 //仓位\n\tWithDrawInfolist []RpcWithDrawInfo\n}\n```\n没把定期DepositAmount和WithDrawTime放到ZeroDepositlist里，因为这样处理方便，暂时这样用\n\n```go\ntype RpcOwnerInfo struct {\n\tOwner           string //common.Address\n\tWithdrawAllTime uint64\n\tSignAddress     string //common.Address `rlp:\"-\"`\n}\n```\n\n```go\ntype RpcValidatorGroupState struct {\n\tOwnerInfo    RpcOwnerInfo\n\tReward       vm.RewardRate\n\tValidatorMap []RpcValidatorInfo\n}\n```\n\n```go\ntype RpcValidatorInfo struct {\n\tAddress   string //common.Address\n\tReward    *big.Int\n\tAllAmount *big.Int //`rlp:\"-\"`\n\tCurrent   validatorGroup.CurrentData\n\tPositions []validatorGroup.DepositPos\n}\n```\n\n```go\ntype RpcWithDrawInfo struct {\n\tWithDrawAmount *hexutil.Big\n\tWithDrawTime   uint64 //退选时间\n}\n```\n退选信息\n\n```go\ntype SendTxArgs struct {\n\tFrom     common.Address  `json:\"from\"`\n\tCurrency string          `json:\"currency\"`\n\tTo       *common.Address `json:\"to\"`\n\tGas      *hexutil.Uint64 `json:\"gas\"`\n\tGasPrice *hexutil.Big    `json:\"gasPrice\"`\n\tValue    *hexutil.Big    `json:\"value\"`\n\tNonce    *hexutil.Uint64 `json:\"nonce\"`\n\t// We accept \"data\" and \"input\" for backwards-compatibility reasons. \"input\" is the\n\t// newer name and should be preferred by clients.\n\tData        *hexutil.Bytes `json:\"data\"`\n\tInput       *hexutil.Bytes `json:\"input\"`\n\tV           *hexutil.Big   `json:\"v\"`\n\tR           *hexutil.Big   `json:\"r\"`\n\tS           *hexutil.Big   `json:\"s\"`\n\tTxType      byte           `json:\"txType\"`     //\n\tLockHeight  uint64         `json:\"lockHeight\"` //\n\tIsEntrustTx byte           `json:\"isEntrustTx\"`\n\tCommitTime  uint64         `json:\"commitTime\"`\n\tExtraTo     []*ExtraTo_Mx  `json:\"extra_to\"` //\n}\n```\nSendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.\n\n```go\nfunc StrArgsToByteArgs(args1 SendTxArgs1) (args SendTxArgs, err error)\n```\n\n```go\ntype SendTxArgs1 struct {\n\tFrom     string          `json:\"from\"`\n\tTo       *string         `json:\"to\"`\n\tGas      *hexutil.Uint64 `json:\"gas\"`\n\tGasPrice *hexutil.Big    `json:\"gasPrice\"`\n\tValue    *hexutil.Big    `json:\"value\"`\n\tNonce    *hexutil.Uint64 `json:\"nonce\"`\n\t// We accept \"data\" and \"input\" for backwards-compatibility reasons. \"input\" is the\n\t// newer name and should be preferred by clients.\n\tData        *hexutil.Bytes `json:\"data\"`\n\tInput       *hexutil.Bytes `json:\"input\"`\n\tV           *hexutil.Big   `json:\"v\"`\n\tR           *hexutil.Big   `json:\"r\"`\n\tS           *hexutil.Big   `json:\"s\"`\n\tCurrency    *string        `json:\"currency\"`\n\tTxType      byte           `json:\"txType\"`     //\n\tLockHeight  uint64         `json:\"lockHeight\"` //\n\tIsEntrustTx byte           `json:\"isEntrustTx\"`\n\tCommitTime  uint64         `json:\"commitTime\"`\n\tExtraTo     []*ExtraTo_Mx1 `json:\"extra_to\"` //\n}\n```\nSendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.\n\n```go\ntype SignTransactionResult struct {\n\tRaw hexutil.Bytes         `json:\"raw\"`\n\tTx  types.SelfTransaction `json:\"tx\"`\n}\n```\nSignTransactionResult represents a RLP encoded signed transaction.\n\n```go\ntype StructLogRes struct {\n\tPc      uint64             `json:\"pc\"`\n\tOp      string             `json:\"op\"`\n\tGas     uint64             `json:\"gas\"`\n\tGasCost uint64             `json:\"gasCost\"`\n\tDepth   int                `json:\"depth\"`\n\tError   error              `json:\"error,omitempty\"`\n\tStack   *[]string          `json:\"stack,omitempty\"`\n\tMemory  *[]string          `json:\"memory,omitempty\"`\n\tStorage *map[string]string `json:\"storage,omitempty\"`\n}\n```\nStructLogRes stores a structured log emitted by the EVM while replaying a transaction in debug mode\n\n```go\nfunc FormatLogs(logs []vm.StructLog) []StructLogRes\n```\nformatLogs formats EVM returned structured logs for json output\n\n```go\ntype TopologyStatus struct {\n\tLeaderReelect         bool       `json:\"leader_reelect\"`\n\tValidators            []NodeInfo `json:\"validators\"`\n\tBackupValidators      []NodeInfo `json:\"backup_validators\"`\n\tMiners                []NodeInfo `json:\"miners\"`\n\tElectValidators       []NodeInfo `json:\"elect_validators\"`\n\tElectBackupValidators []NodeInfo `json:\"elect_backup_validators\"`\n}\n```\n\n","path":"github.com/chainopen/matrixchaincode/internal/manapi","name":"manapi","synopsis":"","isRedistributable":true}
