package org.bdware.sc;

import com.google.gson.JsonObject;
import org.zz.gmhelper.SM2KeyPair;

import java.math.BigInteger;

public interface NodeCenterConn {
    boolean deliverEvent(String event, String target);

    NodeKey[] listNodes();

    String getNodeId(String str);

    String routeContract(String contractID);

    String reRouteContract(String contractID);

    void sendMsg(String msg);

    SM2KeyPair getNodeKeyPair();

    JsonObject checkIsContract(String requestID, String json);

    class NodeKey {
        public String id;
        public BigInteger biId;

        public NodeKey(String id) {
            this.id = id;
            this.biId = new BigInteger(id, 16);
        }
    }

    class Response {
        String responseID;
        String action;
        Object data;
        long executeTime;
    }
}
