-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ pub mod evm; | |
pub mod near; | ||
|
||
pub mod constants; | ||
pub mod signer; | ||
pub mod transaction_builder; | ||
pub mod types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use near_sdk::ext_contract; | ||
use near_sdk::serde::{Deserialize, Serialize}; | ||
use near_sdk::NearToken; | ||
use schemars::JsonSchema; | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
#[serde(crate = "near_sdk::serde")] | ||
pub struct SignatureResponse { | ||
pub big_r: SerializableAffinePoint, | ||
pub s: SerializableScalar, | ||
pub recovery_id: u8, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
#[serde(crate = "near_sdk::serde")] | ||
pub struct SerializableAffinePoint { | ||
pub affine_point: String, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
#[serde(crate = "near_sdk::serde")] | ||
pub struct SerializableScalar { | ||
pub scalar: String, | ||
} | ||
|
||
#[derive(Debug, Serialize)] | ||
#[serde(crate = "near_sdk::serde")] | ||
pub struct SignRequest { | ||
pub payload: [u8; 32], | ||
pub path: String, | ||
pub key_version: u32, | ||
} | ||
|
||
#[allow(dead_code)] | ||
#[ext_contract(mpc_contract)] | ||
pub trait MPCContract { | ||
fn sign(&self, request: SignRequest); | ||
fn experimental_signature_deposit(&self) -> NearToken; | ||
} |