@credebl/ssi-mobile

2.0.0 • Public • Published

@credebl/ssi-mobile

npm npm

Installing

npm install @credebl/ssi-mobile

# or

yarn add @credebl/ssi-mobile

# or

pnpm add @credebl/ssi-mobile

Peer Dependencies

  • We also need to add the peer dependencies of this package to our App.
"dependencies": {
  ...
  "@hyperledger/anoncreds-react-native": "^0.1.0",
  "@hyperledger/aries-askar-react-native": "^0.1.1",
  "@hyperledger/indy-vdr-react-native": "^0.1.0",
}

Usage

import { useAdeyaAgent } from '@credebl/ssi-mobile'

const { agent } = useAdeyaAgent()

API

Agent

  • initializeAgent - Initialize the agent with the given Config and Agent Modules
import { initializeAgent } from '@credebl/ssi-mobile'

const config: InitConfig = {
  label: 'ADEYA Wallet',
  walletConfig: {
    id: 'adeya-wallet',
    key: 'adeya-wallet-key'
  },
  logger: new ConsoleLogger(LogLevel.debug),
  autoUpdateStorageOnStartup: true
}

const agent = await initializeAgent({
  agentConfig: config,
  modules: getAgentModules(mediatorUrl, indyLedgers)
})
  • getAgentModules - Get the default agent modules.
import { getAgentModules } from '@credebl/ssi-mobile'

const modules = getAgentModules(mediatorUrl, indyLedgers)
  • AdeyaAgent - The agent instance type.
import { AdeyaAgent } from '@credebl/ssi-mobile'

Wallet

  • isWalletPinCorrect - Check if the wallet pin is correct.
import { isWalletPinCorrect } from '@credebl/ssi-mobile'

const isCorrect = await isWalletPinCorrect(walletConfig)
  • exportWallet - Export the wallet.
import { exportWallet } from '@credebl/ssi-mobile'

await exportWallet(agent, exportConfig)
  • importWalletWithAgent - Import the wallet and start the agent.
import { importWalletWithAgent } from '@credebl/ssi-mobile'

const agent = await importWalletWithAgent({
  importConfig,
  agentConfig,
  modules
})

Connections

  • createLegacyInvitation - Create a legacy invitation.
import { createLegacyInvitation } from '@credebl/ssi-mobile'

const connection = await createLegacyInvitation(agent, domain, config)
  • createLegacyConnectionlessInvitation - Create a legacy connectionless invitation.
import { createLegacyConnectionlessInvitation } from '@credebl/ssi-mobile'

const connection = await createLegacyConnectionlessInvitation(agent, config)
  • createInvitation - Create an invitation.
import { createInvitation } from '@credebl/ssi-mobile'

const connection = await createInvitation(agent, domain, config)
  • acceptInvitation - Accept an invitation.
import { acceptInvitation } from '@credebl/ssi-mobile'

const connection = await acceptInvitation(agent, invitation, config)
  • parseInvitationFromUrl - Parse an invitation from a url.
import { parseInvitationFromUrl } from '@credebl/ssi-mobile'

const invitation = await parseInvitationFromUrl(agent, invitationUrl)
  • acceptInvitationFromUrl - Accept an invitation from a url.
import { acceptInvitationFromUrl } from '@credebl/ssi-mobile'

const connection = await acceptInvitationFromUrl(agent, invitationUrl, config)
  • getAllConnections - Get all connections.
import { getAllConnections } from '@credebl/ssi-mobile'

const connections = await getAllConnections(agent)
  • getConnectionById - Get a connection by id.
import { getConnectionById } from '@credebl/ssi-mobile'

const connection = await getConnectionById(agent, connectionId)
  • findConnectionById - Find a connection by id.
import { findConnectionById } from '@credebl/ssi-mobile'

const connection = await findConnectionById(agent, connectionId)
  • findOutOfBandRecordById - Find an out of band record by id.
import { findOutOfBandRecordById } from '@credebl/ssi-mobile'

const record = await findOutOfBandRecordById(agent, recordId)
  • findByReceivedInvitationId - Find an out of band record by received invitation id.
import { findByReceivedInvitationId } from '@credebl/ssi-mobile'

const record = await findByReceivedInvitationId(agent, receivedInvitationId)
  • deleteConnectionRecordById - Delete a connection record by id.
import { deleteConnectionRecordById } from '@credebl/ssi-mobile'

await deleteConnectionRecordById(agent, connectionId)
  • deleteOobRecordById - Delete a out-of-band record by id.
import { deleteOobRecordById } from '@credebl/ssi-mobile'

await deleteOobRecordById(agent, outOfBandId)

