Connect Website

DEPRECATED The methods in this section are deprecated and are expected to be removed in a few releases. The TRON community is discussing new specifications, you can go to TRON-TIP to participate in the discussion.

Connect Website

Overview

TronLink supports TRX transfers, contract signature, authorization, etc. initiated by DApps. For security considerations, users are required to authorize the DApp to “connect website”. They can take further actions only after successful authorization. The DApp must first connect to the website, and wait for the user's permission before it can initiate a request for authorization.

Specification

Example

const res = await tronWeb.request(
  {
    method: 'tron_requestAccounts',
    params: {
      websiteIcon: '<WEBSITE ICON URI>',
      websiteName: '<WEBSITE NAME>',
    },
  }
)

Parameters

interface RequestAccountsParams {
  websiteIcon?: string;
  websiteName?: string;
}

Returns

interface ReqestAccountsResponse {
  code: 200 | 4000 | 4001,
  message: string
}

Interaction

Last updated