@entros/pulse-sdk 1.4.0 → 1.4.1
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/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1287,7 +1287,7 @@ function bytesToHex(bytes) {
|
|
|
1287
1287
|
function hexToBytes(hex, expectedLen) {
|
|
1288
1288
|
const trimmed = hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
1289
1289
|
if (trimmed.length !== expectedLen * 2) return null;
|
|
1290
|
-
if (!/^[0-9a-
|
|
1290
|
+
if (!/^[0-9a-f]+$/.test(trimmed)) return null;
|
|
1291
1291
|
const out = new Uint8Array(expectedLen);
|
|
1292
1292
|
for (let i = 0; i < expectedLen; i += 1) {
|
|
1293
1293
|
out[i] = parseInt(trimmed.substr(i * 2, 2), 16);
|
|
@@ -1555,21 +1555,22 @@ async function submitViaWallet(proof, commitment, options) {
|
|
|
1555
1555
|
let ed25519Ix = null;
|
|
1556
1556
|
if (options.signedReceipt) {
|
|
1557
1557
|
ed25519Ix = await buildEd25519ReceiptIx(options.signedReceipt);
|
|
1558
|
-
if (ed25519Ix) {
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
sdkWarn(
|
|
1564
|
-
"[Entros SDK] signedReceipt provided but failed to decode; minting without binding"
|
|
1565
|
-
);
|
|
1558
|
+
if (!ed25519Ix) {
|
|
1559
|
+
return {
|
|
1560
|
+
success: false,
|
|
1561
|
+
error: "Validator returned a signed receipt that failed to decode (malformed hex or wrong byte length). Refusing to mint without a valid binding. The validator service may be misconfigured \u2014 check the validation-service logs."
|
|
1562
|
+
};
|
|
1566
1563
|
}
|
|
1564
|
+
sdkLog(
|
|
1565
|
+
"[Entros SDK] Bundling validator-signed mint receipt before mint_anchor"
|
|
1566
|
+
);
|
|
1567
1567
|
} else {
|
|
1568
1568
|
sdkLog(
|
|
1569
|
-
"[Entros SDK] No validator receipt available; minting without binding (
|
|
1569
|
+
"[Entros SDK] No validator receipt available; minting without binding (on-chain check is log-only today)"
|
|
1570
1570
|
);
|
|
1571
1571
|
}
|
|
1572
1572
|
const tx = new Transaction();
|
|
1573
|
+
tx.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 2e5 }));
|
|
1573
1574
|
if (ed25519Ix) tx.add(ed25519Ix);
|
|
1574
1575
|
tx.add(mintAnchorIx);
|
|
1575
1576
|
tx.feePayer = provider.wallet.publicKey;
|
|
@@ -2034,7 +2035,11 @@ async function extractFingerprintAndValidate(sensorData, config, walletAddress,
|
|
|
2034
2035
|
if (successBody.signed_receipt) {
|
|
2035
2036
|
signedReceipt = successBody.signed_receipt;
|
|
2036
2037
|
}
|
|
2037
|
-
} catch {
|
|
2038
|
+
} catch (err) {
|
|
2039
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2040
|
+
sdkWarn(
|
|
2041
|
+
`[Entros SDK] /validate-features returned 200 but body was not parseable JSON; proceeding without receipt: ${msg}`
|
|
2042
|
+
);
|
|
2038
2043
|
}
|
|
2039
2044
|
} catch (err) {
|
|
2040
2045
|
const msg = err instanceof Error ? err.message : String(err);
|