UNPKG

@dappnode/dappnodesdk

Version:

dappnodesdk is a tool to make the creation of new dappnode packages as simple as possible. It helps to initialize and publish in ethereum blockchain

30 lines 983 B
import querystring from "querystring"; import { URL } from "url"; import { publishTxAppUrl } from "../params.js"; const adminUiBaseUrl = "http://my.dappnode"; /** * Get link to publish a TX from a txData object * @param txData */ export function getPublishTxLink(txData) { // txData => Admin UI link const txDataShortKeys = { r: txData.ensName, v: txData.currentVersion, h: txData.releaseMultiHash }; // Only add developerAddress if necessary to not pollute the link if (txData.developerAddress) txDataShortKeys.d = txData.developerAddress; const url = new URL(publishTxAppUrl); url.search = querystring.stringify(txDataShortKeys); return url.toString(); } /** * Get link to install a DNP from its path * @param releaseMultiHash */ export function getInstallDnpLink(releaseMultiHash) { return `${adminUiBaseUrl}/installer/public/${encodeURIComponent(releaseMultiHash)}`; } //# sourceMappingURL=getLinks.js.map