@airgap/beacon-dapp
Version:
Use this package on your dApp to instanciate a DAppClient object and communicate to wallets.
21 lines • 769 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDAppClientInstance = void 0;
const DAppClient_1 = require("../dapp-client/DAppClient");
let _instance;
/** Get a DAppClient instance. Will make sure only one dAppClient exists. After the first instance has been created, the config will be ignored, unless "reset" is set */
const getDAppClientInstance = (config, reset) => {
if (_instance && reset) {
_instance.disconnect();
_instance = undefined;
}
if (_instance) {
return _instance;
}
if (!_instance) {
_instance = new DAppClient_1.DAppClient(config);
}
return _instance;
};
exports.getDAppClientInstance = getDAppClientInstance;
//# sourceMappingURL=get-instance.js.map