UNPKG

@rarimo/providers-near

Version:

Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on the NEAR blockchain.

54 lines (53 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MAX_GAS_LIMIT: function() { return MAX_GAS_LIMIT; }, NO_DEPOSIT: function() { return NO_DEPOSIT; }, nearToYocto: function() { return nearToYocto; }, yoctoToNear: function() { return yoctoToNear; }, getNearExplorerTxUrl: function() { return getNearExplorerTxUrl; }, getNearExplorerAddressUrl: function() { return getNearExplorerAddressUrl; }, handleNearError: function() { return handleNearError; } }); const _nearapijs = require("near-api-js"); const MAX_GAS_LIMIT = '300000000000000'; const NO_DEPOSIT = '0'; const nearToYocto = (amount)=>{ return _nearapijs.utils.format.parseNearAmount(amount); }; const yoctoToNear = (amount)=>{ return _nearapijs.utils.format.formatNearAmount(amount); }; function getNearExplorerTxUrl(explorerUrl, txHash) { return `${explorerUrl}/transactions/${txHash}`; } function getNearExplorerAddressUrl(explorerUrl, address) { return `${explorerUrl}/accounts/${address}`; } function handleNearError(error) { // TODO: handle error throw error; } //# sourceMappingURL=helpers.js.map