File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 44 "google-importer" : " deno run --allow-read --allow-env --allow-net google-importer.ts" ,
55 "memorydemo" : " deno run --allow-read --allow-env --allow-net memory_demo.ts" ,
66 "test" : " deno test" ,
7- "charmdemo" : " deno run --allow-read --allow-env --allow-net charm_demo.ts"
7+ "charmdemo" : " deno run --allow-read --allow-env --allow-net charm_demo.ts" ,
8+ "name2did" : " deno run -A name2did.ts"
89 },
910 "imports" : {
1011 "open" : " https://deno.land/x/open@v0.0.6/index.ts"
Original file line number Diff line number Diff line change 1+ import { Identity } from "@commontools/identity" ;
2+
3+ const OPERATOR_PASS = Deno . env . get ( "OPERATOR_PASS" ) ?? "implicit trust" ;
4+
5+ export const name2did = async ( name : string ) => {
6+ const account = await Identity . fromPassphrase ( OPERATOR_PASS ) ;
7+ const space = await account . derive ( name ) ;
8+ console . log ( " NAME:" , name ) ;
9+ console . log ( "SPACE:" , space . did ( ) ) ;
10+ } ;
11+
12+ const args = Deno . args ;
13+
14+ if ( args . length < 1 ) {
15+ console . error ( "Error: Please provide a name argument." ) ;
16+ console . log ( "Usage: deno task name2did <name>" ) ;
17+ Deno . exit ( 1 ) ;
18+ }
19+
20+ await name2did ( args [ 0 ] ) ;
21+ Deno . exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments