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