func (c *ClientV3) GetProofForResult(param *v3.ProofResultParam) ([][]byte, error) {
	var result [][]byte
	_, err := c.Do("icx_getProofForResult", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}
refer common/trie/ompt/mtp.go mpt.GetProof(index)
package client
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"reflect"
	"strings"
	"time"
	"github.com/gorilla/websocket"
	"github.com/icon-project/goloop/common"
	"github.com/icon-project/goloop/common/crypto"
	"github.com/icon-project/goloop/common/errors"
	"github.com/icon-project/goloop/common/intconv"
	"github.com/icon-project/goloop/module"
	"github.com/icon-project/goloop/server"
	"github.com/icon-project/goloop/server/jsonrpc"
	v3 "github.com/icon-project/goloop/server/v3"
	"github.com/icon-project/goloop/service/transaction"
)
type ClientV3 struct {
	*JsonRpcClient
	DebugEndPoint string
	conns         map[string]*websocket.Conn
}
func guessDebugEndpoint(endpoint string) string {
	uo, err := url.Parse(endpoint)
	if err != nil {
		return ""
	}
	ps := strings.Split(uo.Path, "/")
	for i, v := range ps {
		if v == "api" {
			if len(ps) > i+1 && ps[i+1] == "v3" {
				ps[i+1] = "v3d"
				uo.Path = strings.Join(ps, "/")
				return uo.String()
			}
			break
		}
	}
	return ""
}
func NewClientV3(endpoint string) *ClientV3 {
	client := new(http.Client)
	apiClient := NewJsonRpcClient(client, endpoint)
	return &ClientV3{
		JsonRpcClient: apiClient,
		DebugEndPoint: guessDebugEndpoint(endpoint),
		conns:         make(map[string]*websocket.Conn),
	}
}
type Block struct {
	BlockHash              jsonrpc.HexBytes  `json:"block_hash" validate:"required,t_hash"`
	Version                jsonrpc.HexInt    `json:"version" validate:"required,t_int"`
	Height                 int64             `json:"height" validate:"required,t_int"`
	Timestamp              int64             `json:"time_stamp" validate:"required,t_int"`
	Proposer               jsonrpc.HexBytes  `json:"peer_id" validate:"optional,t_addr_eoa"`
	PrevID                 jsonrpc.HexBytes  `json:"prev_block_hash" validate:"required,t_hash"`
	NormalTransactionsHash jsonrpc.HexBytes  `json:"merkle_tree_root_hash" validate:"required,t_hash"`
	Signature              jsonrpc.HexBytes  `json:"signature" validate:"optional,t_hash"`
	NormalTransactions     []json.RawMessage `json:"confirmed_transaction_list" `
}
type NormalTransaction struct {
	TxHash    jsonrpc.HexBytes `json:"txHash"`
	Version   jsonrpc.HexInt   `json:"version"`
	From      jsonrpc.Address  `json:"from"`
	To        jsonrpc.Address  `json:"to"`
	Value     jsonrpc.HexInt   `json:"value,omitempty" `
	StepLimit jsonrpc.HexInt   `json:"stepLimit"`
	TimeStamp jsonrpc.HexInt   `json:"timestamp"`
	NID       jsonrpc.HexInt   `json:"nid,omitempty"`
	Nonce     jsonrpc.HexInt   `json:"nonce,omitempty"`
	Signature jsonrpc.HexBytes `json:"signature"`
	DataType  string           `json:"dataType,omitempty"`
	Data      json.RawMessage  `json:"data,omitempty"`
}
type TransactionResult struct {
	To                 jsonrpc.Address  `json:"to"`
	CumulativeStepUsed jsonrpc.HexInt   `json:"cumulativeStepUsed"`
	StepUsed           jsonrpc.HexInt   `json:"stepUsed"`
	StepPrice          jsonrpc.HexInt   `json:"stepPrice"`
	EventLogs          []EventLog       `json:"eventLogs"`
	LogsBloom          jsonrpc.HexBytes `json:"logsBloom"`
	Status             jsonrpc.HexInt   `json:"status"`
	Failure            *FailureReason   `json:"failure,omitempty"`
	SCOREAddress       jsonrpc.Address  `json:"scoreAddress,omitempty"`
	BlockHash          jsonrpc.HexBytes `json:"blockHash" validate:"required,t_hash"`
	BlockHeight        jsonrpc.HexInt   `json:"blockHeight" validate:"required,t_int"`
	TxIndex            jsonrpc.HexInt   `json:"txIndex" validate:"required,t_int"`
	TxHash             jsonrpc.HexBytes `json:"txHash" validate:"required,t_int"`
	StepDetails        interface{}      `json:"stepUsedDetails,omitempty"`
}
type EventLog struct {
	Addr    jsonrpc.Address `json:"scoreAddress"`
	Indexed []*string       `json:"indexed"`
	Data    []*string       `json:"data"`
}
type FailureReason struct {
	CodeValue    jsonrpc.HexInt `json:"code"`
	MessageValue string         `json:"message"`
}
type Transaction struct {
	NormalTransaction
	BlockHash   jsonrpc.HexBytes `json:"blockHash" validate:"required,t_hash"`
	BlockHeight jsonrpc.HexInt   `json:"blockHeight" validate:"required,t_int"`
	TxIndex     jsonrpc.HexInt   `json:"txIndex" validate:"required,t_int"`
}
func (c *ClientV3) GetLastBlock() (*Block, error) {
	blk := &Block{}
	_, err := c.Do("icx_getLastBlock", nil, blk)
	if err != nil {
		return nil, err
	}
	return blk, nil
}
func (c *ClientV3) GetBlockByHeight(param *v3.BlockHeightParam) (*Block, error) {
	blk := &Block{}
	_, err := c.Do("icx_getBlockByHeight", param, blk)
	if err != nil {
		return nil, err
	}
	return blk, nil
}
func (c *ClientV3) GetBlockByHash(param *v3.BlockHashParam) (*Block, error) {
	blk := &Block{}
	_, err := c.Do("icx_getBlockByHash", param, blk)
	if err != nil {
		return nil, err
	}
	return blk, nil
}
func (c *ClientV3) Call(param *v3.CallParam) (interface{}, error) {
	var result interface{}
	_, err := c.Do("icx_call", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}
func (c *ClientV3) GetBalance(param *v3.AddressParam) (*jsonrpc.HexInt, error) {
	var result jsonrpc.HexInt
	_, err := c.Do("icx_getBalance", param, &result)
	if err != nil {
		return nil, err
	}
	return &result, nil
}
func (c *ClientV3) GetScoreApi(param *v3.ScoreAddressParam) ([]interface{}, error) {
	var result []interface{}
	_, err := c.Do("icx_getScoreApi", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}
func (c *ClientV3) GetTotalSupply() (*jsonrpc.HexInt, error) {
	var result jsonrpc.HexInt
	_, err := c.Do("icx_getTotalSupply", nil, &result)
	if err != nil {
		return nil, err
	}
	return &result, nil
}
func (c *ClientV3) GetTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error) {
	tr := &TransactionResult{}
	_, err := c.Do("icx_getTransactionResult", param, tr)
	if err != nil {
		return nil, err
	}
	return tr, nil
}
func (c *ClientV3) WaitTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error) {
	tr := &TransactionResult{}
	if _, err := c.Do("icx_waitTransactionResult", param, tr); err != nil {
		return nil, err
	}
	return tr, nil
}
func (c *ClientV3) GetTransactionByHash(param *v3.TransactionHashParam) (*Transaction, error) {
	t := &Transaction{}
	_, err := c.Do("icx_getTransactionByHash", param, t)
	if err != nil {
		return nil, err
	}
	return t, nil
}
var txSerializeExcludes = map[string]bool{"signature": true}
func (c *ClientV3) SendTransaction(w module.Wallet, param *v3.TransactionParam) (*jsonrpc.HexBytes, error) {
	param.Timestamp = jsonrpc.HexInt(intconv.FormatInt(time.Now().UnixNano() / int64(time.Microsecond)))
	js, err := json.Marshal(param)
	if err != nil {
		return nil, err
	}
	bs, err := transaction.SerializeJSON(js, nil, txSerializeExcludes)
	if err != nil {
		return nil, err
	}
	bs = append([]byte("icx_sendTransaction."), bs...)
	sig, err := w.Sign(crypto.SHA3Sum256(bs))
	if err != nil {
		return nil, err
	}
	param.Signature = base64.StdEncoding.EncodeToString(sig)
	var result jsonrpc.HexBytes
	if _, err = c.Do("icx_sendTransaction", param, &result); err != nil {
		return nil, err
	}
	return &result, nil
}
func (c *ClientV3) SendRawTransaction(w module.Wallet, param map[string]interface{}) (*jsonrpc.HexBytes, error) {
	param["timestamp"] = intconv.FormatInt(time.Now().UnixNano() / int64(time.Microsecond))
	bs, err := transaction.SerializeMap(param, nil, txSerializeExcludes)
	if err != nil {
		return nil, err
	}
	bs = append([]byte("icx_sendTransaction."), bs...)
	sig, err := w.Sign(crypto.SHA3Sum256(bs))
	if err != nil {
		return nil, err
	}
	param["signature"] = base64.StdEncoding.EncodeToString(sig)
	var result jsonrpc.HexBytes
	if _, err = c.Do("icx_sendTransaction", param, &result); err != nil {
		return nil, err
	}
	return &result, nil
}
func (c *ClientV3) GetDataByHash(param *v3.DataHashParam) ([]byte, error) {
	var result []byte
	_, err := c.Do("icx_getDataByHash", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}
func (c *ClientV3) GetBlockHeaderByHeight(param *v3.BlockHeightParam) ([]byte, error) {
	var result []byte
	_, err := c.Do("icx_getBlockHeaderByHeight", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}
func (c *ClientV3) GetVotesByHeight(param *v3.BlockHeightParam) ([]byte, error) {
	var result []byte
	_, err := c.Do("icx_getVotesByHeight", param, &result)
	if err != nil {
		return nil, err
	}
	return result, nil
}