@lighthouse-web3/sdk
Version:
NPM package and CLI tool to interact with lighthouse protocol
21 lines (20 loc) • 823 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const browser_1 = __importDefault(require("./browser"));
const node_1 = __importDefault(require("./node"));
exports.default = async (path, apiKey, publicKey, signedMessage, cidVersion = 1, uploadProgressCallback) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === 'undefined') {
return await (0, node_1.default)(path, apiKey, publicKey, signedMessage, cidVersion);
}
else {
return await (0, browser_1.default)(path, apiKey, publicKey, signedMessage, cidVersion, uploadProgressCallback ||
(() => {
return;
}));
}
};