{"version":3,"file":"status-list-credential.cjs","sources":["../../../../src/modules/multi-api/status-list-credential.js"],"sourcesContent":["import { AbstractStatusListCredentialModule } from '../abstract';\nimport { StatusListCredentialId } from '../../types';\nimport { injectModuleRouter } from './common';\n\nexport default class MultiApiStatusListCredentialModule extends injectModuleRouter(\n  AbstractStatusListCredentialModule,\n) {\n  /**\n   * Fetches `StatusList2021Credential` with the supplied identifier.\n   * @param {*} statusListCredentialId\n   * @returns {Promise<StatusList2021Credential | null>}\n   */\n  async getStatusListCredential(statusListCredentialId) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).getStatusListCredential(id);\n  }\n\n  /**\n   * Create a transaction to create a new status list credential on-chain.\n   * @param id - is the unique id of the status list credential. The function will check whether `id` is already taken or not.\n   * @param statusListCredential - the credential to be associated with the given `id`\n   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async createStatusListCredentialTx(\n    statusListCredentialId,\n    statusListCredential,\n    didKeypair,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).createStatusListCredentialTx(\n      id,\n      statusListCredential,\n      didKeypair,\n    );\n  }\n\n  /**\n   * Create a transaction to update an existing status list credential on-chain.\n   * @param statusListCredentialUpdate - Update for the status list credential.\n   * @param didKeypair - `DID` signing key(s)\n   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async updateStatusListCredentialTx(\n    statusListCredentialId,\n    statusListCredential,\n    didKeypair,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).updateStatusListCredentialTx(\n      id,\n      statusListCredential,\n      didKeypair,\n    );\n  }\n\n  /**\n   * Create a transaction to remove an existing status list credential from the chain.\n   * @param statusListCredentialId - is the unique id of the status list credential. The function will check whether `id` is already taken or not.\n   * @param didKeypair - `DID` signing key(s)\n   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async removeStatusListCredentialTx(\n    statusListCredentialId,\n    didKeypair,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).removeStatusListCredentialTx(\n      id,\n      didKeypair,\n    );\n  }\n\n  /**\n   * Create a transaction to create a new status list credential on-chain.\n   * @param id - is the unique id of the status list credential. The function will check whether `id` is already taken or not.\n   * @param statusListCredential - the credential to be associated with the given `id`\n   * @param didKeypair\n   * @param params\n   * @return {Promise<StatusListCredentialId>} - the extrinsic to sign and send.\n   */\n  async createStatusListCredential(\n    statusListCredentialId,\n    statusListCredential,\n    didKeypair,\n    params,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).createStatusListCredential(\n      id,\n      statusListCredential,\n      didKeypair,\n      params,\n    );\n  }\n\n  /**\n   * Create a transaction to update an existing status list credential on-chain.\n   * @param id\n   * @param statusListCredentialUpdate - Update for the status list credential.\n   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.\n   * @param params\n   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async updateStatusListCredential(\n    statusListCredentialId,\n    statusListCredential,\n    didKeypair,\n    params,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).updateStatusListCredential(\n      id,\n      statusListCredential,\n      didKeypair,\n      params,\n    );\n  }\n\n  /**\n   * Create a transaction to remove an existing status list credential from the chain.\n   * @param statusListCredentialId - is the unique id of the status list credential. The function will check whether `id` is already taken or not.\n   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.\n   * @param params\n   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async removeStatusListCredential(\n    statusListCredentialId,\n    didKeypair,\n    params,\n  ) {\n    const id = StatusListCredentialId.from(statusListCredentialId);\n\n    return await this.moduleById(id).removeStatusListCredential(\n      id,\n      didKeypair,\n      params,\n    );\n  }\n}\n"],"names":["injectModuleRouter","AbstractStatusListCredentialModule","StatusListCredentialId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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