Neucron
Search
K
Comment on page

Pay

Multiple Payment Channel

Introduction

The "tx/multipayc" endpoint provides functionality for creating a payment channel with multiple types of outputs. This endpoint allows you to create a transaction that involves various outputs with different characteristics, such as changing lock times and specific script requirements. The endpoint ensures security through authentication and handles various responses for different scenarios.

Endpoint

POST /tx/multipayc

Authentication

This endpoint requires authentication using a bearer token ("BearerAuth").

Request Parameters

  • walletID (optional, query parameter): The identifier for the wallet. If not provided, the default wallet will be used for the transaction.
  • sendRequest (required, request body): A JSON object that defines the transaction details.

Transaction Builder (sendRequest)

The sendRequest object contains the following parameters:
  • Change_Address (string): The address where the remaining Satoshis will be sent after the successful transaction.
  • Input (array of objects): An array of input objects, each representing an unspent transaction output. Each input object has the following properties:
    • SequenceNum (integer): A sequence number representing the transaction sequence. Must be greater than 0 and less than 4294967295. This sequence number is beneficial for changing the lock time of a particular UTXO.
    • Utxo_index (integer): The index of the UTXO object in the list/UTXOs.
  • LockTime (string, format: "2006-01-02T15:04:05Z"): A timestamp representing the time until which the script remains unlocked.
  • Outputs (array of objects): An array of output objects, each representing a transaction output. Each output object has the following properties:
    • Amount (integer): The amount of cryptocurrency associated with the output.
    • Asm (string): The is used to add locking script as output
Please note that the sum of the Amount values in the Input array must be greater than the sum of the Amount values in the Outputs array

Examples

Request

POST /tx/multipayc?walletID=example_wallet
Content-Type: application/json
{
"sendRequest": {
"Change_Address": "change_address_1",
"Input": [
{
"SequenceNum": 100,
"Utxo_index": 3
}
],
"LockTime": "2006-01-02T15:04:05Z",
"Outputs": [
{
"Amount": 80,
"Asm": "OP_2 OP_2 OP_ADD OP_EQUAL"
}
]
}
}

Response (200 OK)

{
"transactionID": "transaction_id",
"message": "Transaction successfully created and broadcasted."
}

Response (400 Bad Request)

{
"error": "Bad Request",
"message": "Invalid input data. Please check your request."
}

Conclusion

The "tx/multipayc" endpoint enables the creation of payment channels with multiple types of outputs, offering flexibility in handling various transaction scenarios. By providing the necessary input parameters and adhering to the guidelines for inputs and outputs, you can create and broadcast transactions seamlessly.
Oops, something is missing.We could not find the original source to display this content.

Payment Channel

Introduction

The "tx/payc" endpoint enables the creation of future transactions using a payment channel. This endpoint allows you to specify transaction details, including the amount to be sent, the date when the transaction will be available for spending, the receiver's address, and a sequence number associated with a selected UTXO. The sequence number can be used to change the lockscript time for the UTXO by increasing the sequence number. The endpoint ensures security through authentication and handles various responses for different scenarios.

Endpoint

POST /tx/payc

Authentication

This endpoint requires authentication using a bearer token ("BearerAuth").

Request Parameters

  • walletID (optional, query parameter): The identifier for the wallet. If not provided, the default wallet will be used for the transaction.
  • sendRequest (required, request body): A JSON object that defines the transaction details.

Transaction Details (sendRequest)

The sendRequest object contains the following parameters:
  • amount (integer): The amount of cryptocurrency you want to send.
  • date (string, format: "yyyy-mm-dd"): The date when the transaction will be available for decryption.
  • receiver_address (string): The address to which the transaction will be made.
  • sequence_Num (integer): A sequence number associated with a selected UTXO. This sequence number can be beneficial for changing the lockscript time by increasing it.
  • time (string, format: "hh:mm:ss"): The time when the transaction will be available for spending.

Response Codes

  • 200 OK: The request was successful. .
  • 400 Bad Request: The request was invalid.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An internal server error occurred

Examples

Request

POST /tx/payc?walletID=example_wallet
Content-Type: application/json
{
"sendRequest": {
"amount": 100,
"date": "2023-08-31",
"receiver_address": "receiver_address_1",
"sequence_Num": 100,
"time": "12:00:00"
}
}

Response (200 OK)

{
"transactionID": "transaction_id",
"message": "Transaction successfully created and broadcasted."
}

Response (400 Bad Request)

{
"error": "Bad Request",
"message": "Invalid input data. Please check your request."
}

Additional Details

  • walletID: This parameter is optional. If no walletID is provided, the default walletID will be used, and the UTXO will be selected from it.
  • sequence_Num: The sequence number associated with the UTXO. This sequence number can be used to change the lockscript time by increasing it.

Conclusion

The "tx/payc" endpoint provides the ability to create future transactions using a payment channel. By specifying the transaction amount, decryption date, receiver's address, and sequence number, you can initiate secure and flexible transactions. The option to modify the lockscript time through the sequence number adds an extra layer of control over your transactions.
Oops, something is missing.We could not find the original source to display this content.
Certainly, here's the GitBook documentation for the "/tx/send" endpoint based on your provided information:

Build Multiple P2PKH Output

Introduction

The "tx/send" endpoint allows you to build transactions with multiple Pay-to-Public-Key-Hash (P2PKH) outputs. This feature can be particularly useful for crowd-donation purposes or when you need to distribute cryptocurrency to multiple recipients. The endpoint ensures security through authentication and handles various responses for different scenarios.

Endpoint

POST /tx/send

Authentication

This endpoint requires authentication using a bearer token ("BearerAuth").

Request Parameters

  • walletID (optional, query parameter): The identifier for the wallet. If not provided, the default wallet will be used for the transaction.
  • sendRequest (required, request body): A JSON object that defines the transaction details.

Transaction Details (sendRequest)

The sendRequest object contains the following parameters:
  • change_Address (string): The address where the remaining satoshis will be sent after the transaction.
  • output_Utxo (array of objects): An array of output objects, each representing a P2PKH output. Each output object has the following properties:
    • address (string): The recipient's address where the amount will be sent.
    • amount (integer): The amount of cryptocurrency to send. The amount must be greater than 1.
If no walletID is provided, the default wallet will be used.

Response

The response from this endpoint is a JSON object with the following parameter:
  • txid (string): The transaction ID associated with the created transaction.

Response Codes

  • 200 OK: The request was successful. The response will be a JSON object containing the txid.
  • 400 Bad Request: The request was invalid or improperly formatted.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An internal server error occurred.

Examples

Request

POST /tx/send?walletID=example_wallet
Content-Type: application/json
{
"sendRequest": {
"change_Address": "change_address_1",
"output_Utxo": [
{
"address": "recipient_address_1",
"amount": 100
},
{
"address": "recipient_address_2",
"amount": 50
}
]
}
}

Response (200 OK)

{
"txid": "transaction_id"
}

Response (400 Bad Request)

{
"error": "Bad Request",
"message": "Invalid input data. Please check your request."
}

Conclusion

The "tx/send" endpoint provides the capability to build transactions with multiple P2PKH outputs, making it suitable for crowd-donation purposes and other use cases. By specifying the change address and the recipient addresses with corresponding amounts, you can efficiently distribute cryptocurrency to multiple recipients.
Oops, something is missing.We could not find the original source to display this content.