Get A Module

Get module information based on module ID

🚧

This is a SDK for Alpha

This SDK is alpha and not production complete yet, which means that we could change the schemas, smart contract deployment and backend endpoints that at any time without warning or notice to you. When this SDK is production ready, we will remove this warning and will endeavor to ensure the production quality of the SDK and update the SDK in regular basis with formal notice.

Developers can use the ModuleClient to get the module by providing moduleId.

Usage

const { module } = await client.module.get({ moduleId });

Parameters

  • moduleId: string: The identifier of the module.

Response

  • module: Module: An object with module information. Here is the definition of Module.
{
	id: string					// The ID which is the deployment address of the module
	ipOrgId: string			// The IP Org ID of the module.
	moduleKey: string		// The key of the module, the short description of the module that is in the module smart contract
}

Example

You can refer to the source code below to call get function of ModuleClient.

client.module.get({moduleId: "0x4231c45c32b53ba61d8d04ad05255ccbf3e5dbd2"})
  .then(({module}) => {
    console.log(module);
  });

Here is the output of the example:

{
  id: '0x4231c45c32b53ba61d8d04ad05255ccbf3e5dbd2',
  ipOrgId: '0x0000000000000000000000000000000000000000',
  moduleKey: 'RELATIONSHIP_MODULE'
}

The output shows the zero address 0x0 for the ipOrgId, it means the module is the Story Protocol global module.

You can refer to the source code of above example at here.