Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPC for "omni_sendtomany" and "omni_createpayload_sendtomany" #1248

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

dexX7
Copy link
Member

@dexX7 dexX7 commented Dec 18, 2021

The documentation for two new RPCs is added for send-to-many transactions:


omni_sendtomany

Create and broadcast a send-to-many transaction, which allows to transfer tokens from one source to multiple receivers.

Arguments:

Name Type Presence Description
fromaddress string required the address to send from
propertyid number required the identifier of the tokens to send
mapping array required an array with the receiving address "address" and the "amount" to send

Result:

"hash"  // (string) the hex-encoded transaction hash

Example:

$ omnicore-cli "omni_sendtomany" 1 '[{"address": "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa", "amount": "10.5"}, {"address": "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH", "amount": "0.5"}]'

omni_createpayload_sendtomany

Create the payload for a send-to-many transaction.

Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units!

Arguments:

Name Type Presence Description
propertyid number required the identifier of the tokens to send
mapping array required an array with output index "output" starting at 0 and the "amount" to send

Result:

"payload"  // (string) the hex-encoded payload

Example:

$ omnicore-cli "omni_createpayload_sendtomany" 1 '[{"output": 2, "amount": "10.5"}, {"output": 3, "amount": "0.5"}, {"output": 5, "amount": "15.0"}]'

@dexX7 dexX7 changed the title Add RPC docs for "omni_sendtomany" and "omni_createpayload_sendtomany" Add RPC for "omni_sendtomany" and "omni_createpayload_sendtomany" Dec 21, 2021
@dexX7 dexX7 force-pushed the 0.12.0-send-to-many-docs branch from f9eee28 to 0f2e50b Compare March 24, 2022 13:56
@dexX7 dexX7 merged commit 567e762 into OmniLayer:develop Mar 24, 2022
counos pushed a commit to CounosH/counoslayer that referenced this pull request Sep 27, 2023
…ayload_sendtomany"

Pull request description:

  The documentation for two new RPCs is added for send-to-many transactions:

  ---

  ### omni_sendtomany

  Create and broadcast a send-to-many transaction, which allows to transfer tokens from one source to multiple receivers.

  **Arguments:**

  | Name                | Type    | Presence | Description                                                                                  |
  |---------------------|---------|----------|----------------------------------------------------------------------------------------------|
  | `fromaddress`       | string  | required | the address to send from                                                                     |
  | `propertyid`        | number  | required | the identifier of the tokens to send                                                         |
  | `mapping`           | array   | required | an array with the receiving address "address" and the "amount" to send                       |

  **Result:**
  ```js
  "hash"  // (string) the hex-encoded transaction hash
  ```

  **Example:**

  ```bash
  $ omnicore-cli "omni_sendtomany" 1 '[{"address": "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa", "amount": "10.5"}, {"address": "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH", "amount": "0.5"}]'
  ```

  ---

  ### omni_createpayload_sendtomany

  Create the payload for a send-to-many transaction.

  Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units!

  **Arguments:**

  | Name                | Type    | Presence | Description                                                                                  |
  |---------------------|---------|----------|----------------------------------------------------------------------------------------------|
  | `propertyid`        | number  | required | the identifier of the tokens to send                                                         |
  | `mapping`           | array   | required | an array with output index "output" starting at 0 and the "amount" to send                   |

  **Result:**
  ```js
  "payload"  // (string) the hex-encoded payload
  ```

  **Example:**

  ```bash
  $ omnicore-cli "omni_createpayload_sendtomany" 1 '[{"output": 2, "amount": "10.5"}, {"output": 3, "amount": "0.5"}, {"output": 5, "amount": "15.0"}]'
  ```

# Conflicts:
#	src/counoscore/doc/rpc-api.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant