{"_id":"@elysium-onchain-id/identity-sdk","_rev":"5-5708677faeb0790aaf8aff2a765374de","name":"@elysium-onchain-id/identity-sdk","dist-tags":{"latest":"1.7.5"},"versions":{"1.7.1":{"name":"@elysium-onchain-id/identity-sdk","version":"1.7.1","keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","_id":"@elysium-onchain-id/identity-sdk@1.7.1","maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"homepage":"https://github.com/onchain-id/identity-sdk#readme","bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"dist":{"shasum":"26944d7c5329005f731e6b39509b5f449653029c","tarball":"https://registry.npmjs.org/@elysium-onchain-id/identity-sdk/-/identity-sdk-1.7.1.tgz","fileCount":54,"integrity":"sha512-A+cuUjiS1pSOUp7UlDwWBVwoM483D4JEIDmbqhdKHJv9Wg0WLfSJvWMTB7J6uNrkNcBTZ0pdRcPRNdEeyKWdTw==","signatures":[{"sig":"MEUCIGgkWPGIPyYoYc9T2K/3Q8hP8ZZg51siS9QEXPcgm8sXAiEA12IGZ0SNPXg1Wy3exZsmi1a08l25+iKXQqcD0kWprDI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207541},"main":"dist/index.js","husky":{"hooks":{"commit-msg":"cross-env-shell node ./scripts/commit-msg.js $HUSKY_GIT_PARAMS && commitlint -E HUSKY_GIT_PARAMS"}},"types":"dist/index.d.ts","engines":{"npm":"> 5.0.0","node":"> 8.0.0"},"gitHead":"89dfa84d300347b47c1599fa7b2ef809f768876b","scripts":{"lint":"eslint src/**/**.ts","test":"npm run test:unit && npm run test:integration && npm run test:e2e","build":"rimraf dist && tsc -p tsconfig.build.json","lint:fix":"eslint src/**/**.ts --fix","test:e2e":"cross-env NODE_ENV=test jest --config ./jest.config.e2e.js --runInBand","test:unit":"cross-env NODE_ENV=test jest --config ./jest.config.unit.js --coverage","build:docs":"typedoc --options ./typedoc.json ./src","build:watch":"rimraf dist && tsc -p tsconfig.build.json -w","test:e2e:watch":"cross-env npm run test:e2e -- --watch","test:unit:watch":"npm run test:unit -- --watch"},"_npmUser":{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"},"repository":{"url":"git+https://github.com/onchain-id/identity-sdk.git","type":"git"},"_npmVersion":"9.8.1","description":"Interact with BlockChain Identities.","directories":{},"_nodeVersion":"18.18.0","dependencies":{"ethers":"5.7.2","@onchain-id/solidity":"2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","nock":"^13.3.1","husky":"^4.3.8","eslint":"^7.32.0","ganache":"^7.8.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typedoc":"^0.17.8","cross-env":"^7.0.3","commitlint":"^9.1.2","typescript":"^5.1.6","@types/jest":"^29.5.2","@types/nock":"^11.1.0","@types/node":"^18.16.19","jest-extended":"^4.0.0","@typescript-eslint/parser":"^5.61.0","@typescript-eslint/eslint-plugin":"^5.61.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-sdk_1.7.1_1731409029019_0.5179248723191536","host":"s3://npm-registry-packages"}},"1.7.2":{"name":"@elysium-onchain-id/identity-sdk","version":"1.7.2","keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","_id":"@elysium-onchain-id/identity-sdk@1.7.2","maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"homepage":"https://github.com/onchain-id/identity-sdk#readme","bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"dist":{"shasum":"d62d1bd74d10ca3ba15e4727ee8abb29580450d1","tarball":"https://registry.npmjs.org/@elysium-onchain-id/identity-sdk/-/identity-sdk-1.7.2.tgz","fileCount":54,"integrity":"sha512-wC1QgC7XrB40Wp1Vkvc59QjvkXvrn5rVKM4vwUhy2K4WsOswoJrY4kbBT3vn6AUPUfm+jfNK3fF1gjsb9waj2w==","signatures":[{"sig":"MEUCICw1hUCw5c211xXPA9ZUFDJtivByFj3U0BkSvbvfOkTdAiEA0yljM5yQo0RPtiiYRHcGfJJLOOizWSeFEkhu1hofD6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208284},"main":"dist/index.js","husky":{"hooks":{"commit-msg":"cross-env-shell node ./scripts/commit-msg.js $HUSKY_GIT_PARAMS && commitlint -E HUSKY_GIT_PARAMS"}},"types":"dist/index.d.ts","engines":{"npm":"> 5.0.0","node":"> 8.0.0"},"gitHead":"d965c9f4d12fe1733e81872249780f19c4b2a80d","scripts":{"lint":"eslint src/**/**.ts","test":"npm run test:unit && npm run test:integration && npm run test:e2e","build":"rimraf dist && tsc -p tsconfig.build.json","lint:fix":"eslint src/**/**.ts --fix","test:e2e":"cross-env NODE_ENV=test jest --config ./jest.config.e2e.js --runInBand","test:unit":"cross-env NODE_ENV=test jest --config ./jest.config.unit.js --coverage","build:docs":"typedoc --options ./typedoc.json ./src","build:watch":"rimraf dist && tsc -p tsconfig.build.json -w","test:e2e:watch":"cross-env npm run test:e2e -- --watch","test:unit:watch":"npm run test:unit -- --watch"},"_npmUser":{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"},"repository":{"url":"git+https://github.com/onchain-id/identity-sdk.git","type":"git"},"_npmVersion":"9.8.1","description":"Interact with BlockChain Identities.","directories":{},"_nodeVersion":"18.18.0","dependencies":{"ethers":"5.7.2","@onchain-id/solidity":"2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","nock":"^13.3.1","husky":"^4.3.8","eslint":"^7.32.0","ganache":"^7.8.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typedoc":"^0.17.8","cross-env":"^7.0.3","commitlint":"^9.1.2","typescript":"^5.1.6","@types/jest":"^29.5.2","@types/nock":"^11.1.0","@types/node":"^18.16.19","jest-extended":"^4.0.0","@typescript-eslint/parser":"^5.61.0","@typescript-eslint/eslint-plugin":"^5.61.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-sdk_1.7.2_1731410328307_0.030340207473501968","host":"s3://npm-registry-packages"}},"1.7.3":{"name":"@elysium-onchain-id/identity-sdk","version":"1.7.3","keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","_id":"@elysium-onchain-id/identity-sdk@1.7.3","maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"homepage":"https://github.com/onchain-id/identity-sdk#readme","bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"dist":{"shasum":"e91ffe5605481270cf7b5f8f4c0f3df8b9916f6b","tarball":"https://registry.npmjs.org/@elysium-onchain-id/identity-sdk/-/identity-sdk-1.7.3.tgz","fileCount":54,"integrity":"sha512-INlN96nw60L6hxjsDMLkpy4QIWrc7lF7AMkFw+Qs8ncpgPQFAWv56RVGLic/5mtJMsXO7151abOMPxde3HgDcA==","signatures":[{"sig":"MEQCH3im5Y4cvwircOeoGgT7kIKow+vCKhZv6NOmQC8rSnMCIQC9AyPe1wpOL1g1bAmo8aSBWeRsYRsRo4S42kFTQ7rGyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208284},"main":"dist/index.js","husky":{"hooks":{"commit-msg":"cross-env-shell node ./scripts/commit-msg.js $HUSKY_GIT_PARAMS && commitlint -E HUSKY_GIT_PARAMS"}},"types":"dist/index.d.ts","engines":{"npm":"> 5.0.0","node":"> 8.0.0"},"gitHead":"d0af894166ba95d3f7af13f465042d6b2373b88c","scripts":{"lint":"eslint src/**/**.ts","test":"npm run test:unit && npm run test:integration && npm run test:e2e","build":"rimraf dist && tsc -p tsconfig.build.json","lint:fix":"eslint src/**/**.ts --fix","test:e2e":"cross-env NODE_ENV=test jest --config ./jest.config.e2e.js --runInBand","test:unit":"cross-env NODE_ENV=test jest --config ./jest.config.unit.js --coverage","build:docs":"typedoc --options ./typedoc.json ./src","build:watch":"rimraf dist && tsc -p tsconfig.build.json -w","test:e2e:watch":"cross-env npm run test:e2e -- --watch","test:unit:watch":"npm run test:unit -- --watch"},"_npmUser":{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"},"repository":{"url":"git+https://github.com/onchain-id/identity-sdk.git","type":"git"},"_npmVersion":"9.8.1","description":"Interact with BlockChain Identities.","directories":{},"_nodeVersion":"18.18.0","dependencies":{"ethers":"5.7.2","@onchain-id/solidity":"2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","nock":"^13.3.1","husky":"^4.3.8","eslint":"^7.32.0","ganache":"^7.8.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typedoc":"^0.17.8","cross-env":"^7.0.3","commitlint":"^9.1.2","typescript":"^5.1.6","@types/jest":"^29.5.2","@types/nock":"^11.1.0","@types/node":"^18.16.19","jest-extended":"^4.0.0","@typescript-eslint/parser":"^5.61.0","@typescript-eslint/eslint-plugin":"^5.61.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-sdk_1.7.3_1732190604701_0.6898553389613127","host":"s3://npm-registry-packages"}},"1.7.4":{"name":"@elysium-onchain-id/identity-sdk","version":"1.7.4","keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","_id":"@elysium-onchain-id/identity-sdk@1.7.4","maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"homepage":"https://github.com/onchain-id/identity-sdk#readme","bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"dist":{"shasum":"260b22fb13e946e15435b9cc4c9cb52c2b0ab649","tarball":"https://registry.npmjs.org/@elysium-onchain-id/identity-sdk/-/identity-sdk-1.7.4.tgz","fileCount":54,"integrity":"sha512-b3jbW42O9b2MzW+V/Pv3lyKJrH8bu1F3sJZ8PTcINpw7yBOLnoBhSNMdTHnpCxgmubkxCCuAOG+eCh3BhueG1g==","signatures":[{"sig":"MEUCIQDUIMWXMVTINvM5UQAcOoDw3v7Azn8JWkYkpXKgAuK2gAIgcODPGQeQ3m8tJLig0EQvp/D2rzRkYmS1WnEnYJwlcIc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":208284},"main":"dist/index.js","husky":{"hooks":{"commit-msg":"cross-env-shell node ./scripts/commit-msg.js $HUSKY_GIT_PARAMS && commitlint -E HUSKY_GIT_PARAMS"}},"types":"dist/index.d.ts","engines":{"npm":"> 5.0.0","node":"> 8.0.0"},"gitHead":"891a0299740a33dc75168190b6af9561a5a2cade","scripts":{"lint":"eslint src/**/**.ts","test":"npm run test:unit && npm run test:integration && npm run test:e2e","build":"rimraf dist && tsc -p tsconfig.build.json","lint:fix":"eslint src/**/**.ts --fix","test:e2e":"cross-env NODE_ENV=test jest --config ./jest.config.e2e.js --runInBand","test:unit":"cross-env NODE_ENV=test jest --config ./jest.config.unit.js --coverage","build:docs":"typedoc --options ./typedoc.json ./src","build:watch":"rimraf dist && tsc -p tsconfig.build.json -w","test:e2e:watch":"cross-env npm run test:e2e -- --watch","test:unit:watch":"npm run test:unit -- --watch"},"_npmUser":{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"},"repository":{"url":"git+https://github.com/onchain-id/identity-sdk.git","type":"git"},"_npmVersion":"10.9.0","description":"Interact with BlockChain Identities.","directories":{},"_nodeVersion":"22.11.0","dependencies":{"ethers":"5.8.0","@onchain-id/solidity":"2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","nock":"^13.3.1","husky":"^4.3.8","eslint":"^7.32.0","ganache":"^7.8.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typedoc":"^0.17.8","cross-env":"^7.0.3","commitlint":"^9.1.2","typescript":"^5.1.6","@types/jest":"^29.5.2","@types/nock":"^11.1.0","@types/node":"^18.16.19","jest-extended":"^4.0.0","@typescript-eslint/parser":"^5.61.0","@typescript-eslint/eslint-plugin":"^5.61.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-sdk_1.7.4_1744094466753_0.6606158559645858","host":"s3://npm-registry-packages-npm-production"}},"1.7.5":{"name":"@elysium-onchain-id/identity-sdk","version":"1.7.5","description":"Interact with BlockChain Identities.","scripts":{"lint":"eslint src/**/**.ts","lint:fix":"eslint src/**/**.ts --fix","build":"rimraf dist && tsc -p tsconfig.build.json","build:watch":"rimraf dist && tsc -p tsconfig.build.json -w","build:docs":"typedoc --options ./typedoc.json ./src","test":"npm run test:unit && npm run test:integration && npm run test:e2e","test:e2e":"cross-env NODE_ENV=test jest --config ./jest.config.e2e.js --runInBand","test:e2e:watch":"cross-env npm run test:e2e -- --watch","test:unit":"cross-env NODE_ENV=test jest --config ./jest.config.unit.js --coverage","test:unit:watch":"npm run test:unit -- --watch"},"repository":{"type":"git","url":"git+https://github.com/onchain-id/identity-sdk.git"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"> 8.0.0","npm":"> 5.0.0"},"keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","dependencies":{"@onchain-id/solidity":"2.2.1","ethers":"5.8.0"},"devDependencies":{"@types/jest":"^29.5.2","@types/nock":"^11.1.0","@types/node":"^18.16.19","@typescript-eslint/eslint-plugin":"^5.61.0","@typescript-eslint/parser":"^5.61.0","commitlint":"^19.8.0","cross-env":"^7.0.3","eslint":"^7.32.0","ganache":"^6.4.5","husky":"^4.3.8","jest":"^29.5.0","jest-extended":"^4.0.0","nock":"^13.3.1","ts-jest":"^29.1.0","ts-node":"^10.9.1","typedoc":"^0.28.2","typescript":"^5.1.6"},"husky":{"hooks":{"commit-msg":"cross-env-shell node ./scripts/commit-msg.js $HUSKY_GIT_PARAMS && commitlint -E HUSKY_GIT_PARAMS"}},"_id":"@elysium-onchain-id/identity-sdk@1.7.5","gitHead":"891a0299740a33dc75168190b6af9561a5a2cade","bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"homepage":"https://github.com/onchain-id/identity-sdk#readme","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-YtAJKnI5+VqqnkD4KJCTwmvt4bzSNqdpMp7M6Lw6Cl8DdwV0YYFSc3GmKN1SRBHRcnUnNWBlwxzWB1aLGrwA8Q==","shasum":"e113c0cdc1d2e65222f31aea63959aaba6d11aab","tarball":"https://registry.npmjs.org/@elysium-onchain-id/identity-sdk/-/identity-sdk-1.7.5.tgz","fileCount":54,"unpackedSize":208285,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB1b/KTljERDGaYFd2tknoJ8eQoh91UVpk2SNr8o3zb1AiBTwt6ZPoxxXd8eZfEJp+D7xqE+ddufOdHBJLw5uo50Eg=="}]},"_npmUser":{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"},"directories":{},"maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/identity-sdk_1.7.5_1744094639941_0.23301115720908383"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-12T10:57:08.904Z","modified":"2025-04-08T06:44:00.329Z","1.7.1":"2024-11-12T10:57:09.175Z","1.7.2":"2024-11-12T11:18:48.456Z","1.7.3":"2024-11-21T12:03:24.903Z","1.7.4":"2025-04-08T06:41:06.915Z","1.7.5":"2025-04-08T06:44:00.156Z"},"bugs":{"url":"https://github.com/onchain-id/identity-sdk/issues"},"author":{"name":"OnchainID Organization"},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://github.com/onchain-id/identity-sdk#readme","keywords":["ONCHAINID","TREX","Identities","ERC734","ERC735"],"repository":{"type":"git","url":"git+https://github.com/onchain-id/identity-sdk.git"},"description":"Interact with BlockChain Identities.","maintainers":[{"name":"elysiumvulcan","email":"aqeel.kazmi@vaivaltech.com"}],"readme":"# IDENTITY SDK\n\n> This package facilitates the interaction with Identities stored in the BlockChain.\n\n## Specifications\n\n### Features\n\n- Deploy identities\n- List and Manage keys on an Identity\n- List and manage Claims on an Identity.\n- Issue claims for an Identity.\n- Fetch claim data using their URI.\n\n---\n\n## Usage\n\n### Installation\n\n**Install with `npm install @onchain-id/identity-sdk`**\n\nThen require with:\n\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n```\n\n\n### Tutorials\n\n- [Tutorial Homepage](./docs/tutorials/README.md)\n  - [Implement a Claim Issuer service](./docs/tutorials/implement%20a%20claim%20issuer.md)\n  - [Restrict access to compliant Identities](./docs/tutorials/restrict%20to%20compliant%20identities.md)\n  - [Connect with Identity](./docs/tutorials/connect%20with%20identity.md)\n\n### BlockChain Provider\n\nTo interact with the BlockChain, you will need to instantiate a Provider.\n\nThe SDK is using [Ethers](https://github.com/ethers-io/ethers.js) to connect with Ethereum network.\nThus, any provider supported by Ethers can be used with the SDK.\nThis means any standard web3 provider should by supported.\n\nConnect to a default provider:\n\n```javascript\n// You can use any standard network name\n//  - \"homestead\"\n//  - \"rinkeby\"\n//  - \"ropsten\"\n//  - \"kovan\"\nconst ethers = require('ethers');\n\nconst provider = ethers.getDefaultProvider('ropsten');\n\nconst identity = await Identity.at('0x...', { provider });\n```\n\nConnect to JSON RPC:\n\n```javascript\n// When using the JSON-RPC API, the network will be automatically detected\n// Default: http://localhost:8545\nlet httpProvider = new ethers.providers.JsonRpcProvider();\n```\n\nConnect to any Web3 Provider:\n\n```javascript\n// When using a Web3 provider, the network will be automatically detected\n\n// e.g. HTTP provider\nlet currentProvider = new web3.providers.HttpProvider('http://localhost:8545');\n\nlet web3Provider = new ethers.providers.Web3Provider(currentProvider);\n```\n\nConnect to metamask:\n\n```javascript\n// The network will be automatically detected; if the network is\n// changed in MetaMask, it causes a page refresh.\n\nlet provider = new ethers.providers.Web3Provider(web3.currentProvider);\n```\n\nTo use a signer instead of a provider (required to sign transactions):\n\n```javascript\nconst signer = new ethers.Wallet('PRIVATE_KEY', provider); // Or other signers from EthersJS.\n\nconst identity = await Identity.at('0x...', { signer });\n```\n\n> Please refer to the [Ethers Providers Documentation](https://docs.ethers.io/ethers.js/html/api-providers.html) for more information.\n\n#### Overriding provider or signer for operation\n\nEvery methods that connects to the Blockchain (write or read) accept last `options` arguments to specify the\nsigner or provider to use for the operation, and for write operation, to override transaction parameters:\n\n```javascript\nconst ethers = require('ethers');\nconst identity = new IdentitySDK.Identity('0xadD92F8Ef0729E969c5a98Ea5740c9b644B362e3', provider);\n\nawait identity.addKey('0x..', 1, 3, { signer: someSigner, overrides: { gasPrice: ethers.parseUnits('2.0', 'gwei') } });\n```  \n\n### Configuration\n\n#### Providers\nBy default, unsecured providers are not allowed. The SDK will refuse to fetch data on these endpoints.\nA claim that has an uri which is not an HTTPS endpoint won't be retrieved.\n\nAllow unsecured endpoints with:\n```\nconst IdentitySDK = require('@onchain-id/identity-sdk');\nIdentitySDK.Config.config({ allowUnsecuredProviders: true });\n``` \n\n### SignerModule\n\nMany interaction with identities, and especially claims, require to sign a challenge message.\nFunctions requiring these signatures expect a SignerModule as argument.\n\nA SignerModule must expose a .getPublicKey() and a .signMessage(message: string) functions.\n\nThis is, for instance, a valid SignerModule:\n\n```javascript\nconst jsrasign = require('jsrasign');\n\nconst signer = new SignerModule({\n    getPublicKey: async () => ({\n        key: \"-----BEGIN CERTIFICATE----- my_super_public_key -----END CERTIFICATE-----\",\n        type: \"X.509\",\n        signingMethod: \"SHA-256\",\n    }),\n    signMessage: async (message) => {\n        const signer = new jsrsasign.Signature({ alg: 'SHA256withRSA' });\n        signer.init(\"-----BEGIN CERTIFICATE----- my_super_PRIVATE_no_really_super_secret_PRIVATE_key -----END CERTIFICATE-----\");\n        signer.updateString(message);\n        return signer.sign();\n    },\n});\n```\n\nAs a convenient method, a SignerModule can be created from an ethers Wallet:\n\n```javascript\nconst wallet = new IdentitySDK.Providers.Wallet('PRIVATE_KEY', provider);\nconst signer = new IdentitySDK.SignerModule(wallet);\n```\n\n### Examples\n\nFind examples in the [Example folder](./examples).\n\n#### Load a contract\n\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n\nconst provider = new ethers.providers.JsonRpcProvider();\n\n(async () => {\n  const identity = new IdentitySDK.Identity(); // Create the Identity Object\n\n  console.log(identity.instantiateAtAddress('0xadD92F8Ef0729E969c5a98Ea5740c9b644B362e3', provider)); // Get the instance of the Identity\n\n  console.log(await identity.instance.getClaimIdsByTopic(1)); // Call directly a function from the Contract.\n})();\n```\n\n#### Get claims of an Identity\n\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n\nconst provider = new ethers.providers.JsonRpcProvider();\n\n(async () => {\n  const identity = new IdentitySDK.Identity('0xadD92F8Ef0729E969c5a98Ea5740c9b644B362e3', provider);\n\n  const claims = await identity.getClaimsByTopic(1);\n\n  console.log(claims);\n})();\n```\n\n#### Get keys of an Identity\n\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n\nconst provider = new ethers.providers.JsonRpcProvider();\n\n(async () => {\n  const identity = new IdentitySDK.Identity('0xadD92F8Ef0729E969c5a98Ea5740c9b644B362e3', provider);\n\n  const keys = await identity.getKeysByPurpose(IdentitySDK.utils.enums.KeyPurpose.CLAIM);\n  \n  console.log(keys);\n  \n  console.log(await identity.getKeyPurposes(keys[0].key));\n})();\n```\n\n#### Deploy an identity\n\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n\nconst provider = new ethers.providers.JsonRpcProvider();\n\nconst CLAIM_ISSUER_PRIVATE_KEY = 'issuer_private_key';\nconst claimIssuerWallet = new IdentitySDK.Providers.Wallet(CLAIM_ISSUER_PRIVATE_KEY, provider);\n\nconst DEPLOY_PRIVATE_KEY = 'deploy_private_key';\nconst deployWallet = new IdentitySDK.Providers.Wallet(DEPLOY_PRIVATE_KEY, provider);\n\n(async () => {\n  // Deploy a new Identity\n    const identity = await IdentitySDK.Identity.deployNew(\n      {\n        managementKey: deployWallet.address,\n        implementationAuthority: IdentitySDK.constants.implementationAuthorities.kovan,\n      },\n      { signer: deployWallet }\n    );\n    await identity.deployed();\n\n  await identity.addKey(IdentitySDK.utils.crypto.keccak256(claimIssuerWallet.address), IdentitySDK.utils.enums.KeyPurpose.CLAIM, IdentitySDK.utils.enums.KeyType.ECDSA);\n  \n  identity.useProvider(claimIssuerWallet);\n\n  await identity.addClaim(IdentitySDK.utils.enums.ClaimTopic.KYC, IdentitySDK.utils.enums.ClaimScheme.SOME, claimIssuerWallet.address, \"a signature\", \"what a lot of data\", \"http://localhost:8080/claims/666\");\n})();\n```\n\n#### Deploy an implementation\n\n```javascript\nconst ethers = require('ethers');\nconst OnchainID = require('@onchain-id/solidity');\n\n(async () => {\n  const provider = ethers.getDefaultProvider('kovan');\n  const signer = new ethers.Wallet('<private key>', provider);\n\n  const implementation = await new ethers.ContractFactory(\n    OnchainID.contracts.Identity.abi,\n    OnchainID.contracts.Identity.bytecode,\n    signer\n  ).deploy(\n    signer.address,\n    true,\n  );\n\n  await implementation.deployed();\n\n  console.log(implementation.address);\n})();\n```\n\n#### Deploy an implementation authority\n\n```javascript\nconst ethers = require('ethers');\nconst OnchainID = require('@onchain-id/solidity');\n\n(async () => {\n  const provider = ethers.getDefaultProvider('kovan');\n  const signer = new ethers.Wallet('<private key>', provider);\n\n  const implementationAddress = '<implementation address>';\n\n  const implementationAuthority = await new ethers.ContractFactory(\n    OnchainID.contracts.ImplementationAuthority.abi,\n    OnchainID.contracts.ImplementationAuthority.bytecode,\n    signer\n  ).deploy(implementationAddress);\n\n  await implementationAuthority.deployed();\n\n  console.log(implementationAuthority.address);\n})();\n```\n\n---\n\n#### Get details of a claim\n```javascript\nconst { IdentitySDK } = require('@onchain-id/identity-sdk');\n\nconst provider = new ethers.providers.JsonRpcProvider();\n\n(async () => {\n    IdentitySDK.config({ allowUnsecuredProviders: true });\n\n    const identity = new IdentitySDK.Identity('0xadD92F8Ef0729E969c5a98Ea5740c9b644B362e3', provider);\n\n    const claims = await identity.getClaimsByTopic(IdentitySDK.utils.enums.ClaimTopic.KYC);\n\n    const claim = new IdentitySDK.Claim(claims[0]);\n\n    await claim.populate();\n\n    console.log(claim);\n    \n    /*\n    Claim {\n      data: '0x65773261724950755a302f626e5a744e327961676676376139462f6a3672744a4e3761666a52414c6871493d',\n      id: '0x3c6532cc1f4d1a44de8f58d4bde617bef8e744168bf92d783a0e1b66e7c6a44a',\n      issuer: '0x8c78fF753c63ea0e8CA1FcA9997A132bC3e6a8F1',\n      scheme: 1,\n      topic: 1,\n      uri: 'http://localhost:8080/claims/b701e350-2a08-11e9-ac7e-517ddf10b60e',\n      issuanceDate: 2019-02-06T12:14:12.996Z,\n      emissionDate: 2019-02-06T12:15:02.039Z,\n      status: 'PENDING',\n      publicData: { result: 'clear' } }\n     */\n})();\n```\n\n## Development\n\n- Install dependencies: `yarn`.\n- Lint code with `yarn lint`.\n- Run unit tests: `yarn test:unit`. You can run unit tests each time you modify a file with `yarn test:unit:watch`.\n- Build project with `yarn build`. This will build package into the `dist/` folder from the TypeScript sources.\n- Run end to end tests against a builded package: `yarn test:e2e`.\n- You can generate type documentation with `yarn build:docs`. This will build the TypeDoc website into `docs/type_doc`.\n","readmeFilename":"README.md"}