@@ -180,31 +180,32 @@ export async function createPersonaByJsonWebKey(options: {
180180
181181export async function createProfileWithPersona (
182182 profileID : ProfileIdentifier ,
183- data : LinkedProfileDetails ,
184- keys : {
183+ linkMeta : LinkedProfileDetails ,
184+ persona : {
185185 nickname ?: string
186186 publicKey : EC_Public_JsonWebKey
187187 privateKey ?: EC_Private_JsonWebKey
188188 localKey ?: AESJsonWebKey
189189 mnemonic ?: PersonaRecord [ 'mnemonic' ]
190190 } ,
191+ token ?: string | null ,
191192) : Promise < void > {
192- const ec_id = ( await ECKeyIdentifier . fromJsonWebKey ( keys . publicKey ) ) . unwrap ( )
193+ const ec_id = ( await ECKeyIdentifier . fromJsonWebKey ( persona . publicKey ) ) . unwrap ( )
193194 const rec : PersonaRecord = {
194195 createdAt : new Date ( ) ,
195196 updatedAt : new Date ( ) ,
196197 identifier : ec_id ,
197198 linkedProfiles : new Map ( ) ,
198- nickname : keys . nickname ,
199- publicKey : keys . publicKey ,
200- privateKey : keys . privateKey ,
201- localKey : keys . localKey ,
202- mnemonic : keys . mnemonic ,
199+ nickname : persona . nickname ,
200+ publicKey : persona . publicKey ,
201+ privateKey : persona . privateKey ,
202+ localKey : persona . localKey ,
203+ mnemonic : persona . mnemonic ,
203204 hasLogout : false ,
204205 }
205206 await consistentPersonaDBWriteAccess ( async ( t ) => {
206207 await createOrUpdatePersonaDB ( rec , { explicitUndefinedField : 'ignore' , linkedProfiles : 'merge' } , t )
207- await attachProfileDB ( profileID , ec_id , data , t )
208+ await attachProfileDB ( profileID , ec_id , linkMeta , { token } , t )
208209 } )
209210}
210211// #endregion
0 commit comments