Documentation ¶
Index ¶
- func BabyJubJub() *edwards.Param
- func BcoinDialJsonRpc(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*rpcclient.Client, error)
- func BcoinGenerateKeyPair(version byte) (address *string, privateKey *ecdsa.PrivateKey, err error)
- func BcoinGetBlock(networkID, rpcURL, rpcAPIUser, rpcAPIKey, hash string) (map[string]interface{}, error)
- func BcoinGetChainInfo(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (map[string]interface{}, error)
- func BcoinGetDifficulty(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*float64, error)
- func BcoinGetHeader(networkID, rpcURL, rpcAPIUser, rpcAPIKey, hash string) (map[string]interface{}, error)
- func BcoinGetHeight(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*int64, error)
- func BcoinGetNetworkStatus(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*api.NetworkStatus, error)
- func BcoinInvokeJsonRpcClient(networkID, rpcURL, rpcAPIUser, rpcAPIKey, method string, params []interface{}, ...) error
- func BcoinResolveJsonRpcClient(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*rpcclient.Client, error)
- func C25519ComputeSecret(privateKey, peerPublicKey []byte) []byte
- func C25519GenerateKeyPair() (publicKey, privateKey []byte, err error)
- func EVMBroadcastSignedTx(rpcClientKey, rpcURL string, signedTx *types.Transaction) error
- func EVMBroadcastTx(ctx context.Context, rpcClientKey, rpcURL string, tx *types.Transaction, ...) error
- func EVMChainConfigFactory(chainID *big.Int) *params.ChainConfig
- func EVMDialJsonRpc(rpcClientKey, rpcURL string) (*ethclient.Client, error)
- func EVMEncodeABI(method *abi.Method, params ...interface{}) ([]byte, error)
- func EVMEthCall(rpcClientKey, rpcURL string, params []interface{}) (*api.EthereumJsonRpcResponse, error)
- func EVMGenerateKeyPair() (address *string, privateKey *ecdsa.PrivateKey, err error)
- func EVMGetBlockByNumber(rpcClientKey, rpcURL string, blockNumber uint64) (*api.EthereumJsonRpcResponse, error)
- func EVMGetBlockGasLimit(rpcClientKey, rpcURL string) (uint64, error)
- func EVMGetBlockNumber(rpcClientKey, rpcURL string) *uint64
- func EVMGetChainConfig(rpcClientKey, rpcURL string) (*params.ChainConfig, error)
- func EVMGetChainID(rpcClientKey, rpcURL string) (*big.Int, error)
- func EVMGetCode(rpcClientKey, rpcURL, addr, scope string) (*string, error)
- func EVMGetGasPrice(rpcClientKey, rpcURL string) *string
- func EVMGetHeaderByNumber(rpcClientKey, rpcURL string, blockNumber uint64) (*api.EthereumJsonRpcResponse, error)
- func EVMGetLatestBlock(rpcClientKey, rpcURL string) (*api.EthereumJsonRpcResponse, error)
- func EVMGetLatestBlockNumber(rpcClientKey, rpcURL string) (uint64, error)
- func EVMGetNativeBalance(rpcClientKey, rpcURL, addr string) (*big.Int, error)
- func EVMGetNetworkStatus(rpcClientKey, rpcURL string) (*api.NetworkStatus, error)
- func EVMGetPeerCount(rpcClientKey, rpcURL string) uint64
- func EVMGetProtocolVersion(rpcClientKey, rpcURL string) *string
- func EVMGetSyncProgress(client *ethclient.Client) (*ethereum.SyncProgress, error)
- func EVMGetTokenBalance(rpcClientKey, rpcURL, tokenAddr, addr string, contractABI interface{}) (*big.Int, error)
- func EVMGetTokenSymbol(rpcClientKey, rpcURL, from, tokenAddr string, contractABI interface{}) (*string, error)
- func EVMGetTxReceipt(rpcClientKey, rpcURL, txHash, from string) (*types.Receipt, error)
- func EVMHashFunctionSelector(sel string) string
- func EVMInvokeJsonRpcClient(rpcClientKey, rpcURL, method string, params []interface{}, ...) error
- func EVMMarshalEncryptedKey(addr common.Address, privateKey *ecdsa.PrivateKey, secret string) ([]byte, error)
- func EVMMarshalKeyPairJSON(addr common.Address, privateKey *ecdsa.PrivateKey) ([]byte, error)
- func EVMResolveEthClient(rpcClientKey, rpcURL string) (*ethclient.Client, error)
- func EVMResolveJsonRpcClient(rpcClientKey, rpcURL string) (*ethrpc.Client, error)
- func EVMSignTx(rpcClientKey, rpcURL, from, privateKey string, to, data *string, val *big.Int, ...) (*types.Transaction, *string, error)
- func EVMTraceTx(rpcClientKey, rpcURL string, hash *string) (interface{}, error)
- func EVMTxFactory(rpcClientKey, rpcURL, from string, to, data *string, val *big.Int, ...) (types.Signer, *types.Transaction, []byte, error)
- func FromECDSA(priv *ecdsa.PrivateKey) []byte
- func HexToAddress(s string) common.Address
- func Keccak256(str string) []byte
- func TECGenerateKeyPair() (publicKey, privateKey []byte, err error)
- func TECSign(privateKey, message []byte) ([]byte, error)
- func TECVerify(publicKey, message []byte, signature []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BabyJubJub ¶
BabyJubJub describes the twisted Edwards curve, babyJubJub, required for zero-knowledge proofs
func BcoinDialJsonRpc ¶
BcoinDialJsonRpc - dials and caches a new JSON-RPC client instance at the JSON-RPC url and caches it using the given network id
func BcoinGenerateKeyPair ¶
func BcoinGenerateKeyPair(version byte) (address *string, privateKey *ecdsa.PrivateKey, err error)
BcoinGenerateKeyPair generates a bitcoin address using the given hex representation of a secp256k1 private key; see http://bcoin.io/guides/generate-address.html; returns the address and private key, or an error
func BcoinGetBlock ¶
func BcoinGetBlock(networkID, rpcURL, rpcAPIUser, rpcAPIKey, hash string) (map[string]interface{}, error)
BcoinGetBlock retrieves the latsest block
func BcoinGetChainInfo ¶
func BcoinGetChainInfo(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (map[string]interface{}, error)
BcoinGetChainInfo retrieves chain info
func BcoinGetDifficulty ¶
BcoinGetDifficulty retrieves the current difficulty target
func BcoinGetHeader ¶
func BcoinGetHeader(networkID, rpcURL, rpcAPIUser, rpcAPIKey, hash string) (map[string]interface{}, error)
BcoinGetHeader retrieves the latsest block
func BcoinGetHeight ¶
BcoinGetHeight retrieves the height of the longest chain
func BcoinGetNetworkStatus ¶
func BcoinGetNetworkStatus(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*api.NetworkStatus, error)
BcoinGetNetworkStatus retrieves current metadata from the JSON-RPC client; returned struct includes block height, number of connected peers, protocol version, and syncing state.
func BcoinInvokeJsonRpcClient ¶
func BcoinInvokeJsonRpcClient(networkID, rpcURL, rpcAPIUser, rpcAPIKey, method string, params []interface{}, response interface{}) error
BcoinInvokeJsonRpcClient - invokes the JSON-RPC client for the given network and url
func BcoinResolveJsonRpcClient ¶
func BcoinResolveJsonRpcClient(networkID, rpcURL, rpcAPIUser, rpcAPIKey string) (*rpcclient.Client, error)
BcoinResolveJsonRpcClient resolves a cached *ethclient.Client client or dials and caches a new instance
func C25519ComputeSecret ¶
C25519ComputeSecret - computes the shared secret given a private key and peer's public key
func C25519GenerateKeyPair ¶
C25519GenerateKeyPair - generates a c25519 keypair suitable for Diffie-Hellman key exchange
func EVMBroadcastSignedTx ¶
func EVMBroadcastSignedTx(rpcClientKey, rpcURL string, signedTx *types.Transaction) error
EVMBroadcastSignedTx emits a given signed tx for inclusion in a block
func EVMBroadcastTx ¶
func EVMBroadcastTx(ctx context.Context, rpcClientKey, rpcURL string, tx *types.Transaction, client *ethclient.Client, result interface{}) error
EVMBroadcastTx injects a signed transaction into the pending pool for execution.
func EVMChainConfigFactory ¶
func EVMChainConfigFactory(chainID *big.Int) *params.ChainConfig
EVMChainConfigFactory returns the chain config for the given chain id
func EVMDialJsonRpc ¶
EVMDialJsonRpc - dials and caches a new JSON-RPC client instance at the JSON-RPC url and caches it using the given network id
func EVMEncodeABI ¶
EVMEncodeABI returns the ABI-encoded calldata for the given method and params
func EVMEthCall ¶
func EVMEthCall(rpcClientKey, rpcURL string, params []interface{}) (*api.EthereumJsonRpcResponse, error)
EVMEthCall invokes eth_call manually via JSON-RPC
func EVMGenerateKeyPair ¶
func EVMGenerateKeyPair() (address *string, privateKey *ecdsa.PrivateKey, err error)
EVMGenerateKeyPair - creates and returns an ECDSA keypair; the returned *ecdsa.PrivateKey can be encoded with: hex.EncodeToString(ethcrypto.FromECDSA(privateKey))
func EVMGetBlockByNumber ¶
func EVMGetBlockByNumber(rpcClientKey, rpcURL string, blockNumber uint64) (*api.EthereumJsonRpcResponse, error)
EVMGetBlockByNumber retrieves a given block by number
func EVMGetBlockGasLimit ¶
EVMGetBlockGasLimit retrieves the latest block gas limit
func EVMGetBlockNumber ¶
EVMGetBlockNumber retrieves the latest block known to the JSON-RPC client
func EVMGetChainConfig ¶
func EVMGetChainConfig(rpcClientKey, rpcURL string) (*params.ChainConfig, error)
EVMGetChainConfig parses the cached network config mapped to the given `rpcClientKey`, if one exists; otherwise, the mainnet chain config is returned.
func EVMGetChainID ¶
EVMGetChainID retrieves the current chainID via JSON-RPC
func EVMGetCode ¶
EVMGetCode retrieves the code stored at the named address in the given scope; scope can be a block number, latest, earliest or pending
func EVMGetGasPrice ¶
EVMGetGasPrice returns the gas price
func EVMGetHeaderByNumber ¶
func EVMGetHeaderByNumber(rpcClientKey, rpcURL string, blockNumber uint64) (*api.EthereumJsonRpcResponse, error)
EVMGetHeaderByNumber retrieves a given block header by number
func EVMGetLatestBlock ¶
func EVMGetLatestBlock(rpcClientKey, rpcURL string) (*api.EthereumJsonRpcResponse, error)
EVMGetLatestBlock retrieves the latsest block
func EVMGetLatestBlockNumber ¶
EVMGetLatestBlockNumber retrieves the latest block number
func EVMGetNativeBalance ¶
EVMGetNativeBalance retrieves a wallet's native currency balance
func EVMGetNetworkStatus ¶
func EVMGetNetworkStatus(rpcClientKey, rpcURL string) (*api.NetworkStatus, error)
EVMGetNetworkStatus retrieves current metadata from the JSON-RPC client; returned struct includes block height, chainID, number of connected peers, protocol version, and syncing state.
func EVMGetPeerCount ¶
EVMGetPeerCount returns the number of peers currently connected to the JSON-RPC client
func EVMGetProtocolVersion ¶
EVMGetProtocolVersion returns the JSON-RPC client protocol version
func EVMGetSyncProgress ¶
func EVMGetSyncProgress(client *ethclient.Client) (*ethereum.SyncProgress, error)
EVMGetSyncProgress retrieves the status of the current network sync
func EVMGetTokenBalance ¶
func EVMGetTokenBalance(rpcClientKey, rpcURL, tokenAddr, addr string, contractABI interface{}) (*big.Int, error)
EVMGetTokenBalance retrieves a token balance for a specific token contract and network address
func EVMGetTokenSymbol ¶
func EVMGetTokenSymbol(rpcClientKey, rpcURL, from, tokenAddr string, contractABI interface{}) (*string, error)
EVMGetTokenSymbol attempts to retrieve the symbol of a token presumed to be deployed at the given token contract address
func EVMGetTxReceipt ¶
EVMGetTxReceipt retrieves the full transaction receipt via JSON-RPC given the transaction hash
func EVMHashFunctionSelector ¶
EVMHashFunctionSelector returns the first 4 bytes of the Keccak256 hash of the given function selector
func EVMInvokeJsonRpcClient ¶
func EVMInvokeJsonRpcClient(rpcClientKey, rpcURL, method string, params []interface{}, response interface{}) error
EVMInvokeJsonRpcClient - invokes the JSON-RPC client for the given network and url
func EVMMarshalEncryptedKey ¶
func EVMMarshalEncryptedKey(addr common.Address, privateKey *ecdsa.PrivateKey, secret string) ([]byte, error)
EVMMarshalEncryptedKey encrypts key as version 3.
func EVMMarshalKeyPairJSON ¶
EVMMarshalKeyPairJSON - returns keystore JSON representation of given private key
func EVMResolveEthClient ¶
EVMResolveEthClient resolves a cached *ethclient.Client client or dials and caches a new instance
func EVMResolveJsonRpcClient ¶
EVMResolveJsonRpcClient resolves a cached *ethclient.Client client or dials and caches a new instance
func EVMSignTx ¶
func EVMSignTx( rpcClientKey, rpcURL, from, privateKey string, to, data *string, val *big.Int, nonce *uint64, gasLimit uint64, gasPrice *uint64, ) (*types.Transaction, *string, error)
EVMSignTx signs a transaction using the given private key and calldata; providing 0 gas results in the tx attempting to use up to the block gas limit for execution
func EVMTraceTx ¶
EVMTraceTx returns the VM traces; requires parity JSON-RPC client and the node must be configured with `--fat-db on --tracing on --pruning archive`
func EVMTxFactory ¶
func EVMTxFactory( rpcClientKey, rpcURL, from string, to, data *string, val *big.Int, nonce *uint64, gasLimit uint64, gasPrice *uint64, ) (types.Signer, *types.Transaction, []byte, error)
EVMTxFactory builds and returns an unsigned transaction hash
func FromECDSA ¶
func FromECDSA(priv *ecdsa.PrivateKey) []byte
FromECDSA exports a private key into a binary dump.
func HexToAddress ¶
HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.
func TECGenerateKeyPair ¶
TECGenerateKeyPair - creates and returns an Twisted Edwards Curve (TEC) keypair;
Types ¶
This section is empty.