Package foundation.omni.tx
Class RawTxBuilder
java.lang.Object
foundation.omni.tx.RawTxBuilder
Build hex-encoded raw Omni transactions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAcceptDexOfferHex
(CurrencyID currencyId, OmniValue amount) Creates a hex-encoded raw transaction of type 22: "purchase tokens with bitcoins".createChangePropertyManagerHex
(CurrencyID currencyId) Creates a hex-encoded raw transaction of type 70: "change manager of a managed property".createCloseCrowdsaleHex
(CurrencyID currencyId) Creates a hex-encoded raw transaction of type 53: "close a crowdsale manually".createCrowdsaleHex
(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info, CurrencyID propertyDesired, Long tokensPerUnit, Long deadline, Byte earlyBirdBonus, Byte issuerBonus) Creates a hex-encoded raw transaction of type 51: "create a property via crowdsale with variable supply".createDexSellOfferHex
(CurrencyID currencyId, OmniDivisibleValue amountForSale, org.bitcoinj.base.Coin amountDesired, Byte paymentWindow, org.bitcoinj.base.Coin commitmentFee, Byte action) Creates a hex-encoded raw transaction of type 20: "sell tokens for bitcoins".createGrantTokensHex
(CurrencyID currencyId, OmniValue amount, String memo) Creates a hex-encoded raw transaction of type 55: "grant tokens for a managed property".createManagedPropertyHex
(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info) Creates a hex-encoded raw transaction of type 54: "create a managed property with variable supply".createMetaDexSellOfferHex
(CurrencyID currencyForSale, OmniValue amountForSale, CurrencyID currencyDesired, OmniValue amountDesired, Byte action) Creates a hex-encoded raw transaction of type 21: "trade tokens for tokens".createPropertyHex
(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info, OmniValue amount) Creates a hex-encoded raw transaction of type 50: "create a property with fixed supply".createRevokeTokensHex
(CurrencyID currencyId, OmniValue amount, String memo) Creates a hex-encoded raw transaction of type 56: "revoke tokens of a managed property".byte[]
createSendToOwners
(CurrencyID currencyId, OmniValue amount) createSendToOwnersHex
(CurrencyID currencyId, OmniValue amount) Creates a hex-encoded raw transaction of type 3: "send to owners".byte[]
createSimpleSend
(CurrencyID currencyId, OmniValue amount) createSimpleSendHex
(CurrencyID currencyId, OmniValue amount) Deprecated.
-
Constructor Details
-
RawTxBuilder
public RawTxBuilder()
-
-
Method Details
-
createSimpleSendHex
Deprecated.Creates a hex-encoded raw transaction of type 0: "simple send".- Parameters:
currencyId
- currency ID to sendamount
- amount to send- Returns:
- Hex encoded string for the transaction
-
createSimpleSend
-
createSendToOwnersHex
Creates a hex-encoded raw transaction of type 3: "send to owners".- Parameters:
currencyId
- currency ID to sendamount
- amount to send to all owners- Returns:
- Hex encoded string for the transaction
-
createSendToOwners
-
createDexSellOfferHex
public String createDexSellOfferHex(CurrencyID currencyId, OmniDivisibleValue amountForSale, org.bitcoinj.base.Coin amountDesired, Byte paymentWindow, org.bitcoinj.base.Coin commitmentFee, Byte action) Creates a hex-encoded raw transaction of type 20: "sell tokens for bitcoins". Currency amounts are Long values in satoshis/willetts- Parameters:
currencyId
- Currency ID to sell OMNI or TOMNI onlyamountForSale
- Amount of OMNI/TOMNI for saleamountDesired
- Amount of BTC desiredpaymentWindow
- Time period in blockscommitmentFee
- Minimum Bitcoin transaction feeaction
- Sell offer sub-action- Returns:
- The hex-encoded raw transaction
-
createMetaDexSellOfferHex
public String createMetaDexSellOfferHex(CurrencyID currencyForSale, OmniValue amountForSale, CurrencyID currencyDesired, OmniValue amountDesired, Byte action) Creates a hex-encoded raw transaction of type 21: "trade tokens for tokens".- Parameters:
currencyForSale
- currency to sellamountForSale
- amount to sellcurrencyDesired
- currency desired in exchangeamountDesired
- amount of other currency desiredaction
- action- Returns:
- The hex-encoded raw transaction
-
createAcceptDexOfferHex
Creates a hex-encoded raw transaction of type 22: "purchase tokens with bitcoins".- Parameters:
currencyId
- currency ID to purchaseamount
- amount to purchase- Returns:
- The hex-encoded raw transaction
-
createPropertyHex
public String createPropertyHex(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info, OmniValue amount) Creates a hex-encoded raw transaction of type 50: "create a property with fixed supply".- Parameters:
ecosystem
- main or test ecosystempropertyType
- divisible or indivisiblepreviousPropertyId
- 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
- infoamount
- the number of tokens to create- Returns:
- The hex-encoded raw transaction
-
createCrowdsaleHex
public String createCrowdsaleHex(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info, CurrencyID propertyDesired, Long tokensPerUnit, Long deadline, Byte earlyBirdBonus, Byte issuerBonus) Creates a hex-encoded raw transaction of type 51: "create a property via crowdsale with variable supply".- Parameters:
ecosystem
- main or test ecosystempropertyType
- divisible or indivisiblepreviousPropertyId
- an identifier of a predecessor token (0 for new crowdsales)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
- infopropertyDesired
- the identifier of a token eligible to participate in the crowdsaletokensPerUnit
- the amount of tokens granted per unit invested in the crowdsaledeadline
- the deadline of the crowdsale as Unix timestampearlyBirdBonus
- an early bird bonus for participants in percent per weekissuerBonus
- a percentage of tokens that will be granted to the issuer- Returns:
- The hex-encoded raw transaction
-
createCloseCrowdsaleHex
Creates a hex-encoded raw transaction of type 53: "close a crowdsale manually".- Parameters:
currencyId
- currency id of crowdsale- Returns:
- The hex-encoded raw transaction
-
createManagedPropertyHex
public String createManagedPropertyHex(Ecosystem ecosystem, PropertyType propertyType, Long previousPropertyId, String category, String subCategory, String label, String website, String info) Creates a hex-encoded raw transaction of type 54: "create a managed property with variable supply".- Parameters:
ecosystem
- Omni ecosystempropertyType
- divisible or indivisiblepreviousPropertyId
- 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:
- The hex-encoded raw transaction
-
createGrantTokensHex
Creates a hex-encoded raw transaction of type 55: "grant tokens for a managed property".- Parameters:
currencyId
- currency id for grantamount
- amount to grantmemo
- memo- Returns:
- The hex-encoded raw transaction
-
createRevokeTokensHex
Creates a hex-encoded raw transaction of type 56: "revoke tokens of a managed property".- Parameters:
currencyId
- currency id for revokeamount
- amount to revokememo
- memo- Returns:
- The hex-encoded raw transaction
-
createChangePropertyManagerHex
Creates a hex-encoded raw transaction of type 70: "change manager of a managed property".- Parameters:
currencyId
- currency id to change manager- Returns:
- The hex-encoded raw transaction
-