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

tech.deplant.jacki.framework.contract.tip4.TIP4IndexBasisContract Maven / Gradle / Ivy

package tech.deplant.jacki.framework.contract.tip4;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.lang.Object;
import java.lang.String;
import java.lang.Void;
import java.util.Map;
import tech.deplant.jacki.framework.ContractAbi;
import tech.deplant.jacki.framework.Credentials;
import tech.deplant.jacki.framework.FunctionHandle;
import tech.deplant.jacki.framework.contract.AbstractContract;
import tech.deplant.jacki.framework.datatype.Address;

/**
 * Java wrapper class for usage of TIP4IndexBasisContract contract for Everscale blockchain.
 */
public class TIP4IndexBasisContract extends AbstractContract {
  public TIP4IndexBasisContract(int contextId, String address) throws JsonProcessingException {
    super(contextId,address,DEFAULT_ABI(),Credentials.NONE);
  }

  public TIP4IndexBasisContract(int contextId, String address, ContractAbi abi) {
    super(contextId,address,abi,Credentials.NONE);
  }

  public TIP4IndexBasisContract(int contextId, String address, Credentials credentials) throws
      JsonProcessingException {
    super(contextId,address,DEFAULT_ABI(),credentials);
  }

  @JsonCreator
  public TIP4IndexBasisContract(int contextId, String address, ContractAbi abi,
      Credentials credentials) {
    super(contextId,address,abi,credentials);
  }

  public static ContractAbi DEFAULT_ABI() throws JsonProcessingException {
    return ContractAbi.ofString("{\"version\":\"2.2\",\"header\":[\"time\"],\"functions\":[{\"name\":\"constructor\",\"inputs\":[],\"outputs\":[]},{\"name\":\"getInfo\",\"inputs\":[{\"name\":\"answerId\",\"type\":\"uint32\"}],\"outputs\":[{\"name\":\"collection\",\"type\":\"address\"}]},{\"name\":\"destruct\",\"inputs\":[{\"name\":\"gasReceiver\",\"type\":\"address\"}],\"outputs\":[]}],\"events\":[],\"data\":[{\"key\":1,\"name\":\"_collection\",\"type\":\"address\"}],\"fields\":[{\"name\":\"_pubkey\",\"type\":\"uint256\"},{\"name\":\"_timestamp\",\"type\":\"uint64\"},{\"name\":\"_constructorFlag\",\"type\":\"bool\"},{\"name\":\"_collection\",\"type\":\"address\"}],\"ABI version\":2}");
  }

  public FunctionHandle getInfo() {
    Map params = Map.of("answerId", 0);
    return new FunctionHandle(ResultOfGetInfo.class, contextId(), address(), abi(), credentials(), "getInfo", params, null);
  }

  public FunctionHandle destruct(Address gasReceiver) {
    Map params = Map.of("gasReceiver", gasReceiver);
    return new FunctionHandle(Void.class, contextId(), address(), abi(), credentials(), "destruct", params, null);
  }

  public record ResultOfGetInfo(Address collection) {
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy