Documentation ¶
Index ¶
- Constants
- type ConvertedPrice
- type EstimateFeeResult
- type ListCustomToken
- type OutCoinKey
- func (outCoinKey OutCoinKey) OtaKey() string
- func (outCoinKey OutCoinKey) PaymentAddress() string
- func (outCoinKey OutCoinKey) ReadonlyKey() string
- func (outCoinKey *OutCoinKey) SetOTAKey(v string)
- func (outCoinKey *OutCoinKey) SetPaymentAddress(v string)
- func (outCoinKey *OutCoinKey) SetReadonlyKey(v string)
- type RPCServer
- func (server *RPCServer) AuthorizedSubmitKey(otaStr string, accessToken string, fromHeight uint64, isReset bool) ([]byte, error)
- func (server *RPCServer) CheckShieldStatus(txHash string) ([]byte, error)
- func (server *RPCServer) CheckTradeStatus(txHash string) ([]byte, error)
- func (server *RPCServer) ConvertPDEPrice(tokenToSell, tokenToBuy string, amount uint64) ([]byte, error)
- func (server *RPCServer) ConvertPaymentAddress(addr string) ([]byte, error)
- func (server *RPCServer) CreateAndSendTokenInitTransaction(privateKey string, tokenName, tokenSymbol string, initAmount uint64) ([]byte, error)
- func (server *RPCServer) EstimateFeeWithEstimator(defaultFee int, shardID byte, numBlock int, tokenID string) ([]byte, error)
- func (server *RPCServer) GenerateShieldingMultiSigAddress(paymentAddress, tokenID string) ([]byte, error)
- func (server *RPCServer) GetActiveShards() ([]byte, error)
- func (server *RPCServer) GetAllBridgeTokens() ([]byte, error)
- func (server *RPCServer) GetBalanceByPrivateKey(privateKey string) ([]byte, error)
- func (server *RPCServer) GetBeaconBestState() ([]byte, error)
- func (server *RPCServer) GetBestBlock() ([]byte, error)
- func (server *RPCServer) GetBestBlockHash() ([]byte, error)
- func (server *RPCServer) GetBlockchainInfo() ([]byte, error)
- func (server *RPCServer) GetBurnPRVPeggingProof(txHash string, isBSC ...bool) ([]byte, error)
- func (server *RPCServer) GetBurnProof(txHash string, isBSC ...bool) ([]byte, error)
- func (server *RPCServer) GetBurnProofForSC(txHash string) ([]byte, error)
- func (server *RPCServer) GetCommitteeState(beaconHeight uint64, beaconRootHash string) ([]byte, error)
- func (server *RPCServer) GetCommitteeStateByShardID(shardID int, shardRootHash string) ([]byte, error)
- func (server *RPCServer) GetEncodedTransactionsByHashes(txHashList []string) ([]byte, error)
- func (server *RPCServer) GetKeySubmissionInfo(otaStr string) ([]byte, error)
- func (server *RPCServer) GetListOutputCoinsByRPCV1(outCoinKey *OutCoinKey, tokenID string, h uint64) ([]byte, error)
- func (server *RPCServer) GetListOutputCoinsByRPCV2(outCoinKey *OutCoinKey, tokenID string, _ uint64) ([]byte, error)
- func (server *RPCServer) GetListRewardAmount() ([]byte, error)
- func (server *RPCServer) GetMiningInfo() ([]byte, error)
- func (server *RPCServer) GetOTACoinLength() ([]byte, error)
- func (server *RPCServer) GetOTACoinsByIndices(shardID byte, tokenID string, idxList []uint64) ([]byte, error)
- func (server *RPCServer) GetPDEState(beaconHeight uint64) ([]byte, error)
- func (server *RPCServer) GetPortalShieldingRequestStatus(shieldID string) ([]byte, error)
- func (server *RPCServer) GetPortalUnShieldingRequestStatus(unShieldID string) ([]byte, error)
- func (server *RPCServer) GetRawMemPool() ([]byte, error)
- func (server *RPCServer) GetRewardAmount(paymentAddress string) ([]byte, error)
- func (server *RPCServer) GetShardBestState(shardID byte) ([]byte, error)
- func (server *RPCServer) GetSyncStats() ([]byte, error)
- func (server *RPCServer) GetTokenByRPC(tokenID string) ([]byte, error)
- func (server *RPCServer) GetTransactionByHash(txHash string) ([]byte, error)
- func (server *RPCServer) GetTxHashByPublicKey(publicKeys []string) ([]byte, error)
- func (server *RPCServer) GetTxHashByReceiver(paymentAddress string) ([]byte, error)
- func (server *RPCServer) GetTxHashBySerialNumber(snList []string, tokenID string, shardID byte) ([]byte, error)
- func (server *RPCServer) GetURL() string
- func (server *RPCServer) HasSerialNumberByRPC(shardID byte, tokenID string, snList []string) ([]byte, error)
- func (server *RPCServer) HasSerialNumberInMemPool(snList []string) ([]byte, error)
- func (server *RPCServer) InitToURL(url string) *RPCServer
- func (server *RPCServer) ListBridgeTokenByRPC() ([]byte, error)
- func (server *RPCServer) ListPrivacyCustomTokenByRPC() ([]byte, error)
- func (server *RPCServer) ListUnspentOutputCoinsByRPC(privateKey string) ([]byte, error)
- func (server *RPCServer) RandomCommitments(shardID byte, inputCoins []jsonresult.OutCoin, tokenID string) ([]byte, error)
- func (server *RPCServer) RandomCommitmentsAndPublicKeys(shardID byte, tokenID string, lenDecoy int) ([]byte, error)
- func (server *RPCServer) RetrieveBlock(blockHash string, verbosity string) ([]byte, error)
- func (server *RPCServer) SendPostRequestWithQuery(query string) ([]byte, error)
- func (server *RPCServer) SendQuery(method string, params []interface{}) ([]byte, error)
- func (server *RPCServer) SendRawTokenTx(encodedTx string) ([]byte, error)
- func (server *RPCServer) SendRawTx(encodedTx string) ([]byte, error)
- func (server *RPCServer) SubmitKey(otaStr string) ([]byte, error)
- type TokenInitParam
Constants ¶
const (
// reward
CreateRawWithDrawTransaction = "withdrawreward"
)
rpc cmd method
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConvertedPrice ¶
ConvertedPrice represents a price conversion between two tokenIDs.
type EstimateFeeResult ¶
EstimateFeeResult represents an estimated fee result returned by the remote server.
type ListCustomToken ¶
type ListCustomToken struct { ID int `json:"Id"` Result struct { ListCustomToken []struct { ID string `json:"ID"` Name string `json:"Name"` Symbol string `json:"Symbol"` Image string `json:"Image"` Amount float64 `json:"Amount"` IsPrivacy bool `json:"IsPrivacy"` IsBridgeToken bool `json:"IsBridgeToken"` ListTxs []interface{} `json:"ListTxs"` CountTxs int `json:"CountTxs"` InitiatorPublicKey string `json:"InitiatorPublicKey"` TxInfo string `json:"TxInfo"` } `json:"ListCustomToken"` } `json:"Result"` Error interface{} `json:"Error"` Params []interface{} `json:"Params"` Method string `json:"Method"` Jsonrpc string `json:"JsonRPC"` }
ListCustomToken represents the custom-token listing result returned by the remote server.
type OutCoinKey ¶
type OutCoinKey struct {
// contains filtered or unexported fields
}
OutCoinKey is used to retrieve output coins via RPC.
The payment addresses is required in all cases. For retrieving output coins V2, the ota key is required. Readonly keys are optional.
func NewOutCoinKey ¶
func NewOutCoinKey(paymentAddress, otaKey, readonlyKey string) *OutCoinKey
NewOutCoinKey create a new OutCoinKey with the given parameters.
func (OutCoinKey) OtaKey ¶
func (outCoinKey OutCoinKey) OtaKey() string
OtaKey returns the ota key of an OutCoinKey.
func (OutCoinKey) PaymentAddress ¶
func (outCoinKey OutCoinKey) PaymentAddress() string
PaymentAddress returns the payment address of an OutCoinKey.
func (OutCoinKey) ReadonlyKey ¶
func (outCoinKey OutCoinKey) ReadonlyKey() string
ReadonlyKey returns the read-only of an OutCoinKey.
func (*OutCoinKey) SetOTAKey ¶
func (outCoinKey *OutCoinKey) SetOTAKey(v string)
SetOTAKey sets v as the ota key of an OutCoinKey.
func (*OutCoinKey) SetPaymentAddress ¶
func (outCoinKey *OutCoinKey) SetPaymentAddress(v string)
SetPaymentAddress sets v as the payment address of an OutCoinKey.
func (*OutCoinKey) SetReadonlyKey ¶
func (outCoinKey *OutCoinKey) SetReadonlyKey(v string)
SetReadonlyKey sets v as the read-only key of an OutCoinKey.
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
RPCServer represents a RPC host server.
func NewRPCServer ¶
NewRPCServer creates a new RPCServer pointing to the given url.
func (*RPCServer) AuthorizedSubmitKey ¶
func (server *RPCServer) AuthorizedSubmitKey(otaStr string, accessToken string, fromHeight uint64, isReset bool) ([]byte, error)
AuthorizedSubmitKey submits an OTA Key in an authorized manner for more privileges.
func (*RPCServer) CheckShieldStatus ¶
CheckShieldStatus checks the status of a decentralized shielding transaction.
func (*RPCServer) CheckTradeStatus ¶
CheckTradeStatus retrieves the status of a trading transaction.
func (*RPCServer) ConvertPDEPrice ¶
func (server *RPCServer) ConvertPDEPrice(tokenToSell, tokenToBuy string, amount uint64) ([]byte, error)
ConvertPDEPrice gets the pDEX to check the price between to tokens.
func (*RPCServer) ConvertPaymentAddress ¶
ConvertPaymentAddress calls the full-node to convert a payment address into the oldest version.
func (*RPCServer) CreateAndSendTokenInitTransaction ¶
func (server *RPCServer) CreateAndSendTokenInitTransaction(privateKey string, tokenName, tokenSymbol string, initAmount uint64) ([]byte, error)
CreateAndSendTokenInitTransaction has the server create and broadcast a transaction that initializes a new token on the network.
NOTE: PrivateKey must be supplied and sent to the server.
func (*RPCServer) EstimateFeeWithEstimator ¶
func (server *RPCServer) EstimateFeeWithEstimator(defaultFee int, shardID byte, numBlock int, tokenID string) ([]byte, error)
EstimateFeeWithEstimator retrieves an estimate fee for a tokenID.
func (*RPCServer) GenerateShieldingMultiSigAddress ¶
func (server *RPCServer) GenerateShieldingMultiSigAddress(paymentAddress, tokenID string) ([]byte, error)
GenerateShieldingMultiSigAddress calls the remote node to generate the depositing address for a payment address w.r.t to a tokenID.
func (*RPCServer) GetActiveShards ¶
GetActiveShards retrieves the active shards of the network.
func (*RPCServer) GetAllBridgeTokens ¶
GetAllBridgeTokens retrieves the list of bridge tokens in the network.
func (*RPCServer) GetBalanceByPrivateKey ¶
GetBalanceByPrivateKey retrieves the PRV balance of a private key.
NOTE: PrivateKey must be supplied and sent to the server.
func (*RPCServer) GetBeaconBestState ¶
GetBeaconBestState returns the best state of the beacon chain.
func (*RPCServer) GetBestBlock ¶
GetBestBlock returns the best block numbers (for beacon and shard chains).
func (*RPCServer) GetBestBlockHash ¶
GetBestBlockHash returns the current best block hashes.
func (*RPCServer) GetBlockchainInfo ¶
GetBlockchainInfo returns the current state of the Incognito network.
func (*RPCServer) GetBurnPRVPeggingProof ¶
GetBurnPRVPeggingProof retrieves the burning prv pegging proof of a transaction.
func (*RPCServer) GetBurnProof ¶
GetBurnProof retrieves the burning proof of a transaction.
func (*RPCServer) GetBurnProofForSC ¶
GetBurnProofForSC retrieves the burning proof of a transaction for depositing to smart contracts.
func (*RPCServer) GetCommitteeState ¶
func (server *RPCServer) GetCommitteeState(beaconHeight uint64, beaconRootHash string) ([]byte, error)
GetCommitteeState retrieves the committee state at the given beacon height and beacon root hash. This RPC is mainly used for debugging purposes.
func (*RPCServer) GetCommitteeStateByShardID ¶
func (server *RPCServer) GetCommitteeStateByShardID(shardID int, shardRootHash string) ([]byte, error)
GetCommitteeStateByShardID retrieves the committee state of a shard given a root hash. This RPC is mainly used for debugging purposes.
func (*RPCServer) GetEncodedTransactionsByHashes ¶
GetEncodedTransactionsByHashes retrieves base58-encoded transactions given their hashes.
func (*RPCServer) GetKeySubmissionInfo ¶
GetKeySubmissionInfo returns the information of an OTAKey if it has been submitted.
func (*RPCServer) GetListOutputCoinsByRPCV1 ¶
func (server *RPCServer) GetListOutputCoinsByRPCV1(outCoinKey *OutCoinKey, tokenID string, h uint64) ([]byte, error)
GetListOutputCoinsByRPCV1 retrieves list of output coins of an OutCoinKey and returns the result in raw json bytes.
func (*RPCServer) GetListOutputCoinsByRPCV2 ¶
func (server *RPCServer) GetListOutputCoinsByRPCV2(outCoinKey *OutCoinKey, tokenID string, _ uint64) ([]byte, error)
GetListOutputCoinsByRPCV2 retrieves list of output coins of an OutCoinKey and returns the result in raw json bytes.
func (*RPCServer) GetListRewardAmount ¶
GetListRewardAmount returns the current reward amounts on the network.
func (*RPCServer) GetMiningInfo ¶
GetMiningInfo retrieves the mining status of a remote (validator) node.
This RPC should call to the (staked) node, instead of a full-node.
func (*RPCServer) GetOTACoinLength ¶
GetOTACoinLength returns the number of OTA coins for each shard.
func (*RPCServer) GetOTACoinsByIndices ¶
func (server *RPCServer) GetOTACoinsByIndices(shardID byte, tokenID string, idxList []uint64) ([]byte, error)
GetOTACoinsByIndices returns the list of output coins given the indices.
func (*RPCServer) GetPDEState ¶
GetPDEState retrieves the pDEX state at the given beacon height.
func (*RPCServer) GetPortalShieldingRequestStatus ¶
GetPortalShieldingRequestStatus retrieves the status of a port shielding request.
func (*RPCServer) GetPortalUnShieldingRequestStatus ¶
GetPortalUnShieldingRequestStatus retrieves the status of a portal un-shielding request.
func (*RPCServer) GetRawMemPool ¶
GetRawMemPool returns a list of transactions currently in the pool.
func (*RPCServer) GetRewardAmount ¶
GetRewardAmount gets the reward amounts of a user.
func (*RPCServer) GetShardBestState ¶
GetShardBestState returns the best state of a shard chain.
func (*RPCServer) GetSyncStats ¶
GetSyncStats retrieves the sync statistics of a remote (validator) node.
This RPC should call to the (staked) node, instead of a full-node.
func (*RPCServer) GetTokenByRPC ¶
GetTokenByRPC retrieves all the token's information on the blockchain.
func (*RPCServer) GetTransactionByHash ¶
GetTransactionByHash retrieves the transaction detail given its hash.
func (*RPCServer) GetTxHashByPublicKey ¶
GetTxHashByPublicKey returns the list of transactions sent to a public key.
func (*RPCServer) GetTxHashByReceiver ¶
GetTxHashByReceiver returns the list of transactions V1 sent to a payment address.
func (*RPCServer) GetTxHashBySerialNumber ¶
func (server *RPCServer) GetTxHashBySerialNumber(snList []string, tokenID string, shardID byte) ([]byte, error)
GetTxHashBySerialNumber returns the list of transactions which have spent the given serial numbers.
func (*RPCServer) HasSerialNumberByRPC ¶
func (server *RPCServer) HasSerialNumberByRPC(shardID byte, tokenID string, snList []string) ([]byte, error)
HasSerialNumberByRPC checks if the provided serial numbers have been spent or not.
Returned result in raw json bytes.
func (*RPCServer) HasSerialNumberInMemPool ¶
HasSerialNumberInMemPool checks if the provided serial numbers are currently in the pool or not.
Returned result in raw json bytes.
func (*RPCServer) ListBridgeTokenByRPC ¶
ListBridgeTokenByRPC lists all bridge-tokens currently present on the blockchain.
func (*RPCServer) ListPrivacyCustomTokenByRPC ¶
ListPrivacyCustomTokenByRPC lists all tokens currently present on the blockchain.
func (*RPCServer) ListUnspentOutputCoinsByRPC ¶
ListUnspentOutputCoinsByRPC retrieves list of output coins of an OutCoinKey and returns the result in raw json bytes.
NOTE: PrivateKey must be supplied and sent to the server.
func (*RPCServer) RandomCommitments ¶
func (server *RPCServer) RandomCommitments(shardID byte, inputCoins []jsonresult.OutCoin, tokenID string) ([]byte, error)
RandomCommitments gets a list of random commitments to create transactions of version 1.
func (*RPCServer) RandomCommitmentsAndPublicKeys ¶
func (server *RPCServer) RandomCommitmentsAndPublicKeys(shardID byte, tokenID string, lenDecoy int) ([]byte, error)
RandomCommitmentsAndPublicKeys gets a list of random commitments to create transactions of version 2.
func (*RPCServer) RetrieveBlock ¶
RetrieveBlock returns the detail of a block given its hash.
func (*RPCServer) SendPostRequestWithQuery ¶
SendPostRequestWithQuery sends a query to the remote server using the POST method.
func (*RPCServer) SendQuery ¶
SendQuery sends a query to the remote server given the method and parameters.
func (*RPCServer) SendRawTokenTx ¶
SendRawTokenTx broadcasts a base58-encoded token transaction to the network.