0.4.22 • Published 10 months ago

@docknetwork/wallet-sdk-dids v0.4.22

Weekly downloads
-
License
https://github.co...
Repository
github
Last release
10 months ago

DID Manager

DID stands for Decentralized IDentifiers. DIDs are meant to be globally unique identifiers that allow their owner to prove cryptographic control over them. A DID identifies any subject (e.g., a person, organization, thing, data model, abstract entity, etc.) that the controller of the DID decides that it identifies.

On React Native it's required to set up the WalletSDKProvider, described on @docknetwork/wallet-sdk-react-native

Supports did:key

import {DIDKeyManager} from '@docknetwork/wallet-sdk-dids/lib';

// Create did document from keypair

const keyDoc = {
    id: 'did:key:z6MkhN7PBjWgSMQ24Bebdpvvw8fVRv7m6MHDqiwTKozzBgrJ#z6MkhN7PBjWgSMQ24Bebdpvvw8fVRv7m6MHDqiwTKozzBgrJ',
    controller: 'did:key:z6MkhN7PBjWgSMQ24Bebdpvvw8fVRv7m6MHDqiwTKozzBgrJ',
    type: 'Ed25519VerificationKey2018',
    publicKeyBase58: '3urLbVGF6ouYwgotxFy6637VcLqugU2s9i2XVY2yGU4v',
    privateKeyBase58:
    '3rF4Jhp7vF6tavGZCSgkdMM3ANLB7YpmzfRcB5FTs1Q7EgN6u5cCwzCaHCDYcestRSEHzjF82TvJUaj3mdqcbGnS',
    publicKeyMultibase: 'z3urLbVGF6ouYwgotxFy6637VcLqugU2s9i2XVY2yGU4v',
    privateKeyMultibase:
    'z3rF4Jhp7vF6tavGZCSgkdMM3ANLB7YpmzfRcB5FTs1Q7EgN6u5cCwzCaHCDYcestRSEHzjF82TvJUaj3mdqcbGnS',
};

const {didDocument, keyDoc: resKeyDoc} =
    await DIDKeyManager.keypairToDIDKeyDocument(keyDoc);


// Get DID resolution

const didDocument = {
    id: 'did:key:z6Mks8mvCnVx4HQcoq7ZwvpTbMnoRGudHSiEpXhMf6VW8XMg',
};

const didResolution = await DIDKeyManager.getDIDResolution(didDocument);
0.4.22

10 months ago

0.4.19

1 year ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.0.1

3 years ago