From 2cca24e3d663ef81c47f91f25be9d42862208ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGiems=E2=80=9D?= <“hubert.wabia@gmail.com”> Date: Wed, 7 Feb 2024 09:26:36 +0100 Subject: [PATCH 1/2] "refactor" http endpoints --- .../src/{client => http}/connect_session.rs | 48 ++++++++----------- server/src/{client => http}/drop_sessions.rs | 3 +- .../{client => http}/get_pending_request.rs | 14 +++--- .../{client => http}/get_pending_requests.rs | 1 + .../src/{client => http}/get_session_info.rs | 1 + server/src/{client => http}/get_sessions.rs | 0 .../{client => http}/get_wallets_metadata.rs | 3 +- server/src/{client => http}/mod.rs | 0 .../src/{client => http}/resolve_request.rs | 33 ++++++------- server/src/lib.rs | 2 +- server/src/router.rs | 23 +++++---- server/src/state.rs | 16 ++++--- server/src/structs/session.rs | 38 +++++++++------ .../client_handler/methods/process_connect.rs | 11 ++++- 14 files changed, 102 insertions(+), 91 deletions(-) rename server/src/{client => http}/connect_session.rs (64%) rename server/src/{client => http}/drop_sessions.rs (97%) rename server/src/{client => http}/get_pending_request.rs (87%) rename server/src/{client => http}/get_pending_requests.rs (99%) rename server/src/{client => http}/get_session_info.rs (99%) rename server/src/{client => http}/get_sessions.rs (100%) rename server/src/{client => http}/get_wallets_metadata.rs (99%) rename server/src/{client => http}/mod.rs (100%) rename server/src/{client => http}/resolve_request.rs (75%) diff --git a/server/src/client/connect_session.rs b/server/src/http/connect_session.rs similarity index 64% rename from server/src/client/connect_session.rs rename to server/src/http/connect_session.rs index 95e5d29a..7cbe01c5 100644 --- a/server/src/client/connect_session.rs +++ b/server/src/http/connect_session.rs @@ -1,15 +1,11 @@ -use axum::{extract::State, http::StatusCode, Json}; -use serde::{Deserialize, Serialize}; -use ts_rs::TS; - use crate::{ errors::NightlyError, state::{ClientToSessions, ModifySession, Sessions}, - structs::{ - app_messages::{app_messages::ServerToApp, user_connected_event::UserConnectedEvent}, - common::{Device, Notification, SessionStatus}, - }, + structs::common::{Device, Notification}, }; +use axum::{extract::State, http::StatusCode, Json}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TS)] #[ts(export)] @@ -45,32 +41,28 @@ pub async fn connect_session( )) } }; + // Insert user socket - session.update_status(SessionStatus::ClientConnected); - session.client_state.device = request.device.clone(); - session.client_state.connected_public_keys = request.public_keys.clone(); - session.client_state.metadata = request.metadata.clone(); - session.client_state.client_id = Some(request.client_id.clone()); - // notification - if let Some(notification) = request.notification.clone() { - session.notification = Some(notification); - } - let app_event = ServerToApp::UserConnectedEvent(UserConnectedEvent { - public_keys: request.public_keys, - metadata: request.metadata, - }); - match session.send_to_app(app_event).await { - Ok(_) => {} - Err(_) => { - return Err(( + session + .connect_user( + &request.device, + &request.public_keys, + &request.metadata, + &request.client_id, + &request.notification, + ) + .await + .map_err(|_| { + return ( StatusCode::BAD_REQUEST, NightlyError::AppDisconnected.to_string(), - )) - } - }; + ); + })?; + // Insert new session id into client_to_sessions client_to_sessions .add_session(request.client_id.clone(), request.session_id.clone()) .await; + return Ok(Json(HttpConnectSessionResponse {})); } diff --git a/server/src/client/drop_sessions.rs b/server/src/http/drop_sessions.rs similarity index 97% rename from server/src/client/drop_sessions.rs rename to server/src/http/drop_sessions.rs index 75cf6abc..debda4e6 100644 --- a/server/src/client/drop_sessions.rs +++ b/server/src/http/drop_sessions.rs @@ -26,7 +26,7 @@ pub async fn drop_sessions( Json(request): Json, ) -> Result, (StatusCode, String)> { let mut dropped_sessions = Vec::new(); - // TODO handle disconnecting app + for session_id in request.sessions { if sessions.disconnect_user(session_id.clone()).await.is_ok() { dropped_sessions.push(session_id.clone()); @@ -36,5 +36,6 @@ pub async fn drop_sessions( .remove_session(request.client_id.clone(), session_id) .await; } + Ok(Json(HttpDropSessionsResponse { dropped_sessions })) } diff --git a/server/src/client/get_pending_request.rs b/server/src/http/get_pending_request.rs similarity index 87% rename from server/src/client/get_pending_request.rs rename to server/src/http/get_pending_request.rs index 292b777d..07150bbc 100644 --- a/server/src/client/get_pending_request.rs +++ b/server/src/http/get_pending_request.rs @@ -37,14 +37,20 @@ pub async fn get_pending_request( )) } }; + if session.client_state.client_id != Some(request.client_id.clone()) { return Err(( StatusCode::BAD_REQUEST, NightlyError::UserNotConnected.to_string(), )); } - let pending_request = match session.pending_requests.get(&request.request_id) { - Some(pending_request) => pending_request, + + match session.pending_requests.get(&request.request_id) { + Some(pending_request) => { + return Ok(Json(HttpGetPendingRequestResponse { + request: pending_request.clone(), + })) + } None => { return Err(( StatusCode::BAD_REQUEST, @@ -52,8 +58,4 @@ pub async fn get_pending_request( )) } }; - - Ok(Json(HttpGetPendingRequestResponse { - request: pending_request.clone(), - })) } diff --git a/server/src/client/get_pending_requests.rs b/server/src/http/get_pending_requests.rs similarity index 99% rename from server/src/client/get_pending_requests.rs rename to server/src/http/get_pending_requests.rs index ce53455d..1517d7fe 100644 --- a/server/src/client/get_pending_requests.rs +++ b/server/src/http/get_pending_requests.rs @@ -37,6 +37,7 @@ pub async fn get_pending_requests( )) } }; + if session.client_state.client_id != Some(request.client_id.clone()) { return Err(( StatusCode::BAD_REQUEST, diff --git a/server/src/client/get_session_info.rs b/server/src/http/get_session_info.rs similarity index 99% rename from server/src/client/get_session_info.rs rename to server/src/http/get_session_info.rs index 131ca50b..1e388b20 100644 --- a/server/src/client/get_session_info.rs +++ b/server/src/http/get_session_info.rs @@ -38,6 +38,7 @@ pub async fn get_session_info( )) } }; + let response = HttpGetSessionInfoResponse { status: session.status.clone(), persistent: session.persistent, diff --git a/server/src/client/get_sessions.rs b/server/src/http/get_sessions.rs similarity index 100% rename from server/src/client/get_sessions.rs rename to server/src/http/get_sessions.rs diff --git a/server/src/client/get_wallets_metadata.rs b/server/src/http/get_wallets_metadata.rs similarity index 99% rename from server/src/client/get_wallets_metadata.rs rename to server/src/http/get_wallets_metadata.rs index 305623d0..69410ee3 100644 --- a/server/src/client/get_wallets_metadata.rs +++ b/server/src/http/get_wallets_metadata.rs @@ -1,6 +1,5 @@ -use axum::{http::StatusCode, Json}; - use crate::{structs::wallet_metadata::WalletMetadata, wallets::WALLETS_METADATA}; +use axum::{http::StatusCode, Json}; pub async fn get_wallets_metadata() -> Result>, (StatusCode, String)> { Ok(Json(WALLETS_METADATA.to_vec())) diff --git a/server/src/client/mod.rs b/server/src/http/mod.rs similarity index 100% rename from server/src/client/mod.rs rename to server/src/http/mod.rs diff --git a/server/src/client/resolve_request.rs b/server/src/http/resolve_request.rs similarity index 75% rename from server/src/client/resolve_request.rs rename to server/src/http/resolve_request.rs index c6878fbf..1e2b3d69 100644 --- a/server/src/client/resolve_request.rs +++ b/server/src/http/resolve_request.rs @@ -26,8 +26,8 @@ pub async fn resolve_request( State(sessions): State, Json(request): Json, ) -> Result, (StatusCode, String)> { + // Get session let mut sessions = sessions.write().await; - let session = match sessions.get_mut(&request.session_id) { Some(session) => session, None => { @@ -37,36 +37,33 @@ pub async fn resolve_request( )) } }; - // Check if client_id matches + // Check if client_id matches if session.client_state.client_id != Some(request.client_id.clone()) { return Err(( StatusCode::BAD_REQUEST, NightlyError::UserNotConnected.to_string(), )); } - let _pending_request = match session.pending_requests.remove(&request.request_id) { - Some(pending_request) => pending_request, - None => { - return Err(( - StatusCode::BAD_REQUEST, - NightlyError::RequestDoesNotExist.to_string(), - )) - } + // Remove request from pending requests + if let None = session.pending_requests.remove(&request.request_id) { + return Err(( + StatusCode::BAD_REQUEST, + NightlyError::RequestDoesNotExist.to_string(), + )); }; + // Send to app let app_msg = ServerToApp::ResponsePayload(ResponsePayload { response_id: request.request_id.clone(), content: request.content.clone(), }); - match session.send_to_app(app_msg).await { - Ok(_) => {} - Err(_) => { - return Err(( - StatusCode::BAD_REQUEST, - NightlyError::AppDisconnected.to_string(), - )) - } + if let Err(_) = session.send_to_app(app_msg).await { + return Err(( + StatusCode::BAD_REQUEST, + NightlyError::AppDisconnected.to_string(), + )); }; + return Ok(Json(HttpResolveRequestResponse {})); } diff --git a/server/src/lib.rs b/server/src/lib.rs index 4b972472..fc488906 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1,6 +1,6 @@ -pub mod client; pub mod errors; pub mod handle_error; +pub mod http; pub mod router; mod sesssion_cleaner; pub mod state; diff --git a/server/src/router.rs b/server/src/router.rs index 541969b3..61d0969a 100644 --- a/server/src/router.rs +++ b/server/src/router.rs @@ -1,21 +1,11 @@ -use std::time::Duration; - -use axum::{ - error_handling::HandleErrorLayer, - routing::{get, post}, - Router, -}; -use tower::ServiceBuilder; -use tracing_subscriber::EnvFilter; - use crate::{ - client::{ + handle_error::handle_error, + http::{ connect_session::connect_session, drop_sessions::drop_sessions, get_pending_request::get_pending_request, get_pending_requests::get_pending_requests, get_session_info::get_session_info, get_sessions::get_sessions, get_wallets_metadata::get_wallets_metadata, resolve_request::resolve_request, }, - handle_error::handle_error, sesssion_cleaner::start_cleaning_sessions, state::ServerState, structs::http_endpoints::HttpEndpoint, @@ -25,7 +15,16 @@ use crate::{ client_handler::handler::on_new_client_connection, }, }; +use axum::{ + error_handling::HandleErrorLayer, + routing::{get, post}, + Router, +}; +use std::time::Duration; +use tower::ServiceBuilder; use tower_http::trace::TraceLayer; +use tracing_subscriber::EnvFilter; + pub async fn get_router() -> Router { let state = ServerState { sessions: Default::default(), diff --git a/server/src/state.rs b/server/src/state.rs index 42123769..c1a8d074 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -17,6 +17,15 @@ pub type SessionId = String; pub type ClientId = String; pub type Sessions = Arc>>; pub type ClientSockets = Arc>>>>; +pub type ClientToSessions = Arc>>>>; + +#[derive(Clone, FromRef)] +pub struct ServerState { + pub sessions: Sessions, + pub client_to_sockets: ClientSockets, // Holds only live sockets + pub client_to_sessions: ClientToSessions, +} + #[async_trait] pub trait DisconnectUser { async fn disconnect_user(&self, session_id: SessionId) -> Result<()>; @@ -69,13 +78,6 @@ impl SendToClient for ClientSockets { } } } -pub type ClientToSessions = Arc>>>>; -#[derive(Clone, FromRef)] -pub struct ServerState { - pub sessions: Sessions, - pub client_to_sockets: ClientSockets, // Holds only live sockets - pub client_to_sessions: ClientToSessions, -} #[async_trait] pub trait ModifySession { diff --git a/server/src/structs/session.rs b/server/src/structs/session.rs index f6cc6c5a..8d0f1844 100644 --- a/server/src/structs/session.rs +++ b/server/src/structs/session.rs @@ -1,19 +1,16 @@ -use std::collections::HashMap; - -use crate::{state::ClientId, utils::get_timestamp_in_milliseconds}; - use super::{ app_messages::{ app_messages::ServerToApp, initialize::InitializeRequest, user_connected_event::UserConnectedEvent, user_disconnected_event::UserDisconnectedEvent, }, - client_messages::connect::ConnectRequest, common::{AppMetadata, Device, Network, Notification, PendingRequest, SessionStatus, Version}, }; -use anyhow::Result; +use crate::{state::ClientId, utils::get_timestamp_in_milliseconds}; +use anyhow::{bail, Result}; use axum::extract::ws::{Message, WebSocket}; use futures::{stream::SplitSink, SinkExt}; use log::{info, warn}; +use std::collections::HashMap; use uuid7::Uuid; #[derive(Debug)] @@ -114,26 +111,37 @@ impl Session { } } - pub async fn connect_user(&mut self, connect_request: &ConnectRequest) { + pub async fn connect_user( + &mut self, + device: &Option, + public_keys: &Vec, + metadata: &Option, + client_id: &String, + notification: &Option, + ) -> Result<()> { // Update session status self.update_status(SessionStatus::ClientConnected); // Update client state - self.client_state.device = connect_request.device.clone(); - self.client_state.connected_public_keys = connect_request.public_keys.clone(); - self.client_state.metadata = connect_request.metadata.clone(); - self.client_state.client_id = Some(connect_request.client_id.clone()); + self.client_state.device = device.clone(); + self.client_state.connected_public_keys = public_keys.clone(); + self.client_state.metadata = metadata.clone(); + self.client_state.client_id = Some(client_id.clone()); - if let Some(notification) = &connect_request.notification { + if let Some(notification) = notification { self.notification = Some(notification.clone()); } // Send user connected event to app let app_event = ServerToApp::UserConnectedEvent(UserConnectedEvent { - public_keys: connect_request.public_keys.clone(), - metadata: connect_request.metadata.clone(), + public_keys: public_keys.clone(), + metadata: metadata.clone(), }); - self.send_to_app(app_event).await.unwrap_or_default(); + + match self.send_to_app(app_event).await { + Ok(_) => Ok(()), + Err(err) => bail!("Failed to send message to app: {:?}", err), + } } pub async fn disconnect_user(&mut self) { diff --git a/server/src/ws/client_handler/methods/process_connect.rs b/server/src/ws/client_handler/methods/process_connect.rs index bdc837c0..da33cd8d 100644 --- a/server/src/ws/client_handler/methods/process_connect.rs +++ b/server/src/ws/client_handler/methods/process_connect.rs @@ -40,7 +40,16 @@ pub async fn process_client_connect( }; // Update session - session.connect_user(&connect_request).await; + session + .connect_user( + &connect_request.device, + &connect_request.public_keys, + &connect_request.metadata, + &connect_request.client_id, + &connect_request.notification, + ) + .await + .unwrap_or_default(); // Insert new session id into client_to_sessions client_to_sessions From 7d43279509ea664a2db7b939c11fd1565f1976a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGiems=E2=80=9D?= <“hubert.wabia@gmail.com”> Date: Wed, 7 Feb 2024 10:39:59 +0100 Subject: [PATCH 2/2] move wallets to separate files --- server/src/http/get_wallets_metadata.rs | 11 +- server/src/lib.rs | 1 - server/src/router.rs | 5 +- server/src/state.rs | 6 +- server/src/structs/mod.rs | 1 + .../src/structs/wallets/aleph_zero_signer.rs | 60 ++++ server/src/structs/wallets/mod.rs | 11 + server/src/structs/wallets/nightly.rs | 91 ++++++ server/src/structs/wallets/polkadot.rs | 60 ++++ server/src/structs/wallets/sub_wallet.rs | 64 ++++ server/src/structs/wallets/talisman.rs | 60 ++++ server/src/utils.rs | 12 + server/src/wallets.rs | 295 ------------------ 13 files changed, 374 insertions(+), 303 deletions(-) create mode 100644 server/src/structs/wallets/aleph_zero_signer.rs create mode 100644 server/src/structs/wallets/mod.rs create mode 100644 server/src/structs/wallets/nightly.rs create mode 100644 server/src/structs/wallets/polkadot.rs create mode 100644 server/src/structs/wallets/sub_wallet.rs create mode 100644 server/src/structs/wallets/talisman.rs delete mode 100644 server/src/wallets.rs diff --git a/server/src/http/get_wallets_metadata.rs b/server/src/http/get_wallets_metadata.rs index 69410ee3..f3cb5976 100644 --- a/server/src/http/get_wallets_metadata.rs +++ b/server/src/http/get_wallets_metadata.rs @@ -1,6 +1,9 @@ -use crate::{structs::wallet_metadata::WalletMetadata, wallets::WALLETS_METADATA}; -use axum::{http::StatusCode, Json}; +use crate::structs::wallet_metadata::WalletMetadata; +use axum::{extract::State, http::StatusCode, Json}; +use std::{ops::Deref, sync::Arc}; -pub async fn get_wallets_metadata() -> Result>, (StatusCode, String)> { - Ok(Json(WALLETS_METADATA.to_vec())) +pub async fn get_wallets_metadata( + State(wallets_metadata): State>>, +) -> Result>, (StatusCode, String)> { + Ok(Json(wallets_metadata.deref().clone())) } diff --git a/server/src/lib.rs b/server/src/lib.rs index fc488906..f149a6eb 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -6,5 +6,4 @@ mod sesssion_cleaner; pub mod state; pub mod structs; pub mod utils; -pub mod wallets; pub mod ws; diff --git a/server/src/router.rs b/server/src/router.rs index 61d0969a..371408c8 100644 --- a/server/src/router.rs +++ b/server/src/router.rs @@ -9,7 +9,7 @@ use crate::{ sesssion_cleaner::start_cleaning_sessions, state::ServerState, structs::http_endpoints::HttpEndpoint, - utils::get_cors, + utils::{get_cors, get_wallets_metadata_vec}, ws::{ app_handler::handler::on_new_app_connection, client_handler::handler::on_new_client_connection, @@ -20,7 +20,7 @@ use axum::{ routing::{get, post}, Router, }; -use std::time::Duration; +use std::{sync::Arc, time::Duration}; use tower::ServiceBuilder; use tower_http::trace::TraceLayer; use tracing_subscriber::EnvFilter; @@ -30,6 +30,7 @@ pub async fn get_router() -> Router { sessions: Default::default(), client_to_sessions: Default::default(), client_to_sockets: Default::default(), + wallets_metadata: Arc::new(get_wallets_metadata_vec()), }; // Start cleaning outdated sessions start_cleaning_sessions(state.sessions.clone(), state.client_to_sessions.clone()); diff --git a/server/src/state.rs b/server/src/state.rs index c1a8d074..8312724c 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -1,4 +1,7 @@ -use crate::structs::{client_messages::client_messages::ServerToClient, session::Session}; +use crate::structs::{ + client_messages::client_messages::ServerToClient, session::Session, + wallet_metadata::WalletMetadata, +}; use anyhow::Result; use async_trait::async_trait; use axum::extract::{ @@ -24,6 +27,7 @@ pub struct ServerState { pub sessions: Sessions, pub client_to_sockets: ClientSockets, // Holds only live sockets pub client_to_sessions: ClientToSessions, + pub wallets_metadata: Arc>, } #[async_trait] diff --git a/server/src/structs/mod.rs b/server/src/structs/mod.rs index ee77e901..e2247efe 100644 --- a/server/src/structs/mod.rs +++ b/server/src/structs/mod.rs @@ -6,3 +6,4 @@ pub mod notification_msg; pub mod session; pub mod wallet_metadata; pub mod wallet_type; +pub mod wallets; diff --git a/server/src/structs/wallets/aleph_zero_signer.rs b/server/src/structs/wallets/aleph_zero_signer.rs new file mode 100644 index 00000000..72e37029 --- /dev/null +++ b/server/src/structs/wallets/aleph_zero_signer.rs @@ -0,0 +1,60 @@ +use crate::structs::{ + common::{Network, Version}, + wallet_metadata::{Images, Platform, WalletMetadata}, + wallet_type::WalletType, +}; +use std::collections::HashMap; + +pub fn aleph_zero_signer_metadata() -> WalletMetadata { + WalletMetadata { + slug: "aleph-zero-signer".to_string(), + name: "Aleph Zero Signer".to_string(), + description: "Aleph Zero Signer".to_string(), + homepage: "https://alephzero.org/signer".to_string(), + app: HashMap::from([ + ( + Platform::chrome, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::edge, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::browser, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::brave, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), + ), + ( + Platform::firefox, + "https://addons.mozilla.org/en-GB/firefox/addon/aleph-zero-signer/".to_string(), + ), + ]), + chains: vec![Network::new("polkadot")], + desktop: None, + mobile: None, + image: Images { + default: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), + sm: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), + md: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), + lg: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), + }, + inject_path: HashMap::from([ + (Network::new("polkadot"),"window.injectedWeb3.aleph-zero-signer".to_string()), + ]), + last_updated_timestamp: 1696942859, + version: Version("0.1.0".to_string()), + wallet_type: WalletType::extension, + } +} diff --git a/server/src/structs/wallets/mod.rs b/server/src/structs/wallets/mod.rs new file mode 100644 index 00000000..9e934c1f --- /dev/null +++ b/server/src/structs/wallets/mod.rs @@ -0,0 +1,11 @@ +pub mod aleph_zero_signer; +pub mod nightly; +pub mod polkadot; +pub mod sub_wallet; +pub mod talisman; + +pub use aleph_zero_signer::*; +pub use nightly::*; +pub use polkadot::*; +pub use sub_wallet::*; +pub use talisman::*; diff --git a/server/src/structs/wallets/nightly.rs b/server/src/structs/wallets/nightly.rs new file mode 100644 index 00000000..1bc26e5c --- /dev/null +++ b/server/src/structs/wallets/nightly.rs @@ -0,0 +1,91 @@ +use crate::structs::{ + common::{Network, Version}, + wallet_metadata::{Deeplink, Images, Platform, WalletMetadata}, + wallet_type::WalletType, +}; +use std::collections::HashMap; + +pub fn nightly_metadata() -> WalletMetadata { + WalletMetadata { + slug: "nightly".to_string(), + name: "Nightly".to_string(), + description: "TODO".to_string(), + homepage: "https://wallet.nightly.app".to_string(), + app: HashMap::from([ + ( + Platform::chrome, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::edge, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::browser, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::brave, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa" + .to_string(), + ), + ( + Platform::firefox, + "https://addons.mozilla.org/en-GB/firefox/addon/nightly-app/".to_string(), + ), + ( + Platform::android, + "https://play.google.com/store/apps/details?id=com.nightlymobile".to_string(), + ), + ( + Platform::ios, + "https://apps.apple.com/pl/app/nightly-multichain-wallet/id6444768157".to_string(), + ), + ]), + chains: vec![ + Network::new("solana"), + Network::new("near"), + Network::new("sui"), + Network::new("aptos"), + Network::new("polkadot"), + ], + desktop: None, + mobile: Some(Deeplink { + native: Some("nightly".to_string()), + universal: Some("https://wallet.nightly.app".to_string()), + redirect_to_app_browser: None, + }), + image: Images { + default: format!("https://registry.nightly.app/wallets/nightly/default.png"), + sm: format!("https://registry.nightly.app/wallets/nightly/sm.png"), + md: format!("https://registry.nightly.app/wallets/nightly/md.png"), + lg: format!("https://registry.nightly.app/wallets/nightly/lg.png"), + }, + inject_path: HashMap::from([ + (Network::new("solana"), "window.nightly.solana".to_string()), + (Network::new("sui"), "window.nightly.sui".to_string()), + (Network::new("aptos"), "window.nightly.aptos".to_string()), + (Network::new("near"), "window.nightly.near".to_string()), + ( + Network::new("polkadot"), + "window.nightly.polkadot".to_string(), + ), + ]), + last_updated_timestamp: 1686303253, + version: Version("0.0.1".to_string()), + wallet_type: WalletType::hybrid, + } +} diff --git a/server/src/structs/wallets/polkadot.rs b/server/src/structs/wallets/polkadot.rs new file mode 100644 index 00000000..1a2d5adf --- /dev/null +++ b/server/src/structs/wallets/polkadot.rs @@ -0,0 +1,60 @@ +use crate::structs::{ + common::{Network, Version}, + wallet_metadata::{Images, Platform, WalletMetadata}, + wallet_type::WalletType, +}; +use std::collections::HashMap; + +pub fn polkadot_js_metadata() -> WalletMetadata { + WalletMetadata { + slug: "polkadot-js".to_string(), + name: "Polkadot{.js}".to_string(), + description: "Polkadot{.js} extension".to_string(), + homepage: "https://polkadot.js.org/extension/".to_string(), + app: HashMap::from([ + ( + Platform::chrome, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::edge, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::browser, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::brave, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), + ), + ( + Platform::firefox, + "https://addons.mozilla.org/en-US/firefox/addon/polkadot-js-extension/".to_string(), + ), + ]), + chains: vec![Network::new("polkadot")], + desktop: None, + mobile: None, + image: Images { + default: format!("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIi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S42Yy0wLjYsMi44LDEuMiw1LjYsNCw2LjJjMi44LDAuNiw1LjYtMS4yLDYuMi00YzAuMS0wLjYsMS43LTcuOSwxLjctNy45IGMxLjItNS42LDUuOC05LjcsMTEuMi0xMC40YzEuMi0wLjIsNS45LTAuNSw1LjktMC41YzE5LjUtMS41LDM0LjktMTcuOCwzNC45LTM3LjdDMTIyLjgsNTEuNiwxMDUuOCwzNC43LDg1LDM0Ljd6IE04Ny43LDEyMS43IGMtMy40LTAuNy02LjgsMS40LTcuNSw0LjljLTAuNywzLjQsMS40LDYuOCw0LjksNy41YzMuNCwwLjcsNi44LTEuNCw3LjUtNC45QzkzLjMsMTI1LjcsOTEuMiwxMjIuNCw4Ny43LDEyMS43eiI+PC9wYXRoPjwvZz48L2c+PC9zdmc+Cg=="), + }, + inject_path: HashMap::from([ + (Network::new("polkadot"),"window.injectedWeb3.polkadot-js".to_string()), + ]), + last_updated_timestamp: 1696942859, + version: Version("0.1.0".to_string()), + wallet_type: WalletType::extension, + } +} diff --git a/server/src/structs/wallets/sub_wallet.rs b/server/src/structs/wallets/sub_wallet.rs new file mode 100644 index 00000000..0f1efa25 --- /dev/null +++ b/server/src/structs/wallets/sub_wallet.rs @@ -0,0 +1,64 @@ +use crate::structs::{ + common::{Network, Version}, + wallet_metadata::{Deeplink, Images, Platform, WalletMetadata}, + wallet_type::WalletType, +}; +use std::collections::HashMap; + +pub fn subwallet_metadata() -> WalletMetadata { + WalletMetadata { + slug: "subwallet-js".to_string(), + name: "SubWallet".to_string(), + description: "The comprehensive non-custodial wallet solution for Polkadot, Substrate & Ethereum ecosystem".to_string(), + homepage: "https://www.subwallet.app/".to_string(), + app: HashMap::from([ + ( + Platform::chrome, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::edge, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::browser, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::brave, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), + ), + ( + Platform::firefox, + "https://addons.mozilla.org/en-US/firefox/addon/subwallet/".to_string(), + ), + ]), + chains: vec![Network::new("polkadot")], + desktop: None, + mobile: Some(Deeplink { + native: None, + universal: None, + redirect_to_app_browser: Some("https://mobile.subwallet.app/browser?url={{url}}".to_string()), + }), + image: Images { + default: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), + sm: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), + md: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), + lg: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), + }, + inject_path: HashMap::from([ + (Network::new("polkadot"),"window.injectedWeb3.subwallet-js".to_string()), + ]), + last_updated_timestamp: 1705113229, + version: Version("0.1.0".to_string()), + wallet_type: WalletType::hybrid, + } +} diff --git a/server/src/structs/wallets/talisman.rs b/server/src/structs/wallets/talisman.rs new file mode 100644 index 00000000..8e3b7576 --- /dev/null +++ b/server/src/structs/wallets/talisman.rs @@ -0,0 +1,60 @@ +use crate::structs::{ + common::{Network, Version}, + wallet_metadata::{Images, Platform, WalletMetadata}, + wallet_type::WalletType, +}; +use std::collections::HashMap; + +pub fn talisman_metadata() -> WalletMetadata { + WalletMetadata { + slug: "talisman".to_string(), + name: "Talisman".to_string(), + description: "Talisman".to_string(), + homepage: "https://www.talisman.xyz/".to_string(), + app: HashMap::from([ + ( + Platform::chrome, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::edge, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::browser, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::brave, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::opera, + "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), + ), + ( + Platform::firefox, + "https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension".to_string(), + ), + ]), + chains: vec![Network::new("polkadot")], + desktop: None, + mobile: None, + image: Images { + default: format!("https://registry.nightly.app/wallets/talisman/default.png"), + sm: format!("https://registry.nightly.app/wallets/talisman/default.png"), + md: format!("https://registry.nightly.app/wallets/talisman/default.png"), + lg: format!("https://registry.nightly.app/wallets/talisman/default.png"), + }, + inject_path: HashMap::from([ + (Network::new("polkadot"),"window.injectedWeb3.talisman".to_string()), + ]), + last_updated_timestamp: 1696942859, + version: Version("0.1.0".to_string()), + wallet_type: WalletType::extension, +} +} diff --git a/server/src/utils.rs b/server/src/utils.rs index 0bf83cca..65b6bffc 100644 --- a/server/src/utils.rs +++ b/server/src/utils.rs @@ -2,6 +2,8 @@ use axum::http::{header, Method}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use tower_http::cors::{Any, CorsLayer}; +use crate::structs::{wallet_metadata::WalletMetadata, wallets::*}; + pub fn get_timestamp_in_milliseconds() -> u64 { let now = SystemTime::now(); let since_the_epoch = now.duration_since(UNIX_EPOCH).expect("Time went backwards"); @@ -23,3 +25,13 @@ pub fn get_cors() -> CorsLayer { header::ACCESS_CONTROL_REQUEST_HEADERS, ]) } + +pub fn get_wallets_metadata_vec() -> Vec { + vec![ + nightly_metadata(), + polkadot_js_metadata(), + talisman_metadata(), + aleph_zero_signer_metadata(), + subwallet_metadata(), + ] +} diff --git a/server/src/wallets.rs b/server/src/wallets.rs deleted file mode 100644 index 5a6646d0..00000000 --- a/server/src/wallets.rs +++ /dev/null @@ -1,295 +0,0 @@ -use std::collections::HashMap; - -use once_cell::sync::Lazy; - -use crate::structs::{ - common::{Network, Version}, - wallet_metadata::{Deeplink, Images, Platform, WalletMetadata}, - wallet_type::WalletType, -}; - -pub static WALLETS_METADATA: Lazy> = Lazy::new(|| { - // TODO refactor it to separate file for each wallet - return vec![ - // Nightly - WalletMetadata { - slug: "nightly".to_string(), - name: "Nightly".to_string(), - description: "TODO".to_string(), - homepage: "https://wallet.nightly.app".to_string(), - app: HashMap::from([ - ( - Platform::chrome, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::edge, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::browser, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::brave, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa".to_string(), - ), - ( - Platform::firefox, - "https://addons.mozilla.org/en-GB/firefox/addon/nightly-app/".to_string(), - ), - ( - Platform::android, - "https://play.google.com/store/apps/details?id=com.nightlymobile".to_string(), - ), - ( - Platform::ios, - "https://apps.apple.com/pl/app/nightly-multichain-wallet/id6444768157".to_string(), - ), - ]), - chains: vec![Network::new("solana"), Network::new("near"), Network::new("sui"), Network::new("aptos"), Network::new("polkadot")], - desktop: None, - mobile: Some(Deeplink { - native: Some("nightly".to_string()), - universal: Some("https://wallet.nightly.app".to_string()), - redirect_to_app_browser: None - }), - image: Images { - default: format!("https://registry.nightly.app/wallets/nightly/default.png"), - sm: format!("https://registry.nightly.app/wallets/nightly/sm.png"), - md: format!("https://registry.nightly.app/wallets/nightly/md.png"), - lg: format!("https://registry.nightly.app/wallets/nightly/lg.png"), - }, - inject_path: HashMap::from([ - (Network::new("solana"),"window.nightly.solana".to_string()), - (Network::new("sui"),"window.nightly.sui".to_string()), - (Network::new("aptos"),"window.nightly.aptos".to_string()), - (Network::new("near"),"window.nightly.near".to_string()), - (Network::new("polkadot"),"window.nightly.polkadot".to_string()), - ]), - last_updated_timestamp: 1686303253, - version: Version("0.0.1".to_string()), - wallet_type: WalletType::hybrid, - }, - // Aleph Zero Signer - WalletMetadata { - slug: "aleph-zero-signer".to_string(), - name: "Aleph Zero Signer".to_string(), - description: "Aleph Zero Signer".to_string(), - homepage: "https://alephzero.org/signer".to_string(), - app: HashMap::from([ - ( - Platform::chrome, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::edge, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::browser, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::brave, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/aleph-zero-signer/opbinaebpmphpefcimknblieddamhmol".to_string(), - ), - ( - Platform::firefox, - "https://addons.mozilla.org/en-GB/firefox/addon/aleph-zero-signer/".to_string(), - ), - ]), - chains: vec![Network::new("polkadot")], - desktop: None, - mobile: None, - image: Images { - default: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), - sm: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), - md: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), - lg: format!("https://registry.nightly.app/wallets/aleph-zero-signer/default.png"), - }, - inject_path: HashMap::from([ - (Network::new("polkadot"),"window.injectedWeb3.aleph-zero-signer".to_string()), - ]), - last_updated_timestamp: 1696942859, - version: Version("0.1.0".to_string()), - wallet_type: WalletType::extension, - }, - // SubWallet - WalletMetadata { - slug: "subwallet-js".to_string(), - name: "SubWallet".to_string(), - description: "The comprehensive non-custodial wallet solution for Polkadot, Substrate & Ethereum ecosystem".to_string(), - homepage: "https://www.subwallet.app/".to_string(), - app: HashMap::from([ - ( - Platform::chrome, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::edge, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::browser, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::brave, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/subwallet-polkadot-wallet/onhogfjeacnfoofkfgppdlbmlmnplgbn".to_string(), - ), - ( - Platform::firefox, - "https://addons.mozilla.org/en-US/firefox/addon/subwallet/".to_string(), - ), - ]), - chains: vec![Network::new("polkadot")], - desktop: None, - mobile: Some(Deeplink { - native: None, - universal: None, - redirect_to_app_browser: Some("https://mobile.subwallet.app/browser?url={{url}}".to_string()), - }), - image: Images { - default: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), - sm: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), - md: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), - lg: format!("https://registry.nightly.app/wallets/subwallet-js/default.png"), - }, - inject_path: HashMap::from([ - (Network::new("polkadot"),"window.injectedWeb3.subwallet-js".to_string()), - ]), - last_updated_timestamp: 1705113229, - version: Version("0.1.0".to_string()), - wallet_type: WalletType::hybrid, - }, - // Talisman - WalletMetadata { - slug: "talisman".to_string(), - name: "Talisman".to_string(), - description: "Talisman".to_string(), - homepage: "https://www.talisman.xyz/".to_string(), - app: HashMap::from([ - ( - Platform::chrome, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::edge, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::browser, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::brave, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/talisman-polkadot-and-eth/fijngjgcjhjmmpcmkeiomlglpeiijkld".to_string(), - ), - ( - Platform::firefox, - "https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension".to_string(), - ), - ]), - chains: vec![Network::new("polkadot")], - desktop: None, - mobile: None, - image: Images { - default: format!("https://registry.nightly.app/wallets/talisman/default.png"), - sm: format!("https://registry.nightly.app/wallets/talisman/default.png"), - md: format!("https://registry.nightly.app/wallets/talisman/default.png"), - lg: format!("https://registry.nightly.app/wallets/talisman/default.png"), - }, - inject_path: HashMap::from([ - (Network::new("polkadot"),"window.injectedWeb3.talisman".to_string()), - ]), - last_updated_timestamp: 1696942859, - version: Version("0.1.0".to_string()), - wallet_type: WalletType::extension, - }, - // Polkadot{.js} - WalletMetadata { - slug: "polkadot-js".to_string(), - name: "Polkadot{.js}".to_string(), - description: "Polkadot{.js} extension".to_string(), - homepage: "https://polkadot.js.org/extension/".to_string(), - app: HashMap::from([ - ( - Platform::chrome, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::edge, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::browser, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::brave, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::opera, - "https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd".to_string(), - ), - ( - Platform::firefox, - "https://addons.mozilla.org/en-US/firefox/addon/polkadot-js-extension/".to_string(), - ), - ]), - chains: vec![Network::new("polkadot")], - desktop: None, - mobile: None, - image: Images { - default: format!("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93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jRMODEsNzMuNGMwLjYtMi44LTEuMi01LjYtNC02LjIgYy0yLjgtMC42LTUuNiwxLjItNi4yLDRjMCwwLTExLjgsNTUtMTEuOSw1NS42Yy0wLjYsMi44LDEuMiw1LjYsNCw2LjJjMi44LDAuNiw1LjYtMS4yLDYuMi00YzAuMS0wLjYsMS43LTcuOSwxLjctNy45IGMxLjItNS42LDUuOC05LjcsMTEuMi0xMC40YzEuMi0wLjIsNS45LTAuNSw1LjktMC41YzE5LjUtMS41LDM0LjktMTcuOCwzNC45LTM3LjdDMTIyLjgsNTEuNiwxMDUuOCwzNC43LDg1LDM0Ljd6IE04Ny43LDEyMS43IGMtMy40LTAuNy02LjgsMS40LTcuNSw0LjljLTAuNywzLjQsMS40LDYuOCw0LjksNy41YzMuNCwwLjcsNi44LTEuNCw3LjUtNC45QzkzLjMsMTI1LjcsOTEuMiwxMjIuNCw4Ny43LDEyMS43eiI+PC9wYXRoPjwvZz48L2c+PC9zdmc+Cg=="), - }, - inject_path: HashMap::from([ - (Network::new("polkadot"),"window.injectedWeb3.polkadot-js".to_string()), - ]), - last_updated_timestamp: 1696942859, - version: Version("0.1.0".to_string()), - wallet_type: WalletType::extension, - }, - ]; -});