congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
com.icodici.universa.contract
Code IndexAdd Tabnine to your IDE (free)

How to use com.icodici.universa.contract

Best Java code snippets using com.icodici.universa.contract (Showing top 20 results out of 315)

origin: UniversaBlockchain/universa

/**
 * Binder to hold any data client might want to keep per one transaction.
 * @return data {@link Binder} from transactional section
 */
public Binder getTransactionalData() {
  if (transactional == null)
    createTransactionalSection();
  return transactional.getData();
}
origin: UniversaBlockchain/universa

/**
 * Checks if permission of given type exists and is allowed for given key record
 * @param permissionName type of permission to check for
 * @param keyRecord key record to check permission with
 * @return permission allowed for keyRecord is found
 * @throws Quantiser.QuantiserException if quantas limit was reached during check
 */
public boolean isPermitted(String permissionName, KeyRecord keyRecord) throws Quantiser.QuantiserException {
  return isPermitted(permissionName, keyRecord.getPublicKey());
}
origin: UniversaBlockchain/universa

/**
 * Pack the contract to the most modern .unicon format, same as {@link TransactionPack#pack()}. Uses bounded {@link
 * TransactionPack} instance to save together the contract, revoking and new items (if any). This is a binary format
 * using to submit for approval. Use {@link #fromPackedTransaction(byte[])} to read this format.
 *
 * @return packed binary form.
 */
public byte[] getPackedTransaction() {
  return getTransactionPack().pack();
}
origin: UniversaBlockchain/universa

protected Contract createCoin(String yamlFilePath) throws IOException {
  Contract c = Contract.fromDslFile(yamlFilePath);
  c.setOwnerKey(ownerKey2);
  return c;
}
origin: UniversaBlockchain/universa

public int getRevision() {
  return this.currentContract.getState().getRevision();
}
origin: UniversaBlockchain/universa

@Test
public void deserializeOldContract() throws Exception {
  TransactionPack tp = TransactionPack.unpack(c.sealAsV2());
  checkSimplePack(tp);
}
origin: UniversaBlockchain/universa

public Contract getPayloadContract() {
  if (payload != null)
    return payload.getContract();
  return null;
}
origin: UniversaBlockchain/universa

/**
 * Create new revision to be changed, signed sealed and then ready to approve. Created "revision" contract is a copy
 * of this contract, with all fields and references correctly set. After this call one need to change mutable
 * fields, add signing keys, seal it and then apss to Universa network for approval.
 *
 * @param keys initially added and signer keys. Role "creator" is set to these keys for new revision
 * @return new revision of this contract, identical to this one, to be modified.
 */
public synchronized Contract createRevision(Collection<PrivateKey> keys) {
  return createRevision(keys, null);
}
origin: UniversaBlockchain/universa

/**
 * @see #createTokenContract(Set, Set, BigDecimal, BigDecimal, String, String, String)
 */
public synchronized static Contract createTokenContract(Set<PrivateKey> issuerKeys, Set<PublicKey> ownerKeys, BigDecimal amount, BigDecimal minValue) {
  return createTokenContract(issuerKeys, ownerKeys, amount, minValue, "DT", "Default token name", "Default token description");
}
origin: UniversaBlockchain/universa

public void removeAllReferencedItems() {
  for (Contract c: getReferenced())
    removeReferencedItem(c);
}
/**
origin: UniversaBlockchain/universa

@Override
public Binder serialize(BiSerializer s) {
  Binder binder = Binder.of(
          "api_level", apiLevel,
          "definition", definition.serializeWith(s),
          "state", state.serializeWith(s)
  );
  if(transactional != null)
    binder.set("transactional", transactional.serializeWith(s));
  return binder;
}
origin: UniversaBlockchain/universa

/**
 * Create new revision to be changed, signed sealed and then ready to approve. Created "revision" contract is a copy
 * of this contract, with all fields and references correctly set. After this call one need to change mutable
 * fields, add signing keys, seal it and then apss to Universa network for approval.
 *
 * @param keys initially added and signer keys. Role "creator" is set to anonymous ids of these keys
 * @return new revision of this contract, identical to this one, to be modified.
 */
public synchronized Contract createRevisionAnonymously(Collection<?> keys) {
  return createRevisionAnonymously(keys, null);
}
origin: UniversaBlockchain/universa

/**
 * Check not pre-parsed condition of reference (old version)
 * @param condition condition to check for matching
 * @param ref contract to check for matching
 * @param contracts contract list to check for matching
 * @param iteration check inside references iteration number
 * @return true if match or false
 */
private boolean checkCondition(String condition, Contract ref, Collection<Contract> contracts, int iteration) {
  Binder parsed = parseCondition(condition);
  return checkCondition(parsed, ref, contracts, iteration);
}
origin: UniversaBlockchain/universa

/**
 * Sign the data with a given key.
 *
 * @param key is {@link PrivateKey} to sign with
 * @param data to be sign with key
 *
 * @return binary signature
 */
static public byte[] sign(PrivateKey key, byte[] data) {
  return sign(key, data, true);
}
origin: UniversaBlockchain/universa

/**
 * Create a transaction pack and add a contract to it. See {@link TransactionPack#TransactionPack()} and {@link
 * #setContract(Contract)} for more information.
 *
 * @param contract is {@link Contract} to be send with this {@link TransactionPack}
 */
public TransactionPack(Contract contract) {
  this();
  setContract(contract);
}
origin: UniversaBlockchain/universa

/**
 * Set "creator" role to given key records
 * @param records key records to set "creator" role to
 * @return creator role
 */
public Role setCreator(Collection<KeyRecord> records) {
  return setRole("creator", records);
}
origin: UniversaBlockchain/universa

/**
 * Check if given item matching with current reference criteria
 * @param a item to check for matching
 * @param contracts contract list to check for matching
 * @return true if match or false
 */
public boolean isMatchingWith(Approvable a, Collection<Contract> contracts) {
  return isMatchingWith(a, contracts, 0);
}
origin: UniversaBlockchain/universa

/**
 * Set the conditions from the reference
 * @return this reference
 */
public Reference setConditions(Binder conditions) {
  this.conditions = parseConditions(conditions);
  return this;
}
origin: UniversaBlockchain/universa

/**
 * Create new transactional section for the contract
 * @return created transactional
 */
public Transactional createTransactionalSection() {
  transactional = new Transactional();
  return transactional;
}
origin: UniversaBlockchain/universa

protected static Contract createCoin(String yamlFilePath) throws IOException {
  Contract c = Contract.fromDslFile(yamlFilePath);
  c.setOwnerKey(ownerKey2);
  return c;
}
com.icodici.universa.contract

Most used classes

  • Contract
  • Contract$Definition
  • ContractsService
    Public (for third-party developers) methods for help with creating and preparing contracts.
  • Reference
  • TransactionPack
    The main contract and its subItems and referenced contracts needed for registration submission bundl
  • RoleLink,
  • SimpleRole,
  • Contract$State,
  • KeyRecord,
  • Parcel,
  • Reference$conditionsModeType,
  • JSApiExecOptions,
  • JSApiHttpServer,
  • JSApiHttpServerRoutes,
  • JSApiScriptParameters,
  • ChangeOwnerPermission,
  • Permission,
  • SplitJoinPermission,
  • ListRole
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now