-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e622d71
commit 1816e43
Showing
9 changed files
with
1,398 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
code_examples/sdk_examples/src/core_features/getting_started/03_fetch_did.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* eslint-disable prefer-const */ | ||
import * as Kilt from '@kiltprotocol/sdk-js' | ||
import * as Did from '@kiltprotocol/did' | ||
|
||
export async function main(): Promise<Kilt.DidUri | null> { | ||
export async function main(): Promise<String | null> { | ||
let apiConfig = Kilt.ConfigService.get('api') | ||
const encodedKiltnerd123Details = | ||
await apiConfig.call.did.queryByWeb3Name('kiltnerd123') | ||
|
||
// This function will throw if kiltnerd123 does not exist | ||
const { | ||
document: { uri } | ||
} = Kilt.Did.linkedInfoFromChain(encodedKiltnerd123Details) | ||
console.log(`My name is kiltnerd123 and this is my DID: "${uri}"`) | ||
document: { id } | ||
} = Did.linkedInfoFromChain(encodedKiltnerd123Details) | ||
console.log(`My name is kiltnerd123 and this is my DID: "${id}"`) | ||
|
||
return uri | ||
return id | ||
} |
10 changes: 4 additions & 6 deletions
10
code_examples/sdk_examples/src/core_features/getting_started/04_fetch_endpoints.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
code_examples/sdk_examples/src/core_features/getting_started/05_fetch_endpoint_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
code_examples/sdk_examples/src/core_features/getting_started/06_verify_credential.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.