{"version":3,"file":"blob.cjs","sources":["../../../../src/modules/multi-api/blob.js"],"sourcesContent":["import { AbstractBlobModule } from '../abstract';\nimport { BlobId, BlobWithId } from '../../types';\nimport { injectModuleRouter } from './common';\n\nexport default class MultiApiBlobModule extends injectModuleRouter(\n  AbstractBlobModule,\n) {\n  /**\n   * Write a new blob on chain.\n   * @param blobWithId\n   * @param targetDid - Signer of the blob\n   * @param signingKeyRef - The key id used by the signer. This will be used by the verifier (node) to fetch the public key for verification\n   * @returns {Promise<*>}\n   */\n  async new(blobWithId, didKeypair, params = {}) {\n    const parsedBlobWithId = BlobWithId.from(blobWithId);\n\n    return await this.moduleById(parsedBlobWithId.id).new(\n      parsedBlobWithId,\n      didKeypair,\n      params,\n    );\n  }\n\n  /**\n   * Write a new blob on chain.\n   * @param blob\n   * @param signerDid - Signer of the blob\n   * @param signingKeyRef - The key id used by the signer. This will be used by the verifier (node) to fetch the public key for verification\n   * @returns {Promise<*>}\n   */\n  async newTx(blobWithId, didKeypair) {\n    const parsedBlobWithId = BlobWithId.from(blobWithId);\n\n    return await this.moduleById(parsedBlobWithId.id).newTx(\n      parsedBlobWithId,\n      didKeypair,\n    );\n  }\n\n  /**\n   * Get blob with given id from the chain. Throws if the blob can't be found.\n   * @param {string} id - Can either be a full blob id like blob:dock:0x... or just the hex identifier\n   * @returns {Promise<Blob>} - A 2-element array where the first is the author and the second is the blob contents.\n   */\n  async get(id) {\n    const parsedId = BlobId.from(id);\n\n    return await this.moduleById(parsedId).get(parsedId);\n  }\n}\n"],"names":["injectModuleRouter","AbstractBlobModule","BlobWithId","BlobId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIe,MAAM,kBAAkB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