diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js --- a/lib/types/identity-service-types.js +++ b/lib/types/identity-service-types.js @@ -212,6 +212,10 @@ farcasterIDs: $ReadOnlyArray, ) => Promise<$ReadOnlyArray>; +linkFarcasterAccount: (farcasterID: string) => Promise; + +linkFarcasterDCsAccount: ( + farcasterID: string, + farcasterDCsToken: string, + ) => Promise; +unlinkFarcasterAccount: () => Promise; +findUserIdentities: ( userIDs: $ReadOnlyArray, diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.h b/native/cpp/CommonCpp/NativeModules/CommRustModule.h --- a/native/cpp/CommonCpp/NativeModules/CommRustModule.h +++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.h @@ -200,6 +200,13 @@ jsi::String deviceID, jsi::String accessToken, jsi::String farcasterID) override; + virtual jsi::Value linkFarcasterDCsAccount( + jsi::Runtime &rt, + jsi::String userID, + jsi::String deviceID, + jsi::String accessToken, + jsi::String farcasterID, + jsi::String farcasterDCsToken) override; virtual jsi::Value unlinkFarcasterAccount( jsi::Runtime &rt, jsi::String userID, diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp --- a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp +++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp @@ -974,6 +974,41 @@ }); } +jsi::Value CommRustModule::linkFarcasterDCsAccount( + jsi::Runtime &rt, + jsi::String userID, + jsi::String deviceID, + jsi::String accessToken, + jsi::String farcasterID, + jsi::String farcasterDCsToken) { + auto userIDRust = jsiStringToRustString(userID, rt); + auto deviceIDRust = jsiStringToRustString(deviceID, rt); + auto accessTokenRust = jsiStringToRustString(accessToken, rt); + auto farcasterIDRust = jsiStringToRustString(farcasterID, rt); + auto farcasterDCsTokenRust = jsiStringToRustString(farcasterDCsToken, rt); + return createPromiseAsJSIValue( + rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr promise) { + std::string error; + try { + auto currentID = RustPromiseManager::instance.addPromise( + {promise, this->jsInvoker_, innerRt}); + identityLinkFarcasterDCsAccount( + userIDRust, + deviceIDRust, + accessTokenRust, + farcasterIDRust, + farcasterDCsTokenRust, + currentID); + } catch (const std::exception &e) { + error = e.what(); + }; + if (!error.empty()) { + this->jsInvoker_->invokeAsync( + [error, promise]() { promise->reject(error); }); + } + }); +} + jsi::Value CommRustModule::unlinkFarcasterAccount( jsi::Runtime &rt, jsi::String userID, diff --git a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp --- a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp +++ b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp @@ -93,6 +93,9 @@ static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_linkFarcasterAccount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->linkFarcasterAccount(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt)); } +static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_linkFarcasterDCsAccount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->linkFarcasterDCsAccount(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt), args[4].asString(rt)); +} static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_unlinkFarcasterAccount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->unlinkFarcasterAccount(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt)); } @@ -129,6 +132,7 @@ methodMap_["findUserIDForUsername"] = MethodMetadata {1, __hostFunction_CommRustModuleSchemaCxxSpecJSI_findUserIDForUsername}; methodMap_["getFarcasterUsers"] = MethodMetadata {1, __hostFunction_CommRustModuleSchemaCxxSpecJSI_getFarcasterUsers}; methodMap_["linkFarcasterAccount"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_linkFarcasterAccount}; + methodMap_["linkFarcasterDCsAccount"] = MethodMetadata {5, __hostFunction_CommRustModuleSchemaCxxSpecJSI_linkFarcasterDCsAccount}; methodMap_["unlinkFarcasterAccount"] = MethodMetadata {3, __hostFunction_CommRustModuleSchemaCxxSpecJSI_unlinkFarcasterAccount}; methodMap_["findUserIdentities"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_findUserIdentities}; } diff --git a/native/cpp/CommonCpp/_generated/rustJSI.h b/native/cpp/CommonCpp/_generated/rustJSI.h --- a/native/cpp/CommonCpp/_generated/rustJSI.h +++ b/native/cpp/CommonCpp/_generated/rustJSI.h @@ -47,6 +47,7 @@ virtual jsi::Value findUserIDForUsername(jsi::Runtime &rt, jsi::String username) = 0; virtual jsi::Value getFarcasterUsers(jsi::Runtime &rt, jsi::Array farcasterIDs) = 0; virtual jsi::Value linkFarcasterAccount(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String farcasterID) = 0; + virtual jsi::Value linkFarcasterDCsAccount(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String farcasterID, jsi::String farcasterDCsToken) = 0; virtual jsi::Value unlinkFarcasterAccount(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken) = 0; virtual jsi::Value findUserIdentities(jsi::Runtime &rt, jsi::String authUserID, jsi::String authDeviceID, jsi::String authAccessToken, jsi::Array userIDs) = 0; @@ -286,6 +287,14 @@ return bridging::callFromJs( rt, &T::linkFarcasterAccount, jsInvoker_, instance_, std::move(userID), std::move(deviceID), std::move(accessToken), std::move(farcasterID)); } + jsi::Value linkFarcasterDCsAccount(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String farcasterID, jsi::String farcasterDCsToken) override { + static_assert( + bridging::getParameterCount(&T::linkFarcasterDCsAccount) == 6, + "Expected linkFarcasterDCsAccount(...) to have 6 parameters"); + + return bridging::callFromJs( + rt, &T::linkFarcasterDCsAccount, jsInvoker_, instance_, std::move(userID), std::move(deviceID), std::move(accessToken), std::move(farcasterID), std::move(farcasterDCsToken)); + } jsi::Value unlinkFarcasterAccount(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken) override { static_assert( bridging::getParameterCount(&T::unlinkFarcasterAccount) == 4, diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js --- a/native/identity-service/identity-service-context-provider.react.js +++ b/native/identity-service/identity-service-context-provider.react.js @@ -768,6 +768,26 @@ 'linkFarcasterAccount', ); }, + linkFarcasterDCsAccount: async ( + farcasterID: string, + farcasterDCsToken: string, + ) => { + const { + deviceID, + userID, + accessToken: token, + } = await getAuthMetadata(); + return authVerifiedEndpoint( + commRustModule.linkFarcasterDCsAccount( + userID, + deviceID, + token, + farcasterID, + farcasterDCsToken, + ), + 'linkFarcasterDCsAccount', + ); + }, unlinkFarcasterAccount: async () => { const { deviceID, diff --git a/native/native_rust_library/src/identity/farcaster.rs b/native/native_rust_library/src/identity/farcaster.rs --- a/native/native_rust_library/src/identity/farcaster.rs +++ b/native/native_rust_library/src/identity/farcaster.rs @@ -6,7 +6,8 @@ }; use grpc_clients::identity::{ get_auth_client, get_unauthenticated_client, - protos::auth::LinkFarcasterAccountRequest, protos::unauth::Empty, + protos::auth::LinkFarcasterAccountRequest, + protos::auth::LinkFarcasterDCsAccountRequest, protos::unauth::Empty, protos::unauth::GetFarcasterUsersRequest, }; use serde::Serialize; @@ -52,6 +53,27 @@ }); } + pub fn link_farcaster_dcs_account( + user_id: String, + device_id: String, + access_token: String, + farcaster_id: String, + farcaster_dcs_token: String, + promise_id: u32, + ) { + RUNTIME.spawn(async move { + let result = link_farcaster_dcs_account_helper( + user_id, + device_id, + access_token, + farcaster_id, + farcaster_dcs_token, + ) + .await; + handle_void_result_as_callback(result, promise_id); + }); + } + pub fn unlink_farcaster_account( user_id: String, device_id: String, @@ -126,6 +148,34 @@ Ok(()) } +async fn link_farcaster_dcs_account_helper( + user_id: String, + device_id: String, + access_token: String, + farcaster_id: String, + farcaster_dcs_token: String, +) -> Result<(), Error> { + let mut identity_client = get_auth_client( + IDENTITY_SOCKET_ADDR, + user_id, + device_id, + access_token, + PLATFORM_METADATA.clone(), + ) + .await?; + + let link_farcaster_dcs_account_request = LinkFarcasterDCsAccountRequest { + farcaster_id, + farcaster_dcs_token, + }; + + identity_client + .link_farcaster_d_cs_account(link_farcaster_dcs_account_request) + .await?; + + Ok(()) +} + async fn unlink_farcaster_account_helper( user_id: String, device_id: String, diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs --- a/native/native_rust_library/src/lib.rs +++ b/native/native_rust_library/src/lib.rs @@ -341,6 +341,16 @@ promise_id: u32, ); + #[cxx_name = "identityLinkFarcasterDCsAccount"] + fn link_farcaster_dcs_account( + user_id: String, + device_id: String, + access_token: String, + farcaster_id: String, + farcaster_dcs_token: String, + promise_id: u32, + ); + #[cxx_name = "identityUnlinkFarcasterAccount"] fn unlink_farcaster_account( user_id: String, diff --git a/native/schema/CommRustModuleSchema.js b/native/schema/CommRustModuleSchema.js --- a/native/schema/CommRustModuleSchema.js +++ b/native/schema/CommRustModuleSchema.js @@ -190,6 +190,13 @@ accessToken: string, farcasterID: string, ) => Promise; + +linkFarcasterDCsAccount: ( + userID: string, + deviceID: string, + accessToken: string, + farcasterID: string, + farcasterDCsToken: string, + ) => Promise; +unlinkFarcasterAccount: ( userID: string, deviceID: string, diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js --- a/web/grpc/identity-service-client-wrapper.js +++ b/web/grpc/identity-service-client-wrapper.js @@ -648,6 +648,21 @@ await client.linkFarcasterAccount(linkFarcasterAccountRequest); }; + linkFarcasterDCsAccount: ( + farcasterID: string, + farcasterDCsToken: string, + ) => Promise = async (farcasterID, farcasterDCsToken) => { + const client = this.authClient; + if (!client) { + throw new Error('Identity service client is not initialized'); + } + const linkFarcasterDCsAccountRequest = + new IdentityAuthStructs.LinkFarcasterDCsAccountRequest(); + linkFarcasterDCsAccountRequest.setFarcasterId(farcasterID); + linkFarcasterDCsAccountRequest.setFarcasterDcsToken(farcasterDCsToken); + await client.linkFarcasterDCsAccount(linkFarcasterDCsAccountRequest); + }; + unlinkFarcasterAccount: () => Promise = async () => { const client = this.authClient; if (!client) { diff --git a/web/grpc/identity-service-context-provider.react.js b/web/grpc/identity-service-context-provider.react.js --- a/web/grpc/identity-service-context-provider.react.js +++ b/web/grpc/identity-service-context-provider.react.js @@ -159,6 +159,7 @@ syncPlatformDetails: proxyMethodToWorker('syncPlatformDetails'), getFarcasterUsers: proxyMethodToWorker('getFarcasterUsers'), linkFarcasterAccount: proxyMethodToWorker('linkFarcasterAccount'), + linkFarcasterDCsAccount: proxyMethodToWorker('linkFarcasterDCsAccount'), unlinkFarcasterAccount: proxyMethodToWorker('unlinkFarcasterAccount'), findUserIdentities: proxyMethodToWorker('findUserIdentities'), versionSupported: proxyMethodToWorker('versionSupported'), diff --git a/web/protobufs/identity-auth-client.cjs b/web/protobufs/identity-auth-client.cjs --- a/web/protobufs/identity-auth-client.cjs +++ b/web/protobufs/identity-auth-client.cjs @@ -1359,6 +1359,67 @@ }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.identity.auth.LinkFarcasterDCsAccountRequest, + * !proto.identity.unauth.Empty>} + */ +const methodDescriptor_IdentityClientService_LinkFarcasterDCsAccount = new grpc.web.MethodDescriptor( + '/identity.auth.IdentityClientService/LinkFarcasterDCsAccount', + grpc.web.MethodType.UNARY, + proto.identity.auth.LinkFarcasterDCsAccountRequest, + identity_unauth_pb.Empty, + /** + * @param {!proto.identity.auth.LinkFarcasterDCsAccountRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + identity_unauth_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.identity.auth.LinkFarcasterDCsAccountRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.identity.auth.IdentityClientServiceClient.prototype.linkFarcasterDCsAccount = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/identity.auth.IdentityClientService/LinkFarcasterDCsAccount', + request, + metadata || {}, + methodDescriptor_IdentityClientService_LinkFarcasterDCsAccount, + callback); +}; + + +/** + * @param {!proto.identity.auth.LinkFarcasterDCsAccountRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.identity.auth.IdentityClientServicePromiseClient.prototype.linkFarcasterDCsAccount = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/identity.auth.IdentityClientService/LinkFarcasterDCsAccount', + request, + metadata || {}, + methodDescriptor_IdentityClientService_LinkFarcasterDCsAccount); +}; + + /** * @const * @type {!grpc.web.MethodDescriptor< diff --git a/web/protobufs/identity-auth-client.cjs.flow b/web/protobufs/identity-auth-client.cjs.flow --- a/web/protobufs/identity-auth-client.cjs.flow +++ b/web/protobufs/identity-auth-client.cjs.flow @@ -158,6 +158,13 @@ response: identityStructs.Empty) => void ): grpcWeb.ClientReadableStream; + linkFarcasterDCsAccount( + request: identityAuthStructs.LinkFarcasterDCsAccountRequest, + metadata: grpcWeb.Metadata | void, + callback: (err: grpcWeb.RpcError, + response: identityStructs.Empty) => void + ): grpcWeb.ClientReadableStream; + findUserIdentities( request: identityAuthStructs.UserIdentitiesRequest, metadata: grpcWeb.Metadata | void, @@ -283,6 +290,11 @@ metadata?: grpcWeb.Metadata ): Promise; + linkFarcasterDCsAccount( + request: identityAuthStructs.LinkFarcasterDCsAccountRequest, + metadata?: grpcWeb.Metadata + ): Promise; + findUserIdentities( request: identityAuthStructs.UserIdentitiesRequest, metadata?: grpcWeb.Metadata diff --git a/web/protobufs/identity-auth-structs.cjs b/web/protobufs/identity-auth-structs.cjs --- a/web/protobufs/identity-auth-structs.cjs +++ b/web/protobufs/identity-auth-structs.cjs @@ -36,6 +36,7 @@ goog.exportSymbol('proto.identity.auth.InboundKeysForUserResponse', null, global); goog.exportSymbol('proto.identity.auth.KeyserverKeysResponse', null, global); goog.exportSymbol('proto.identity.auth.LinkFarcasterAccountRequest', null, global); +goog.exportSymbol('proto.identity.auth.LinkFarcasterDCsAccountRequest', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeyInfo', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeysForUserRequest', null, global); goog.exportSymbol('proto.identity.auth.OutboundKeysForUserResponse', null, global); @@ -686,6 +687,27 @@ */ proto.identity.auth.LinkFarcasterAccountRequest.displayName = 'proto.identity.auth.LinkFarcasterAccountRequest'; } +/** + * 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.auth.LinkFarcasterDCsAccountRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.identity.auth.LinkFarcasterDCsAccountRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.auth.LinkFarcasterDCsAccountRequest.displayName = 'proto.identity.auth.LinkFarcasterDCsAccountRequest'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -6432,6 +6454,166 @@ + + +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.auth.LinkFarcasterDCsAccountRequest.prototype.toObject = function(opt_includeInstance) { + return proto.identity.auth.LinkFarcasterDCsAccountRequest.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.auth.LinkFarcasterDCsAccountRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.toObject = function(includeInstance, msg) { + var f, obj = { + farcasterDcsToken: jspb.Message.getFieldWithDefault(msg, 1, ""), + farcasterId: 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.auth.LinkFarcasterDCsAccountRequest} + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.auth.LinkFarcasterDCsAccountRequest; + return proto.identity.auth.LinkFarcasterDCsAccountRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.auth.LinkFarcasterDCsAccountRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.auth.LinkFarcasterDCsAccountRequest} + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.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.setFarcasterDcsToken(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFarcasterId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.auth.LinkFarcasterDCsAccountRequest.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.auth.LinkFarcasterDCsAccountRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFarcasterDcsToken(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getFarcasterId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string farcaster_dcs_token = 1; + * @return {string} + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.prototype.getFarcasterDcsToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.auth.LinkFarcasterDCsAccountRequest} returns this + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.prototype.setFarcasterDcsToken = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string farcaster_id = 2; + * @return {string} + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.prototype.getFarcasterId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.auth.LinkFarcasterDCsAccountRequest} returns this + */ +proto.identity.auth.LinkFarcasterDCsAccountRequest.prototype.setFarcasterId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + /** * List of repeated fields within this message type. * @private {!Array} diff --git a/web/protobufs/identity-auth-structs.cjs.flow b/web/protobufs/identity-auth-structs.cjs.flow --- a/web/protobufs/identity-auth-structs.cjs.flow +++ b/web/protobufs/identity-auth-structs.cjs.flow @@ -693,6 +693,26 @@ farcasterId: string, } +declare export class LinkFarcasterDCsAccountRequest extends Message { + getFarcasterDcsToken(): string; + setFarcasterDcsToken(value: string): LinkFarcasterDCsAccountRequest; + + getFarcasterId(): string; + setFarcasterId(value: string): LinkFarcasterDCsAccountRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LinkFarcasterDCsAccountRequestObject; + static toObject(includeInstance: boolean, msg: LinkFarcasterDCsAccountRequest): LinkFarcasterDCsAccountRequestObject; + static serializeBinaryToWriter(message: LinkFarcasterDCsAccountRequest, writer: BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LinkFarcasterDCsAccountRequest; + static deserializeBinaryFromReader(message: LinkFarcasterDCsAccountRequest, reader: BinaryReader): LinkFarcasterDCsAccountRequest; +} + +export type LinkFarcasterDCsAccountRequestObject = { + farcasterDcsToken: string, + farcasterId: string, +} + declare export class UserIdentitiesRequest extends Message { getUserIdsList(): Array; setUserIdsList(value: Array): UserIdentitiesRequest; diff --git a/web/protobufs/identity-unauth-structs.cjs b/web/protobufs/identity-unauth-structs.cjs --- a/web/protobufs/identity-unauth-structs.cjs +++ b/web/protobufs/identity-unauth-structs.cjs @@ -1441,7 +1441,8 @@ 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, "") + initialDeviceList: jspb.Message.getFieldWithDefault(msg, 5, ""), + farcasterDcsToken: jspb.Message.getFieldWithDefault(msg, 6, "") }; if (includeInstance) { @@ -1499,6 +1500,10 @@ var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setFarcasterDcsToken(value); + break; default: reader.skipField(); break; @@ -1564,6 +1569,13 @@ f ); } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } }; @@ -1718,6 +1730,42 @@ }; +/** + * optional string farcaster_dc_token = 6; + * @return {string} + */ +proto.identity.unauth.RegistrationStartRequest.prototype.getFarcasterDcsToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.unauth.RegistrationStartRequest} returns this + */ +proto.identity.unauth.RegistrationStartRequest.prototype.setFarcasterDcsToken = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.unauth.RegistrationStartRequest} returns this + */ +proto.identity.unauth.RegistrationStartRequest.prototype.clearFarcasterDcsToken = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.unauth.RegistrationStartRequest.prototype.hasFarcasterDcsToken = function() { + return jspb.Message.getField(this, 6) != null; +}; + + @@ -3288,7 +3336,8 @@ 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, "") + initialDeviceList: jspb.Message.getFieldWithDefault(msg, 5, ""), + farcasterDcsToken: jspb.Message.getFieldWithDefault(msg, 6, "") }; if (includeInstance) { @@ -3346,6 +3395,10 @@ var value = /** @type {string} */ (reader.readString()); msg.setInitialDeviceList(value); break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setFarcasterDcsToken(value); + break; default: reader.skipField(); break; @@ -3411,6 +3464,13 @@ f ); } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } }; @@ -3541,6 +3601,42 @@ }; +/** + * optional string farcaster_dcs_token = 6; + * @return {string} + */ +proto.identity.unauth.WalletAuthRequest.prototype.getFarcasterDcsToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.unauth.WalletAuthRequest} returns this + */ +proto.identity.unauth.WalletAuthRequest.prototype.setFarcasterDcsToken = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.unauth.WalletAuthRequest} returns this + */ +proto.identity.unauth.WalletAuthRequest.prototype.clearFarcasterDcsToken = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.unauth.WalletAuthRequest.prototype.hasFarcasterDcsToken = function() { + return jspb.Message.getField(this, 6) != null; +}; + + diff --git a/web/protobufs/identity-unauth-structs.cjs.flow b/web/protobufs/identity-unauth-structs.cjs.flow --- a/web/protobufs/identity-unauth-structs.cjs.flow +++ b/web/protobufs/identity-unauth-structs.cjs.flow @@ -124,6 +124,11 @@ getInitialDeviceList(): string; setInitialDeviceList(value: string): RegistrationStartRequest; + getFarcasterDcsToken(): string; + setFarcasterDcsToken(value: string): RegistrationStartRequest; + hasFarcasterDcsToken(): boolean; + clearFarcasterDcsToken(): RegistrationStartRequest; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RegistrationStartRequestObject; static toObject(includeInstance: boolean, msg: RegistrationStartRequest): RegistrationStartRequestObject; @@ -138,6 +143,7 @@ deviceKeyUpload?: DeviceKeyUploadObject, farcasterId?: string, initialDeviceList: string, + farcasterDcsToken?: string, }; declare export class ReservedRegistrationStartRequest extends Message { @@ -346,6 +352,11 @@ getInitialDeviceList(): string; setInitialDeviceList(value: string): WalletAuthRequest; + getFarcasterDcsToken(): string; + setFarcasterDcsToken(value: string): WalletAuthRequest; + hasFarcasterDcsToken(): boolean; + clearFarcasterDcsToken(): WalletAuthRequest; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): WalletAuthRequestObject; static toObject(includeInstance: boolean, msg: WalletAuthRequest): WalletAuthRequestObject; @@ -360,6 +371,7 @@ deviceKeyUpload?: DeviceKeyUploadObject, farcasterId?: string, initialDeviceList: string, + farcasterDcsToken?: string, }; declare export class RestoreUserRequest extends Message {