@@ -29,6 +29,7 @@ export class BlockcoreDidResolver {
2929
3030 const pool = new SimplePool ( ) ;
3131 const services = [ ] as any [ ] ;
32+ let profile = null ;
3233
3334 const metadata = await pool . get ( this . #relays, {
3435 kinds : [ kinds . Metadata ] ,
@@ -43,8 +44,8 @@ export class BlockcoreDidResolver {
4344 pool . close ( this . #relays) ;
4445
4546 if ( metadata ?. content ) {
46- const metadataObject = JSON . parse ( metadata . content ) ;
47- const website = metadataObject . website ;
47+ profile = JSON . parse ( metadata . content ) ;
48+ const website = profile . website ;
4849
4950 if ( website ) {
5051 services . push ( {
@@ -55,7 +56,7 @@ export class BlockcoreDidResolver {
5556 }
5657
5758 // TODO: Is there any use putting NIP05 in DID Document?
58- // const nip05 = metadataObject .nip05;
59+ // const nip05 = profile .nip05;
5960 // if (nip05) {
6061 // services.push({
6162 // id: `${parsed.did}#nip05`,
@@ -86,7 +87,10 @@ export class BlockcoreDidResolver {
8687 retrieved : new Date ( ) . toISOString ( ) ,
8788 } ,
8889 didDocumentMetadata : {
90+ created : profile ?. created_at ,
91+ updated : profile ?. created_at ,
8992 deactivated : false , // TODO: Check if the key is deactivated.
93+ profile
9094 } ,
9195 } ;
9296
0 commit comments