@turnkey/react-wallet-kit 1.10.0 → 1.11.0

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.
@@ -888,7 +888,7 @@ var ClientProvider = function ClientProvider(_ref) {
888
888
  var walletEvents = provider === null || provider === void 0 ? void 0 : (_provider$features = provider.features) === null || _provider$features === void 0 ? void 0 : _provider$features["standard:events"];
889
889
  if (walletEvents !== null && walletEvents !== void 0 && walletEvents.on) {
890
890
  var offChange = walletEvents.on("change", /*#__PURE__*/function () {
891
- var _ref159 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee137(_evt) {
891
+ var _ref160 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee137(_evt) {
892
892
  return _regenerator().w(function (_context137) {
893
893
  while (1) switch (_context137.n) {
894
894
  case 0:
@@ -900,7 +900,7 @@ var ClientProvider = function ClientProvider(_ref) {
900
900
  }, _callee137);
901
901
  }));
902
902
  return function (_x114) {
903
- return _ref159.apply(this, arguments);
903
+ return _ref160.apply(this, arguments);
904
904
  };
905
905
  }());
906
906
  cleanups.push(offChange);
@@ -914,7 +914,7 @@ var ClientProvider = function ClientProvider(_ref) {
914
914
  attachEthereumListeners = function _attachEthereumListen(provider, onUpdateState) {
915
915
  if (typeof provider.on !== "function") return;
916
916
  var handleChainChanged = /*#__PURE__*/function () {
917
- var _ref157 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee135(_chainId) {
917
+ var _ref158 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee135(_chainId) {
918
918
  return _regenerator().w(function (_context135) {
919
919
  while (1) switch (_context135.n) {
920
920
  case 0:
@@ -923,11 +923,11 @@ var ClientProvider = function ClientProvider(_ref) {
923
923
  }, _callee135);
924
924
  }));
925
925
  return function handleChainChanged(_x112) {
926
- return _ref157.apply(this, arguments);
926
+ return _ref158.apply(this, arguments);
927
927
  };
928
928
  }();
929
929
  var handleAccountsChanged = /*#__PURE__*/function () {
930
- var _ref158 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee136(accounts) {
930
+ var _ref159 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee136(accounts) {
931
931
  return _regenerator().w(function (_context136) {
932
932
  while (1) switch (_context136.n) {
933
933
  case 0:
@@ -938,7 +938,7 @@ var ClientProvider = function ClientProvider(_ref) {
938
938
  }, _callee136);
939
939
  }));
940
940
  return function handleAccountsChanged(_x113) {
941
- return _ref158.apply(this, arguments);
941
+ return _ref159.apply(this, arguments);
942
942
  };
943
943
  }();
944
944
  var handleDisconnect = function handleDisconnect() {
@@ -995,7 +995,7 @@ var ClientProvider = function ClientProvider(_ref) {
995
995
  if (standardEvents !== null && standardEvents !== void 0 && standardEvents.on) {
996
996
  if (standardEvents !== null && standardEvents !== void 0 && standardEvents.on) {
997
997
  unsubscribe = standardEvents.on("change", /*#__PURE__*/function () {
998
- var _ref160 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee138(evt) {
998
+ var _ref161 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee138(evt) {
999
999
  var _callbacks$onError10, providers, currentSession, _wcProviders, wcWallets;
1000
1000
  return _regenerator().w(function (_context138) {
1001
1001
  while (1) switch (_context138.n) {
@@ -1057,7 +1057,7 @@ var ClientProvider = function ClientProvider(_ref) {
1057
1057
  }, _callee138);
1058
1058
  }));
1059
1059
  return function (_x115) {
1060
- return _ref160.apply(this, arguments);
1060
+ return _ref161.apply(this, arguments);
1061
1061
  };
1062
1062
  }());
1063
1063
  cleanups.push(unsubscribe);
@@ -6135,8 +6135,8 @@ var ClientProvider = function ClientProvider(_ref) {
6135
6135
  return _context126.a(2, new Promise(function (resolve, reject) {
6136
6136
  var action = /*#__PURE__*/function () {
6137
6137
  var _ref146 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee125() {
6138
- var _pollResult$eth$txHas, _pollResult$eth;
6139
- var sendTransactionStatusId, pollResult, txHash, _t28;
6138
+ var _ref148, _txDetails$eth$txHash, _txDetails$eth, _txDetails$solana;
6139
+ var sendTransactionStatusId, pollResult, txDetails, txHash, _t28;
6140
6140
  return _regenerator().w(function (_context125) {
6141
6141
  while (1) switch (_context125.n) {
6142
6142
  case 0:
@@ -6206,7 +6206,8 @@ var ClientProvider = function ClientProvider(_ref) {
6206
6206
  });
6207
6207
  case 6:
6208
6208
  pollResult = _context125.v;
6209
- txHash = (_pollResult$eth$txHas = pollResult === null || pollResult === void 0 ? void 0 : (_pollResult$eth = pollResult.eth) === null || _pollResult$eth === void 0 ? void 0 : _pollResult$eth.txHash) !== null && _pollResult$eth$txHas !== void 0 ? _pollResult$eth$txHas : pollResult === null || pollResult === void 0 ? void 0 : pollResult.txHash;
6209
+ txDetails = pollResult;
6210
+ txHash = (_ref148 = (_txDetails$eth$txHash = (_txDetails$eth = txDetails.eth) === null || _txDetails$eth === void 0 ? void 0 : _txDetails$eth.txHash) !== null && _txDetails$eth$txHash !== void 0 ? _txDetails$eth$txHash : (_txDetails$solana = txDetails.solana) === null || _txDetails$solana === void 0 ? void 0 : _txDetails$solana.signature) !== null && _ref148 !== void 0 ? _ref148 : txDetails.txHash;
6210
6211
  return _context125.a(2, txHash ? {
6211
6212
  txHash: txHash
6212
6213
  } : {});
@@ -6246,7 +6247,7 @@ var ClientProvider = function ClientProvider(_ref) {
6246
6247
  };
6247
6248
  }(), [ethSendTransaction, getSession, pollTransactionStatus, pushPage, solSendTransaction]);
6248
6249
  var handleSendErc20Transfer = useCallback(/*#__PURE__*/function () {
6249
- var _ref148 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee128(params) {
6250
+ var _ref149 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee128(params) {
6250
6251
  var session, organizationId, transfer, icon, stampWith, _params$successPageDu6, successPageDuration, caip2;
6251
6252
  return _regenerator().w(function (_context128) {
6252
6253
  while (1) switch (_context128.n) {
@@ -6266,8 +6267,8 @@ var ClientProvider = function ClientProvider(_ref) {
6266
6267
  caip2 = transfer.caip2;
6267
6268
  return _context128.a(2, new Promise(function (resolve, reject) {
6268
6269
  var action = /*#__PURE__*/function () {
6269
- var _ref149 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee127() {
6270
- var _pollResult$eth$txHas2, _pollResult$eth2;
6270
+ var _ref150 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee127() {
6271
+ var _pollResult$eth$txHas, _pollResult$eth;
6271
6272
  var sendTransactionStatusId, pollResult, txHash;
6272
6273
  return _regenerator().w(function (_context127) {
6273
6274
  while (1) switch (_context127.n) {
@@ -6293,7 +6294,7 @@ var ClientProvider = function ClientProvider(_ref) {
6293
6294
  });
6294
6295
  case 3:
6295
6296
  pollResult = _context127.v;
6296
- txHash = (_pollResult$eth$txHas2 = pollResult === null || pollResult === void 0 ? void 0 : (_pollResult$eth2 = pollResult.eth) === null || _pollResult$eth2 === void 0 ? void 0 : _pollResult$eth2.txHash) !== null && _pollResult$eth$txHas2 !== void 0 ? _pollResult$eth$txHas2 : pollResult === null || pollResult === void 0 ? void 0 : pollResult.txHash;
6297
+ txHash = (_pollResult$eth$txHas = pollResult === null || pollResult === void 0 ? void 0 : (_pollResult$eth = pollResult.eth) === null || _pollResult$eth === void 0 ? void 0 : _pollResult$eth.txHash) !== null && _pollResult$eth$txHas !== void 0 ? _pollResult$eth$txHas : pollResult === null || pollResult === void 0 ? void 0 : pollResult.txHash;
6297
6298
  return _context127.a(2, txHash ? {
6298
6299
  txHash: txHash
6299
6300
  } : {});
@@ -6301,7 +6302,7 @@ var ClientProvider = function ClientProvider(_ref) {
6301
6302
  }, _callee127);
6302
6303
  }));
6303
6304
  return function action() {
6304
- return _ref149.apply(this, arguments);
6305
+ return _ref150.apply(this, arguments);
6305
6306
  };
6306
6307
  }();
6307
6308
  pushPage({
@@ -6329,11 +6330,11 @@ var ClientProvider = function ClientProvider(_ref) {
6329
6330
  }, _callee128);
6330
6331
  }));
6331
6332
  return function (_x109) {
6332
- return _ref148.apply(this, arguments);
6333
+ return _ref149.apply(this, arguments);
6333
6334
  };
6334
6335
  }(), [ethSendErc20Transfer, getSession, pollTransactionStatus, pushPage]);
6335
6336
  var handleOnRamp = useCallback(/*#__PURE__*/function () {
6336
- var _ref150 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee131(params) {
6337
+ var _ref151 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee131(params) {
6337
6338
  var _walletAccount$addres;
6338
6339
  var walletAccount, fiatCurrencyAmount, fiatCurrencyCode, paymentMethod, countrySubdivisionCode, urlForSignature, countryCode, _params$onrampProvide, onrampProvider, _params$sandboxMode, sandboxMode, _params$successPageDu7, successPageDuration, _params$openInNewTab, openInNewTab, s, organizationId, cryptoCurrencyCode, network, openNewTab, _t31;
6339
6340
  return _regenerator().w(function (_context131) {
@@ -6393,7 +6394,7 @@ var ClientProvider = function ClientProvider(_ref) {
6393
6394
  };
6394
6395
  }, []);
6395
6396
  var action = /*#__PURE__*/function () {
6396
- var _ref151 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee130() {
6397
+ var _ref152 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee130() {
6397
6398
  var _client$httpClient, onRampWindow, result, popupWidth, popupHeight, left, top, onRampTransactionId, _t30;
6398
6399
  return _regenerator().w(function (_context130) {
6399
6400
  while (1) switch (_context130.p = _context130.n) {
@@ -6536,7 +6537,7 @@ var ClientProvider = function ClientProvider(_ref) {
6536
6537
  }, _callee130, null, [[0, 7]]);
6537
6538
  }));
6538
6539
  return function action() {
6539
- return _ref151.apply(this, arguments);
6540
+ return _ref152.apply(this, arguments);
6540
6541
  };
6541
6542
  }();
6542
6543
  return jsx(OnRampPage, {
@@ -6572,16 +6573,16 @@ var ClientProvider = function ClientProvider(_ref) {
6572
6573
  }, _callee131);
6573
6574
  }));
6574
6575
  return function (_x110) {
6575
- return _ref150.apply(this, arguments);
6576
+ return _ref151.apply(this, arguments);
6576
6577
  };
6577
6578
  }(), [getSession, client, pushPage]);
6578
6579
  var handleVerifyAppProofs = useCallback(/*#__PURE__*/function () {
6579
- var _ref153 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee132(params) {
6580
- var _ref154, appProofs, _ref154$successPageDu, successPageDuration, stampWith, s, organizationId, _t32;
6580
+ var _ref154 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee132(params) {
6581
+ var _ref155, appProofs, _ref155$successPageDu, successPageDuration, stampWith, s, organizationId, _t32;
6581
6582
  return _regenerator().w(function (_context132) {
6582
6583
  while (1) switch (_context132.p = _context132.n) {
6583
6584
  case 0:
6584
- _ref154 = params || {}, appProofs = _ref154.appProofs, _ref154$successPageDu = _ref154.successPageDuration, successPageDuration = _ref154$successPageDu === void 0 ? 3000 : _ref154$successPageDu, stampWith = _ref154.stampWith;
6585
+ _ref155 = params || {}, appProofs = _ref155.appProofs, _ref155$successPageDu = _ref155.successPageDuration, successPageDuration = _ref155$successPageDu === void 0 ? 3000 : _ref155$successPageDu, stampWith = _ref155.stampWith;
6585
6586
  _context132.n = 1;
6586
6587
  return getSession();
6587
6588
  case 1:
@@ -6635,14 +6636,14 @@ var ClientProvider = function ClientProvider(_ref) {
6635
6636
  }, _callee132, null, [[2, 3]]);
6636
6637
  }));
6637
6638
  return function (_x111) {
6638
- return _ref153.apply(this, arguments);
6639
+ return _ref154.apply(this, arguments);
6639
6640
  };
6640
6641
  }(), [getSession, pushPage]);
6641
6642
  useEffect(function () {
6642
6643
  if (proxyAuthConfigRef.current) return;
6643
6644
  // Only fetch the proxy auth config once. Use that to build the master config.
6644
6645
  var fetchProxyAuthConfig = /*#__PURE__*/function () {
6645
- var _ref155 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee133() {
6646
+ var _ref156 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee133() {
6646
6647
  var proxyAuthConfig;
6647
6648
  return _regenerator().w(function (_context133) {
6648
6649
  while (1) switch (_context133.p = _context133.n) {
@@ -6673,7 +6674,7 @@ var ClientProvider = function ClientProvider(_ref) {
6673
6674
  }, _callee133, null, [[0, 3]]);
6674
6675
  }));
6675
6676
  return function fetchProxyAuthConfig() {
6676
- return _ref155.apply(this, arguments);
6677
+ return _ref156.apply(this, arguments);
6677
6678
  };
6678
6679
  }();
6679
6680
  fetchProxyAuthConfig();
@@ -6706,7 +6707,7 @@ var ClientProvider = function ClientProvider(_ref) {
6706
6707
  var debouncedFetchWalletProviders = useDebouncedCallback(fetchWalletProviders, 100);
6707
6708
  useEffect(function () {
6708
6709
  var handleUpdateState = /*#__PURE__*/function () {
6709
- var _ref156 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee134() {
6710
+ var _ref157 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee134() {
6710
6711
  var currentSession;
6711
6712
  return _regenerator().w(function (_context134) {
6712
6713
  while (1) switch (_context134.n) {
@@ -6733,7 +6734,7 @@ var ClientProvider = function ClientProvider(_ref) {
6733
6734
  }, _callee134);
6734
6735
  }));
6735
6736
  return function handleUpdateState() {
6736
- return _ref156.apply(this, arguments);
6737
+ return _ref157.apply(this, arguments);
6737
6738
  };
6738
6739
  }();
6739
6740
  var cleanup = function cleanup() {};