@dubsdotapp/expo 0.2.50 → 0.2.52

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
@@ -77,6 +77,20 @@ __export(index_exports, {
77
77
  });
78
78
  module.exports = __toCommonJS(index_exports);
79
79
 
80
+ // src/polyfill.ts
81
+ var import_expo_crypto = require("expo-crypto");
82
+ if (typeof global !== "undefined") {
83
+ if (typeof global.crypto !== "object") {
84
+ global.crypto = {};
85
+ }
86
+ if (typeof global.crypto.getRandomValues !== "function") {
87
+ global.crypto.getRandomValues = import_expo_crypto.getRandomValues;
88
+ }
89
+ }
90
+ if (typeof self === "undefined" && typeof globalThis !== "undefined") {
91
+ globalThis.self = globalThis;
92
+ }
93
+
80
94
  // src/constants.ts
81
95
  var DEFAULT_BASE_URL = "https://dubs-server-prod-9c91d3f01199.herokuapp.com/api/developer/v1";
82
96
  var DEFAULT_RPC_URL = "https://api.mainnet-beta.solana.com";
@@ -803,28 +817,6 @@ var import_bs582 = __toESM(require("bs58"));
803
817
  // src/wallet/phantom-deeplink/crypto.ts
804
818
  var import_tweetnacl = __toESM(require("tweetnacl"));
805
819
  var import_bs58 = __toESM(require("bs58"));
806
- try {
807
- import_tweetnacl.default.randomBytes(1);
808
- } catch {
809
- const g = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : void 0;
810
- if (g?.crypto?.getRandomValues) {
811
- import_tweetnacl.default.setPRNG((x, n) => {
812
- const v = new Uint8Array(n);
813
- g.crypto.getRandomValues(v);
814
- for (let i = 0; i < n; i++) x[i] = v[i];
815
- });
816
- } else {
817
- try {
818
- const { getRandomValues } = require("expo-crypto");
819
- import_tweetnacl.default.setPRNG((x, n) => {
820
- const v = new Uint8Array(n);
821
- getRandomValues(v);
822
- for (let i = 0; i < n; i++) x[i] = v[i];
823
- });
824
- } catch {
825
- }
826
- }
827
- }
828
820
  function generateKeyPair() {
829
821
  const kp = import_tweetnacl.default.box.keyPair();
830
822
  return { publicKey: kp.publicKey, secretKey: kp.secretKey };