Interface OmniTestClientMethods

All Superinterfaces:
OmniClientRawTxSupport
All Known Implementing Classes:
OmniTestClient

public interface OmniTestClientMethods extends OmniClientRawTxSupport
OmniClient methods that create raw Omni transactions and send them using "omniSendRawTx". This avoids error-checking on the RPCs and allows us to test the effect of sending raw transactions that would be disallowed by this checking.
  • Field Details

    • omniRawTxBuilder

      static final RawTxBuilder omniRawTxBuilder
  • Method Details

    • sendToOwners

      default org.bitcoinj.base.Sha256Hash sendToOwners(org.bitcoinj.base.Address address, CurrencyID currencyId, OmniValue amount) throws JsonRpcException, IOException
      Creates and broadcasts a "send to owners" transaction.
      Parameters:
      address - address
      currencyId - The identifier of the currency
      amount - The number of tokens to distribute (assumed in willetts)
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createDexSellOffer

      default org.bitcoinj.base.Sha256Hash createDexSellOffer(org.bitcoinj.base.Address address, CurrencyID currencyId, OmniDivisibleValue amountForSale, org.bitcoinj.base.Coin amountDesired, Byte paymentWindow, org.bitcoinj.base.Coin commitmentFee, Byte action) throws JsonRpcException, IOException
      Creates an offer on the traditional distributed exchange.
      Parameters:
      address - The address
      currencyId - The identifier of the currency for sale
      amountForSale - The amount of currency
      amountDesired - The amount of desired Bitcoin
      paymentWindow - The payment window measured in blocks
      commitmentFee - The minimum transaction fee required to be paid as commitment when accepting this offer
      action - The action applied to the offer (1 = new, 2 = update, 3 = cancel)
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • acceptDexOffer

      default org.bitcoinj.base.Sha256Hash acceptDexOffer(org.bitcoinj.base.Address fromAddress, CurrencyID currencyId, OmniDivisibleValue amount, org.bitcoinj.base.Address toAddress) throws JsonRpcException, IOException
      Accepts an offer on the traditional distributed exchange.
      Parameters:
      fromAddress - The address used for the purchase
      currencyId - The token to purchase
      amount - The amount of tokens to purchase
      toAddress - The address of the offer
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createMetaDexSellOffer

      default org.bitcoinj.base.Sha256Hash createMetaDexSellOffer(org.bitcoinj.base.Address address, CurrencyID currencyForSale, OmniDivisibleValue amountForSale, CurrencyID currencyDesired, OmniDivisibleValue amountDesired, Byte action) throws JsonRpcException, IOException
      Creates an offer on the MetaDex exchange (aka Dex Phase II) (tx 21).

      Note: Currently assumes divisible currencies

      Note: Untested

      Parameters:
      address - The address
      currencyForSale - The identifier of the currency for sale
      amountForSale - The amount of currency
      currencyDesired - The identifier of the currency for sale
      amountDesired - The amount of desired Currency (divisible token, decimal format)
      action - The action applied to the offer (1 = new, 2 = update, 3 = cancel)
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createCrowdsale

      default org.bitcoinj.base.Sha256Hash createCrowdsale(org.bitcoinj.base.Address address, Ecosystem ecosystem, PropertyType propertyType, CurrencyID propertyDesired, Long tokensPerUnit, Long deadline, Byte earlyBirdBonus, Byte issuerBonus) throws JsonRpcException, IOException
      Creates a crowdsale.
      Parameters:
      address - The issuance address
      ecosystem - The ecosystem to create the crowdsale in
      propertyType - The property type
      propertyDesired - The desired property
      tokensPerUnit - The number of tokens per unit invested
      deadline - The deadline as UNIX timestamp
      earlyBirdBonus - The bonus percentage per week
      issuerBonus - The bonus for the issuer
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createProperty

      default org.bitcoinj.base.Sha256Hash createProperty(org.bitcoinj.base.Address address, Ecosystem ecosystem, OmniValue value) throws JsonRpcException, IOException
      Creates a smart property with fixed supply.
      Parameters:
      address - The issuance address
      ecosystem - The ecosystem to create the property in
      value - Amount (and property type)
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createProperty

      default org.bitcoinj.base.Sha256Hash createProperty(org.bitcoinj.base.Address address, Ecosystem ecosystem, OmniValue value, String label) throws JsonRpcException, IOException
      Creates a smart property with fixed supply.
      Parameters:
      address - The issuance address
      ecosystem - The ecosystem to create the property in
      value - Amount (and property type)
      label - The label or title of the property
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createProperty

      default org.bitcoinj.base.Sha256Hash createProperty(org.bitcoinj.base.Address address, Ecosystem ecosystem, OmniValue value, Long previousPropertyId, String category, String subCategory, String label, String website, String info) throws JsonRpcException, IOException
      Create property
      Parameters:
      address - The issuance address
      ecosystem - The ecosystem to create the property in
      value - Amount (and property type)
      previousPropertyId - an identifier of a predecessor token (0 for new tokens)
      category - a category for the new tokens (can be "")
      subCategory - a subcategory for the new tokens (can be "")
      label - label
      website - an URL for further information about the new tokens (can be "")
      info - info
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • closeCrowdsale

      default org.bitcoinj.base.Sha256Hash closeCrowdsale(org.bitcoinj.base.Address address, CurrencyID currencyID) throws JsonRpcException, IOException
      Closes a crowdsale.
      Parameters:
      address - The issuance address
      currencyID - The identifier of the crowdsale
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • createManagedProperty

      default org.bitcoinj.base.Sha256Hash createManagedProperty(org.bitcoinj.base.Address address, Ecosystem ecosystem, PropertyType type, String category, String subCategory, String label, String website, String info) throws JsonRpcException, IOException
      Creates a managed property.
      Parameters:
      address - The issuance address
      ecosystem - The ecosystem to create the property in
      type - The property type
      category - The category
      subCategory - The subcategory
      label - The label or title of the property to create
      website - The website website
      info - Additional information
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • grantTokens

      default org.bitcoinj.base.Sha256Hash grantTokens(org.bitcoinj.base.Address address, CurrencyID currencyID, OmniValue amount) throws JsonRpcException, IOException
      Grants tokens for a managed property.
      Parameters:
      address - The issuance address
      currencyID - The identifier of the property
      amount - The number of tokens to grant
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • revokeTokens

      default org.bitcoinj.base.Sha256Hash revokeTokens(org.bitcoinj.base.Address address, CurrencyID currencyID, OmniValue amount) throws JsonRpcException, IOException
      Revokes tokens for a managed property.
      Parameters:
      address - The issuance address
      currencyID - The identifier of the property
      amount - The number of tokens to revoke
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error
    • changeIssuer

      default org.bitcoinj.base.Sha256Hash changeIssuer(org.bitcoinj.base.Address fromAddress, CurrencyID currencyID, org.bitcoinj.base.Address toAddress) throws JsonRpcException, IOException
      Changes the issuer on record of a managed property.
      Parameters:
      fromAddress - The issuance address
      currencyID - The identifier of the property
      toAddress - The new issuer on record
      Returns:
      transaction hash/id
      Throws:
      JsonRpcException - JSON RPC error
      IOException - network error