All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hyperchain.sdk.service.impl.RadarServiceImpl Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package cn.hyperchain.sdk.service.impl;

import cn.hyperchain.sdk.provider.ProviderManager;
import cn.hyperchain.sdk.request.RadarRequest;
import cn.hyperchain.sdk.request.Request;
import cn.hyperchain.sdk.response.radar.RadarResponse;
import cn.hyperchain.sdk.service.RadarService;

import java.util.HashMap;
import java.util.Map;

public class RadarServiceImpl implements RadarService {
    private ProviderManager providerManager;
    private static final String RADAR_PRE = "radar_";

    public RadarServiceImpl(ProviderManager providerManager) {
        this.providerManager = providerManager;
    }


    @Override
    public Request listenContract(String sourceCode, String contractAddress, int... nodeIds) {
        RadarRequest radarResponseRequest = new RadarRequest(RADAR_PRE + "registerContract", providerManager, RadarResponse.class, nodeIds);
        Map metas = new HashMap<>();
        metas.put("source", sourceCode);
        metas.put("address", contractAddress);
        radarResponseRequest.addParams(metas);
        return radarResponseRequest;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy