Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

wallet_connect

Requests to connect account(s) with optional capabilities.

Authentication Required: No (triggers authentication)

Request

await jaw.provider.request({
  method: 'wallet_connect',
  params: [{
    capabilities: {
      signInWithEthereum: {
        nonce: 'abc123xyz789',
        chainId: '0x1',
        domain: 'my-dapp.com',
        uri: 'https://my-dapp.com',
        statement: 'Sign in to My DApp with your JAW account'
      },
      subnameTextRecords: [
        { key: 'avatar', value: 'https://my-dapp.com/avatars/1.png' },
        { key: 'description', value: 'Premium member' }
      ]
    }
  }],
});

Parameters

NameTypeRequiredDescription
capabilitiesobjectNoRequested capabilities

Capabilities

signInWithEthereum

NameTypeRequiredDescription
noncestringYesRandom nonce for SIWE
chainIdstringYesChain ID (hex format)
domainstringNoDomain requesting signature
uristringNoURI of the application
statementstringNoHuman-readable statement
versionstringNoSIWE version (default: "1")
issuedAtstringNoISO 8601 timestamp
expirationTimestringNoISO 8601 expiration

subnameTextRecords

Array of key-value pairs to attach as ENS text records to the user's subname on account creation.

Note: This capability is only used if an ENS domain is configured in the SDK preferences (via the ens option). If no ENS domain is configured, these records are disregarded.

NameTypeDescription
keystringText record key (e.g., "avatar", "url")
valuestringText record value

Response

Returns connection result with accounts and capabilities.

Type: object

Example

{
  "accounts": [{
    "address": "0x1234567890123456789012345678901234567890",
    "capabilities": {
      "signInWithEthereum": {
        "message": "my-dapp.com wants you to sign in with your Ethereum account:\n0x1234...",
        "signature": "0xabcdef..."
      }
    }
  }]
}

Behavior

  • Opens authentication popup
  • User creates account or signs in with existing account
  • If signInWithEthereum capability is requested:
    • Generates and signs a SIWE message with the provided parameters
    • Returns the signed message in the response capabilities
  • If subnameTextRecords capability is provided and ens is configured in SDK preferences:
    • Attaches the provided text records to the subname
  • Returns accounts with capability responses

Errors

CodeDescription
4001User rejected the request
4100Unauthorized (authentication failed)
-32602Invalid params

Example

const result = await jaw.provider.request({
  method: 'wallet_connect',
  params: [{}],
});

Related Methods