{"version":3,"file":"module.cjs","sources":["../../../../../src/modules/abstract/status-list-credential/module.js"],"sourcesContent":["import { AbstractBaseModule } from '../common';\nimport { withExtendedPrototypeProperties } from '../../../utils';\n\n/**\n * Module supporting `StatusList2021Credential` and `RevocationList2020Credential`.\n */\nclass AbstractStatusListCredentialModule extends AbstractBaseModule {\n  /**\n   * Fetches `StatusList2021Credential` with the supplied identifier.\n   * @param {*} statusListCredentialId\n   * @returns {Promise<StatusList2021Credential | null>}\n   */\n  async getStatusListCredential(_statusListCredentialId) {\n    throw new Error('Unimplemented');\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    id,\n    statusListCredential,\n    didKeypair,\n    params,\n  ) {\n    return await this.signAndSend(\n      await this.createStatusListCredentialTx(\n        id,\n        statusListCredential,\n        didKeypair,\n      ),\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    id,\n    statusListCredential,\n    didKeypair,\n    params,\n  ) {\n    return await this.signAndSend(\n      await this.updateStatusListCredentialTx(\n        id,\n        statusListCredential,\n        didKeypair,\n      ),\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    return await this.signAndSend(\n      await this.removeStatusListCredentialTx(\n        statusListCredentialId,\n        didKeypair,\n      ),\n      params,\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   * @return {Promise<*>} - the extrinsic to sign and send.\n   */\n  async createStatusListCredentialTx(\n    _id,\n    _statusListCredential,\n    _didKeypair,\n  ) {\n    throw new Error('Unimplemented');\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<*>} - the extrinsic to sign and send.\n   */\n  async updateStatusListCredentialTx(\n    _id,\n    _statusListCredential,\n    _didKeypair,\n  ) {\n    throw new Error('Unimplemented');\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   * @return {Promise<object>} - the extrinsic to sign and send.\n   */\n  async removeStatusListCredentialTx(\n    _statusListCredentialId,\n    _didKeypair,\n  ) {\n    throw new Error('Unimplemented');\n  }\n}\n\nexport default withExtendedPrototypeProperties(\n  [\n    'getStatusListCredential',\n    'createStatusListCredentialTx',\n    'updateStatusListCredentialTx',\n    'removeStatusListCredentialTx',\n  ],\n  AbstractStatusListCredentialModule,\n);\n"],"names":["AbstractBaseModule","withExtendedPrototypeProperties","AbstractStatusListCredentialModule"],"mappings":";;;;;;;;;;;;;;AAGA;AACA;AACA;2CACA,MAAM,kCAAkC,SAASA,0CAAkB,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,uBAAuB,CAAC,uBAAuB,EAAE;AACzD,IAAI,MAAM,IAAI,KAAK,C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