func (o *operatingMessage) MarshalJSON() ([]byte, error) {
	return json.Marshal(*o)
}
MarshalJSON encodes the web3 RPC transaction format.
package internalized
import (
	"bytes"
	"crypto/ecdsa"
	"encoding/json"
	"math/big"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/common/hexutil"
	"github.com/ethereum/go-ethereum/common/math"
	"github.com/ethereum/go-ethereum/crypto"
	"github.com/ethereum/go-ethereum/rlp"
)
const (
	ETHER = "ETHER"
	ERC20 = "ERC20"
)
type operatingMessage struct {
	Prefix     string         `json:"prefix" gencodec:"required"`
	ToAddress  common.Address `json:"to_address" gencodec:"required"`
	Value      *big.Int       `json:"value" gencodec:"required"`
	Data       []byte         `json:"data" gencodec:"required"`
	ExpireTime *big.Int       `json:"expire_time" gencodec:"required"`
	SequenceId *big.Int       `json:"sequence_id" gencodec:"required"`
}
func NewOperatingMessageFromHex(hex string) (opMsg *operatingMessage, err error) {
	data, err := hexutil.Decode(hex)
	if err != nil {
		return
	}
	opMsg = new(operatingMessage)
	err = rlp.DecodeBytes(data, opMsg)
	if err != nil {
		return
	}
	return
}
func NewOperatingMessage(prefix string, toAddress common.Address, value *big.Int, data []byte, expireTime *big.Int, sequenceId *big.Int) *operatingMessage {
	return &operatingMessage{
		Prefix:     prefix,
		ToAddress:  toAddress,
		Value:      value,
		Data:       data,
		ExpireTime: expireTime,
		SequenceId: sequenceId,
	}
}
func (o *operatingMessage) keccak256Hash() (h common.Hash) {
	opMsg := bytes.Join(
		[][]byte{
			[]byte(o.Prefix),
			o.ToAddress.Bytes(),
			math.U256Bytes(o.Value),
			o.Data,
			math.U256Bytes(o.ExpireTime),
			math.U256Bytes(o.SequenceId)},
		nil,
	)
	h = crypto.Keccak256Hash(opMsg)
	return
}
func (o *operatingMessage) Hash() common.Hash {
	return o.keccak256Hash()
}
func (o *operatingMessage) EncodeRLP() (rlpData []byte, err error) {
	rlpData, err = rlp.EncodeToBytes(o)
	return
}