A Cordova plugin that wraps Hyperledger Indy functionality.
Currently supported platforms:
- iOS (13+)
Add the plugin to your Cordova project:
cordova plugin add https://github.com/global-121/121-indy-wrapper-ios.git#0.2.0Where #0.2.0 can be replaced by a specific tag/release version.
All API functions are available on the Global121.Indy object. For instance,
the setup function can be referenced as follows:
const { setup } = Global121.IndyEnsure that the plugin is set up properly:
await setup()Create the wallet. This needs to be called only once:
let password = 'shh, secret!'
await createWallet({ password })Create a master secret (needed for zero knowledge proofs). Like most API calls this requires the wallet password.
await createMasterSecret({ password })Generate a new DID (Decentralized Identity):
let { did, verificationKey } = await generateDid({ password })Create a credential request:
let { json, meta } = await createCredentialRequest({
password, did, credentialOffer, credentialDefinitionId
})Store a credential:
let id = await storeCredential({
password, definition, requestMeta, credential
})Create a proof:
let proof = await createProof({ password, proofRequest })The API calls are all asynchronous, and they support both callbacks and promises. So you can use the async/await syntax from the examples above, but also the older syntax where you supply success and error callbacks:
setup(
function(result) { /* handle success */ },
function(error) { /* handle error */ }
)See the iOS Test-App for running the plugin tests on iOS.
Released under the Apache 2.0 License. See LICENSE.