@volr/react 0.1.117 → 0.1.119
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.cjs +167 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.js +163 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -20425,6 +20425,14 @@ function detectPlatform2() {
|
|
|
20425
20425
|
function detectBrowser() {
|
|
20426
20426
|
if (typeof navigator === "undefined") return "Unknown";
|
|
20427
20427
|
const ua = navigator.userAgent;
|
|
20428
|
+
if (/KAKAOTALK/i.test(ua)) return "KakaoTalk-InApp";
|
|
20429
|
+
if (/NAVER\(/i.test(ua)) return "Naver-InApp";
|
|
20430
|
+
if (/Line\//i.test(ua)) return "Line-InApp";
|
|
20431
|
+
if (/MetaMaskMobile/i.test(ua)) return "MetaMask-InApp";
|
|
20432
|
+
if (/FB_IAB|FBAN/i.test(ua)) return "Facebook-InApp";
|
|
20433
|
+
if (/Instagram/i.test(ua)) return "Instagram-InApp";
|
|
20434
|
+
if (/Telegram/i.test(ua)) return "Telegram-InApp";
|
|
20435
|
+
if (/SamsungBrowser/i.test(ua)) return "Samsung";
|
|
20428
20436
|
if (/Edg/.test(ua)) return "Edge";
|
|
20429
20437
|
if (/Chrome/.test(ua) && !/Chromium/.test(ua)) return "Chrome";
|
|
20430
20438
|
if (/Safari/.test(ua) && !/Chrome/.test(ua)) return "Safari";
|
|
@@ -20432,6 +20440,36 @@ function detectBrowser() {
|
|
|
20432
20440
|
if (/Opera|OPR/.test(ua)) return "Opera";
|
|
20433
20441
|
return "Unknown";
|
|
20434
20442
|
}
|
|
20443
|
+
function isInAppBrowser() {
|
|
20444
|
+
const browser = detectBrowser();
|
|
20445
|
+
return browser.includes("-InApp");
|
|
20446
|
+
}
|
|
20447
|
+
function getBrowserVersion() {
|
|
20448
|
+
if (typeof navigator === "undefined") return { browser: "Unknown", version: 0 };
|
|
20449
|
+
const ua = navigator.userAgent;
|
|
20450
|
+
const edgeMatch = ua.match(/Edg\/(\d+)/);
|
|
20451
|
+
if (edgeMatch) return { browser: "Edge", version: parseInt(edgeMatch[1]) };
|
|
20452
|
+
const samsungMatch = ua.match(/SamsungBrowser\/(\d+)/);
|
|
20453
|
+
if (samsungMatch) return { browser: "Samsung", version: parseInt(samsungMatch[1]) };
|
|
20454
|
+
const chromeMatch = ua.match(/Chrome\/(\d+)/);
|
|
20455
|
+
if (chromeMatch && !/Edg/.test(ua)) return { browser: "Chrome", version: parseInt(chromeMatch[1]) };
|
|
20456
|
+
const safariMatch = ua.match(/Version\/(\d+)\.(\d+)/);
|
|
20457
|
+
if (safariMatch && /Safari/.test(ua) && !/Chrome/.test(ua)) {
|
|
20458
|
+
return { browser: "Safari", version: parseFloat(`${safariMatch[1]}.${safariMatch[2]}`) };
|
|
20459
|
+
}
|
|
20460
|
+
const firefoxMatch = ua.match(/Firefox\/(\d+)/);
|
|
20461
|
+
if (firefoxMatch) return { browser: "Firefox", version: parseInt(firefoxMatch[1]) };
|
|
20462
|
+
return { browser: "Unknown", version: 0 };
|
|
20463
|
+
}
|
|
20464
|
+
function getIOSVersion() {
|
|
20465
|
+
if (typeof navigator === "undefined") return null;
|
|
20466
|
+
const ua = navigator.userAgent;
|
|
20467
|
+
const match = ua.match(/OS (\d+)_(\d+)/);
|
|
20468
|
+
if (match) {
|
|
20469
|
+
return parseFloat(`${match[1]}.${match[2]}`);
|
|
20470
|
+
}
|
|
20471
|
+
return null;
|
|
20472
|
+
}
|
|
20435
20473
|
function checkPrfSupport() {
|
|
20436
20474
|
const platform = detectPlatform2();
|
|
20437
20475
|
const browser = detectBrowser();
|
|
@@ -20549,6 +20587,130 @@ async function checkPrfExtensionAvailable() {
|
|
|
20549
20587
|
const { prfSupported } = checkPrfSupport();
|
|
20550
20588
|
return prfSupported;
|
|
20551
20589
|
}
|
|
20590
|
+
var MIN_BROWSER_VERSIONS = {
|
|
20591
|
+
Chrome: 109,
|
|
20592
|
+
Edge: 109,
|
|
20593
|
+
Safari: 17.4,
|
|
20594
|
+
Samsung: 21
|
|
20595
|
+
// Samsung Internet 21+ is based on Chromium 109+
|
|
20596
|
+
};
|
|
20597
|
+
var MIN_IOS_VERSION = 17.4;
|
|
20598
|
+
function checkPrfCompatibility() {
|
|
20599
|
+
const platform = detectPlatform2();
|
|
20600
|
+
const browser = detectBrowser();
|
|
20601
|
+
const { browser: browserName, version: browserVersion } = getBrowserVersion();
|
|
20602
|
+
const baseResult = {
|
|
20603
|
+
platform,
|
|
20604
|
+
browser,
|
|
20605
|
+
browserVersion
|
|
20606
|
+
};
|
|
20607
|
+
if (isInAppBrowser()) {
|
|
20608
|
+
return {
|
|
20609
|
+
...baseResult,
|
|
20610
|
+
supported: false,
|
|
20611
|
+
reason: "inapp-browser",
|
|
20612
|
+
messageKey: "passkey.compatibility.inAppBrowser",
|
|
20613
|
+
action: "use-external-browser"
|
|
20614
|
+
};
|
|
20615
|
+
}
|
|
20616
|
+
if (browserName === "Firefox") {
|
|
20617
|
+
return {
|
|
20618
|
+
...baseResult,
|
|
20619
|
+
supported: false,
|
|
20620
|
+
reason: "unsupported-browser",
|
|
20621
|
+
messageKey: "passkey.compatibility.firefoxNotSupported",
|
|
20622
|
+
action: "use-chrome"
|
|
20623
|
+
};
|
|
20624
|
+
}
|
|
20625
|
+
if (browserName === "Chrome" && browserVersion < MIN_BROWSER_VERSIONS.Chrome) {
|
|
20626
|
+
return {
|
|
20627
|
+
...baseResult,
|
|
20628
|
+
supported: false,
|
|
20629
|
+
reason: "outdated-browser",
|
|
20630
|
+
messageKey: "passkey.compatibility.outdatedChrome",
|
|
20631
|
+
action: "update-browser"
|
|
20632
|
+
};
|
|
20633
|
+
}
|
|
20634
|
+
if (browserName === "Edge" && browserVersion < MIN_BROWSER_VERSIONS.Edge) {
|
|
20635
|
+
return {
|
|
20636
|
+
...baseResult,
|
|
20637
|
+
supported: false,
|
|
20638
|
+
reason: "outdated-browser",
|
|
20639
|
+
messageKey: "passkey.compatibility.outdatedEdge",
|
|
20640
|
+
action: "update-browser"
|
|
20641
|
+
};
|
|
20642
|
+
}
|
|
20643
|
+
if (browserName === "Safari" && browserVersion < MIN_BROWSER_VERSIONS.Safari) {
|
|
20644
|
+
return {
|
|
20645
|
+
...baseResult,
|
|
20646
|
+
supported: false,
|
|
20647
|
+
reason: "outdated-browser",
|
|
20648
|
+
messageKey: "passkey.compatibility.outdatedSafari",
|
|
20649
|
+
action: "update-browser"
|
|
20650
|
+
};
|
|
20651
|
+
}
|
|
20652
|
+
if (browserName === "Samsung" && browserVersion < MIN_BROWSER_VERSIONS.Samsung) {
|
|
20653
|
+
return {
|
|
20654
|
+
...baseResult,
|
|
20655
|
+
supported: false,
|
|
20656
|
+
reason: "outdated-browser",
|
|
20657
|
+
messageKey: "passkey.compatibility.outdatedSamsung",
|
|
20658
|
+
action: "update-browser"
|
|
20659
|
+
};
|
|
20660
|
+
}
|
|
20661
|
+
if (platform === "iOS") {
|
|
20662
|
+
const iosVersion = getIOSVersion();
|
|
20663
|
+
if (iosVersion && iosVersion < MIN_IOS_VERSION) {
|
|
20664
|
+
return {
|
|
20665
|
+
...baseResult,
|
|
20666
|
+
supported: false,
|
|
20667
|
+
reason: "outdated-os",
|
|
20668
|
+
messageKey: "passkey.compatibility.outdatedIOS",
|
|
20669
|
+
action: "update-os"
|
|
20670
|
+
};
|
|
20671
|
+
}
|
|
20672
|
+
}
|
|
20673
|
+
if (browserName === "Unknown") {
|
|
20674
|
+
return {
|
|
20675
|
+
...baseResult,
|
|
20676
|
+
supported: true,
|
|
20677
|
+
messageKey: "passkey.compatibility.unknownBrowser"
|
|
20678
|
+
};
|
|
20679
|
+
}
|
|
20680
|
+
return {
|
|
20681
|
+
...baseResult,
|
|
20682
|
+
supported: true
|
|
20683
|
+
};
|
|
20684
|
+
}
|
|
20685
|
+
function getPlatformHint(platform) {
|
|
20686
|
+
switch (platform) {
|
|
20687
|
+
case "macOS":
|
|
20688
|
+
return {
|
|
20689
|
+
hintKey: "passkey.hint.macOS",
|
|
20690
|
+
noteKey: "passkey.hint.note"
|
|
20691
|
+
};
|
|
20692
|
+
case "iOS":
|
|
20693
|
+
return {
|
|
20694
|
+
hintKey: "passkey.hint.iOS",
|
|
20695
|
+
noteKey: "passkey.hint.note"
|
|
20696
|
+
};
|
|
20697
|
+
case "Android":
|
|
20698
|
+
return {
|
|
20699
|
+
hintKey: "passkey.hint.android",
|
|
20700
|
+
noteKey: "passkey.hint.note"
|
|
20701
|
+
};
|
|
20702
|
+
case "Windows":
|
|
20703
|
+
return {
|
|
20704
|
+
hintKey: "passkey.hint.windows",
|
|
20705
|
+
noteKey: "passkey.hint.note"
|
|
20706
|
+
};
|
|
20707
|
+
default:
|
|
20708
|
+
return {
|
|
20709
|
+
hintKey: "passkey.hint.default",
|
|
20710
|
+
noteKey: "passkey.hint.note"
|
|
20711
|
+
};
|
|
20712
|
+
}
|
|
20713
|
+
}
|
|
20552
20714
|
function blobToBase642(blob) {
|
|
20553
20715
|
return new Promise((resolve, reject) => {
|
|
20554
20716
|
const reader = new FileReader();
|
|
@@ -20926,6 +21088,7 @@ exports.VolrProvider = VolrProvider;
|
|
|
20926
21088
|
exports.analyzeContractForEIP7702 = analyzeContractForEIP7702;
|
|
20927
21089
|
exports.buildCall = buildCall;
|
|
20928
21090
|
exports.buildCalls = buildCalls;
|
|
21091
|
+
exports.checkPrfCompatibility = checkPrfCompatibility;
|
|
20929
21092
|
exports.checkPrfExtensionAvailable = checkPrfExtensionAvailable;
|
|
20930
21093
|
exports.checkPrfSupport = checkPrfSupport;
|
|
20931
21094
|
exports.compareERC20Balances = compareERC20Balances;
|
|
@@ -20937,11 +21100,15 @@ exports.debugTransactionFailure = debugTransactionFailure;
|
|
|
20937
21100
|
exports.defaultIdempotencyKey = defaultIdempotencyKey;
|
|
20938
21101
|
exports.detectWalletConnector = detectWalletConnector;
|
|
20939
21102
|
exports.diagnoseTransactionFailure = diagnoseTransactionFailure;
|
|
21103
|
+
exports.getBrowserVersion = getBrowserVersion;
|
|
20940
21104
|
exports.getERC20Balance = getERC20Balance;
|
|
21105
|
+
exports.getIOSVersion = getIOSVersion;
|
|
20941
21106
|
exports.getPasskeyAuthGuidance = getPasskeyAuthGuidance;
|
|
21107
|
+
exports.getPlatformHint = getPlatformHint;
|
|
20942
21108
|
exports.getUserCredentials = getUserCredentials;
|
|
20943
21109
|
exports.getWalletState = getWalletState;
|
|
20944
21110
|
exports.isEIP7702Delegated = isEIP7702Delegated;
|
|
21111
|
+
exports.isInAppBrowser = isInAppBrowser;
|
|
20945
21112
|
exports.isUserCancelledError = isUserCancelledError;
|
|
20946
21113
|
exports.listenForSeedRequests = listenForSeedRequests;
|
|
20947
21114
|
exports.normalizeHex = normalizeHex;
|