async LibraryContentTypes({libraryId}) {
    const typesLength = (await this.ethClient.CallContractMethod({
      contractAddress: Utils.HashToAddress(libraryId),
      abi: LibraryContract.abi,
      methodName: "contentTypesLength",
      methodArgs: [],
      signer: this.signer
    })).toNumber();

    // No allowed types set - any type accepted
    if(typesLength === 0) { return {}; }

    // Get the list of allowed content type addresses
    let allowedTypes = {};
    await Promise.all(
      Array.from(new Array(typesLength), async (_, i) => {
        const typeAddress = await this.ethClient.CallContractMethod({
          contractAddress: Utils.HashToAddress(libraryId),
          abi: LibraryContract.abi,
          methodName: "contentTypes",
          methodArgs: [i],
          signer: this.signer
        });

        const typeId = this.utils.AddressToObjectId(typeAddress);
        allowedTypes[typeId] = await this.ContentType({typeId});
      })
    );

    return allowedTypes;
  }
/**
   * Retrieve the allowed content types for the specified library.
   *
   * Note: If no content types have been set on the library, all types are allowed, but an empty hash will be returned.
   *
   * @see <a href="#ContentTypes">ContentTypes</a>
   *
   * @methodGroup Content Libraries
   * @namedParams
   * @param {string} libraryId - ID of the library
   *
   * @returns {Promise<Object>} - List of accepted content types - return format is equivalent to ContentTypes method
   */
Retrieve the allowed content types for the specified library.
Note: If no content types have been set on the library, all types are allowed, but an empty hash will be returned.



@methodGroup Content Libraries
@namedParams
@param {string} libraryId - ID of the library

@returns {Promise} - List of accepted content types - return format is equivalent to ContentTypes method
Retrieve the allowed content types for the specified library . Note : If no content types have been set on the library all types are allowed but an empty hash will be returned . @methodGroup Content Libraries @namedParams @param { string } libraryId - ID of the library @returns { Promise } - List of accepted content types - return format is equivalent to ContentTypes method
async LibraryContentTypes({libraryId}) {
    const typesLength = (await this.ethClient.CallContractMethod({
      contractAddress: Utils.HashToAddress(libraryId),
      abi: LibraryContract.abi,
      methodName: "contentTypesLength",
      methodArgs: [],
      signer: this.signer
    })).toNumber();
    if(typesLength === 0) { return {}; }
    let allowedTypes = {};
    await Promise.all(
      Array.from(new Array(typesLength), async (_, i) => {
        const typeAddress = await this.ethClient.CallContractMethod({
          contractAddress: Utils.HashToAddress(libraryId),
          abi: LibraryContract.abi,
          methodName: "contentTypes",
          methodArgs: [i],
          signer: this.signer
        });
        const typeId = this.utils.AddressToObjectId(typeAddress);
        allowedTypes[typeId] = await this.ContentType({typeId});
      })
    );
    return allowedTypes;
  }
async LibraryContentTypes ( { libraryId } ) { const typesLength = ( await this . ethClient . CallContractMethod ( { contractAddress : Utils . HashToAddress ( libraryId ) , abi : LibraryContract . abi , methodName : "contentTypesLength" , methodArgs : [ ] , signer : this . signer } ) ) . toNumber ( ) ; if ( typesLength === 0 ) { return { } ; } let allowedTypes = { } ; await Promise . all ( Array . from ( new Array ( typesLength ) , async ( _ , i ) => { const typeAddress = await this . ethClient . CallContractMethod ( { contractAddress : Utils . HashToAddress ( libraryId ) , abi : LibraryContract . abi , methodName : "contentTypes" , methodArgs : [ i ] , signer : this . signer } ) ; const typeId = this . utils . AddressToObjectId ( typeAddress ) ; allowedTypes [ typeId ] = await this . ContentType ( { typeId } ) ; } ) ) ; return allowedTypes ; }
Retrieve the allowed content types for the specified library.
Retrieve the allowed content types for the specified library .
// No allowed types set - any type accepted // Get the list of allowed content type addresses