diff --git a/native/native_rust_library/src/identity.rs b/native/native_rust_library/src/identity.rs index 8e6aa45a1..1ad4fc928 100644 --- a/native/native_rust_library/src/identity.rs +++ b/native/native_rust_library/src/identity.rs @@ -1,202 +1,203 @@ use grpc_clients::identity::get_unauthenticated_client; use grpc_clients::identity::protos::unauth::{ AuthResponse, DeviceKeyUpload, Empty, IdentityKeyInfo, Prekey, }; use serde::Serialize; use crate::utils::jsi_callbacks::{ handle_bool_result_as_callback, handle_string_result_as_callback, }; use crate::{Error, RUNTIME}; use crate::{CODE_VERSION, DEVICE_TYPE, IDENTITY_SOCKET_ADDR}; pub mod account_actions; pub mod device_list; pub mod exact_user_search; pub mod farcaster; pub mod find_user_identities; pub mod login; pub mod registration; pub mod x3dh; pub mod ffi { use super::*; pub use account_actions::ffi::*; pub use device_list::ffi::*; pub use exact_user_search::ffi::*; pub use farcaster::ffi::*; pub use find_user_identities::ffi::*; pub use login::ffi::*; pub use registration::ffi::*; pub use x3dh::ffi::*; pub fn generate_nonce(promise_id: u32) { RUNTIME.spawn(async move { let result = fetch_nonce().await; handle_string_result_as_callback(result, promise_id); }); } pub fn version_supported(promise_id: u32) { RUNTIME.spawn(async move { let result = version_supported_helper().await; handle_bool_result_as_callback(result, promise_id); }); } } // helper structs pub struct AuthInfo { pub user_id: String, pub device_id: String, pub access_token: String, } pub struct DeviceKeys { pub key_payload: String, pub key_payload_signature: String, pub content_prekey: String, pub content_prekey_signature: String, pub notif_prekey: String, pub notif_prekey_signature: String, pub content_one_time_keys: Vec, pub notif_one_time_keys: Vec, } impl From for DeviceKeyUpload { fn from(value: DeviceKeys) -> Self { let DeviceKeys { key_payload, key_payload_signature, content_prekey, content_prekey_signature, notif_prekey, notif_prekey_signature, content_one_time_keys, notif_one_time_keys, } = value; Self { device_key_info: Some(IdentityKeyInfo { payload: key_payload, payload_signature: key_payload_signature, }), content_upload: Some(Prekey { prekey: content_prekey, prekey_signature: content_prekey_signature, }), notif_upload: Some(Prekey { prekey: notif_prekey, prekey_signature: notif_prekey_signature, }), one_time_content_prekeys: content_one_time_keys, one_time_notif_prekeys: notif_one_time_keys, device_type: DEVICE_TYPE.into(), } } } pub struct LogInPasswordUserInfo { pub username: String, pub password: String, pub device_keys: DeviceKeys, } pub struct RegisterPasswordUserInfo { pub username: String, pub password: String, pub device_keys: DeviceKeys, pub farcaster_id: Option, pub initial_device_list: String, } pub struct RegisterReservedPasswordUserInfo { pub username: String, pub password: String, pub device_keys: DeviceKeys, pub keyserver_message: String, pub keyserver_signature: String, pub initial_device_list: String, } pub struct LogInWalletUserInfo { pub siwe_message: String, pub siwe_signature: String, pub device_keys: DeviceKeys, } pub struct RegisterWalletUserInfo { pub siwe_message: String, pub siwe_signature: String, pub device_keys: DeviceKeys, pub farcaster_id: Option, pub initial_device_list: String, } pub struct RegisterReservedWalletUserInfo { pub siwe_message: String, pub siwe_signature: String, pub device_keys: DeviceKeys, pub keyserver_message: String, pub keyserver_signature: String, pub initial_device_list: String, } #[derive(Serialize)] #[serde(rename_all = "camelCase")] pub struct UserIDAndDeviceAccessToken { #[serde(rename = "userID")] user_id: String, access_token: String, } impl From for UserIDAndDeviceAccessToken { fn from(value: AuthResponse) -> Self { let AuthResponse { user_id, access_token, + .. } = value; Self { user_id, access_token, } } } // API implementation helpers async fn fetch_nonce() -> Result { let mut identity_client = get_unauthenticated_client( IDENTITY_SOCKET_ADDR, CODE_VERSION, DEVICE_TYPE.as_str_name().to_lowercase(), ) .await?; let nonce = identity_client .generate_nonce(Empty {}) .await? .into_inner() .nonce; Ok(nonce) } async fn version_supported_helper() -> Result { let mut identity_client = get_unauthenticated_client( IDENTITY_SOCKET_ADDR, CODE_VERSION, DEVICE_TYPE.as_str_name().to_lowercase(), ) .await?; let response = identity_client.ping(Empty {}).await; match response { Ok(_) => Ok(true), Err(e) => { if grpc_clients::error::is_version_unsupported(&e) { Ok(false) } else { Err(e.into()) } } } } diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs index c992b404b..1509947d6 100644 --- a/services/identity/src/client_service.rs +++ b/services/identity/src/client_service.rs @@ -1,1182 +1,1196 @@ // Standard library imports use std::str::FromStr; // External crate imports use comm_lib::aws::DynamoDBError; use comm_lib::shared::reserved_users::RESERVED_USERNAME_SET; use comm_opaque2::grpc::protocol_error_to_grpc_status; use rand::rngs::OsRng; use serde::{Deserialize, Serialize}; use siwe::eip55; use tonic::Response; use tracing::{debug, error, info, warn}; // Workspace crate imports use crate::config::CONFIG; use crate::constants::{ request_metadata, error_types }; use crate::database::{ DBDeviceTypeInt, DatabaseClient, DeviceType, KeyPayload, }; use crate::error::{DeviceListError, Error as DBError}; use crate::grpc_services::authenticated::DeletePasswordUserInfo; use crate::grpc_services::protos::unauth::{ find_user_id_request, AddReservedUsernamesRequest, AuthResponse, Empty, ExistingDeviceLoginRequest, FindUserIdRequest, FindUserIdResponse, GenerateNonceResponse, OpaqueLoginFinishRequest, OpaqueLoginStartRequest, OpaqueLoginStartResponse, RegistrationFinishRequest, RegistrationStartRequest, RegistrationStartResponse, RemoveReservedUsernameRequest, ReservedRegistrationStartRequest, ReservedWalletRegistrationRequest, SecondaryDeviceKeysUploadRequest, VerifyUserAccessTokenRequest, VerifyUserAccessTokenResponse, WalletAuthRequest, GetFarcasterUsersRequest, GetFarcasterUsersResponse }; use crate::grpc_services::shared::get_value; use crate::grpc_utils::{ SignedNonce, DeviceKeyUploadActions, }; use crate::nonce::generate_nonce_data; use crate::reserved_users::{ validate_account_ownership_message_and_get_user_id, validate_add_reserved_usernames_message, validate_remove_reserved_username_message, }; use crate::siwe::{ is_valid_ethereum_address, parse_and_verify_siwe_message, SocialProof, }; use crate::token::{AccessTokenData, AuthType}; pub use crate::grpc_services::protos::unauth::identity_client_service_server::{ IdentityClientService, IdentityClientServiceServer, }; use crate::regex::is_valid_username; #[derive(Clone, Serialize, Deserialize)] pub enum WorkflowInProgress { Registration(Box), Login(Box), Update(UpdateState), PasswordUserDeletion(Box), } #[derive(Clone, Serialize, Deserialize)] pub struct UserRegistrationInfo { pub username: String, pub flattened_device_key_upload: FlattenedDeviceKeyUpload, pub user_id: Option, pub farcaster_id: Option, } #[derive(Clone, Serialize, Deserialize)] pub struct UserLoginInfo { pub user_id: String, + pub username: String, pub flattened_device_key_upload: FlattenedDeviceKeyUpload, pub opaque_server_login: comm_opaque2::server::Login, pub device_to_remove: Option, } #[derive(Clone, Serialize, Deserialize)] pub struct UpdateState { pub user_id: String, } #[derive(Clone, Serialize, Deserialize)] pub struct FlattenedDeviceKeyUpload { pub device_id_key: String, pub key_payload: String, pub key_payload_signature: String, pub content_prekey: String, pub content_prekey_signature: String, pub content_one_time_keys: Vec, pub notif_prekey: String, pub notif_prekey_signature: String, pub notif_one_time_keys: Vec, pub device_type: DeviceType, } #[derive(derive_more::Constructor)] pub struct ClientService { client: DatabaseClient, } #[tonic::async_trait] impl IdentityClientService for ClientService { #[tracing::instrument(skip_all)] async fn register_password_user_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); debug!("Received registration request for: {}", message.username); if !is_valid_username(&message.username) || is_valid_ethereum_address(&message.username) { return Err(tonic::Status::invalid_argument("invalid username")); } self.check_username_taken(&message.username).await?; let username_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&message.username) .await .map_err(handle_db_error)?; if username_in_reserved_usernames_table { return Err(tonic::Status::already_exists("username already exists")); } if RESERVED_USERNAME_SET.contains(&message.username) { return Err(tonic::Status::invalid_argument("username reserved")); } if let Some(fid) = &message.farcaster_id { self.check_farcaster_id_taken(fid).await?; } let registration_state = construct_user_registration_info( &message, None, message.username.clone(), message.farcaster_id.clone(), )?; let server_registration = comm_opaque2::server::Registration::new(); let server_message = server_registration .start( &CONFIG.server_setup, &message.opaque_registration_request, message.username.as_bytes(), ) .map_err(protocol_error_to_grpc_status)?; let session_id = self .client .insert_workflow(WorkflowInProgress::Registration(Box::new( registration_state, ))) .await .map_err(handle_db_error)?; let response = RegistrationStartResponse { session_id, opaque_registration_response: server_message, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn register_reserved_password_user_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); self.check_username_taken(&message.username).await?; if RESERVED_USERNAME_SET.contains(&message.username) { return Err(tonic::Status::invalid_argument("username reserved")); } let username_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&message.username) .await .map_err(handle_db_error)?; if !username_in_reserved_usernames_table { return Err(tonic::Status::permission_denied("username not reserved")); } let user_id = validate_account_ownership_message_and_get_user_id( &message.username, &message.keyserver_message, &message.keyserver_signature, )?; let registration_state = construct_user_registration_info( &message, Some(user_id), message.username.clone(), None, )?; let server_registration = comm_opaque2::server::Registration::new(); let server_message = server_registration .start( &CONFIG.server_setup, &message.opaque_registration_request, message.username.as_bytes(), ) .map_err(protocol_error_to_grpc_status)?; let session_id = self .client .insert_workflow(WorkflowInProgress::Registration(Box::new( registration_state, ))) .await .map_err(handle_db_error)?; let response = RegistrationStartResponse { session_id, opaque_registration_response: server_message, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn register_password_user_finish( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); if let Some(WorkflowInProgress::Registration(state)) = self .client .get_workflow(message.session_id) .await .map_err(handle_db_error)? { let server_registration = comm_opaque2::server::Registration::new(); let password_file = server_registration .finish(&message.opaque_registration_upload) .map_err(protocol_error_to_grpc_status)?; let login_time = chrono::Utc::now(); let device_id = state.flattened_device_key_upload.device_id_key.clone(); + let username = state.username.clone(); let user_id = self .client .add_password_user_to_users_table( *state, password_file, code_version, login_time, ) .await .map_err(handle_db_error)?; // Create access token let token = AccessTokenData::with_created_time( user_id.clone(), device_id, login_time, crate::token::AuthType::Password, &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username, }; Ok(Response::new(response)) } else { Err(tonic::Status::not_found("session not found")) } } #[tracing::instrument(skip_all)] async fn log_in_password_user_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); debug!("Attempting to log in user: {:?}", &message.username); let user_id_and_password_file = self .client .get_user_id_and_password_file_from_username(&message.username) .await .map_err(handle_db_error)?; let (user_id, password_file_bytes) = if let Some(data) = user_id_and_password_file { data } else { // It's possible that the user attempting login is already registered // on Ashoat's keyserver. If they are, we should send back a gRPC status // code instructing them to get a signed message from Ashoat's keyserver // in order to claim their username and register with the Identity // service. let username_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&message.username) .await .map_err(handle_db_error)?; if username_in_reserved_usernames_table { return Err(tonic::Status::permission_denied( "need keyserver message to claim username", )); } return Err(tonic::Status::not_found("user not found")); }; let flattened_device_key_upload = construct_flattened_device_key_upload(&message)?; let maybe_device_to_remove = self .get_keyserver_device_to_remove( &user_id, &flattened_device_key_upload.device_id_key, message.force.unwrap_or(false), &flattened_device_key_upload.device_type, ) .await?; let mut server_login = comm_opaque2::server::Login::new(); let server_response = server_login .start( &CONFIG.server_setup, &password_file_bytes, &message.opaque_login_request, message.username.as_bytes(), ) .map_err(protocol_error_to_grpc_status)?; let login_state = construct_user_login_info( user_id, + message.username, server_login, flattened_device_key_upload, maybe_device_to_remove, )?; let session_id = self .client .insert_workflow(WorkflowInProgress::Login(Box::new(login_state))) .await .map_err(handle_db_error)?; let response = Response::new(OpaqueLoginStartResponse { session_id, opaque_login_response: server_response, }); Ok(response) } #[tracing::instrument(skip_all)] async fn log_in_password_user_finish( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); if let Some(WorkflowInProgress::Login(state)) = self .client .get_workflow(message.session_id) .await .map_err(handle_db_error)? { let mut server_login = state.opaque_server_login.clone(); server_login .finish(&message.opaque_login_upload) .map_err(protocol_error_to_grpc_status)?; if let Some(device_to_remove) = state.device_to_remove { self .client .remove_device(state.user_id.clone(), device_to_remove) .await .map_err(handle_db_error)?; } let login_time = chrono::Utc::now(); self .client .add_user_device( state.user_id.clone(), state.flattened_device_key_upload.clone(), code_version, login_time, ) .await .map_err(handle_db_error)?; // Create access token let token = AccessTokenData::with_created_time( state.user_id.clone(), state.flattened_device_key_upload.device_id_key, login_time, crate::token::AuthType::Password, &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id: state.user_id, access_token, + username: state.username, }; Ok(Response::new(response)) } else { Err(tonic::Status::not_found("session not found")) } } #[tracing::instrument(skip_all)] async fn log_in_wallet_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); let parsed_message = parse_and_verify_siwe_message( &message.siwe_message, &message.siwe_signature, )?; self.verify_and_remove_nonce(&parsed_message.nonce).await?; let wallet_address = eip55(&parsed_message.address); let flattened_device_key_upload = construct_flattened_device_key_upload(&message)?; let login_time = chrono::Utc::now(); let Some(user_id) = self .client .get_user_id_from_user_info(wallet_address.clone(), &AuthType::Wallet) .await .map_err(handle_db_error)? else { // It's possible that the user attempting login is already registered // on Ashoat's keyserver. If they are, we should send back a gRPC status // code instructing them to get a signed message from Ashoat's keyserver // in order to claim their wallet address and register with the Identity // service. let username_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&wallet_address) .await .map_err(handle_db_error)?; if username_in_reserved_usernames_table { return Err(tonic::Status::permission_denied( "need keyserver message to claim username", )); } return Err(tonic::Status::not_found("user not found")); }; self .client .add_user_device( user_id.clone(), flattened_device_key_upload.clone(), code_version, chrono::Utc::now(), ) .await .map_err(handle_db_error)?; // Create access token let token = AccessTokenData::with_created_time( user_id.clone(), flattened_device_key_upload.device_id_key, login_time, crate::token::AuthType::Wallet, &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username: wallet_address, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn register_wallet_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); let parsed_message = parse_and_verify_siwe_message( &message.siwe_message, &message.siwe_signature, )?; match self .client .get_nonce_from_nonces_table(&parsed_message.nonce) .await .map_err(handle_db_error)? { None => return Err(tonic::Status::invalid_argument("invalid nonce")), Some(nonce) if nonce.is_expired() => { // we don't need to remove the nonce from the table here // because the DynamoDB TTL will take care of it return Err(tonic::Status::aborted("nonce expired")); } Some(_) => self .client .remove_nonce_from_nonces_table(&parsed_message.nonce) .await .map_err(handle_db_error)?, }; let wallet_address = eip55(&parsed_message.address); self.check_wallet_address_taken(&wallet_address).await?; let username_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&wallet_address) .await .map_err(handle_db_error)?; if username_in_reserved_usernames_table { return Err(tonic::Status::already_exists( "wallet address already exists", )); } if let Some(fid) = &message.farcaster_id { self.check_farcaster_id_taken(fid).await?; } let flattened_device_key_upload = construct_flattened_device_key_upload(&message)?; let login_time = chrono::Utc::now(); let social_proof = SocialProof::new(message.siwe_message, message.siwe_signature); let user_id = self .client .add_wallet_user_to_users_table( flattened_device_key_upload.clone(), - wallet_address, + wallet_address.clone(), social_proof, None, code_version, login_time, message.farcaster_id, ) .await .map_err(handle_db_error)?; // Create access token let token = AccessTokenData::with_created_time( user_id.clone(), flattened_device_key_upload.device_id_key, login_time, crate::token::AuthType::Wallet, &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username: wallet_address, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn register_reserved_wallet_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); let parsed_message = parse_and_verify_siwe_message( &message.siwe_message, &message.siwe_signature, )?; self.verify_and_remove_nonce(&parsed_message.nonce).await?; let wallet_address = eip55(&parsed_message.address); self.check_wallet_address_taken(&wallet_address).await?; let wallet_address_in_reserved_usernames_table = self .client .username_in_reserved_usernames_table(&wallet_address) .await .map_err(handle_db_error)?; if !wallet_address_in_reserved_usernames_table { return Err(tonic::Status::permission_denied( "wallet address not reserved", )); } let user_id = validate_account_ownership_message_and_get_user_id( &wallet_address, &message.keyserver_message, &message.keyserver_signature, )?; let flattened_device_key_upload = construct_flattened_device_key_upload(&message)?; let social_proof = SocialProof::new(message.siwe_message, message.siwe_signature); let login_time = chrono::Utc::now(); self .client .add_wallet_user_to_users_table( flattened_device_key_upload.clone(), - wallet_address, + wallet_address.clone(), social_proof, Some(user_id.clone()), code_version, login_time, None, ) .await .map_err(handle_db_error)?; let token = AccessTokenData::with_created_time( user_id.clone(), flattened_device_key_upload.device_id_key, login_time, crate::token::AuthType::Wallet, &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username: wallet_address, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn upload_keys_for_registered_device_and_log_in( &self, request: tonic::Request, ) -> Result, tonic::Status> { let code_version = get_code_version(&request); let message = request.into_inner(); let challenge_response = SignedNonce::try_from(&message)?; let flattened_device_key_upload = construct_flattened_device_key_upload(&message)?; let user_id = message.user_id; let device_id = flattened_device_key_upload.device_id_key.clone(); let nonce = challenge_response.verify_and_get_nonce(&device_id)?; self.verify_and_remove_nonce(&nonce).await?; let user_identity = self .client .get_user_identity(&user_id) .await .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let Some(device_list) = self .client .get_current_device_list(&user_id) .await .map_err(handle_db_error)? else { warn!("User {} does not have valid device list. Secondary device auth impossible.", user_id); return Err(tonic::Status::aborted("device list error")); }; if !device_list.device_ids.contains(&device_id) { return Err(tonic::Status::permission_denied( "device not in device list", )); } let login_time = chrono::Utc::now(); let identifier = user_identity.identifier; + let username = identifier.username().to_string(); let token = AccessTokenData::with_created_time( user_id.clone(), device_id, login_time, identifier.into(), &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; self .client .put_device_data( &user_id, flattened_device_key_upload, code_version, login_time, ) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn log_in_existing_device( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status> { let message = request.into_inner(); let challenge_response = SignedNonce::try_from(&message)?; let ExistingDeviceLoginRequest { user_id, device_id, .. } = message; let nonce = challenge_response.verify_and_get_nonce(&device_id)?; self.verify_and_remove_nonce(&nonce).await?; let (identity_response, device_list_response) = tokio::join!( self.client.get_user_identity(&user_id), self.client.get_current_device_list(&user_id) ); let user_identity = identity_response .map_err(handle_db_error)? .ok_or_else(|| tonic::Status::not_found("user not found"))?; let device_list = device_list_response .map_err(handle_db_error)? .ok_or_else(|| { warn!("User {} does not have a valid device list.", user_id); tonic::Status::aborted("device list error") })?; if !device_list.device_ids.contains(&device_id) { return Err(tonic::Status::permission_denied( "device not in device list", )); } let login_time = chrono::Utc::now(); let identifier = user_identity.identifier; + let username = identifier.username().to_string(); let token = AccessTokenData::with_created_time( user_id.clone(), device_id, login_time, identifier.into(), &mut OsRng, ); let access_token = token.access_token.clone(); self .client .put_access_token_data(token) .await .map_err(handle_db_error)?; let response = AuthResponse { user_id, access_token, + username, }; Ok(Response::new(response)) } #[tracing::instrument(skip_all)] async fn generate_nonce( &self, _request: tonic::Request, ) -> Result, tonic::Status> { let nonce_data = generate_nonce_data(&mut OsRng); match self .client .add_nonce_to_nonces_table(nonce_data.clone()) .await { Ok(_) => Ok(Response::new(GenerateNonceResponse { nonce: nonce_data.nonce, })), Err(e) => Err(handle_db_error(e)), } } #[tracing::instrument(skip_all)] async fn verify_user_access_token( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); debug!("Verifying device: {}", &message.device_id); let token_valid = self .client .verify_access_token( message.user_id, message.device_id.clone(), message.access_token, ) .await .map_err(handle_db_error)?; let response = Response::new(VerifyUserAccessTokenResponse { token_valid }); debug!( "device {} was verified: {}", &message.device_id, token_valid ); Ok(response) } #[tracing::instrument(skip_all)] async fn add_reserved_usernames( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let user_details = validate_add_reserved_usernames_message( &message.message, &message.signature, )?; let filtered_user_details = self .client .filter_out_taken_usernames(user_details) .await .map_err(handle_db_error)?; self .client .add_usernames_to_reserved_usernames_table(filtered_user_details) .await .map_err(handle_db_error)?; let response = Response::new(Empty {}); Ok(response) } #[tracing::instrument(skip_all)] async fn remove_reserved_username( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let username = validate_remove_reserved_username_message( &message.message, &message.signature, )?; self .client .delete_username_from_reserved_usernames_table(username) .await .map_err(handle_db_error)?; let response = Response::new(Empty {}); Ok(response) } #[tracing::instrument(skip_all)] async fn ping( &self, _request: tonic::Request, ) -> Result, tonic::Status> { let response = Response::new(Empty {}); Ok(response) } #[tracing::instrument(skip_all)] async fn find_user_id( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); use find_user_id_request::Identifier; let (user_ident, auth_type) = match message.identifier { None => { return Err(tonic::Status::invalid_argument("no identifier provided")) } Some(Identifier::Username(username)) => (username, AuthType::Password), Some(Identifier::WalletAddress(address)) => (address, AuthType::Wallet), }; let (is_reserved_result, user_id_result) = tokio::join!( self .client .username_in_reserved_usernames_table(&user_ident), self .client .get_user_id_from_user_info(user_ident.clone(), &auth_type), ); let is_reserved = is_reserved_result.map_err(handle_db_error)?; let user_id = user_id_result.map_err(handle_db_error)?; Ok(Response::new(FindUserIdResponse { user_id, is_reserved, })) } #[tracing::instrument(skip_all)] async fn get_farcaster_users( &self, request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); let farcaster_users = self .client .get_farcaster_users(message.farcaster_ids) .await .map_err(handle_db_error)? .into_iter() .map(|d| d.0) .collect(); Ok(Response::new(GetFarcasterUsersResponse { farcaster_users })) } } impl ClientService { async fn check_username_taken( &self, username: &str, ) -> Result<(), tonic::Status> { let username_taken = self .client .username_taken(username.to_string()) .await .map_err(handle_db_error)?; if username_taken { return Err(tonic::Status::already_exists("username already exists")); } Ok(()) } async fn check_wallet_address_taken( &self, wallet_address: &str, ) -> Result<(), tonic::Status> { let wallet_address_taken = self .client .wallet_address_taken(wallet_address.to_string()) .await .map_err(handle_db_error)?; if wallet_address_taken { return Err(tonic::Status::already_exists( "wallet address already exists", )); } Ok(()) } async fn check_farcaster_id_taken( &self, farcaster_id: &str, ) -> Result<(), tonic::Status> { let fid_already_registered = !self .client .get_farcaster_users(vec![farcaster_id.to_string()]) .await .map_err(handle_db_error)? .is_empty(); if fid_already_registered { return Err(tonic::Status::already_exists( "farcaster ID already associated with different user", )); } Ok(()) } async fn verify_and_remove_nonce( &self, nonce: &str, ) -> Result<(), tonic::Status> { match self .client .get_nonce_from_nonces_table(nonce) .await .map_err(handle_db_error)? { None => return Err(tonic::Status::invalid_argument("invalid nonce")), Some(nonce) if nonce.is_expired() => { // we don't need to remove the nonce from the table here // because the DynamoDB TTL will take care of it return Err(tonic::Status::aborted("nonce expired")); } Some(nonce_data) => self .client .remove_nonce_from_nonces_table(&nonce_data.nonce) .await .map_err(handle_db_error)?, }; Ok(()) } async fn get_keyserver_device_to_remove( &self, user_id: &str, new_keyserver_device_id: &str, force: bool, device_type: &DeviceType, ) -> Result, tonic::Status> { if device_type != &DeviceType::Keyserver { return Ok(None); } let maybe_keyserver_device_id = self .client .get_keyserver_device_id_for_user(user_id) .await .map_err(handle_db_error)?; let Some(existing_keyserver_device_id) = maybe_keyserver_device_id else { return Ok(None); }; if new_keyserver_device_id == existing_keyserver_device_id { return Ok(None); } if force { info!( "keyserver {} will be removed from the device list", existing_keyserver_device_id ); Ok(Some(existing_keyserver_device_id)) } else { Err(tonic::Status::already_exists( "user already has a keyserver", )) } } } #[tracing::instrument(skip_all)] pub fn handle_db_error(db_error: DBError) -> tonic::Status { match db_error { DBError::AwsSdk(DynamoDBError::InternalServerError(_)) | DBError::AwsSdk(DynamoDBError::ProvisionedThroughputExceededException( _, )) | DBError::AwsSdk(DynamoDBError::RequestLimitExceeded(_)) => { tonic::Status::unavailable("please retry") } DBError::DeviceList(DeviceListError::InvalidDeviceListUpdate) => { tonic::Status::invalid_argument("invalid device list update") } DBError::DeviceList(DeviceListError::InvalidSignature) => { tonic::Status::invalid_argument("invalid device list signature") } e => { error!( errorType = error_types::GENERIC_DB_LOG, "Encountered an unexpected error: {}", e ); tonic::Status::failed_precondition("unexpected error") } } } fn construct_user_registration_info( message: &impl DeviceKeyUploadActions, user_id: Option, username: String, farcaster_id: Option, ) -> Result { Ok(UserRegistrationInfo { username, flattened_device_key_upload: construct_flattened_device_key_upload( message, )?, user_id, farcaster_id, }) } fn construct_user_login_info( user_id: String, + username: String, opaque_server_login: comm_opaque2::server::Login, flattened_device_key_upload: FlattenedDeviceKeyUpload, device_to_remove: Option, ) -> Result { Ok(UserLoginInfo { user_id, + username, flattened_device_key_upload, opaque_server_login, device_to_remove, }) } fn construct_flattened_device_key_upload( message: &impl DeviceKeyUploadActions, ) -> Result { let key_info = KeyPayload::from_str(&message.payload()?) .map_err(|_| tonic::Status::invalid_argument("malformed payload"))?; let flattened_device_key_upload = FlattenedDeviceKeyUpload { device_id_key: key_info.primary_identity_public_keys.ed25519, key_payload: message.payload()?, key_payload_signature: message.payload_signature()?, content_prekey: message.content_prekey()?, content_prekey_signature: message.content_prekey_signature()?, content_one_time_keys: message.one_time_content_prekeys()?, notif_prekey: message.notif_prekey()?, notif_prekey_signature: message.notif_prekey_signature()?, notif_one_time_keys: message.one_time_notif_prekeys()?, device_type: DeviceType::try_from(DBDeviceTypeInt(message.device_type()?)) .map_err(handle_db_error)?, }; Ok(flattened_device_key_upload) } fn get_code_version(req: &tonic::Request) -> u64 { get_value(req, request_metadata::CODE_VERSION) .and_then(|version| version.parse().ok()) .unwrap_or_else(|| { warn!( "Could not retrieve code version from request: {:?}. Defaulting to 0", req ); Default::default() }) } diff --git a/services/identity/src/ddb_utils.rs b/services/identity/src/ddb_utils.rs index b6be3eeec..4a9b56ab2 100644 --- a/services/identity/src/ddb_utils.rs +++ b/services/identity/src/ddb_utils.rs @@ -1,284 +1,293 @@ use chrono::{DateTime, NaiveDateTime, Utc}; use comm_lib::{ aws::{ ddb::types::{ error::TransactionCanceledException, AttributeValue, Put, TransactWriteItem, Update, }, DynamoDBError, }, database::{AttributeExtractor, AttributeMap}, }; use std::collections::{HashMap, HashSet}; use std::iter::IntoIterator; use crate::{ constants::{ USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME, USERS_TABLE_SOCIAL_PROOF_ATTRIBUTE_NAME, USERS_TABLE_USERNAME_ATTRIBUTE, USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE, }, database::{DeviceIDAttribute, OTKRow}, siwe::SocialProof, }; #[derive(Copy, Clone, Debug)] pub enum OlmAccountType { Content, Notification, } pub fn create_one_time_key_partition_key( user_id: &str, device_id: &str, account_type: OlmAccountType, ) -> String { let account_type = match account_type { OlmAccountType::Content => "content", OlmAccountType::Notification => "notif", }; format!("{user_id}#{device_id}#{account_type}") } fn create_one_time_key_sort_key( key_number: usize, current_time: DateTime, ) -> String { let timestamp = current_time.to_rfc3339(); format!("{timestamp}#{:02}", key_number) } fn create_one_time_key_put_request( user_id: &str, device_id: &str, one_time_key: String, key_number: usize, account_type: OlmAccountType, current_time: DateTime, ) -> Put { use crate::constants::one_time_keys_table::*; let partition_key = create_one_time_key_partition_key(user_id, device_id, account_type); let sort_key = create_one_time_key_sort_key(key_number, current_time); let builder = Put::builder(); let attrs = HashMap::from([ (PARTITION_KEY.to_string(), AttributeValue::S(partition_key)), (SORT_KEY.to_string(), AttributeValue::S(sort_key)), ( ATTR_ONE_TIME_KEY.to_string(), AttributeValue::S(one_time_key), ), ]); builder.table_name(NAME).set_item(Some(attrs)).build() } pub fn into_one_time_put_requests( user_id: &str, device_id: &str, one_time_keys: T, account_type: OlmAccountType, current_time: DateTime, ) -> Vec where T: IntoIterator, ::Item: ToString, { one_time_keys .into_iter() .enumerate() .map(|(index, otk)| { create_one_time_key_put_request( user_id, device_id, otk.to_string(), index, account_type, current_time, ) }) .map(|put_request| TransactWriteItem::builder().put(put_request).build()) .collect() } pub fn into_one_time_update_and_delete_requests( user_id: &str, device_id: &str, num_content_keys_to_append: usize, num_notif_keys_to_append: usize, content_keys_to_delete: Vec, notif_keys_to_delete: Vec, ) -> Vec { use crate::constants::devices_table; let mut transactions = Vec::new(); for otk_row in content_keys_to_delete.iter().chain(¬if_keys_to_delete) { let delete_otk_operation = otk_row.as_delete_request(); transactions.push(delete_otk_operation) } let content_key_count_delta = num_content_keys_to_append - content_keys_to_delete.len(); let notif_key_count_delta = num_notif_keys_to_append - notif_keys_to_delete.len(); let update_otk_count = Update::builder() .table_name(devices_table::NAME) .key( devices_table::ATTR_USER_ID, AttributeValue::S(user_id.to_string()), ) .key( devices_table::ATTR_ITEM_ID, DeviceIDAttribute(device_id.into()).into(), ) .update_expression(format!( "ADD {} :num_content, {} :num_notif", devices_table::ATTR_CONTENT_OTK_COUNT, devices_table::ATTR_NOTIF_OTK_COUNT )) .expression_attribute_values( ":num_content", AttributeValue::N(content_key_count_delta.to_string()), ) .expression_attribute_values( ":num_notif", AttributeValue::N(notif_key_count_delta.to_string()), ) .build(); let update_otk_count_operation = TransactWriteItem::builder() .update(update_otk_count) .build(); transactions.push(update_otk_count_operation); transactions } pub trait DateTimeExt { fn from_utc_timestamp_millis(timestamp: i64) -> Option>; } impl DateTimeExt for DateTime { fn from_utc_timestamp_millis(timestamp: i64) -> Option { let naive = NaiveDateTime::from_timestamp_millis(timestamp)?; Some(Self::from_naive_utc_and_offset(naive, Utc)) } } pub struct DBIdentity { pub identifier: Identifier, pub farcaster_id: Option, } pub enum Identifier { Username(String), WalletAddress(EthereumIdentity), } +impl Identifier { + pub fn username(&self) -> &str { + match self { + Identifier::Username(username) => username, + Identifier::WalletAddress(eth_identity) => ð_identity.wallet_address, + } + } +} + pub struct EthereumIdentity { pub wallet_address: String, pub social_proof: SocialProof, } impl TryFrom for DBIdentity { type Error = crate::error::Error; fn try_from(mut value: AttributeMap) -> Result { let farcaster_id = value.take_attr(USERS_TABLE_FARCASTER_ID_ATTRIBUTE_NAME)?; let username_result = value.take_attr(USERS_TABLE_USERNAME_ATTRIBUTE); if let Ok(username) = username_result { return Ok(DBIdentity { identifier: Identifier::Username(username), farcaster_id, }); } let wallet_address_result = value.take_attr(USERS_TABLE_WALLET_ADDRESS_ATTRIBUTE); let social_proof_result = value.take_attr(USERS_TABLE_SOCIAL_PROOF_ATTRIBUTE_NAME); if let (Ok(wallet_address), Ok(social_proof)) = (wallet_address_result, social_proof_result) { Ok(DBIdentity { identifier: Identifier::WalletAddress(EthereumIdentity { wallet_address, social_proof, }), farcaster_id, }) } else { Err(Self::Error::MalformedItem) } } } pub fn is_transaction_retryable( err: &DynamoDBError, retryable_codes: &HashSet<&str>, ) -> bool { match err { DynamoDBError::TransactionCanceledException( TransactionCanceledException { cancellation_reasons: Some(reasons), .. }, ) => reasons.iter().any(|reason| { retryable_codes.contains(&reason.code().unwrap_or_default()) }), _ => false, } } #[cfg(test)] mod tests { use crate::constants::one_time_keys_table; use super::*; #[test] fn test_into_one_time_put_requests() { let otks = ["not", "real", "keys"]; let current_time = Utc::now(); let requests = into_one_time_put_requests( "abc", "123", otks, OlmAccountType::Content, current_time, ); assert_eq!(requests.len(), 3); for (index, request) in requests.into_iter().enumerate() { let mut item = request.put.unwrap().item.unwrap(); assert_eq!( item.remove(one_time_keys_table::PARTITION_KEY).unwrap(), AttributeValue::S("abc#123#content".to_string()) ); assert_eq!( item.remove(one_time_keys_table::SORT_KEY).unwrap(), AttributeValue::S(format!( "{}#{:02}", current_time.to_rfc3339(), index )) ); assert_eq!( item.remove(one_time_keys_table::ATTR_ONE_TIME_KEY).unwrap(), AttributeValue::S(otks[index].to_string()) ); } } } diff --git a/shared/protos/identity_unauth.proto b/shared/protos/identity_unauth.proto index 2361e8d31..b1b3df369 100644 --- a/shared/protos/identity_unauth.proto +++ b/shared/protos/identity_unauth.proto @@ -1,345 +1,347 @@ syntax = "proto3"; package identity.unauth; // RPCs from a client (iOS, Android, or web) to identity service service IdentityClientService { /* Account actions */ // Called by user to register with the Identity Service (PAKE only) // Due to limitations of grpc-web, the Opaque challenge+response // needs to be split up over two unary requests // Start/Finish is used here to align with opaque protocol rpc RegisterPasswordUserStart(RegistrationStartRequest) returns ( RegistrationStartResponse) {} rpc RegisterReservedPasswordUserStart(ReservedRegistrationStartRequest) returns (RegistrationStartResponse) {} rpc RegisterPasswordUserFinish(RegistrationFinishRequest) returns ( AuthResponse) {} // Called by user to register device and get an access token rpc LogInPasswordUserStart(OpaqueLoginStartRequest) returns (OpaqueLoginStartResponse) {} rpc LogInPasswordUserFinish(OpaqueLoginFinishRequest) returns (AuthResponse) {} rpc LogInWalletUser(WalletAuthRequest) returns (AuthResponse) {} rpc RegisterWalletUser(WalletAuthRequest) returns (AuthResponse) {} rpc RegisterReservedWalletUser(ReservedWalletRegistrationRequest) returns (AuthResponse) {} rpc UploadKeysForRegisteredDeviceAndLogIn(SecondaryDeviceKeysUploadRequest) returns (AuthResponse) {} rpc LogInExistingDevice(ExistingDeviceLoginRequest) returns (AuthResponse) {} /* Service actions */ // Called by other services to verify a user's access token rpc VerifyUserAccessToken(VerifyUserAccessTokenRequest) returns (VerifyUserAccessTokenResponse) {} /* Authoritative keyserver actions */ // Called by authoritative keyserver to add usernames // to the Identity service's reserved list rpc AddReservedUsernames(AddReservedUsernamesRequest) returns (Empty) {} // Called by authoritative keyserver to remove usernames from the Identity // service's reserved list rpc RemoveReservedUsername(RemoveReservedUsernameRequest) returns (Empty) {} /* Miscellaneous actions */ // Called by users periodically to check if their code version is supported rpc Ping(Empty) returns (Empty) {} // Returns userID for given username or wallet address rpc FindUserID(FindUserIDRequest) returns (FindUserIDResponse) {} // Called by clients to get a nonce for a Sign-In with Ethereum message // or RPCs requiring challenge-response actions rpc GenerateNonce(Empty) returns (GenerateNonceResponse) {} /* Farcaster actions */ rpc GetFarcasterUsers(GetFarcasterUsersRequest) returns (GetFarcasterUsersResponse) {} } // Helper types message Empty {} message Prekey { string prekey = 1; string prekey_signature = 2; } // Key information needed for starting a X3DH session message IdentityKeyInfo { // JSON payload containing Olm keys // Sessions for users will contain both ContentKeys and NotifKeys // For keyservers, this will only contain ContentKeys string payload = 1; // Payload signed with the signing ed25519 key string payload_signature = 2; } // RegisterUser // Ephemeral information provided so others can create initial message // to this device // // Prekeys are generally rotated periodically // One-time Prekeys are "consumed" after first use, so many need to // be provide to avoid exhausting them. enum DeviceType { KEYSERVER = 0; WEB = 1; // iOS doesn't leave a good option for title to camel case renaming IOS = 2; ANDROID = 3; WINDOWS = 4; MAC_OS = 5; } // Bundle of information needed for creating an initial message using X3DH message DeviceKeyUpload { IdentityKeyInfo device_key_info = 1; Prekey content_upload = 2; Prekey notif_upload = 3; repeated string one_time_content_prekeys = 4; repeated string one_time_notif_prekeys = 5; DeviceType device_type = 6; } // Request for registering a new user message RegistrationStartRequest { // Message sent to initiate PAKE registration (step 1) bytes opaque_registration_request = 1; string username = 2; // Information needed to open a new channel to current user's device DeviceKeyUpload device_key_upload = 3; optional string farcaster_id = 4; // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [] // "timestamp": , // }), // "curPrimarySignature": "base64-encoded primary device signature" // } // It's an empty string for older clients which don't sign device lists yet. string initial_device_list = 5; } message ReservedRegistrationStartRequest { // Message sent to initiate PAKE registration (step 1) bytes opaque_registration_request = 1; string username = 2; // Information needed to open a new channel to current user's device DeviceKeyUpload device_key_upload = 3; // Message from authoritative keyserver attesting that a given user // has ownership of a given username string keyserver_message = 4; // Above message signed with authoritative keyserver's signing ed25519 key string keyserver_signature = 5; // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [] // "timestamp": , // }), // "curPrimarySignature": "base64-encoded primary device signature" // } // It's an empty string for older clients which don't sign device lists yet. string initial_device_list = 6; } // Messages sent from a client to Identity Service message RegistrationFinishRequest { // Identifier to correlate RegisterStart session string session_id = 1; // Final message in PAKE registration bytes opaque_registration_upload = 2; } // Messages sent from Identity Service to client message RegistrationStartResponse { // Identifier used to correlate start request with finish request string session_id = 1; // sent to the user upon reception of the PAKE registration attempt // (step 2) bytes opaque_registration_response = 2; } message AuthResponse { // Unique identifier for user string user_id = 1; string access_token = 2; + // This is wallet address for wallet users + string username = 3; } // LoginUser message OpaqueLoginStartRequest { string username = 1; // Message sent to initiate PAKE login (step 1) bytes opaque_login_request = 2; // Information specific to a user's device needed to open a new channel of // communication with this user DeviceKeyUpload device_key_upload = 3; // If set to true, the user's existing keyserver will be deleted from the // identity service and replaced with this one. This field has no effect if // the device is not a keyserver optional bool force = 4; } message OpaqueLoginFinishRequest { // Identifier used to correlate start request with finish request string session_id = 1; // Message containing client's reponse to server challenge. // Used to verify that client holds password secret (Step 3) bytes opaque_login_upload = 2; } message OpaqueLoginStartResponse { // Identifier used to correlate start request with finish request string session_id = 1; // Opaque challenge sent from server to client attempting to login (Step 2) bytes opaque_login_response = 2; } message WalletAuthRequest { string siwe_message = 1; string siwe_signature = 2; // Information specific to a user's device needed to open a new channel of // communication with this user DeviceKeyUpload device_key_upload = 3; optional string farcaster_id = 4; // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [] // "timestamp": , // }), // "curPrimarySignature": "base64-encoded primary device signature" // } // It's an empty string when used outside `RegisterWalletUser` RPC // and for older clients which don't sign device lists yet. string initial_device_list = 5; } message ReservedWalletRegistrationRequest { string siwe_message = 1; string siwe_signature = 2; // Information specific to a user's device needed to open a new channel of // communication with this user DeviceKeyUpload device_key_upload = 3; // Message from authoritative keyserver attesting that a given user // has ownership of a given wallet address string keyserver_message = 4; // Above message signed with authoritative keyserver's signing ed25519 key string keyserver_signature = 5; // A stringified JSON object of the following format: // { // "rawDeviceList": JSON.stringify({ // "devices": [] // "timestamp": , // }), // "curPrimarySignature": "base64-encoded primary device signature" // } // It's an empty string when used for older clients // which don't sign device lists yet. string initial_device_list = 6; } // UploadKeysForRegisteredDeviceAndLogIn message SecondaryDeviceKeysUploadRequest { string user_id = 1; string nonce = 2; string nonce_signature = 3; // Information specific to a user's device needed to open a new channel of // communication with this user DeviceKeyUpload device_key_upload = 4; } // LogInExistingDevice message ExistingDeviceLoginRequest { string user_id = 1; string device_id = 2; string nonce = 3; string nonce_signature = 4; } // GenerateNonce message GenerateNonceResponse{ string nonce = 1; } // VerifyUserAccessToken message VerifyUserAccessTokenRequest { string user_id = 1; // signing ed25519 key for the given user's device string device_id = 2; string access_token = 3; } message VerifyUserAccessTokenResponse { bool token_valid = 1; } // AddReservedUsernames message AddReservedUsernamesRequest { // Message from authoritative keyserver containing the username to be added string message = 1; // Above message signed with authoritative keyserver's signing ed25519 key string signature = 2; } // RemoveReservedUsername message RemoveReservedUsernameRequest { // Message from authoritative keyserver containing the username to be removed string message = 1; // Above message signed with authoritative keyserver's signing ed25519 key string signature = 2; } // FindUserID message FindUserIDRequest { oneof identifier { string username = 1; string wallet_address = 2; } } message FindUserIDResponse { // userID if the user is registered with Identity Service, null otherwise optional string user_id = 1; // true if the identifier (username or wallet address) exists in the // reserved usernames list, false otherwise. It doesn't take into account // whether the user is registered with Identity Service (userID != null). bool is_reserved = 2; } // GetFarcasterUsers message GetFarcasterUsersRequest { repeated string farcaster_ids = 1; } message GetFarcasterUsersResponse { repeated FarcasterUser farcaster_users = 1; } message FarcasterUser { string user_id = 1; string farcaster_id = 2; string username = 3; } diff --git a/web/protobufs/identity-unauth-structs.cjs b/web/protobufs/identity-unauth-structs.cjs index 94015813b..af7112e2d 100644 --- a/web/protobufs/identity-unauth-structs.cjs +++ b/web/protobufs/identity-unauth-structs.cjs @@ -1,5964 +1,5994 @@ // source: identity_unauth.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public * @generated */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = (typeof globalThis !== 'undefined' && globalThis) || (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || (typeof self !== 'undefined' && self) || (function () { return this; }).call(null) || Function('return this')(); goog.exportSymbol('proto.identity.unauth.AddReservedUsernamesRequest', null, global); goog.exportSymbol('proto.identity.unauth.AuthResponse', null, global); goog.exportSymbol('proto.identity.unauth.DeviceKeyUpload', null, global); goog.exportSymbol('proto.identity.unauth.DeviceType', null, global); goog.exportSymbol('proto.identity.unauth.Empty', null, global); goog.exportSymbol('proto.identity.unauth.ExistingDeviceLoginRequest', null, global); goog.exportSymbol('proto.identity.unauth.FarcasterUser', null, global); goog.exportSymbol('proto.identity.unauth.FindUserIDRequest', null, global); goog.exportSymbol('proto.identity.unauth.FindUserIDRequest.IdentifierCase', null, global); goog.exportSymbol('proto.identity.unauth.FindUserIDResponse', null, global); goog.exportSymbol('proto.identity.unauth.GenerateNonceResponse', null, global); goog.exportSymbol('proto.identity.unauth.GetFarcasterUsersRequest', null, global); goog.exportSymbol('proto.identity.unauth.GetFarcasterUsersResponse', null, global); goog.exportSymbol('proto.identity.unauth.IdentityKeyInfo', null, global); goog.exportSymbol('proto.identity.unauth.OpaqueLoginFinishRequest', null, global); goog.exportSymbol('proto.identity.unauth.OpaqueLoginStartRequest', null, global); goog.exportSymbol('proto.identity.unauth.OpaqueLoginStartResponse', null, global); goog.exportSymbol('proto.identity.unauth.Prekey', null, global); goog.exportSymbol('proto.identity.unauth.RegistrationFinishRequest', null, global); goog.exportSymbol('proto.identity.unauth.RegistrationStartRequest', null, global); goog.exportSymbol('proto.identity.unauth.RegistrationStartResponse', null, global); goog.exportSymbol('proto.identity.unauth.RemoveReservedUsernameRequest', null, global); goog.exportSymbol('proto.identity.unauth.ReservedRegistrationStartRequest', null, global); goog.exportSymbol('proto.identity.unauth.ReservedWalletRegistrationRequest', null, global); goog.exportSymbol('proto.identity.unauth.SecondaryDeviceKeysUploadRequest', null, global); goog.exportSymbol('proto.identity.unauth.VerifyUserAccessTokenRequest', null, global); goog.exportSymbol('proto.identity.unauth.VerifyUserAccessTokenResponse', null, global); goog.exportSymbol('proto.identity.unauth.WalletAuthRequest', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.Empty = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.Empty, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.Empty.displayName = 'proto.identity.unauth.Empty'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.Prekey = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.Prekey, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.Prekey.displayName = 'proto.identity.unauth.Prekey'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.IdentityKeyInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.IdentityKeyInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.IdentityKeyInfo.displayName = 'proto.identity.unauth.IdentityKeyInfo'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.DeviceKeyUpload = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.unauth.DeviceKeyUpload.repeatedFields_, null); }; goog.inherits(proto.identity.unauth.DeviceKeyUpload, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.DeviceKeyUpload.displayName = 'proto.identity.unauth.DeviceKeyUpload'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.RegistrationStartRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.RegistrationStartRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.RegistrationStartRequest.displayName = 'proto.identity.unauth.RegistrationStartRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.ReservedRegistrationStartRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.ReservedRegistrationStartRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.ReservedRegistrationStartRequest.displayName = 'proto.identity.unauth.ReservedRegistrationStartRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.RegistrationFinishRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.RegistrationFinishRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.RegistrationFinishRequest.displayName = 'proto.identity.unauth.RegistrationFinishRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.RegistrationStartResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.RegistrationStartResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.RegistrationStartResponse.displayName = 'proto.identity.unauth.RegistrationStartResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.AuthResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.AuthResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.AuthResponse.displayName = 'proto.identity.unauth.AuthResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.OpaqueLoginStartRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.OpaqueLoginStartRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.OpaqueLoginStartRequest.displayName = 'proto.identity.unauth.OpaqueLoginStartRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.OpaqueLoginFinishRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.OpaqueLoginFinishRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.OpaqueLoginFinishRequest.displayName = 'proto.identity.unauth.OpaqueLoginFinishRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.OpaqueLoginStartResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.OpaqueLoginStartResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.OpaqueLoginStartResponse.displayName = 'proto.identity.unauth.OpaqueLoginStartResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.WalletAuthRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.WalletAuthRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.WalletAuthRequest.displayName = 'proto.identity.unauth.WalletAuthRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.ReservedWalletRegistrationRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.ReservedWalletRegistrationRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.ReservedWalletRegistrationRequest.displayName = 'proto.identity.unauth.ReservedWalletRegistrationRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.SecondaryDeviceKeysUploadRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.displayName = 'proto.identity.unauth.SecondaryDeviceKeysUploadRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.ExistingDeviceLoginRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.ExistingDeviceLoginRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.ExistingDeviceLoginRequest.displayName = 'proto.identity.unauth.ExistingDeviceLoginRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.GenerateNonceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.GenerateNonceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.GenerateNonceResponse.displayName = 'proto.identity.unauth.GenerateNonceResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.VerifyUserAccessTokenRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.VerifyUserAccessTokenRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.VerifyUserAccessTokenRequest.displayName = 'proto.identity.unauth.VerifyUserAccessTokenRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.VerifyUserAccessTokenResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.VerifyUserAccessTokenResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.VerifyUserAccessTokenResponse.displayName = 'proto.identity.unauth.VerifyUserAccessTokenResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.AddReservedUsernamesRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.AddReservedUsernamesRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.AddReservedUsernamesRequest.displayName = 'proto.identity.unauth.AddReservedUsernamesRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.RemoveReservedUsernameRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.RemoveReservedUsernameRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.RemoveReservedUsernameRequest.displayName = 'proto.identity.unauth.RemoveReservedUsernameRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.FindUserIDRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.identity.unauth.FindUserIDRequest.oneofGroups_); }; goog.inherits(proto.identity.unauth.FindUserIDRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.FindUserIDRequest.displayName = 'proto.identity.unauth.FindUserIDRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.FindUserIDResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.FindUserIDResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.FindUserIDResponse.displayName = 'proto.identity.unauth.FindUserIDResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.GetFarcasterUsersRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.unauth.GetFarcasterUsersRequest.repeatedFields_, null); }; goog.inherits(proto.identity.unauth.GetFarcasterUsersRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.GetFarcasterUsersRequest.displayName = 'proto.identity.unauth.GetFarcasterUsersRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.GetFarcasterUsersResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.unauth.GetFarcasterUsersResponse.repeatedFields_, null); }; goog.inherits(proto.identity.unauth.GetFarcasterUsersResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.GetFarcasterUsersResponse.displayName = 'proto.identity.unauth.GetFarcasterUsersResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.identity.unauth.FarcasterUser = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.identity.unauth.FarcasterUser, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.identity.unauth.FarcasterUser.displayName = 'proto.identity.unauth.FarcasterUser'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.Empty.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.Empty.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.Empty} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.Empty.toObject = function(includeInstance, msg) { var f, obj = { }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.Empty} */ proto.identity.unauth.Empty.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.Empty; return proto.identity.unauth.Empty.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.Empty} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.Empty} */ proto.identity.unauth.Empty.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.Empty.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.Empty.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.Empty} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.Empty.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.Prekey.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.Prekey.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.Prekey} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.Prekey.toObject = function(includeInstance, msg) { var f, obj = { prekey: jspb.Message.getFieldWithDefault(msg, 1, ""), prekeySignature: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.Prekey} */ proto.identity.unauth.Prekey.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.Prekey; return proto.identity.unauth.Prekey.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.Prekey} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.Prekey} */ proto.identity.unauth.Prekey.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setPrekey(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setPrekeySignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.Prekey.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.Prekey.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.Prekey} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.Prekey.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPrekey(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getPrekeySignature(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional string prekey = 1; * @return {string} */ proto.identity.unauth.Prekey.prototype.getPrekey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.Prekey} returns this */ proto.identity.unauth.Prekey.prototype.setPrekey = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string prekey_signature = 2; * @return {string} */ proto.identity.unauth.Prekey.prototype.getPrekeySignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.Prekey} returns this */ proto.identity.unauth.Prekey.prototype.setPrekeySignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.IdentityKeyInfo.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.IdentityKeyInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.IdentityKeyInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.IdentityKeyInfo.toObject = function(includeInstance, msg) { var f, obj = { payload: jspb.Message.getFieldWithDefault(msg, 1, ""), payloadSignature: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.IdentityKeyInfo} */ proto.identity.unauth.IdentityKeyInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.IdentityKeyInfo; return proto.identity.unauth.IdentityKeyInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.IdentityKeyInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.IdentityKeyInfo} */ proto.identity.unauth.IdentityKeyInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setPayload(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setPayloadSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.IdentityKeyInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.IdentityKeyInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.IdentityKeyInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.IdentityKeyInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPayload(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getPayloadSignature(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional string payload = 1; * @return {string} */ proto.identity.unauth.IdentityKeyInfo.prototype.getPayload = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.IdentityKeyInfo} returns this */ proto.identity.unauth.IdentityKeyInfo.prototype.setPayload = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string payload_signature = 2; * @return {string} */ proto.identity.unauth.IdentityKeyInfo.prototype.getPayloadSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.IdentityKeyInfo} returns this */ proto.identity.unauth.IdentityKeyInfo.prototype.setPayloadSignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.identity.unauth.DeviceKeyUpload.repeatedFields_ = [4,5]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.DeviceKeyUpload.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.DeviceKeyUpload.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.DeviceKeyUpload} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.DeviceKeyUpload.toObject = function(includeInstance, msg) { var f, obj = { deviceKeyInfo: (f = msg.getDeviceKeyInfo()) && proto.identity.unauth.IdentityKeyInfo.toObject(includeInstance, f), contentUpload: (f = msg.getContentUpload()) && proto.identity.unauth.Prekey.toObject(includeInstance, f), notifUpload: (f = msg.getNotifUpload()) && proto.identity.unauth.Prekey.toObject(includeInstance, f), oneTimeContentPrekeysList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, oneTimeNotifPrekeysList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, deviceType: jspb.Message.getFieldWithDefault(msg, 6, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.DeviceKeyUpload.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.DeviceKeyUpload; return proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.DeviceKeyUpload} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.identity.unauth.IdentityKeyInfo; reader.readMessage(value,proto.identity.unauth.IdentityKeyInfo.deserializeBinaryFromReader); msg.setDeviceKeyInfo(value); break; case 2: var value = new proto.identity.unauth.Prekey; reader.readMessage(value,proto.identity.unauth.Prekey.deserializeBinaryFromReader); msg.setContentUpload(value); break; case 3: var value = new proto.identity.unauth.Prekey; reader.readMessage(value,proto.identity.unauth.Prekey.deserializeBinaryFromReader); msg.setNotifUpload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.addOneTimeContentPrekeys(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.addOneTimeNotifPrekeys(value); break; case 6: var value = /** @type {!proto.identity.unauth.DeviceType} */ (reader.readEnum()); msg.setDeviceType(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.DeviceKeyUpload.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.DeviceKeyUpload} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDeviceKeyInfo(); if (f != null) { writer.writeMessage( 1, f, proto.identity.unauth.IdentityKeyInfo.serializeBinaryToWriter ); } f = message.getContentUpload(); if (f != null) { writer.writeMessage( 2, f, proto.identity.unauth.Prekey.serializeBinaryToWriter ); } f = message.getNotifUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.Prekey.serializeBinaryToWriter ); } f = message.getOneTimeContentPrekeysList(); if (f.length > 0) { writer.writeRepeatedString( 4, f ); } f = message.getOneTimeNotifPrekeysList(); if (f.length > 0) { writer.writeRepeatedString( 5, f ); } f = message.getDeviceType(); if (f !== 0.0) { writer.writeEnum( 6, f ); } }; /** * optional IdentityKeyInfo device_key_info = 1; * @return {?proto.identity.unauth.IdentityKeyInfo} */ proto.identity.unauth.DeviceKeyUpload.prototype.getDeviceKeyInfo = function() { return /** @type{?proto.identity.unauth.IdentityKeyInfo} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.IdentityKeyInfo, 1)); }; /** * @param {?proto.identity.unauth.IdentityKeyInfo|undefined} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setDeviceKeyInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.clearDeviceKeyInfo = function() { return this.setDeviceKeyInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.DeviceKeyUpload.prototype.hasDeviceKeyInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional Prekey content_upload = 2; * @return {?proto.identity.unauth.Prekey} */ proto.identity.unauth.DeviceKeyUpload.prototype.getContentUpload = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.Prekey, 2)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setContentUpload = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.clearContentUpload = function() { return this.setContentUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.DeviceKeyUpload.prototype.hasContentUpload = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional Prekey notif_upload = 3; * @return {?proto.identity.unauth.Prekey} */ proto.identity.unauth.DeviceKeyUpload.prototype.getNotifUpload = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.Prekey, 3)); }; /** * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setNotifUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.clearNotifUpload = function() { return this.setNotifUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.DeviceKeyUpload.prototype.hasNotifUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * repeated string one_time_content_prekeys = 4; * @return {!Array} */ proto.identity.unauth.DeviceKeyUpload.prototype.getOneTimeContentPrekeysList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); }; /** * @param {!Array} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setOneTimeContentPrekeysList = function(value) { return jspb.Message.setField(this, 4, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.addOneTimeContentPrekeys = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 4, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.clearOneTimeContentPrekeysList = function() { return this.setOneTimeContentPrekeysList([]); }; /** * repeated string one_time_notif_prekeys = 5; * @return {!Array} */ proto.identity.unauth.DeviceKeyUpload.prototype.getOneTimeNotifPrekeysList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); }; /** * @param {!Array} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setOneTimeNotifPrekeysList = function(value) { return jspb.Message.setField(this, 5, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.addOneTimeNotifPrekeys = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 5, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.clearOneTimeNotifPrekeysList = function() { return this.setOneTimeNotifPrekeysList([]); }; /** * optional DeviceType device_type = 6; * @return {!proto.identity.unauth.DeviceType} */ proto.identity.unauth.DeviceKeyUpload.prototype.getDeviceType = function() { return /** @type {!proto.identity.unauth.DeviceType} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {!proto.identity.unauth.DeviceType} value * @return {!proto.identity.unauth.DeviceKeyUpload} returns this */ proto.identity.unauth.DeviceKeyUpload.prototype.setDeviceType = function(value) { return jspb.Message.setProto3EnumField(this, 6, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.RegistrationStartRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.RegistrationStartRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.RegistrationStartRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationStartRequest.toObject = function(includeInstance, msg) { var f, obj = { opaqueRegistrationRequest: msg.getOpaqueRegistrationRequest_asB64(), username: jspb.Message.getFieldWithDefault(msg, 2, ""), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f), farcasterId: jspb.Message.getFieldWithDefault(msg, 4, ""), initialDeviceList: jspb.Message.getFieldWithDefault(msg, 5, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.RegistrationStartRequest} */ proto.identity.unauth.RegistrationStartRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.RegistrationStartRequest; return proto.identity.unauth.RegistrationStartRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.RegistrationStartRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.RegistrationStartRequest} */ proto.identity.unauth.RegistrationStartRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationRequest(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; case 3: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setFarcasterId(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.RegistrationStartRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.RegistrationStartRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.RegistrationStartRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationStartRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOpaqueRegistrationRequest_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getUsername(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } f = /** @type {string} */ (jspb.Message.getField(message, 4)); if (f != null) { writer.writeString( 4, f ); } f = message.getInitialDeviceList(); if (f.length > 0) { writer.writeString( 5, f ); } }; /** * optional bytes opaque_registration_request = 1; * @return {string} */ proto.identity.unauth.RegistrationStartRequest.prototype.getOpaqueRegistrationRequest = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes opaque_registration_request = 1; * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {string} */ proto.identity.unauth.RegistrationStartRequest.prototype.getOpaqueRegistrationRequest_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationRequest())); }; /** * optional bytes opaque_registration_request = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {!Uint8Array} */ proto.identity.unauth.RegistrationStartRequest.prototype.getOpaqueRegistrationRequest_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationRequest())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.setOpaqueRegistrationRequest = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional string username = 2; * @return {string} */ proto.identity.unauth.RegistrationStartRequest.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional DeviceKeyUpload device_key_upload = 3; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.RegistrationStartRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.RegistrationStartRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string farcaster_id = 4; * @return {string} */ proto.identity.unauth.RegistrationStartRequest.prototype.getFarcasterId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.setFarcasterId = function(value) { return jspb.Message.setField(this, 4, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.clearFarcasterId = function() { return jspb.Message.setField(this, 4, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.RegistrationStartRequest.prototype.hasFarcasterId = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional string initial_device_list = 5; * @return {string} */ proto.identity.unauth.RegistrationStartRequest.prototype.getInitialDeviceList = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RegistrationStartRequest} returns this */ proto.identity.unauth.RegistrationStartRequest.prototype.setInitialDeviceList = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.ReservedRegistrationStartRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.ReservedRegistrationStartRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ReservedRegistrationStartRequest.toObject = function(includeInstance, msg) { var f, obj = { opaqueRegistrationRequest: msg.getOpaqueRegistrationRequest_asB64(), username: jspb.Message.getFieldWithDefault(msg, 2, ""), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f), keyserverMessage: jspb.Message.getFieldWithDefault(msg, 4, ""), keyserverSignature: jspb.Message.getFieldWithDefault(msg, 5, ""), initialDeviceList: jspb.Message.getFieldWithDefault(msg, 6, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} */ proto.identity.unauth.ReservedRegistrationStartRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.ReservedRegistrationStartRequest; return proto.identity.unauth.ReservedRegistrationStartRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.ReservedRegistrationStartRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} */ proto.identity.unauth.ReservedRegistrationStartRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationRequest(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; case 3: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setKeyserverMessage(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setKeyserverSignature(value); break; case 6: var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.ReservedRegistrationStartRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.ReservedRegistrationStartRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ReservedRegistrationStartRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOpaqueRegistrationRequest_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getUsername(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } f = message.getKeyserverMessage(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getKeyserverSignature(); if (f.length > 0) { writer.writeString( 5, f ); } f = message.getInitialDeviceList(); if (f.length > 0) { writer.writeString( 6, f ); } }; /** * optional bytes opaque_registration_request = 1; * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getOpaqueRegistrationRequest = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes opaque_registration_request = 1; * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getOpaqueRegistrationRequest_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationRequest())); }; /** * optional bytes opaque_registration_request = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationRequest()` * @return {!Uint8Array} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getOpaqueRegistrationRequest_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationRequest())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setOpaqueRegistrationRequest = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional string username = 2; * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional DeviceKeyUpload device_key_upload = 3; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string keyserver_message = 4; * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getKeyserverMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setKeyserverMessage = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * optional string keyserver_signature = 5; * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getKeyserverSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setKeyserverSignature = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; /** * optional string initial_device_list = 6; * @return {string} */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.getInitialDeviceList = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedRegistrationStartRequest} returns this */ proto.identity.unauth.ReservedRegistrationStartRequest.prototype.setInitialDeviceList = function(value) { return jspb.Message.setProto3StringField(this, 6, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.RegistrationFinishRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.RegistrationFinishRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.RegistrationFinishRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationFinishRequest.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueRegistrationUpload: msg.getOpaqueRegistrationUpload_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.RegistrationFinishRequest} */ proto.identity.unauth.RegistrationFinishRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.RegistrationFinishRequest; return proto.identity.unauth.RegistrationFinishRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.RegistrationFinishRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.RegistrationFinishRequest} */ proto.identity.unauth.RegistrationFinishRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationUpload(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.RegistrationFinishRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.RegistrationFinishRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.RegistrationFinishRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationFinishRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueRegistrationUpload_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.unauth.RegistrationFinishRequest.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RegistrationFinishRequest} returns this */ proto.identity.unauth.RegistrationFinishRequest.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_registration_upload = 2; * @return {string} */ proto.identity.unauth.RegistrationFinishRequest.prototype.getOpaqueRegistrationUpload = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_registration_upload = 2; * This is a type-conversion wrapper around `getOpaqueRegistrationUpload()` * @return {string} */ proto.identity.unauth.RegistrationFinishRequest.prototype.getOpaqueRegistrationUpload_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationUpload())); }; /** * optional bytes opaque_registration_upload = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationUpload()` * @return {!Uint8Array} */ proto.identity.unauth.RegistrationFinishRequest.prototype.getOpaqueRegistrationUpload_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationUpload())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.RegistrationFinishRequest} returns this */ proto.identity.unauth.RegistrationFinishRequest.prototype.setOpaqueRegistrationUpload = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.RegistrationStartResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.RegistrationStartResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.RegistrationStartResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationStartResponse.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueRegistrationResponse: msg.getOpaqueRegistrationResponse_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.RegistrationStartResponse} */ proto.identity.unauth.RegistrationStartResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.RegistrationStartResponse; return proto.identity.unauth.RegistrationStartResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.RegistrationStartResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.RegistrationStartResponse} */ proto.identity.unauth.RegistrationStartResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueRegistrationResponse(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.RegistrationStartResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.RegistrationStartResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.RegistrationStartResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RegistrationStartResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueRegistrationResponse_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.unauth.RegistrationStartResponse.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RegistrationStartResponse} returns this */ proto.identity.unauth.RegistrationStartResponse.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_registration_response = 2; * @return {string} */ proto.identity.unauth.RegistrationStartResponse.prototype.getOpaqueRegistrationResponse = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_registration_response = 2; * This is a type-conversion wrapper around `getOpaqueRegistrationResponse()` * @return {string} */ proto.identity.unauth.RegistrationStartResponse.prototype.getOpaqueRegistrationResponse_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueRegistrationResponse())); }; /** * optional bytes opaque_registration_response = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueRegistrationResponse()` * @return {!Uint8Array} */ proto.identity.unauth.RegistrationStartResponse.prototype.getOpaqueRegistrationResponse_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueRegistrationResponse())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.RegistrationStartResponse} returns this */ proto.identity.unauth.RegistrationStartResponse.prototype.setOpaqueRegistrationResponse = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.AuthResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.AuthResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.AuthResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.AuthResponse.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), - accessToken: jspb.Message.getFieldWithDefault(msg, 2, "") + accessToken: jspb.Message.getFieldWithDefault(msg, 2, ""), + username: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.AuthResponse} */ proto.identity.unauth.AuthResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.AuthResponse; return proto.identity.unauth.AuthResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.AuthResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.AuthResponse} */ proto.identity.unauth.AuthResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setAccessToken(value); break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setUsername(value); + break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.AuthResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.AuthResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.AuthResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.AuthResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getAccessToken(); if (f.length > 0) { writer.writeString( 2, f ); } + f = message.getUsername(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.AuthResponse.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.AuthResponse} returns this */ proto.identity.unauth.AuthResponse.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string access_token = 2; * @return {string} */ proto.identity.unauth.AuthResponse.prototype.getAccessToken = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.AuthResponse} returns this */ proto.identity.unauth.AuthResponse.prototype.setAccessToken = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * optional string username = 3; + * @return {string} + */ +proto.identity.unauth.AuthResponse.prototype.getUsername = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.unauth.AuthResponse} returns this + */ +proto.identity.unauth.AuthResponse.prototype.setUsername = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.OpaqueLoginStartRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.OpaqueLoginStartRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginStartRequest.toObject = function(includeInstance, msg) { var f, obj = { username: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueLoginRequest: msg.getOpaqueLoginRequest_asB64(), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f), force: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.OpaqueLoginStartRequest} */ proto.identity.unauth.OpaqueLoginStartRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.OpaqueLoginStartRequest; return proto.identity.unauth.OpaqueLoginStartRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.OpaqueLoginStartRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.OpaqueLoginStartRequest} */ proto.identity.unauth.OpaqueLoginStartRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueLoginRequest(value); break; case 3: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; case 4: var value = /** @type {boolean} */ (reader.readBool()); msg.setForce(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.OpaqueLoginStartRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.OpaqueLoginStartRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginStartRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUsername(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueLoginRequest_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); if (f != null) { writer.writeBool( 4, f ); } }; /** * optional string username = 1; * @return {string} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_login_request = 2; * @return {string} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getOpaqueLoginRequest = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_login_request = 2; * This is a type-conversion wrapper around `getOpaqueLoginRequest()` * @return {string} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getOpaqueLoginRequest_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueLoginRequest())); }; /** * optional bytes opaque_login_request = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueLoginRequest()` * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getOpaqueLoginRequest_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueLoginRequest())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.setOpaqueLoginRequest = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional DeviceKeyUpload device_key_upload = 3; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional bool force = 4; * @return {boolean} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.getForce = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); }; /** * @param {boolean} value * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.setForce = function(value) { return jspb.Message.setField(this, 4, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.OpaqueLoginStartRequest} returns this */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.clearForce = function() { return jspb.Message.setField(this, 4, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.OpaqueLoginStartRequest.prototype.hasForce = function() { return jspb.Message.getField(this, 4) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.OpaqueLoginFinishRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.OpaqueLoginFinishRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginFinishRequest.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueLoginUpload: msg.getOpaqueLoginUpload_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.OpaqueLoginFinishRequest} */ proto.identity.unauth.OpaqueLoginFinishRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.OpaqueLoginFinishRequest; return proto.identity.unauth.OpaqueLoginFinishRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.OpaqueLoginFinishRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.OpaqueLoginFinishRequest} */ proto.identity.unauth.OpaqueLoginFinishRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueLoginUpload(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.OpaqueLoginFinishRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.OpaqueLoginFinishRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginFinishRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueLoginUpload_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.OpaqueLoginFinishRequest} returns this */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_login_upload = 2; * @return {string} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.getOpaqueLoginUpload = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_login_upload = 2; * This is a type-conversion wrapper around `getOpaqueLoginUpload()` * @return {string} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.getOpaqueLoginUpload_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueLoginUpload())); }; /** * optional bytes opaque_login_upload = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueLoginUpload()` * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.getOpaqueLoginUpload_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueLoginUpload())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.OpaqueLoginFinishRequest} returns this */ proto.identity.unauth.OpaqueLoginFinishRequest.prototype.setOpaqueLoginUpload = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.OpaqueLoginStartResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.OpaqueLoginStartResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginStartResponse.toObject = function(includeInstance, msg) { var f, obj = { sessionId: jspb.Message.getFieldWithDefault(msg, 1, ""), opaqueLoginResponse: msg.getOpaqueLoginResponse_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.OpaqueLoginStartResponse} */ proto.identity.unauth.OpaqueLoginStartResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.OpaqueLoginStartResponse; return proto.identity.unauth.OpaqueLoginStartResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.OpaqueLoginStartResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.OpaqueLoginStartResponse} */ proto.identity.unauth.OpaqueLoginStartResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSessionId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOpaqueLoginResponse(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.OpaqueLoginStartResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.OpaqueLoginStartResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.OpaqueLoginStartResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSessionId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpaqueLoginResponse_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional string session_id = 1; * @return {string} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.getSessionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.OpaqueLoginStartResponse} returns this */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.setSessionId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes opaque_login_response = 2; * @return {string} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.getOpaqueLoginResponse = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes opaque_login_response = 2; * This is a type-conversion wrapper around `getOpaqueLoginResponse()` * @return {string} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.getOpaqueLoginResponse_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOpaqueLoginResponse())); }; /** * optional bytes opaque_login_response = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOpaqueLoginResponse()` * @return {!Uint8Array} */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.getOpaqueLoginResponse_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOpaqueLoginResponse())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.identity.unauth.OpaqueLoginStartResponse} returns this */ proto.identity.unauth.OpaqueLoginStartResponse.prototype.setOpaqueLoginResponse = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.WalletAuthRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.WalletAuthRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.WalletAuthRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.WalletAuthRequest.toObject = function(includeInstance, msg) { var f, obj = { siweMessage: jspb.Message.getFieldWithDefault(msg, 1, ""), siweSignature: jspb.Message.getFieldWithDefault(msg, 2, ""), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f), farcasterId: jspb.Message.getFieldWithDefault(msg, 4, ""), initialDeviceList: jspb.Message.getFieldWithDefault(msg, 5, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.WalletAuthRequest} */ proto.identity.unauth.WalletAuthRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.WalletAuthRequest; return proto.identity.unauth.WalletAuthRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.WalletAuthRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.WalletAuthRequest} */ proto.identity.unauth.WalletAuthRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSiweMessage(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSiweSignature(value); break; case 3: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setFarcasterId(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.WalletAuthRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.WalletAuthRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.WalletAuthRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.WalletAuthRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSiweMessage(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getSiweSignature(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } f = /** @type {string} */ (jspb.Message.getField(message, 4)); if (f != null) { writer.writeString( 4, f ); } f = message.getInitialDeviceList(); if (f.length > 0) { writer.writeString( 5, f ); } }; /** * optional string siwe_message = 1; * @return {string} */ proto.identity.unauth.WalletAuthRequest.prototype.getSiweMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.setSiweMessage = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string siwe_signature = 2; * @return {string} */ proto.identity.unauth.WalletAuthRequest.prototype.getSiweSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.setSiweSignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional DeviceKeyUpload device_key_upload = 3; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.WalletAuthRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.WalletAuthRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string farcaster_id = 4; * @return {string} */ proto.identity.unauth.WalletAuthRequest.prototype.getFarcasterId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.setFarcasterId = function(value) { return jspb.Message.setField(this, 4, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.clearFarcasterId = function() { return jspb.Message.setField(this, 4, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.WalletAuthRequest.prototype.hasFarcasterId = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional string initial_device_list = 5; * @return {string} */ proto.identity.unauth.WalletAuthRequest.prototype.getInitialDeviceList = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.WalletAuthRequest} returns this */ proto.identity.unauth.WalletAuthRequest.prototype.setInitialDeviceList = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.ReservedWalletRegistrationRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ReservedWalletRegistrationRequest.toObject = function(includeInstance, msg) { var f, obj = { siweMessage: jspb.Message.getFieldWithDefault(msg, 1, ""), siweSignature: jspb.Message.getFieldWithDefault(msg, 2, ""), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f), keyserverMessage: jspb.Message.getFieldWithDefault(msg, 4, ""), keyserverSignature: jspb.Message.getFieldWithDefault(msg, 5, ""), initialDeviceList: jspb.Message.getFieldWithDefault(msg, 6, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} */ proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.ReservedWalletRegistrationRequest; return proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} */ proto.identity.unauth.ReservedWalletRegistrationRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setSiweMessage(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSiweSignature(value); break; case 3: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setKeyserverMessage(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setKeyserverSignature(value); break; case 6: var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.ReservedWalletRegistrationRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.ReservedWalletRegistrationRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ReservedWalletRegistrationRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSiweMessage(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getSiweSignature(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 3, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } f = message.getKeyserverMessage(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getKeyserverSignature(); if (f.length > 0) { writer.writeString( 5, f ); } f = message.getInitialDeviceList(); if (f.length > 0) { writer.writeString( 6, f ); } }; /** * optional string siwe_message = 1; * @return {string} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getSiweMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setSiweMessage = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string siwe_signature = 2; * @return {string} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getSiweSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setSiweSignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional DeviceKeyUpload device_key_upload = 3; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 3)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string keyserver_message = 4; * @return {string} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getKeyserverMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setKeyserverMessage = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * optional string keyserver_signature = 5; * @return {string} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getKeyserverSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setKeyserverSignature = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; /** * optional string initial_device_list = 6; * @return {string} */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.getInitialDeviceList = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ReservedWalletRegistrationRequest} returns this */ proto.identity.unauth.ReservedWalletRegistrationRequest.prototype.setInitialDeviceList = function(value) { return jspb.Message.setProto3StringField(this, 6, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.SecondaryDeviceKeysUploadRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), nonce: jspb.Message.getFieldWithDefault(msg, 2, ""), nonceSignature: jspb.Message.getFieldWithDefault(msg, 3, ""), deviceKeyUpload: (f = msg.getDeviceKeyUpload()) && proto.identity.unauth.DeviceKeyUpload.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.SecondaryDeviceKeysUploadRequest; return proto.identity.unauth.SecondaryDeviceKeysUploadRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setNonce(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setNonceSignature(value); break; case 4: var value = new proto.identity.unauth.DeviceKeyUpload; reader.readMessage(value,proto.identity.unauth.DeviceKeyUpload.deserializeBinaryFromReader); msg.setDeviceKeyUpload(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.SecondaryDeviceKeysUploadRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getNonce(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getNonceSignature(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getDeviceKeyUpload(); if (f != null) { writer.writeMessage( 4, f, proto.identity.unauth.DeviceKeyUpload.serializeBinaryToWriter ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} returns this */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string nonce = 2; * @return {string} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.getNonce = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} returns this */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.setNonce = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string nonce_signature = 3; * @return {string} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.getNonceSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} returns this */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.setNonceSignature = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional DeviceKeyUpload device_key_upload = 4; * @return {?proto.identity.unauth.DeviceKeyUpload} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.getDeviceKeyUpload = function() { return /** @type{?proto.identity.unauth.DeviceKeyUpload} */ ( jspb.Message.getWrapperField(this, proto.identity.unauth.DeviceKeyUpload, 4)); }; /** * @param {?proto.identity.unauth.DeviceKeyUpload|undefined} value * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} returns this */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.setDeviceKeyUpload = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; /** * Clears the message field making it undefined. * @return {!proto.identity.unauth.SecondaryDeviceKeysUploadRequest} returns this */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.clearDeviceKeyUpload = function() { return this.setDeviceKeyUpload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.SecondaryDeviceKeysUploadRequest.prototype.hasDeviceKeyUpload = function() { return jspb.Message.getField(this, 4) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.ExistingDeviceLoginRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.ExistingDeviceLoginRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ExistingDeviceLoginRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), deviceId: jspb.Message.getFieldWithDefault(msg, 2, ""), nonce: jspb.Message.getFieldWithDefault(msg, 3, ""), nonceSignature: jspb.Message.getFieldWithDefault(msg, 4, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} */ proto.identity.unauth.ExistingDeviceLoginRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.ExistingDeviceLoginRequest; return proto.identity.unauth.ExistingDeviceLoginRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.ExistingDeviceLoginRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} */ proto.identity.unauth.ExistingDeviceLoginRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setDeviceId(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setNonce(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setNonceSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.ExistingDeviceLoginRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.ExistingDeviceLoginRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.ExistingDeviceLoginRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getDeviceId(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getNonce(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getNonceSignature(); if (f.length > 0) { writer.writeString( 4, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} returns this */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string device_id = 2; * @return {string} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.getDeviceId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} returns this */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.setDeviceId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string nonce = 3; * @return {string} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.getNonce = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} returns this */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.setNonce = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional string nonce_signature = 4; * @return {string} */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.getNonceSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.ExistingDeviceLoginRequest} returns this */ proto.identity.unauth.ExistingDeviceLoginRequest.prototype.setNonceSignature = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.GenerateNonceResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.GenerateNonceResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.GenerateNonceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GenerateNonceResponse.toObject = function(includeInstance, msg) { var f, obj = { nonce: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.GenerateNonceResponse} */ proto.identity.unauth.GenerateNonceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.GenerateNonceResponse; return proto.identity.unauth.GenerateNonceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.GenerateNonceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.GenerateNonceResponse} */ proto.identity.unauth.GenerateNonceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setNonce(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.GenerateNonceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.GenerateNonceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.GenerateNonceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GenerateNonceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNonce(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string nonce = 1; * @return {string} */ proto.identity.unauth.GenerateNonceResponse.prototype.getNonce = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.GenerateNonceResponse} returns this */ proto.identity.unauth.GenerateNonceResponse.prototype.setNonce = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.VerifyUserAccessTokenRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.VerifyUserAccessTokenRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.VerifyUserAccessTokenRequest.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), deviceId: jspb.Message.getFieldWithDefault(msg, 2, ""), accessToken: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.VerifyUserAccessTokenRequest} */ proto.identity.unauth.VerifyUserAccessTokenRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.VerifyUserAccessTokenRequest; return proto.identity.unauth.VerifyUserAccessTokenRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.VerifyUserAccessTokenRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.VerifyUserAccessTokenRequest} */ proto.identity.unauth.VerifyUserAccessTokenRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setDeviceId(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setAccessToken(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.VerifyUserAccessTokenRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.VerifyUserAccessTokenRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.VerifyUserAccessTokenRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getDeviceId(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getAccessToken(); if (f.length > 0) { writer.writeString( 3, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.VerifyUserAccessTokenRequest} returns this */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string device_id = 2; * @return {string} */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.getDeviceId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.VerifyUserAccessTokenRequest} returns this */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.setDeviceId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string access_token = 3; * @return {string} */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.getAccessToken = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.VerifyUserAccessTokenRequest} returns this */ proto.identity.unauth.VerifyUserAccessTokenRequest.prototype.setAccessToken = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.VerifyUserAccessTokenResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.VerifyUserAccessTokenResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.VerifyUserAccessTokenResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.VerifyUserAccessTokenResponse.toObject = function(includeInstance, msg) { var f, obj = { tokenValid: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.VerifyUserAccessTokenResponse} */ proto.identity.unauth.VerifyUserAccessTokenResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.VerifyUserAccessTokenResponse; return proto.identity.unauth.VerifyUserAccessTokenResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.VerifyUserAccessTokenResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.VerifyUserAccessTokenResponse} */ proto.identity.unauth.VerifyUserAccessTokenResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {boolean} */ (reader.readBool()); msg.setTokenValid(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.VerifyUserAccessTokenResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.VerifyUserAccessTokenResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.VerifyUserAccessTokenResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.VerifyUserAccessTokenResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getTokenValid(); if (f) { writer.writeBool( 1, f ); } }; /** * optional bool token_valid = 1; * @return {boolean} */ proto.identity.unauth.VerifyUserAccessTokenResponse.prototype.getTokenValid = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); }; /** * @param {boolean} value * @return {!proto.identity.unauth.VerifyUserAccessTokenResponse} returns this */ proto.identity.unauth.VerifyUserAccessTokenResponse.prototype.setTokenValid = function(value) { return jspb.Message.setProto3BooleanField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.AddReservedUsernamesRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.AddReservedUsernamesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.AddReservedUsernamesRequest.toObject = function(includeInstance, msg) { var f, obj = { message: jspb.Message.getFieldWithDefault(msg, 1, ""), signature: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.AddReservedUsernamesRequest} */ proto.identity.unauth.AddReservedUsernamesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.AddReservedUsernamesRequest; return proto.identity.unauth.AddReservedUsernamesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.AddReservedUsernamesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.AddReservedUsernamesRequest} */ proto.identity.unauth.AddReservedUsernamesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setMessage(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.AddReservedUsernamesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.AddReservedUsernamesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.AddReservedUsernamesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMessage(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getSignature(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional string message = 1; * @return {string} */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.getMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.AddReservedUsernamesRequest} returns this */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.setMessage = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string signature = 2; * @return {string} */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.getSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.AddReservedUsernamesRequest} returns this */ proto.identity.unauth.AddReservedUsernamesRequest.prototype.setSignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.RemoveReservedUsernameRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.RemoveReservedUsernameRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RemoveReservedUsernameRequest.toObject = function(includeInstance, msg) { var f, obj = { message: jspb.Message.getFieldWithDefault(msg, 1, ""), signature: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.RemoveReservedUsernameRequest} */ proto.identity.unauth.RemoveReservedUsernameRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.RemoveReservedUsernameRequest; return proto.identity.unauth.RemoveReservedUsernameRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.RemoveReservedUsernameRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.RemoveReservedUsernameRequest} */ proto.identity.unauth.RemoveReservedUsernameRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setMessage(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.RemoveReservedUsernameRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.RemoveReservedUsernameRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.RemoveReservedUsernameRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMessage(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getSignature(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional string message = 1; * @return {string} */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.getMessage = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RemoveReservedUsernameRequest} returns this */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.setMessage = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string signature = 2; * @return {string} */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.getSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.RemoveReservedUsernameRequest} returns this */ proto.identity.unauth.RemoveReservedUsernameRequest.prototype.setSignature = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array>} * @const */ proto.identity.unauth.FindUserIDRequest.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.identity.unauth.FindUserIDRequest.IdentifierCase = { IDENTIFIER_NOT_SET: 0, USERNAME: 1, WALLET_ADDRESS: 2 }; /** * @return {proto.identity.unauth.FindUserIDRequest.IdentifierCase} */ proto.identity.unauth.FindUserIDRequest.prototype.getIdentifierCase = function() { return /** @type {proto.identity.unauth.FindUserIDRequest.IdentifierCase} */(jspb.Message.computeOneofCase(this, proto.identity.unauth.FindUserIDRequest.oneofGroups_[0])); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.FindUserIDRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.FindUserIDRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.FindUserIDRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FindUserIDRequest.toObject = function(includeInstance, msg) { var f, obj = { username: jspb.Message.getFieldWithDefault(msg, 1, ""), walletAddress: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.FindUserIDRequest} */ proto.identity.unauth.FindUserIDRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.FindUserIDRequest; return proto.identity.unauth.FindUserIDRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.FindUserIDRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.FindUserIDRequest} */ proto.identity.unauth.FindUserIDRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setWalletAddress(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.FindUserIDRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.FindUserIDRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.FindUserIDRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FindUserIDRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { writer.writeString( 1, f ); } f = /** @type {string} */ (jspb.Message.getField(message, 2)); if (f != null) { writer.writeString( 2, f ); } }; /** * optional string username = 1; * @return {string} */ proto.identity.unauth.FindUserIDRequest.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FindUserIDRequest} returns this */ proto.identity.unauth.FindUserIDRequest.prototype.setUsername = function(value) { return jspb.Message.setOneofField(this, 1, proto.identity.unauth.FindUserIDRequest.oneofGroups_[0], value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.FindUserIDRequest} returns this */ proto.identity.unauth.FindUserIDRequest.prototype.clearUsername = function() { return jspb.Message.setOneofField(this, 1, proto.identity.unauth.FindUserIDRequest.oneofGroups_[0], undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.FindUserIDRequest.prototype.hasUsername = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional string wallet_address = 2; * @return {string} */ proto.identity.unauth.FindUserIDRequest.prototype.getWalletAddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FindUserIDRequest} returns this */ proto.identity.unauth.FindUserIDRequest.prototype.setWalletAddress = function(value) { return jspb.Message.setOneofField(this, 2, proto.identity.unauth.FindUserIDRequest.oneofGroups_[0], value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.FindUserIDRequest} returns this */ proto.identity.unauth.FindUserIDRequest.prototype.clearWalletAddress = function() { return jspb.Message.setOneofField(this, 2, proto.identity.unauth.FindUserIDRequest.oneofGroups_[0], undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.FindUserIDRequest.prototype.hasWalletAddress = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.FindUserIDResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.FindUserIDResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.FindUserIDResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FindUserIDResponse.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), isReserved: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.FindUserIDResponse} */ proto.identity.unauth.FindUserIDResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.FindUserIDResponse; return proto.identity.unauth.FindUserIDResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.FindUserIDResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.FindUserIDResponse} */ proto.identity.unauth.FindUserIDResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); msg.setIsReserved(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.FindUserIDResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.FindUserIDResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.FindUserIDResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FindUserIDResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { writer.writeString( 1, f ); } f = message.getIsReserved(); if (f) { writer.writeBool( 2, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.FindUserIDResponse.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FindUserIDResponse} returns this */ proto.identity.unauth.FindUserIDResponse.prototype.setUserId = function(value) { return jspb.Message.setField(this, 1, value); }; /** * Clears the field making it undefined. * @return {!proto.identity.unauth.FindUserIDResponse} returns this */ proto.identity.unauth.FindUserIDResponse.prototype.clearUserId = function() { return jspb.Message.setField(this, 1, undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.identity.unauth.FindUserIDResponse.prototype.hasUserId = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional bool is_reserved = 2; * @return {boolean} */ proto.identity.unauth.FindUserIDResponse.prototype.getIsReserved = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value * @return {!proto.identity.unauth.FindUserIDResponse} returns this */ proto.identity.unauth.FindUserIDResponse.prototype.setIsReserved = function(value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.identity.unauth.GetFarcasterUsersRequest.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.GetFarcasterUsersRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.GetFarcasterUsersRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GetFarcasterUsersRequest.toObject = function(includeInstance, msg) { var f, obj = { farcasterIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.GetFarcasterUsersRequest} */ proto.identity.unauth.GetFarcasterUsersRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.GetFarcasterUsersRequest; return proto.identity.unauth.GetFarcasterUsersRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.GetFarcasterUsersRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.GetFarcasterUsersRequest} */ proto.identity.unauth.GetFarcasterUsersRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.addFarcasterIds(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.GetFarcasterUsersRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.GetFarcasterUsersRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GetFarcasterUsersRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getFarcasterIdsList(); if (f.length > 0) { writer.writeRepeatedString( 1, f ); } }; /** * repeated string farcaster_ids = 1; * @return {!Array} */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.getFarcasterIdsList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** * @param {!Array} value * @return {!proto.identity.unauth.GetFarcasterUsersRequest} returns this */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.setFarcasterIdsList = function(value) { return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.identity.unauth.GetFarcasterUsersRequest} returns this */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.addFarcasterIds = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.unauth.GetFarcasterUsersRequest} returns this */ proto.identity.unauth.GetFarcasterUsersRequest.prototype.clearFarcasterIdsList = function() { return this.setFarcasterIdsList([]); }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.identity.unauth.GetFarcasterUsersResponse.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.GetFarcasterUsersResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.GetFarcasterUsersResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GetFarcasterUsersResponse.toObject = function(includeInstance, msg) { var f, obj = { farcasterUsersList: jspb.Message.toObjectList(msg.getFarcasterUsersList(), proto.identity.unauth.FarcasterUser.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.GetFarcasterUsersResponse} */ proto.identity.unauth.GetFarcasterUsersResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.GetFarcasterUsersResponse; return proto.identity.unauth.GetFarcasterUsersResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.GetFarcasterUsersResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.GetFarcasterUsersResponse} */ proto.identity.unauth.GetFarcasterUsersResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.identity.unauth.FarcasterUser; reader.readMessage(value,proto.identity.unauth.FarcasterUser.deserializeBinaryFromReader); msg.addFarcasterUsers(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.GetFarcasterUsersResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.GetFarcasterUsersResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.GetFarcasterUsersResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getFarcasterUsersList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.identity.unauth.FarcasterUser.serializeBinaryToWriter ); } }; /** * repeated FarcasterUser farcaster_users = 1; * @return {!Array} */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.getFarcasterUsersList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.identity.unauth.FarcasterUser, 1)); }; /** * @param {!Array} value * @return {!proto.identity.unauth.GetFarcasterUsersResponse} returns this */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.setFarcasterUsersList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** * @param {!proto.identity.unauth.FarcasterUser=} opt_value * @param {number=} opt_index * @return {!proto.identity.unauth.FarcasterUser} */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.addFarcasterUsers = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.identity.unauth.FarcasterUser, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.identity.unauth.GetFarcasterUsersResponse} returns this */ proto.identity.unauth.GetFarcasterUsersResponse.prototype.clearFarcasterUsersList = function() { return this.setFarcasterUsersList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.identity.unauth.FarcasterUser.prototype.toObject = function(opt_includeInstance) { return proto.identity.unauth.FarcasterUser.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.identity.unauth.FarcasterUser} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FarcasterUser.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), farcasterId: jspb.Message.getFieldWithDefault(msg, 2, ""), username: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.identity.unauth.FarcasterUser} */ proto.identity.unauth.FarcasterUser.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.identity.unauth.FarcasterUser; return proto.identity.unauth.FarcasterUser.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.identity.unauth.FarcasterUser} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.identity.unauth.FarcasterUser} */ proto.identity.unauth.FarcasterUser.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setUserId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setFarcasterId(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setUsername(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.identity.unauth.FarcasterUser.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.identity.unauth.FarcasterUser.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.identity.unauth.FarcasterUser} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.identity.unauth.FarcasterUser.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getFarcasterId(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getUsername(); if (f.length > 0) { writer.writeString( 3, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.identity.unauth.FarcasterUser.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FarcasterUser} returns this */ proto.identity.unauth.FarcasterUser.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string farcaster_id = 2; * @return {string} */ proto.identity.unauth.FarcasterUser.prototype.getFarcasterId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FarcasterUser} returns this */ proto.identity.unauth.FarcasterUser.prototype.setFarcasterId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string username = 3; * @return {string} */ proto.identity.unauth.FarcasterUser.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.identity.unauth.FarcasterUser} returns this */ proto.identity.unauth.FarcasterUser.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * @enum {number} */ proto.identity.unauth.DeviceType = { KEYSERVER: 0, WEB: 1, IOS: 2, ANDROID: 3, WINDOWS: 4, MAC_OS: 5 }; goog.object.extend(exports, proto.identity.unauth); diff --git a/web/protobufs/identity-unauth-structs.cjs.flow b/web/protobufs/identity-unauth-structs.cjs.flow index e3d9bb3a8..f5e9256cc 100644 --- a/web/protobufs/identity-unauth-structs.cjs.flow +++ b/web/protobufs/identity-unauth-structs.cjs.flow @@ -1,659 +1,663 @@ // @flow import { Message, BinaryWriter, BinaryReader, Map as ProtoMap, } from 'google-protobuf'; declare export class Empty extends Message { serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): {}; static toObject(includeInstance: boolean, msg: Empty): {}; static serializeBinaryToWriter(message: Empty, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Empty; static deserializeBinaryFromReader(message: Empty, reader: BinaryReader): Empty; } export type PrekeyObject = { prekey: string, prekeySignature: string, } declare export class Prekey extends Message { getPrekey(): string; setPrekey(value: string): Prekey; getPrekeySignature(): string; setPrekeySignature(value: string): Prekey; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): PrekeyObject; static toObject(includeInstance: boolean, msg: Prekey): PrekeyObject; static serializeBinaryToWriter(message: Prekey, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Prekey; static deserializeBinaryFromReader(message: Prekey, reader: BinaryReader): Prekey; } export type IdentityKeyInfoObject = { payload: string, payloadSignature: string, }; declare export class IdentityKeyInfo extends Message { getPayload(): string; setPayload(value: string): IdentityKeyInfo; getPayloadSignature(): string; setPayloadSignature(value: string): IdentityKeyInfo; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): IdentityKeyInfoObject; static toObject(includeInstance: boolean, msg: IdentityKeyInfo): IdentityKeyInfoObject; static serializeBinaryToWriter(message: IdentityKeyInfo, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): IdentityKeyInfo; static deserializeBinaryFromReader(message: IdentityKeyInfo, reader: BinaryReader): IdentityKeyInfo; } declare export class DeviceKeyUpload extends Message { getDeviceKeyInfo(): IdentityKeyInfo | void; setDeviceKeyInfo(value?: IdentityKeyInfo): DeviceKeyUpload; hasDeviceKeyInfo(): boolean; clearDeviceKeyInfo(): DeviceKeyUpload; getContentUpload(): Prekey | void; setContentUpload(value?: Prekey): DeviceKeyUpload; hasContentUpload(): boolean; clearContentUpload(): DeviceKeyUpload; getNotifUpload(): Prekey | void; setNotifUpload(value?: Prekey): DeviceKeyUpload; hasNotifUpload(): boolean; clearNotifUpload(): DeviceKeyUpload; getOneTimeContentPrekeysList(): Array; setOneTimeContentPrekeysList(value: Array): DeviceKeyUpload; clearOneTimeContentPrekeysList(): DeviceKeyUpload; addOneTimeContentPrekeys(value: string, index?: number): DeviceKeyUpload; getOneTimeNotifPrekeysList(): Array; setOneTimeNotifPrekeysList(value: Array): DeviceKeyUpload; clearOneTimeNotifPrekeysList(): DeviceKeyUpload; addOneTimeNotifPrekeys(value: string, index?: number): DeviceKeyUpload; getDeviceType(): DeviceType; setDeviceType(value: DeviceType): DeviceKeyUpload; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DeviceKeyUploadObject; static toObject(includeInstance: boolean, msg: DeviceKeyUpload): DeviceKeyUploadObject; static serializeBinaryToWriter(message: DeviceKeyUpload, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): DeviceKeyUpload; static deserializeBinaryFromReader(message: DeviceKeyUpload, reader: BinaryReader): DeviceKeyUpload; } export type DeviceKeyUploadObject = { deviceKeyInfo?: IdentityKeyInfoObject, contentUpload?: PrekeyObject, notifUpload?: PrekeyObject, oneTimeContentPrekeysList: Array, oneTimeNotifPrekeysList: Array, deviceType: DeviceType, }; declare export class RegistrationStartRequest extends Message { getOpaqueRegistrationRequest(): Uint8Array | string; getOpaqueRegistrationRequest_asU8(): Uint8Array; getOpaqueRegistrationRequest_asB64(): string; setOpaqueRegistrationRequest(value: Uint8Array | string): RegistrationStartRequest; getUsername(): string; setUsername(value: string): RegistrationStartRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): RegistrationStartRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): RegistrationStartRequest; getFarcasterId(): string; setFarcasterId(value: string): RegistrationStartRequest; hasFarcasterId(): boolean; clearFarcasterId(): RegistrationStartRequest; getInitialDeviceList(): string; setInitialDeviceList(value: string): RegistrationStartRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RegistrationStartRequestObject; static toObject(includeInstance: boolean, msg: RegistrationStartRequest): RegistrationStartRequestObject; static serializeBinaryToWriter(message: RegistrationStartRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): RegistrationStartRequest; static deserializeBinaryFromReader(message: RegistrationStartRequest, reader: BinaryReader): RegistrationStartRequest; } export type RegistrationStartRequestObject = { opaqueRegistrationRequest: Uint8Array | string, username: string, deviceKeyUpload?: DeviceKeyUploadObject, farcasterId?: string, initialDeviceList: string, }; declare export class ReservedRegistrationStartRequest extends Message { getOpaqueRegistrationRequest(): Uint8Array | string; getOpaqueRegistrationRequest_asU8(): Uint8Array; getOpaqueRegistrationRequest_asB64(): string; setOpaqueRegistrationRequest(value: Uint8Array | string): ReservedRegistrationStartRequest; getUsername(): string; setUsername(value: string): ReservedRegistrationStartRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): ReservedRegistrationStartRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): ReservedRegistrationStartRequest; getKeyserverMessage(): string; setKeyserverMessage(value: string): ReservedRegistrationStartRequest; getKeyserverSignature(): string; setKeyserverSignature(value: string): ReservedRegistrationStartRequest; getInitialDeviceList(): string; setInitialDeviceList(value: string): ReservedRegistrationStartRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ReservedRegistrationStartRequestObject; static toObject(includeInstance: boolean, msg: ReservedRegistrationStartRequest): ReservedRegistrationStartRequestObject; static serializeBinaryToWriter(message: ReservedRegistrationStartRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): ReservedRegistrationStartRequest; static deserializeBinaryFromReader(message: ReservedRegistrationStartRequest, reader: BinaryReader): ReservedRegistrationStartRequest; } export type ReservedRegistrationStartRequestObject = { opaqueRegistrationRequest: Uint8Array | string, username: string, deviceKeyUpload?: DeviceKeyUploadObject, keyserverMessage: string, keyserverSignature: string, initialDeviceList: string, }; declare export class RegistrationFinishRequest extends Message { getSessionid(): string; setSessionid(value: string): RegistrationFinishRequest; getOpaqueregistrationupload(): Uint8Array | string; getOpaqueregistrationupload_asU8(): Uint8Array; getOpaqueregistrationupload_asB64(): string; setOpaqueregistrationupload(value: Uint8Array | string): RegistrationFinishRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RegistrationFinishRequestObject; static toObject(includeInstance: boolean, msg: RegistrationFinishRequest): RegistrationFinishRequestObject; static serializeBinaryToWriter(message: RegistrationFinishRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): RegistrationFinishRequest; static deserializeBinaryFromReader(message: RegistrationFinishRequest, reader: BinaryReader): RegistrationFinishRequest; } export type RegistrationFinishRequestObject = { sessionid: string, opaqueregistrationupload: Uint8Array | string, }; declare export class RegistrationStartResponse extends Message { getSessionId(): string; setSessionId(value: string): RegistrationStartResponse; getOpaqueRegistrationResponse(): Uint8Array | string; getOpaqueRegistrationResponse_asU8(): Uint8Array; getOpaqueRegistrationResponse_asB64(): string; setOpaqueRegistrationResponse(value: Uint8Array | string): RegistrationStartResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RegistrationStartResponseObject; static toObject(includeInstance: boolean, msg: RegistrationStartResponse): RegistrationStartResponseObject; static serializeBinaryToWriter(message: RegistrationStartResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): RegistrationStartResponse; static deserializeBinaryFromReader(message: RegistrationStartResponse, reader: BinaryReader): RegistrationStartResponse; } export type RegistrationStartResponseObject = { sessionId: string, opaqueRegistrationResponse: Uint8Array | string, }; declare export class AuthResponse extends Message { getUserId(): string; setUserId(value: string): AuthResponse; getAccessToken(): string; setAccessToken(value: string): AuthResponse; + getUsername(): string; + setUsername(value: string): AuthResponse; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): AuthResponseObject; static toObject(includeInstance: boolean, msg: AuthResponse): AuthResponseObject; static serializeBinaryToWriter(message: AuthResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): AuthResponse; static deserializeBinaryFromReader(message: AuthResponse, reader: BinaryReader): AuthResponse; } export type AuthResponseObject = { userId: string, accessToken: string, + username: string, }; declare export class OpaqueLoginStartRequest extends Message { getUsername(): string; setUsername(value: string): OpaqueLoginStartRequest; getOpaqueLoginRequest(): Uint8Array | string; getOpaqueLoginRequest_asU8(): Uint8Array; getOpaqueLoginRequest_asB64(): string; setOpaqueLoginRequest(value: Uint8Array | string): OpaqueLoginStartRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): OpaqueLoginStartRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): OpaqueLoginStartRequest; getForce(): boolean; setForce(value: boolean): OpaqueLoginStartRequest; hasForce(): boolean; clearForce(): OpaqueLoginStartRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OpaqueLoginStartRequestObject; static toObject(includeInstance: boolean, msg: OpaqueLoginStartRequest): OpaqueLoginStartRequestObject; static serializeBinaryToWriter(message: OpaqueLoginStartRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OpaqueLoginStartRequest; static deserializeBinaryFromReader(message: OpaqueLoginStartRequest, reader: BinaryReader): OpaqueLoginStartRequest; } export type OpaqueLoginStartRequestObject = { username: string, opaqueLoginRequest: Uint8Array | string, deviceKeyUpload?: DeviceKeyUploadObject, force?: boolean, }; declare export class OpaqueLoginFinishRequest extends Message { getSessionId(): string; setSessionId(value: string): OpaqueLoginFinishRequest; getOpaqueLoginUpload(): Uint8Array | string; getOpaqueLoginUpload_asU8(): Uint8Array; getOpaqueLoginUpload_asB64(): string; setOpaqueLoginUpload(value: Uint8Array | string): OpaqueLoginFinishRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OpaqueLoginFinishRequestObject; static toObject(includeInstance: boolean, msg: OpaqueLoginFinishRequest): OpaqueLoginFinishRequestObject; static serializeBinaryToWriter(message: OpaqueLoginFinishRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OpaqueLoginFinishRequest; static deserializeBinaryFromReader(message: OpaqueLoginFinishRequest, reader: BinaryReader): OpaqueLoginFinishRequest; } export type OpaqueLoginFinishRequestObject = { sessionId: string, opaqueLoginUpload: Uint8Array | string, }; declare export class OpaqueLoginStartResponse extends Message { getSessionId(): string; setSessionId(value: string): OpaqueLoginStartResponse; getOpaqueLoginResponse(): Uint8Array | string; getOpaqueLoginResponse_asU8(): Uint8Array; getOpaqueLoginResponse_asB64(): string; setOpaqueLoginResponse(value: Uint8Array | string): OpaqueLoginStartResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OpaqueLoginStartResponseObject; static toObject(includeInstance: boolean, msg: OpaqueLoginStartResponse): OpaqueLoginStartResponseObject; static serializeBinaryToWriter(message: OpaqueLoginStartResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): OpaqueLoginStartResponse; static deserializeBinaryFromReader(message: OpaqueLoginStartResponse, reader: BinaryReader): OpaqueLoginStartResponse; } export type OpaqueLoginStartResponseObject = { sessionId: string, opaqueLoginResponse: Uint8Array | string, }; declare export class WalletAuthRequest extends Message { getSiweMessage(): string; setSiweMessage(value: string): WalletAuthRequest; getSiweSignature(): string; setSiweSignature(value: string): WalletAuthRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): WalletAuthRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): WalletAuthRequest; getFarcasterId(): string; setFarcasterId(value: string): WalletAuthRequest; hasFarcasterId(): boolean; clearFarcasterId(): WalletAuthRequest; getInitialDeviceList(): string; setInitialDeviceList(value: string): WalletAuthRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): WalletAuthRequestObject; static toObject(includeInstance: boolean, msg: WalletAuthRequest): WalletAuthRequestObject; static serializeBinaryToWriter(message: WalletAuthRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): WalletAuthRequest; static deserializeBinaryFromReader(message: WalletAuthRequest, reader: BinaryReader): WalletAuthRequest; } export type WalletAuthRequestObject = { siweMessage: string, siweSignature: string, deviceKeyUpload?: DeviceKeyUploadObject, farcasterId?: string, initialDeviceList: string, }; declare export class ReservedWalletRegistrationRequest extends Message { getSiweMessage(): string; setSiweMessage(value: string): ReservedWalletRegistrationRequest; getSiweSignature(): string; setSiweSignature(value: string): ReservedWalletRegistrationRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): ReservedWalletRegistrationRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): ReservedWalletRegistrationRequest; getKeyserverMessage(): string; setKeyserverMessage(value: string): ReservedWalletRegistrationRequest; getKeyserverSignature(): string; setKeyserverSignature(value: string): ReservedWalletRegistrationRequest; getInitialDeviceList(): string; setInitialDeviceList(value: string): ReservedWalletRegistrationRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ReservedWalletRegistrationRequestObject; static toObject(includeInstance: boolean, msg: ReservedWalletRegistrationRequest): ReservedWalletRegistrationRequestObject; static serializeBinaryToWriter(message: ReservedWalletRegistrationRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): ReservedWalletRegistrationRequest; static deserializeBinaryFromReader(message: ReservedWalletRegistrationRequest, reader: BinaryReader): ReservedWalletRegistrationRequest; } export type ReservedWalletRegistrationRequestObject = { siweMessage: string, siweSignature: string, deviceKeyUpload?: DeviceKeyUploadObject, keyserverMessage: string, keyserverSignature: string, initialDeviceList: string, }; declare export class SecondaryDeviceKeysUploadRequest extends Message { getUserId(): string; setUserId(value: string): SecondaryDeviceKeysUploadRequest; getNonce(): string; setNonce(value: string): SecondaryDeviceKeysUploadRequest; getNonceSignature(): string; setNonceSignature(value: string): SecondaryDeviceKeysUploadRequest; getDeviceKeyUpload(): DeviceKeyUpload | void; setDeviceKeyUpload(value?: DeviceKeyUpload): SecondaryDeviceKeysUploadRequest; hasDeviceKeyUpload(): boolean; clearDeviceKeyUpload(): SecondaryDeviceKeysUploadRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SecondaryDeviceKeysUploadRequestObject; static toObject(includeInstance: boolean, msg: SecondaryDeviceKeysUploadRequest): SecondaryDeviceKeysUploadRequestObject; static serializeBinaryToWriter(message: SecondaryDeviceKeysUploadRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): SecondaryDeviceKeysUploadRequest; static deserializeBinaryFromReader(message: SecondaryDeviceKeysUploadRequest, reader: BinaryReader): SecondaryDeviceKeysUploadRequest; } export type SecondaryDeviceKeysUploadRequestObject = { userId: string, nonce: string, nonceSignature: string, deviceKeyUpload?: DeviceKeyUploadObject, } declare export class ExistingDeviceLoginRequest extends Message { getUserId(): string; setUserId(value: string): ExistingDeviceLoginRequest; getDeviceId(): string; setDeviceId(value: string): ExistingDeviceLoginRequest; getNonce(): string; setNonce(value: string): ExistingDeviceLoginRequest; getNonceSignature(): string; setNonceSignature(value: string): ExistingDeviceLoginRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ExistingDeviceLoginRequestObject; static toObject(includeInstance: boolean, msg: ExistingDeviceLoginRequest): ExistingDeviceLoginRequestObject; static serializeBinaryToWriter(message: ExistingDeviceLoginRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): ExistingDeviceLoginRequest; static deserializeBinaryFromReader(message: ExistingDeviceLoginRequest, reader: BinaryReader): ExistingDeviceLoginRequest; } export type ExistingDeviceLoginRequestObject = { userId: string, deviceId: string, nonce: string, nonceSignature: string, } declare export class GenerateNonceResponse extends Message { getNonce(): string; setNonce(value: string): GenerateNonceResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GenerateNonceResponseObject; static toObject(includeInstance: boolean, msg: GenerateNonceResponse): GenerateNonceResponseObject; static serializeBinaryToWriter(message: GenerateNonceResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): GenerateNonceResponse; static deserializeBinaryFromReader(message: GenerateNonceResponse, reader: BinaryReader): GenerateNonceResponse; } export type GenerateNonceResponseObject = { nonce: string, }; declare export class VerifyUserAccessTokenRequest extends Message { getUserId(): string; setUserId(value: string): VerifyUserAccessTokenRequest; getDeviceId(): string; setDeviceId(value: string): VerifyUserAccessTokenRequest; getAccessToken(): string; setAccessToken(value: string): VerifyUserAccessTokenRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifyUserAccessTokenRequestObject; static toObject(includeInstance: boolean, msg: VerifyUserAccessTokenRequest): VerifyUserAccessTokenRequestObject; static serializeBinaryToWriter(message: VerifyUserAccessTokenRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): VerifyUserAccessTokenRequest; static deserializeBinaryFromReader(message: VerifyUserAccessTokenRequest, reader: BinaryReader): VerifyUserAccessTokenRequest; } export type VerifyUserAccessTokenRequestObject = { userId: string, deviceId: string, accessToken: string, }; declare export class VerifyUserAccessTokenResponse extends Message { getTokenValid(): boolean; setTokenValid(value: boolean): VerifyUserAccessTokenResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifyUserAccessTokenResponseObject; static toObject(includeInstance: boolean, msg: VerifyUserAccessTokenResponse): VerifyUserAccessTokenResponseObject; static serializeBinaryToWriter(message: VerifyUserAccessTokenResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): VerifyUserAccessTokenResponse; static deserializeBinaryFromReader(message: VerifyUserAccessTokenResponse, reader: BinaryReader): VerifyUserAccessTokenResponse; } export type VerifyUserAccessTokenResponseObject = { tokenValid: boolean, }; declare export class AddReservedUsernamesRequest extends Message { getMessage(): string; setMessage(value: string): AddReservedUsernamesRequest; getSignature(): string; setSignature(value: string): AddReservedUsernamesRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): AddReservedUsernamesRequestObject; static toObject(includeInstance: boolean, msg: AddReservedUsernamesRequest): AddReservedUsernamesRequestObject; static serializeBinaryToWriter(message: AddReservedUsernamesRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): AddReservedUsernamesRequest; static deserializeBinaryFromReader(message: AddReservedUsernamesRequest, reader: BinaryReader): AddReservedUsernamesRequest; } export type AddReservedUsernamesRequestObject = { message: string, signature: string, }; declare export class RemoveReservedUsernameRequest extends Message { getMessage(): string; setMessage(value: string): RemoveReservedUsernameRequest; getSignature(): string; setSignature(value: string): RemoveReservedUsernameRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RemoveReservedUsernameRequestObject; static toObject(includeInstance: boolean, msg: RemoveReservedUsernameRequest): RemoveReservedUsernameRequestObject; static serializeBinaryToWriter(message: RemoveReservedUsernameRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): RemoveReservedUsernameRequest; static deserializeBinaryFromReader(message: RemoveReservedUsernameRequest, reader: BinaryReader): RemoveReservedUsernameRequest; } export type RemoveReservedUsernameRequestObject = { message: string, signature: string, }; export type IdentifierCase = 0 | 1 | 2; declare export class FindUserIDRequest extends Message { getUsername(): string; setUsername(value: string): FindUserIDRequest; getWalletAddress(): string; setWalletAddress(value: string): FindUserIDRequest; getIdentifierCase(): IdentifierCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): FindUserIDRequestObject; static toObject(includeInstance: boolean, msg: FindUserIDRequest): FindUserIDRequestObject; static serializeBinaryToWriter(message: FindUserIDRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): FindUserIDRequest; static deserializeBinaryFromReader(message: FindUserIDRequest, reader: BinaryReader): FindUserIDRequest; } export type FindUserIDRequestObject = { username: string, walletAddress: string, } declare export class FindUserIDResponse extends Message { getUserId(): string; setUserId(value: string): FindUserIDResponse; hasUserId(): boolean; clearUserId(): FindUserIDResponse; getIsReserved(): boolean; setIsReserved(value: boolean): FindUserIDResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): FindUserIDResponseObject; static toObject(includeInstance: boolean, msg: FindUserIDResponse): FindUserIDResponseObject; static serializeBinaryToWriter(message: FindUserIDResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): FindUserIDResponse; static deserializeBinaryFromReader(message: FindUserIDResponse, reader: BinaryReader): FindUserIDResponse; } export type FindUserIDResponseObject = { userId?: string, isReserved: boolean, } declare export class GetFarcasterUsersRequest extends Message { getFarcasterIdsList(): Array; setFarcasterIdsList(value: Array): GetFarcasterUsersRequest; clearFarcasterIdsList(): GetFarcasterUsersRequest; addFarcasterIds(value: string, index?: number): GetFarcasterUsersRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetFarcasterUsersRequestObject; static toObject(includeInstance: boolean, msg: GetFarcasterUsersRequest): GetFarcasterUsersRequestObject; static serializeBinaryToWriter(message: GetFarcasterUsersRequest, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): GetFarcasterUsersRequest; static deserializeBinaryFromReader(message: GetFarcasterUsersRequest, reader: BinaryReader): GetFarcasterUsersRequest; } export type GetFarcasterUsersRequestObject = { farcasterIdsList: Array, } declare export class GetFarcasterUsersResponse extends Message { getFarcasterUsersList(): Array; setFarcasterUsersList(value: Array): GetFarcasterUsersResponse; clearFarcasterUsersList(): GetFarcasterUsersResponse; addFarcasterUsers(value?: FarcasterUser, index?: number): FarcasterUser; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetFarcasterUsersResponseObject; static toObject(includeInstance: boolean, msg: GetFarcasterUsersResponse): GetFarcasterUsersResponseObject; static serializeBinaryToWriter(message: GetFarcasterUsersResponse, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): GetFarcasterUsersResponse; static deserializeBinaryFromReader(message: GetFarcasterUsersResponse, reader: BinaryReader): GetFarcasterUsersResponse; } export type GetFarcasterUsersResponseObject = { farcasterUsersList: Array, } declare export class FarcasterUser extends Message { getUserId(): string; setUserId(value: string): FarcasterUser; getFarcasterId(): string; setFarcasterId(value: string): FarcasterUser; getUsername(): string; setUsername(value: string): FarcasterUser; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): FarcasterUserObject; static toObject(includeInstance: boolean, msg: FarcasterUser): FarcasterUserObject; static serializeBinaryToWriter(message: FarcasterUser, writer: BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): FarcasterUser; static deserializeBinaryFromReader(message: FarcasterUser, reader: BinaryReader): FarcasterUser; } export type FarcasterUserObject = { userId: string, farcasterId: string, username: string, } export type DeviceType = 0 | 1 | 2 | 3 | 4 | 5;