Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
API Reference

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

name

string

Yes

The name of your application, displayed prominently in the wallet.

description

string

Yes

A short description of your application's purpose.

icon

string

Yes

A valid HTTPS URL for your application's logo. This should be a high-quality image.

link

string

No

A URL to your application's home page. This allows users to easily return to your app from their wallet.

path

string

No

The deep link URL prefix that the wallet uses. Defaults to https://abtwallet.io/i/.

publisher

string

No

The DID of the application publisher (e.g., did:abt:...).

updateSubEndpoint

boolean

No

A flag to indicate if the subscription endpoint should be updated.

subscriptionEndpoint

string

No

The endpoint for wallet subscription updates.

nodeDid

string

No

The DID of the application's associated node.

agentDid

string

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

type

string

No

The type of blockchain. Supported values are arcblock, ethereum, solona. Defaults to arcblock.

id

string

Conditional

The unique identifier for the chain. For ethereum or solona, this is the numerical Chain ID and is required. For arcblock, this is the string-based chain name (e.g., 'beta') and is optional (defaults to 'none').

host

string

Conditional

The endpoint for the chain. For arcblock chains, this is the GraphQL endpoint and must be a valid URI if provided. For ethereum and solona, this is the RPC endpoint and is optional.

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.