DeveryTrust

DeveryTrust

Main class to deal with the owned smart contract interface and related operations, you can use it to check the current contract owner and listen to ownership change related events

Constructor

new DeveryTrust(options)

Creates a new DeveryTrust instance.

Usage example:

// creates a DeveryTrust with the default params
let trustClient = new DeveryTrust();

// creates a trustClient pointing to a custom address
let trustClient = new DeveryTrust({address:'0xf17f52151EbEF6C7334FAD080c5704DAAA16b732'});

Parameters:
Name Type Description
options ClientOptions

network connection options

Version:
  • 1
Source:

Extends

Methods

(async) approve(brandKey, overrideOptions) → {Promise.<*>}

Approve a brand's veracity. when you approve a brand you are "confirming" its veracity and indicating that you trust that the brand is trustworthy.

Usage example:

 // import devery and DeveryTrust
 import devery from '@devery/devery';

 const { DeveryTrust } = devery;
 // create new instance of deveryTrust
 const deveryTrustClient = new DeveryTrust();
 // approve the transaction
 const exampleBrandKey = "0xB3f64e7c2475227d98790a945B64309f6e75a37F"
 deveryTrustClient.approve(exampleBrandKey).then(res => console.log({res}))
Parameters:
Name Type Description
brandKey

Key of the approved brand

overrideOptions TransactionOptions
Source:

(async) revoke(brandKey, overrideOptions) → {Promise.<*>}

Revoke the approval of a brand. This function is meant to be used when you approve a brand and for some reason regreted that decision. Using it will nullify the previous approved status gaved by your address to a specific brand

Usage example:

 // import devery and DeveryTrust
z     *  import devery from '@devery/devery';

 const { DeveryTrust } = devery;
 // create new instance of deveryTrust
 const deveryTrustClient = new DeveryTrust();
 // revoke a transaction's approval
 const exampleBrandKey = "0xB3f64e7c2475227d98790a945B64309f6e75a37F"
 deveryTrustClient.revoke(exampleBrandKey).then(res => console.log({res}))
Parameters:
Name Type Description
brandKey

Key of the approved brand

overrideOptions TransactionOptions
Source:

(async) check()

Deprecated method that shall not be called

Source:

(async) checkBrand()

Deprecated method that shall not be called

Source:

(async) isApprover()

Deprecated method that shall not be called

Source:

(async) getAddressApprovals(addr) → {Promise.<Array.<String>>}

Returns an array containing all the brand addresses approved by a specific address

Usage example:

 // import devery and DeveryTrust
 import devery from '@devery/devery';

 const { DeveryTrust } = devery;
 // create new instance of deveryTrust
 const deveryTrustClient = new DeveryTrust();
 // revoke a transaction's approval
 const exampleAddr = "0xB3f64e7c2475227d98790a945B64309f6e75a37F"
 deveryTrustClient.getAddressApprovals(exampleAddr).then(res => {
 // what the response is going to look like -> ["0xdC28C4268bd7433b70Dd76B2E11d7D72eb4eC6c3", "0xEEF8c9E628A27574e82D53E77301998C7146096e"]
  console.log({res})
   })
Parameters:
Name Type Description
addr

The evaluated brand address

Source:

(async) getBrandApprovals(addr) → {Promise.<Array.<String>>}

Returns an array containing all the addresses that supported a specific brand

Usage example:

 // import devery and DeveryTrust
 import devery from '@devery/devery';

 const { DeveryTrust } = devery;
 // create new instance of deveryTrust
 const deveryTrustClient = new DeveryTrust();
 // revoke a transaction's approval
 const exampleAddr = "0xB3f64e7c2475227d98790a945B64309f6e75a37F"
 deveryTrustClient.getAddressApprovals(exampleAddr).then(res => {
 // what the response is going to look like -> ["0xC59c7ED1cf318c5C441Fb95a28a66b7E9Db09CbC", "0xC38e73FF84Cd24bE3c74Ee8e7AA191E29C025bd4"]
  console.log({res})
   })
Parameters:
Name Type Description
addr

The evaluated brand address

Source:

getSignerAddress() → {*}

You can use this method to check the current signer wallet address.

Overrides:
Source:

getProvider() → {*}

Returns the internal signer or provider, this method needs to be used with caution as it exposes internals. So unless you know what you are doing it's better to avoid using it.

Overrides:
Source: