-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
493 additions
and
96 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use rooch_types::{ | ||
address::{MultiChainAddress, RoochAddress}, | ||
crypto::PublicKey, | ||
framework::session_key::SessionKey, | ||
key_struct::EncryptionData, | ||
}; | ||
use serde::{Deserialize, Serialize}; | ||
use std::collections::BTreeMap; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct LocalSessionKey { | ||
pub session_key: Option<SessionKey>, | ||
pub private_key: EncryptionData, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct LocalAccount { | ||
pub address: RoochAddress, | ||
pub multichain_address: Option<MultiChainAddress>, | ||
pub public_key: Option<PublicKey>, | ||
pub has_session_key: bool, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct AddressMapping { | ||
pub rooch_to_multichain: BTreeMap<RoochAddress, MultiChainAddress>, | ||
pub multichain_to_rooch: BTreeMap<MultiChainAddress, RoochAddress>, | ||
} | ||
|
||
impl Default for AddressMapping { | ||
fn default() -> Self { | ||
Self { | ||
rooch_to_multichain: BTreeMap::new(), | ||
multichain_to_rooch: BTreeMap::new(), | ||
} | ||
} | ||
} |
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
Oops, something went wrong.