Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 2.17 KB

asset.md

File metadata and controls

24 lines (17 loc) · 2.17 KB

Asset

In the context of EW-DOS, an Asset is a digital representation of a physical or virtual device on the Energy Web Chain. An Asset could represent, for example, a solar PV panel, a battery, an electric vehicle, or an IOT device.

To read more about about Assets in EW-DOS, see the documentation.

The IAM Client Library contains the high-level functions for managing (registering, fetching, transferring ownership, etc.) Assets and their corresponding data.

When a user registers an Asset using the registerAsset method, the user automatically becomes the owner of the Asset. Using the methods in the IAM client library:

  • The Asset owner can make an offer to transfer ownership of the Asset to another address.
  • The offeree can accept or reject the offer of Asset ownership.
  • The offerer can cancel the ownership offer request at any time before the offer is accepted.

Public APIs:

  • registerAsset: Register Asset to the user who initiates the method. This creates a record of the Asset on the Energy Web Chain.
  • getAssetById: Fetch an Asset by its DID.
  • getAssetHistory: Fetch an Asset's history by its DID.
  • getOfferedAssets: Fetch all Assets offered to a given DID. These are Assets that have been offered to the user, but not yet confirmed.
  • getOwnedAssets: Fetch all Assets owned by a given DID.
  • getPreviouslyOwnedAssets: Fetch all Assets previously owned by a given DID.
  • offerAsset: Offer an Asset to a given address.
  • rejectAssetOffer: Reject Asset ownership that has been offered to you as a user.