@nibgate/sdk 0.2.30 → 0.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nibgate.js +21 -13
- package/dist/nibgate.js.map +2 -2
- package/dist/nibgate.min.js +10 -10
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/default-ui.js +21 -10
package/dist/nibgate.js
CHANGED
|
@@ -27357,7 +27357,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27357
27357
|
<div id="nibgate-lottie" style="width:165px;height:168px;margin-bottom:24px"></div>
|
|
27358
27358
|
<div style="font-size:50px;font-weight:700;letter-spacing:-.03em;color:${theme.fg};margin-bottom:12px">${esc(resource.price)} USDC</div>
|
|
27359
27359
|
<div style="font-size:21px;color:${theme.muted};margin-bottom:48px">Pay to unlock this content</div>
|
|
27360
|
-
<div data-nibgate-wallet-label class="nui-mono" style="font-size:18px;color:${theme.muted};margin-bottom:40px;min-height:28px">Connect wallet
|
|
27360
|
+
<div data-nibgate-wallet-label class="nui-mono" style="font-size:18px;color:${theme.muted};margin-bottom:40px;min-height:28px">Connect wallet <span data-nibgate-bal style="display:none"><span data-nibgate-bal-txt></span></span></div>
|
|
27361
27361
|
<div data-nibgate-unlock-wrap style="width:100%;position:relative;border-radius:10px;overflow:hidden;cursor:pointer">
|
|
27362
27362
|
<div data-nibgate-unlock-progress style="position:absolute;inset:0;width:0%;background:${theme.accent};opacity:0.15;border-radius:10px;transition:width .05s linear;z-index:2"></div>
|
|
27363
27363
|
<button type="button" data-nibgate-unlock disabled style="width:100%;padding:14px 0;font-size:17px;font-weight:600;line-height:1;border:0;border-radius:10px;outline:none;cursor:pointer;position:relative;z-index:4;color:#fff;background:${theme.accent};transition:box-shadow .3s,transform .3s;font-family:inherit;display:flex;align-items:center;justify-content:center">${unlockSVG}Hold to pay</button></div>
|
|
@@ -27434,12 +27434,19 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27434
27434
|
}
|
|
27435
27435
|
function updateLabel() {
|
|
27436
27436
|
const addr = ctrl.getWalletAddress();
|
|
27437
|
+
while (label.firstChild) label.removeChild(label.firstChild);
|
|
27437
27438
|
if (addr) {
|
|
27438
|
-
label.
|
|
27439
|
+
label.appendChild(document.createTextNode(shortAddress(addr) + " "));
|
|
27440
|
+
const dc = el("span", { "data-nibgate-disconnect": "", style: "cursor:pointer" }, "\xB7 Disconnect");
|
|
27441
|
+
dc.addEventListener("click", (e) => {
|
|
27442
|
+
if (e.target.dataset.nibgateDisconnect !== void 0) ctrl.disconnect().then(updateLabel);
|
|
27443
|
+
});
|
|
27444
|
+
label.appendChild(dc);
|
|
27445
|
+
if (balEl?.isConnected) label.appendChild(balEl);
|
|
27439
27446
|
btn.disabled = false;
|
|
27440
27447
|
btn.style.cursor = "pointer";
|
|
27441
27448
|
} else {
|
|
27442
|
-
label.
|
|
27449
|
+
label.appendChild(document.createTextNode("Connect wallet"));
|
|
27443
27450
|
btn.disabled = true;
|
|
27444
27451
|
btn.style.cursor = "default";
|
|
27445
27452
|
btn.innerHTML = unlockSVG + "Hold to pay";
|
|
@@ -27488,9 +27495,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27488
27495
|
resetHold();
|
|
27489
27496
|
}
|
|
27490
27497
|
label.addEventListener("click", (e) => {
|
|
27491
|
-
if (
|
|
27492
|
-
ctrl.disconnect().then(updateLabel);
|
|
27493
|
-
} else if (!ctrl.getWalletAddress()) {
|
|
27498
|
+
if (!ctrl.getWalletAddress()) {
|
|
27494
27499
|
ctrl.connect().then(updateLabel).catch(() => updateLabel());
|
|
27495
27500
|
}
|
|
27496
27501
|
});
|
|
@@ -27542,13 +27547,16 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27542
27547
|
}
|
|
27543
27548
|
function ensureBal() {
|
|
27544
27549
|
if (balEl && balEl.isConnected) return balEl;
|
|
27545
|
-
balEl =
|
|
27546
|
-
|
|
27547
|
-
|
|
27548
|
-
|
|
27549
|
-
|
|
27550
|
-
|
|
27551
|
-
|
|
27550
|
+
balEl = label.querySelector("[data-nibgate-bal]");
|
|
27551
|
+
if (balEl) {
|
|
27552
|
+
balEl.style.display = "";
|
|
27553
|
+
balEl.style.marginLeft = "4px";
|
|
27554
|
+
balEl.style.cursor = "pointer";
|
|
27555
|
+
balEl.style.whiteSpace = "nowrap";
|
|
27556
|
+
balEl.style.color = "var(--accent,#7c9a6d)";
|
|
27557
|
+
balEl.innerHTML = "\xB7\xA0<span data-nibgate-bal-txt></span>\xA0|\xA0" + depIcon();
|
|
27558
|
+
balEl.addEventListener("click", showDeposit);
|
|
27559
|
+
}
|
|
27552
27560
|
return balEl;
|
|
27553
27561
|
}
|
|
27554
27562
|
async function refreshBal() {
|