forked from cerc-io/laconicd-deprecated
6c72a79035
* Set up personal account api for personal sign * Added unlocking key functionality and attach to eth rpc * Implemented eth_sign * Transform V in sig based on yp and fix bug * Fix lint issue * Remove escape character from comment * Switch error handling to panic on invalid unlocked key
34 lines
771 B
Go
34 lines
771 B
Go
// Package rpc contains RPC handler methods and utilities to start
|
|
// Ethermint's Web3-compatibly JSON-RPC server.
|
|
package rpc
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
|
emintcrypto "github.com/cosmos/ethermint/crypto"
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
)
|
|
|
|
// GetRPCAPIs returns the list of all APIs
|
|
func GetRPCAPIs(cliCtx context.CLIContext, key emintcrypto.PrivKeySecp256k1) []rpc.API {
|
|
return []rpc.API{
|
|
{
|
|
Namespace: "web3",
|
|
Version: "1.0",
|
|
Service: NewPublicWeb3API(),
|
|
Public: true,
|
|
},
|
|
{
|
|
Namespace: "eth",
|
|
Version: "1.0",
|
|
Service: NewPublicEthAPI(cliCtx, key),
|
|
Public: true,
|
|
},
|
|
{
|
|
Namespace: "personal",
|
|
Version: "1.0",
|
|
Service: NewPersonalEthAPI(cliCtx),
|
|
Public: false,
|
|
},
|
|
}
|
|
}
|