@nibgate/sdk 0.2.26 → 0.2.27
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 +12 -13
- package/dist/nibgate.js.map +2 -2
- package/dist/nibgate.min.js +52 -52
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/default-ui.js +10 -13
package/package.json
CHANGED
|
@@ -225,20 +225,17 @@ export function renderDefaultUnlockUI(container, resource, options = {}) {
|
|
|
225
225
|
card.addEventListener('remove', cleanup);
|
|
226
226
|
|
|
227
227
|
// ── Gateway balance + deposit icon ─────────────────────────────────────
|
|
228
|
-
const ARC_RPC = 'https://arc-testnet.drpc.org';
|
|
229
|
-
const GATEWAY_WALLET = '0x0077777d7EBA4688BDeF3E311b846F25870A19B9';
|
|
230
|
-
const USDC_ADDRESS = '0x3600000000000000000000000000000000000000';
|
|
231
|
-
|
|
232
228
|
async function fetchBalance(addr) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
229
|
+
try {
|
|
230
|
+
const sel = '0xdd62e1c6';
|
|
231
|
+
const pad = (a) => '000000000000000000000000' + a.slice(2).toLowerCase();
|
|
232
|
+
const data = sel + pad('0x3600000000000000000000000000000000000000') + pad(addr);
|
|
233
|
+
const hex = await window.ethereum.request({
|
|
234
|
+
method: 'eth_call',
|
|
235
|
+
params: [{ to: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9', data }, 'latest'],
|
|
236
|
+
});
|
|
237
|
+
return hex && hex !== '0x' ? (Number(BigInt(hex)) / 1_000_000).toFixed(2) + ' USDC' : '0.00 USDC';
|
|
238
|
+
} catch { return '\u2014'; }
|
|
242
239
|
}
|
|
243
240
|
|
|
244
241
|
let balEl = null, gwOverlay = null, balTimer = null;
|