0.1.9 • Published 1 year ago
@datapond/ar-check-new-version v0.1.9
Notice: This project has been submitted to the EduHack 2023 on DevPost as part of the DataPond Project, the first decentralized free book library on the topic of Ethics and Sustainability.
@datapond/ar-check-new-version
This is the browser utility that allows you to load the latest published version from the registered contracts.
A Smart contract aimed at keeping track of deployed versions for a decentralized web3 app. Typically, a downloadable installer, or a URL.
Usage
npm i -D @datapond/ar-check-new-version
import {version} from '../package.json';
import {VersionCheck, Platforms} from '@datapond/ar-check-new-version';
const contractId = 'YOUR_CONTRACT_ID';
const platform = Platforms.Windows;
const {GetLastVersion} = VersionCheck(platform, contractId);
const {version: lastVersion, url} = await GetLastVersion();
if(version !== lastVersion) {
console.log(`A new version is available at ${url}`);
}
Version Management
To create the contract, and manage deployed versions, go to @datapond/ar-web3-versions