2016-11-06 12:51:53 +01:00
|
|
|
// Copyright 2015, 2016 Ethcore (UK) Ltd.
|
|
|
|
// This file is part of Parity.
|
|
|
|
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
//! Parity Signer-related rpc interface.
|
2016-11-09 13:13:35 +01:00
|
|
|
use jsonrpc_core::Error;
|
2016-11-06 12:51:53 +01:00
|
|
|
|
|
|
|
use v1::helpers::auto_args::Wrap;
|
2016-11-10 11:27:05 +01:00
|
|
|
use v1::types::{U256, Bytes, TransactionModification, ConfirmationRequest, ConfirmationResponse};
|
2016-11-06 12:51:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
build_rpc_trait! {
|
|
|
|
/// Signer extension for confirmations rpc interface.
|
|
|
|
pub trait Signer {
|
|
|
|
|
|
|
|
/// Returns a list of items to confirm.
|
|
|
|
#[rpc(name = "signer_requestsToConfirm")]
|
|
|
|
fn requests_to_confirm(&self) -> Result<Vec<ConfirmationRequest>, Error>;
|
|
|
|
|
|
|
|
/// Confirm specific request.
|
|
|
|
#[rpc(name = "signer_confirmRequest")]
|
2016-11-09 13:13:35 +01:00
|
|
|
fn confirm_request(&self, U256, TransactionModification, String) -> Result<ConfirmationResponse, Error>;
|
2016-11-06 12:51:53 +01:00
|
|
|
|
2016-11-10 11:27:05 +01:00
|
|
|
/// Confirm specific request with already signed data.
|
|
|
|
#[rpc(name = "signer_confirmRequestRaw")]
|
|
|
|
fn confirm_request_raw(&self, U256, Bytes) -> Result<ConfirmationResponse, Error>;
|
|
|
|
|
2016-11-06 12:51:53 +01:00
|
|
|
/// Reject the confirmation request.
|
|
|
|
#[rpc(name = "signer_rejectRequest")]
|
|
|
|
fn reject_request(&self, U256) -> Result<bool, Error>;
|
|
|
|
|
|
|
|
/// Generates new authorization token.
|
|
|
|
#[rpc(name = "signer_generateAuthorizationToken")]
|
|
|
|
fn generate_token(&self) -> Result<String, Error>;
|
|
|
|
}
|
|
|
|
}
|