⚙️API
luban_sendPreconfRequest
Sends a preconfirmation request to the preconfer.
Parameters
preconf_request: The preconfirmation request object, containing:tipTx: The tip transaction details.prefConditions: The preconfirmation conditions.preconfTx: The preconfirmation transaction details (optional).initSignature: The user's initial signature.
Returns
On success: A
PreconfResponseobject containing:preconfHash: The hash of the preconfirmation request.preconferSignature: The preconfer's signature.
On failure: An
RpcErrorobject with an error message indicating the reason for the failure.
Example
{
"jsonrpc": "2.0",
"method": "luban_sendPreconfRequest",
"params": [
{
"tipTx": {
"gasLimit": "100000",
"from": "0xUserAddress",
"to": "0xPreconferAddress",
"prePay": "1000000000000000000",
"afterPay": "2000000000000000000",
"nonce": "1"
},
"prefConditions": {
"inclusionMetaData": {
"startingBlockNumber": "1000"
},
"blockNumber": "1001"
},
"preconfTx": {
"to": "",
"value": "0",
"callData": "",
"ethTransfer": false
},
"initSignature": "0xUserSignature"
}
],
"id": 1
}
// Response
{
"jsonrpc": "2.0",
"result": {
"preconfHash": "0x1234567890abcdef",
"preconferSignature": "0xPreconferSignature"
},
"id": 1
}luban_cancelPreconfRequest
Cancels a preconfirmation request.
Parameters
cancel_preconf_request: The cancel preconfirmation request object, containing:preconfHash: The hash of the preconfirmation request to cancel.
Returns
On success: A
CancelPreconfResponseobject (empty).On failure: An
RpcErrorobject with an error message indicating the reason for the failure.
Example
{
"jsonrpc": "2.0",
"method": "luban_cancelPreconfRequest",
"params": [
{
"preconfHash": "0x1234567890abcdef"
}
],
"id": 1
}
// Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}luban_sendPreconfTxRequest
Sends a preconfirmation transaction request.
Parameters
preconf_tx_hash: The hash of the preconfirmation request.preconf_tx: The preconfirmation transaction object.
Returns
On success: An empty result (null).
On failure: An
RpcErrorobject with an error message indicating the reason for the failure.
Example
{
"jsonrpc": "2.0",
"method": "luban_sendPreconfTxRequest",
"params": [
"0x1234567890abcdef",
{
"to": "0xContractAddress",
"value": "0",
"callData": "0x1234567890",
"ethTransfer": false
}
],
"id": 1
}
// Response
{
"jsonrpc": "2.0",
"result": null,
"id": 1
}luban_checkPreconfRequestStatus
Checks the status of a preconfirmation request.
Parameters
preconf_tx_hash: The hash of the preconfirmation request.
Returns
On success: A
PreconfStatusResponseobject containing:status: The status of the preconfirmation request (e.g., "Accepted", "Pending", "Rejected").data: The preconfirmation request data, including:tipTx: The tip transaction details.prefConditions: The preconfirmation conditions.preconfTx: The preconfirmation transaction details (if available).initSignature: The user's initial signature.preconferSignature: The preconfer's signature.
On failure: An
RpcErrorobject with an error message indicating the reason for the failure.
Example
{
"jsonrpc": "2.0",
"method": "luban_checkPreconfRequestStatus",
"params": [
"0x1234567890abcdef"
],
"id": 1
}
// Response
{
"jsonrpc": "2.0",
"result": {
"status": "Accepted",
"data": {
"tipTx": {
"gasLimit": "100000",
"from": "0xUserAddress",
"to": "0xPreconferAddress",
"prePay": "1000000000000000000",
"afterPay": "2000000000000000000",
"nonce": "1"
},
"prefConditions": {
"inclusionMetaData": {
"startingBlockNumber": "1000"
},
"blockNumber": "1001"
},
"preconfTx": {
"to": "",
"value": "0",
"callData": "",
"ethTransfer": false
},
"initSignature": "0xUserSignature",
"preconferSignature": "0xPreconferSignature"
}
},
"id": 1
}Last updated
