Guides
Dash CoreDash PlatformDash.orgDash User DocsLog In
These docs are for v0.24.0. Click to read the latest docs for v0.25-redirect.

Working with multiple apps

Working with multiple apps

When working with other registered contracts, you will need to know their contractId and reference it in the SDK constructor.

Assuming a contract DashPay has the following contractId: "77w8Xqn25HwJhjodrHW133aXhjuTsTv9ozQaYpSHACE3".
You can then pass it as an option.

const client = new Dash.Client({
  apps: {
    dashpay: {
      contractId: '77w8Xqn25HwJhjodrHW133aXhjuTsTv9ozQaYpSHACE3'
    }
  }
});

This allow the method client.platform.documents.get to provide you field selection.
Therefore, if the contract has a profile field that you wish to access, the SDK will allow you to use dot-syntax for access :

const bobProfile = await client.platform.documents.get('dashpay.profile', { name: 'bob' });