Package foundation.omni.rpc.test
Interface OmniTestClientMethods
- All Superinterfaces:
OmniClientRawTxSupport
- All Known Implementing Classes:
OmniTestClient
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault org.bitcoinj.base.Sha256Hash
acceptDexOffer
(org.bitcoinj.base.Address fromAddress, CurrencyID currencyId, OmniDivisibleValue amount, org.bitcoinj.base.Address toAddress) Accepts an offer on the traditional distributed exchange.default org.bitcoinj.base.Sha256Hash
changeIssuer
(org.bitcoinj.base.Address fromAddress, CurrencyID currencyID, org.bitcoinj.base.Address toAddress) Changes the issuer on record of a managed property.default org.bitcoinj.base.Sha256Hash
closeCrowdsale
(org.bitcoinj.base.Address address, CurrencyID currencyID) Closes a crowdsale.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) Creates a crowdsale.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) Creates an offer on the traditional distributed exchange.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) Creates a managed property.default org.bitcoinj.base.Sha256Hash
createMetaDexSellOffer
(org.bitcoinj.base.Address address, CurrencyID currencyForSale, OmniDivisibleValue amountForSale, CurrencyID currencyDesired, OmniDivisibleValue amountDesired, Byte action) Creates an offer on the MetaDex exchange (aka Dex Phase II) (tx 21).default org.bitcoinj.base.Sha256Hash
createProperty
(org.bitcoinj.base.Address address, Ecosystem ecosystem, OmniValue value) Creates a smart property with fixed supply.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) Create propertydefault org.bitcoinj.base.Sha256Hash
createProperty
(org.bitcoinj.base.Address address, Ecosystem ecosystem, OmniValue value, String label) Creates a smart property with fixed supply.default org.bitcoinj.base.Sha256Hash
grantTokens
(org.bitcoinj.base.Address address, CurrencyID currencyID, OmniValue amount) Grants tokens for a managed property.default org.bitcoinj.base.Sha256Hash
revokeTokens
(org.bitcoinj.base.Address address, CurrencyID currencyID, OmniValue amount) Revokes tokens for a managed property.default org.bitcoinj.base.Sha256Hash
sendToOwners
(org.bitcoinj.base.Address address, CurrencyID currencyId, OmniValue amount) Creates and broadcasts a "send to owners" transaction.Methods inherited from interface foundation.omni.rpc.OmniClientRawTxSupport
omniSendRawTx, omniSendRawTx
-
Field Details
-
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
- addresscurrencyId
- The identifier of the currencyamount
- The number of tokens to distribute (assumed in willetts)- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyId
- The identifier of the currency for saleamountForSale
- The amount of currencyamountDesired
- The amount of desired BitcoinpaymentWindow
- The payment window measured in blockscommitmentFee
- The minimum transaction fee required to be paid as commitment when accepting this offeraction
- The action applied to the offer (1 = new, 2 = update, 3 = cancel)- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 purchasecurrencyId
- The token to purchaseamount
- The amount of tokens to purchasetoAddress
- The address of the offer- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyForSale
- The identifier of the currency for saleamountForSale
- The amount of currencycurrencyDesired
- The identifier of the currency for saleamountDesired
- 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 errorIOException
- 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 addressecosystem
- The ecosystem to create the crowdsale inpropertyType
- The property typepropertyDesired
- The desired propertytokensPerUnit
- The number of tokens per unit investeddeadline
- The deadline as UNIX timestampearlyBirdBonus
- The bonus percentage per weekissuerBonus
- The bonus for the issuer- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addressecosystem
- The ecosystem to create the property invalue
- Amount (and property type)- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addressecosystem
- The ecosystem to create the property invalue
- Amount (and property type)label
- The label or title of the property- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addressecosystem
- The ecosystem to create the property invalue
- 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
- labelwebsite
- an URL for further information about the new tokens (can be "")info
- info- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyID
- The identifier of the crowdsale- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addressecosystem
- The ecosystem to create the property intype
- The property typecategory
- The categorysubCategory
- The subcategorylabel
- The label or title of the property to createwebsite
- The website websiteinfo
- Additional information- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyID
- The identifier of the propertyamount
- The number of tokens to grant- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyID
- The identifier of the propertyamount
- The number of tokens to revoke- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- 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 addresscurrencyID
- The identifier of the propertytoAddress
- The new issuer on record- Returns:
- transaction hash/id
- Throws:
JsonRpcException
- JSON RPC errorIOException
- network error
-