The `signer` Module - Wiki OpenEthereum Documentation

JSON-RPC methods

JSON-RPC API Reference

signer_confirmRequest

Confirm a request in the signer queue

Parameters

  1. Quantity - The request id.
  2. Object - Modify the transaction before confirmation.
    • gasPrice: Quantity - (optional) Modify the gas price provided by the sender in Wei.
    • gas: Quantity - (optional) Gas provided by the sender in Wei.
    • condition: Object - (optional) Condition for scheduled transaction. Can be either an integer block number { block: 1 } or UTC timestamp (in seconds) { timestamp: 1491290692 }.
  3. String - The account password
params: [
  "0x1", // 1
  {},
  "hunter2"
]

Returns

Example

Request

curl --data '{"method":"signer_confirmRequest","params":["0x1",{},"hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {}
}

signer_confirmRequestRaw

Confirm a request in the signer queue providing signed request.

Parameters

  1. Quantity - Integer - The request id
  2. Data - Signed request (RLP encoded transaction)
params: [
  "0x1", // 1
  "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
]

Returns

Example

Request

curl --data '{"method":"signer_confirmRequestRaw","params":["0x1","0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {}
}

signer_confirmRequestWithToken

Confirm specific request with rolling token.

Parameters

  1. Quantity - The request id.
  2. Object - Modify the transaction before confirmation.
    • gasPrice: Quantity - (optional) Modify the gas price provided by the sender in Wei.
    • gas: Quantity - (optional) Gas provided by the sender in Wei.
    • condition: Object - (optional) Conditional submission of the transaction. Can be either an integer block number { block: 1 } or UTC timestamp (in seconds) { time: 1491290692 } or null.
  3. String - Password (initially) or a token returned by the previous call.
params: [
  "0x1", // 1
  {},
  "hunter2"
]

Returns

Example

Request

curl --data '{"method":"signer_confirmRequestWithToken","params":["0x1",{},"hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "result": { ... },
    "token": "cAF2w5LE7XUZ3v3N"
  }
}

signer_generateAuthorizationToken

Generates a new authorization token.

Parameters

None

Returns

Example

Request

curl --data '{"method":"signer_generateAuthorizationToken","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "bNGY-iIPB-j7zK-RSYZ"
}

signer_generateWebProxyAccessToken

Generates a new web proxy access token.

Parameters

  1. String - Domain for which the token is valid. Only requests to this domain will be allowed.
params: ["https://parity.io"]

Returns

Example

Request

curl --data '{"method":"signer_generateWebProxyAccessToken","params":["https://parity.io"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "MOWm0tEJjwthDiTU"
}

signer_rejectRequest

Rejects a request in the signer queue

Parameters

  1. Quantity - Integer - The request id
params: [
  "0x1" // 1
]

Returns

Example

Request

curl --data '{"method":"signer_rejectRequest","params":["0x1"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": true
}

signer_requestsToConfirm

Returns a list of the transactions awaiting authorization.

Parameters

None

Returns

Example

Request

curl --data '{"method":"signer_requestsToConfirm","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [ ... ]
}

signer_subscribePending

Starts a subscription for transactions in the confirmation queue.
Each event contains all transactions currently in the queue.

An example notification received by subscribing to this event:
```
{"jsonrpc":"2.0","method":"signer_pending","params":{"subscription":"0x416d77337e24399d","result":[]}}
```

You can unsubscribe using `signer_unsubscribePending` RPC method. Subscriptions are also tied to a transport
connection, disconnecting causes all subscriptions to be canceled.

Parameters

None

Returns

Example

Request

wscat -c localhost:8546
>{"method":"signer_subscribePending","params":[],"id":1,"jsonrpc":"2.0"}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x416d77337e24399d"
}

signer_unsubscribePending

Unsubscribes from pending transactions subscription.

Parameters

  1. String - Subscription ID
params: ["0x416d77337e24399d"]

Returns

Example

Request

wscat -c localhost:8546
>{"method":"signer_unsubscribePending","params":["0x416d77337e24399d"],"id":1,"jsonrpc":"2.0"}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": true
}