EvanDescriptionService

Source description

Blockchain core description class wrapper.


getEvanENSAddress

descriptionService.getEvanENSAddress(ensAddress);

Returns an full evan ENS address.

Parameters

  1. ensAddress - string: ENS postfix (dappdapps => dappdapps.evan.test)

Returns

string: The evan ens address.

Example

descriptionService.getEvanENSAddress('favorites') // => favorites.evan

getDescription

descriptionService.getDescription(arguments);

Load the DBCP description and check if the ens address and it’s DApp behind can be added.

Adds additional runtime properties for easier ui checks: - adds translation values for the current language - name without spaces - ens address - status (invalid, valid, already_added)

Parameters

  1. ensAddress - string: Ens Address to load the DApp from
  2. clearDescription - boolean: remove runtime values like ensAddress, status, translated, trimmedName, currentLang

Returns

https://github.com/evannetwork/dbcp/blob/master/wiki/Example-DBCP-file.md

Promise returns any: return the enchanced descriptions

Example

descriptionService.getDescription('favorites.evan', false)

getMultipleDescriptions

descriptionService.getMultipleDescriptions(ensAddresses);

Takes an array of dapp names and loads their description from the ens.

Parameters

  1. ensAddresses - Array<string>: ENS-Addresses to load

Returns

Promise returns any: multiple descriptions.

Example

await descriptionService.multipleDescriptions([
  'favorites',
  'contacts',
  ...
])

getENSOriginUrl

descriptionService.getENSOriginUrl(ensAddress);

Gets the ens origin url.

Parameters

  1. ensAddress - string: The options used for calling

Returns

string: The ens origin url.

Example

  • typescript
import {
  getDomainName
} from 'dapp-browser';
...

this.ensOrigin = this.description.getENSOriginUrl(`cool-dapp.${ getDomainName() }`);
<img *oneTime [src]="_DomSanitizer.bypassSecurityTrustUrl(ensOrigin + '/cool-img.png')" />