@volr/react 0.1.65 → 0.1.67

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.js CHANGED
@@ -9463,7 +9463,6 @@ function useSessionSync({
9463
9463
 
9464
9464
  // src/config/webauthn.ts
9465
9465
  var AUTHENTICATOR_SELECTION = {
9466
- authenticatorAttachment: "platform",
9467
9466
  userVerification: "required",
9468
9467
  residentKey: "required"
9469
9468
  };
@@ -18870,6 +18869,30 @@ function useDepositListener(input) {
18870
18869
  }, [getRpcUrl, input.chainId, input.address, JSON.stringify(input.asset)]);
18871
18870
  return status;
18872
18871
  }
18872
+ function detectPlatform() {
18873
+ if (typeof navigator === "undefined") return "Unknown";
18874
+ const ua = navigator.userAgent;
18875
+ const platform = navigator.platform || "";
18876
+ if (/iPhone|iPad|iPod/.test(ua) || platform === "MacIntel" && navigator.maxTouchPoints > 1) {
18877
+ return "iOS";
18878
+ }
18879
+ if (/Android/.test(ua)) {
18880
+ return "Android";
18881
+ }
18882
+ if (/Mac/.test(platform)) {
18883
+ return "macOS";
18884
+ }
18885
+ if (/Win/.test(platform)) {
18886
+ return "Windows";
18887
+ }
18888
+ if (/CrOS/.test(ua)) {
18889
+ return "ChromeOS";
18890
+ }
18891
+ if (/Linux/.test(platform)) {
18892
+ return "Linux";
18893
+ }
18894
+ return "Unknown";
18895
+ }
18873
18896
  async function enrollPasskey(params) {
18874
18897
  const {
18875
18898
  client,
@@ -18989,6 +19012,7 @@ async function enrollPasskey(params) {
18989
19012
  }
18990
19013
  const keypair = deriveEvmKey({ masterSeed: masterSeedHandle.bytes });
18991
19014
  const address = keypair.address;
19015
+ const platform = detectPlatform();
18992
19016
  const registerResponse = await client.post("/wallet/provider/register", {
18993
19017
  keyStorageType: "passkey",
18994
19018
  credentialId,
@@ -18998,7 +19022,9 @@ async function enrollPasskey(params) {
18998
19022
  projectId,
18999
19023
  credentialId
19000
19024
  },
19001
- address
19025
+ address,
19026
+ platform
19027
+ // For UX hints when authenticating on different devices
19002
19028
  });
19003
19029
  return {
19004
19030
  credentialId,