Credentials

  • getAllCredentialExchangeRecords - Get all credential exchange records.
import { getAllCredentialExchangeRecords } from '@credebl/ssi-mobile'

const records = await getAllCredentialExchangeRecords(agent)
  • getFormattedCredentialData - Retrieves the formatted data for a given credential record ID.
import { getFormattedCredentialData } from '@credebl/ssi-mobile'

const formattedData = await getFormattedCredentialData(agent, credentialRecordId)
  • acceptCredentialOffer - Accept a credential offer.
import { acceptCredentialOffer } from '@credebl/ssi-mobile'

const credential = await acceptCredentialOffer(agent, options)
  • updateCredentialExchangeRecord - Update a credential exchange record.
import { updateCredentialExchangeRecord } from '@credebl/ssi-mobile'

await updateCredentialExchangeRecord(agent, credentialRecord)
  • declineCredentialOffer - Decline a credential offer.
import { declineCredentialOffer } from '@credebl/ssi-mobile'

const record = await declineCredentialOffer(agent, credentialRecordId)
  • deleteCredentialExchangeRecordById - Delete a credential exchange record by id.
import { deleteCredentialExchangeRecordById } from '@credebl/ssi-mobile'

await deleteCredentialExchangeRecordById(agent, credentialRecordId, options)
  • sendCredentialProblemReport - Send a credential problem report.
import { sendCredentialProblemReport } from '@credebl/ssi-mobile'

const record = await sendCredentialProblemReport(agent, options)
  • getW3cCredentialRecordById - Get a W3C credential record by id.
import { getW3cCredentialRecordById } from '@credebl/ssi-mobile'

const record = await getW3cCredentialRecordById(agent, credentialRecordId)
  • getAllW3cCredentialRecords - Get all W3C credential records.
import { getAllW3cCredentialRecords } from '@credebl/ssi-mobile'

const records = await getAllW3cCredentialRecords(agent)

Proofs

  • getProofFormatData - Get proof format data.
import { getProofFormatData } from '@credebl/ssi-mobile'

const data = await getProofFormatData(agent, proofRecordId)
  • getCredentialsForProofRequest - Get credentials for a proof request.
import { getCredentialsForProofRequest } from '@credebl/ssi-mobile'

const credentials = await getCredentialsForProofRequest(agent, options)
  • selectCredentialsForProofRequest - Select credentials for a proof request.
import { selectCredentialsForProofRequest } from '@credebl/ssi-mobile'

const credentials = await selectCredentialsForProofRequest(agent, options)
  • getProofRequestAgentMessage - Get a proof request agent message.
import { getProofRequestAgentMessage } from '@credebl/ssi-mobile'

const message = await getProofRequestAgentMessage(agent, proofRecordId)
  • createProofRequest - Create a proof request.
import { createProofRequest } from '@credebl/ssi-mobile'

const proofRequest = await createProofRequest(agent, options)
  • requestProof - Request a proof.
import { requestProof } from '@credebl/ssi-mobile'

const proof = await requestProof(agent, options)
  • updateProofRecord - Update a proof record.
import { updateProofRecord } from '@credebl/ssi-mobile'

await updateProofRecord(agent, proofRecord)
  • acceptProofRequest - Accept a proof request.
import { acceptProofRequest } from '@credebl/ssi-mobile'

const proof = await acceptProofRequest(agent, options)
  • declineProofRequest - Decline a proof request.
import { declineProofRequest } from '@credebl/ssi-mobile'

const proof = await declineProofRequest(agent, options)
  • sendProofProblemReport - Send a proof problem report.
import { sendProofProblemReport } from '@credebl/ssi-mobile'

const proof = await sendProofProblemReport(agent, options)

BasicMessages

  • sendBasicMessage - Send a basic message.
import { sendBasicMessage } from '@credebl/ssi-mobile'

const record = await sendBasicMessage(agent, options)

PushNotifications

  • setPushNotificationDeviceInfo - Set the push notification device info.
import { setPushNotificationDeviceInfo } from '@credebl/ssi-mobile'

await setPushNotificationDeviceInfo(agent, options)

Hooks

  • useAdeyaAgent - React hook to get the agent instance.
import { useAdeyaAgent } from '@credebl/ssi-mobile'

const { agent } = useAdeyaAgent()

Readme

Keywords

none

Package Sidebar

Install

npm i @credebl/ssi-mobile

Weekly Downloads

7

Version

2.0.0

License

Apache-2.0

Unpacked Size

22.2 kB

Total Files

3

Last publish

Collaborators

  • sairanjitaw
  • amitpadmani
  • ajayaw
  • lfdt-npm