Transaction Creation
The RPC for transaction creation is used to create and broadcast Omni Protocol transactions. The result returns the hash value of the broadcast transaction.
omni_send
Creates and broadcasts a simple send transaction.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fromaddress | String | Yes | The address to send from |
| toaddress | String | Yes | The recipient's address |
| propertyid | String | Yes | The identifier of the token to send |
| amount | String | Yes | The amount to send |
| redeemaddress | String | No | An address that can process the transaction (default: sender) |
| referenceamount | String | No | The amount of Bitcoin to send to the recipient (default: minimum) |
Example:
$ omnicore-cli "omni_send" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "100.0"Result:
"hash" // Hexadecimal-encoded transaction hashomni_senddexsell
Places, updates, or cancels a sell offer on the traditional distributed OMNI/BTC exchange.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fromaddress | String | Yes | The address to send from |
| propertyidforsale | Uint | Yes | The identifier of the token to list for sale (1 for OMNI, 2 for TOMNI) |
| amountforsale | String | Yes | The amount of tokens to sell |
| amountdesired | String | Yes | The amount of Bitcoin desired |
| paymentwindow | String | Yes | The time limit for the buyer to pay after accepting the offer |
| minacceptfee | String | Yes | The minimum mining fee the buyer must pay |
| action | String | Yes | The action to take (1: new offer, 2: update, 3: cancel) |
Example:
$ omnicore-cli "omni_senddexsell" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "1.5" "0.75" 25 "0.0005" 1Result:
"hash" // Hexadecimal-encoded transaction hashomni_senddexaccept
Creates and broadcasts an acceptance offer for a specified token and amount.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fromaddress | String | Yes | The address to send from |
| toaddress | String | Yes | The seller's address |
| propertyid | String | Yes | The identifier of the token to purchase |
| amount | String | Yes | The amount to accept |
| override | String | Yes | Override the minimum accept fee and payment window checks |
Example:
$ omnicore-cli "omni_senddexaccept" "35URq1NN3xL6GeRKUP6vzaQVcxoJiiJKd8" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "15.0"Result:
"hash" // Hexadecimal-encoded transaction hashomni_sendissuancecrowdsale
Creates a new token as a crowdsale.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fromaddress | String | Yes | The address to send from |
| ecosystem | Uint | Yes | The ecosystem for the token (1: main, 2: test) |
| type | Uint | Yes | The type of token (1: indivisible, 2: divisible) |
| previousid | Uint | Yes | The identifier of the predecessor token (0 for new crowdsale) |
| category | String | Yes | The category of the new token |
| subcategory | String | Yes | The subcategory of the new token |
| name | String | Yes | The name of the new token |
| url | String | Yes | The URL for more information about the token |
| data | String | Yes | A description of the new token |
| propertyiddesired | Uint | Yes | The identifier of the token eligible for the crowdsale |
| tokensperunit | String | Yes | The number of tokens invested per unit in the crowdsale |
| deadline | Uint | Yes | The crowdsale deadline as a Unix timestamp |
| earlybonus | Uint | Yes | The early bonus percentage for participants |
| issuerpercentage | Uint | Yes | The percentage of tokens granted to the issuer |
Example:
$ omnicore-cli "omni_sendissuancecrowdsale" "3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" 2 "100" 1483228800 30 2Result:
"hash" // Hexadecimal-encoded transaction hash๐ Explore OmniLayer Documentation
FAQ
What is OmniProtocol?
OmniProtocol is a platform for creating and trading custom tokens and smart properties on the Bitcoin blockchain.
How do I create a token?
You can create a token using the omni_sendissuancecrowdsale, omni_sendissuancefixed, or omni_sendissuancemanaged commands, depending on your token type.
What is a crowdsale?
A crowdsale is a method for issuing new tokens where participants can invest in the token during a specified period.
How do I trade tokens?
Tokens can be traded using commands like omni_senddexsell, omni_senddexaccept, and omni_sendtrade.