@@ -180,31 +180,32 @@ export async function createPersonaByJsonWebKey(options: {
180
180
181
181
export async function createProfileWithPersona (
182
182
profileID : ProfileIdentifier ,
183
- data : LinkedProfileDetails ,
184
- keys : {
183
+ linkMeta : LinkedProfileDetails ,
184
+ persona : {
185
185
nickname ?: string
186
186
publicKey : EC_Public_JsonWebKey
187
187
privateKey ?: EC_Private_JsonWebKey
188
188
localKey ?: AESJsonWebKey
189
189
mnemonic ?: PersonaRecord [ 'mnemonic' ]
190
190
} ,
191
+ token ?: string | null ,
191
192
) : Promise < void > {
192
- const ec_id = ( await ECKeyIdentifier . fromJsonWebKey ( keys . publicKey ) ) . unwrap ( )
193
+ const ec_id = ( await ECKeyIdentifier . fromJsonWebKey ( persona . publicKey ) ) . unwrap ( )
193
194
const rec : PersonaRecord = {
194
195
createdAt : new Date ( ) ,
195
196
updatedAt : new Date ( ) ,
196
197
identifier : ec_id ,
197
198
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 ,
203
204
hasLogout : false ,
204
205
}
205
206
await consistentPersonaDBWriteAccess ( async ( t ) => {
206
207
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 )
208
209
} )
209
210
}
210
211
// #endregion
0 commit comments