Configuration Objects
When setting up DID Connect, you use configuration objects to define your application's identity and its connection to a specific blockchain. These objects are passed to the WalletAuthenticator constructor and are crucial for the wallet to correctly display information to the user.
This section provides a detailed reference for the ApplicationInfo and ChainInfo data structures.
ApplicationInfo#
The ApplicationInfo object contains metadata about your application. This information is presented to the user in their wallet when they receive a connection request, so it's important to make it clear and accurate.
Property | Type | Required | Description |
|---|---|---|---|
|
| Yes | The name of your application, displayed prominently in the wallet. |
|
| Yes | A short description of your application's purpose. |
|
| Yes | A valid HTTPS URL for your application's logo. This should be a high-quality image. |
|
| No | A URL to your application's home page. This allows users to easily return to your app from their wallet. |
|
| No | The deep link URL prefix that the wallet uses. Defaults to |
|
| No | The DID of the application publisher (e.g., |
|
| No | A flag to indicate if the subscription endpoint should be updated. |
|
| No | The endpoint for wallet subscription updates. |
|
| No | The DID of the application's associated node. |
|
| No | The DID of the agent acting on behalf of the application. |
Example appInfo Object:
const appInfo = {
name: 'DID Wallet Demo',
description: 'A demo application to showcase DID Connect capabilities.',
icon: 'https://arcblock.oss-cn-beijing.aliyuncs.com/images/wallet-round.png',
link: 'https://www.didconnect.io',
publisher: 'did:abt:z1Sre6R4c7WfASj2e2x4T4V8sA1kC1aYg1bT',
};ChainInfo#
The ChainInfo object specifies which blockchain your application will interact with for this session. The wallet uses this information to ensure it's connected to the correct network and can correctly interpret requests like transactions or signatures.
Property | Type | Required | Description |
|---|---|---|---|
|
| No | The type of blockchain. Supported values are |
|
| Conditional | The unique identifier for the chain. For |
|
| Conditional | The endpoint for the chain. For |
Example for an ArcBlock Chain:
const chainInfoArcBlock = {
type: 'arcblock',
id: 'beta',
host: 'https://beta.abtnetwork.io/api',
};Example for an Ethereum Chain:
const chainInfoEthereum = {
type: 'ethereum',
id: '1', // Ethereum Mainnet
host: 'https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID', // Optional but recommended
};With these objects correctly configured, you can proceed to define the specific data you need from the user. For more on this, see the Claim Types documentation.