@openfort/react 1.5.0 → 1.6.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.
Files changed (84) hide show
  1. package/build/components/Common/Chain/styles.d.ts +10 -0
  2. package/build/components/Common/Chain/styles.js +103 -1
  3. package/build/components/Common/Chain/styles.js.map +1 -1
  4. package/build/components/Common/Modal/index.js +2 -0
  5. package/build/components/Common/Modal/index.js.map +1 -1
  6. package/build/components/Common/SolanaChain/index.d.ts +5 -4
  7. package/build/components/Common/SolanaChain/index.js +9 -17
  8. package/build/components/Common/SolanaChain/index.js.map +1 -1
  9. package/build/components/ConnectModal/index.js +2 -0
  10. package/build/components/ConnectModal/index.js.map +1 -1
  11. package/build/components/Openfort/OpenfortProvider.js +4 -0
  12. package/build/components/Openfort/OpenfortProvider.js.map +1 -1
  13. package/build/components/Openfort/context.d.ts +4 -1
  14. package/build/components/Openfort/types.d.ts +22 -0
  15. package/build/components/Openfort/types.js +1 -0
  16. package/build/components/Openfort/types.js.map +1 -1
  17. package/build/components/Pages/Buy/styles.js +10 -10
  18. package/build/components/Pages/BuySelectProvider/index.js +9 -1
  19. package/build/components/Pages/BuySelectProvider/index.js.map +1 -1
  20. package/build/components/Pages/Connected/EthereumConnected.js +7 -1
  21. package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
  22. package/build/components/Pages/Deposit/TestnetNotice.js +15 -3
  23. package/build/components/Pages/Deposit/TestnetNotice.js.map +1 -1
  24. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.d.ts +9 -0
  25. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.js +11 -1
  26. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.js.map +1 -1
  27. package/build/components/Pages/Deposit/index.js +2 -5
  28. package/build/components/Pages/Deposit/index.js.map +1 -1
  29. package/build/components/Pages/Deposit/paymentOptions.d.ts +0 -6
  30. package/build/components/Pages/Deposit/paymentOptions.js +3 -5
  31. package/build/components/Pages/Deposit/paymentOptions.js.map +1 -1
  32. package/build/components/Pages/Deposit/sources.d.ts +3 -0
  33. package/build/components/Pages/Deposit/sources.js +4 -1
  34. package/build/components/Pages/Deposit/sources.js.map +1 -1
  35. package/build/components/Pages/Deposit/useDepositRoute.d.ts +1 -0
  36. package/build/components/Pages/Deposit/useDepositRoute.js +37 -10
  37. package/build/components/Pages/Deposit/useDepositRoute.js.map +1 -1
  38. package/build/components/Pages/Deposit/useFundingTarget.d.ts +6 -4
  39. package/build/components/Pages/Deposit/useFundingTarget.js +18 -7
  40. package/build/components/Pages/Deposit/useFundingTarget.js.map +1 -1
  41. package/build/components/Pages/DepositCex/index.js +24 -5
  42. package/build/components/Pages/DepositCex/index.js.map +1 -1
  43. package/build/components/Pages/DepositCrypto/index.js +2 -2
  44. package/build/components/Pages/DepositWallet/index.js +2 -2
  45. package/build/components/Pages/Send/EthereumSend.js +10 -4
  46. package/build/components/Pages/Send/EthereumSend.js.map +1 -1
  47. package/build/components/Pages/Send/SolanaSend.js +9 -4
  48. package/build/components/Pages/Send/SolanaSend.js.map +1 -1
  49. package/build/components/Pages/Send/styles.d.ts +0 -1
  50. package/build/components/Pages/Send/styles.js +2 -13
  51. package/build/components/Pages/Send/styles.js.map +1 -1
  52. package/build/components/Pages/SendConfirmation/ConfirmationSummary.d.ts +27 -0
  53. package/build/components/Pages/SendConfirmation/ConfirmationSummary.js +15 -0
  54. package/build/components/Pages/SendConfirmation/ConfirmationSummary.js.map +1 -0
  55. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +3 -3
  56. package/build/components/Pages/SendConfirmation/index.js +14 -30
  57. package/build/components/Pages/SendConfirmation/index.js.map +1 -1
  58. package/build/components/Pages/SendConfirmation/styles.d.ts +7 -1
  59. package/build/components/Pages/SendConfirmation/styles.js +49 -17
  60. package/build/components/Pages/SendConfirmation/styles.js.map +1 -1
  61. package/build/components/Pages/SignMessage/index.d.ts +2 -0
  62. package/build/components/Pages/SignMessage/index.js +81 -0
  63. package/build/components/Pages/SignMessage/index.js.map +1 -0
  64. package/build/components/Pages/SignMessage/styles.d.ts +14 -0
  65. package/build/components/Pages/SignMessage/styles.js +82 -0
  66. package/build/components/Pages/SignMessage/styles.js.map +1 -0
  67. package/build/hooks/openfort/useSignMessage.d.ts +27 -0
  68. package/build/hooks/openfort/useSignMessage.js +52 -0
  69. package/build/hooks/openfort/useSignMessage.js.map +1 -0
  70. package/build/hooks/openfort/useUI.d.ts +6 -1
  71. package/build/hooks/openfort/useUI.js +12 -2
  72. package/build/hooks/openfort/useUI.js.map +1 -1
  73. package/build/index.d.ts +2 -1
  74. package/build/index.js +1 -0
  75. package/build/index.js.map +1 -1
  76. package/build/localizations/locales/en-US.js +1 -1
  77. package/build/utils/rpc.d.ts +6 -0
  78. package/build/utils/rpc.js +12 -1
  79. package/build/utils/rpc.js.map +1 -1
  80. package/build/version.d.ts +1 -1
  81. package/build/version.js +1 -1
  82. package/build/wagmi/components/ChainSelect/index.js +2 -94
  83. package/build/wagmi/components/ChainSelect/index.js.map +1 -1
  84. package/package.json +1 -1
@@ -17,6 +17,17 @@ const KNOWN_CHAINS = {
17
17
  [optimismSepolia.id]: optimismSepolia,
18
18
  [arbitrumSepolia.id]: arbitrumSepolia,
19
19
  };
20
+ /** Testnets not in {@link KNOWN_CHAINS} but still worth recognizing (deprecated/uncommon). */
21
+ const EXTRA_TESTNET_CHAIN_IDS = new Set([5, 80001, 97, 4002]);
22
+ /**
23
+ * Whether an EVM chain id is a testnet. Reads viem's chain metadata (`testnet`)
24
+ * for the chains the SDK bundles, falling back to a small extra set. Use this to
25
+ * key behaviour off the wallet's active chain rather than the publishable key.
26
+ */
27
+ function isTestnetChainId(chainId) {
28
+ var _a;
29
+ return ((_a = KNOWN_CHAINS[chainId]) === null || _a === void 0 ? void 0 : _a.testnet) === true || EXTRA_TESTNET_CHAIN_IDS.has(chainId);
30
+ }
20
31
  /**
21
32
  * Default Solana RPC URLs by cluster.
22
33
  * Production apps should provide their own RPCs via walletConfig.solana.rpcUrls.
@@ -93,5 +104,5 @@ function buildChainFromConfig(chainId, rpcUrls) {
93
104
  });
94
105
  }
95
106
 
96
- export { buildChainFromConfig, getChainName, getDefaultEthereumRpcUrl, getDefaultSolanaRpcUrl, getNativeCurrency };
107
+ export { buildChainFromConfig, getChainName, getDefaultEthereumRpcUrl, getDefaultSolanaRpcUrl, getNativeCurrency, isTestnetChainId };
97
108
  //# sourceMappingURL=rpc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- export declare const OPENFORT_VERSION = "1.5.0";
1
+ export declare const OPENFORT_VERSION = "1.6.0";
package/build/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const OPENFORT_VERSION = '1.5.0';
1
+ const OPENFORT_VERSION = '1.6.0';
2
2
 
3
3
  export { OPENFORT_VERSION };
4
4
  //# sourceMappingURL=version.js.map
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { motion } from 'framer-motion';
3
3
  import { useState, useEffect } from 'react';
4
- import { css } from 'styled-components';
5
4
  import { useChainId } from 'wagmi';
6
5
  import Chain from '../../../components/Common/Chain/index.js';
6
+ import { SwitchChainButton } from '../../../components/Common/Chain/styles.js';
7
7
  import Tooltip from '../../../components/Common/Tooltip/index.js';
8
8
  import { routes } from '../../../components/Openfort/types.js';
9
9
  import { useOpenfort } from '../../../components/Openfort/useOpenfort.js';
@@ -15,98 +15,6 @@ import { useSwitchChainFiltered } from '../../useSwitchChainFiltered.js';
15
15
  import ChainSelectDropdown from '../ChainSelectDropdown/index.js';
16
16
 
17
17
  const Container = styled(motion.div) ``;
18
- const SwitchChainButton = styled(motion.button) `
19
- --color: var(
20
- --ck-dropdown-button-color,
21
- var(--ck-button-primary-color, var(--ck-body-color))
22
- );
23
- --background: var(
24
- --ck-dropdown-button-background,
25
- var(--ck-secondary-button-background, var(--ck-body-background-secondary))
26
- );
27
- --box-shadow: var(
28
- --ck-dropdown-button-box-shadow,
29
- var(
30
- --ck-secondary-button-box-shadow,
31
- var(--ck-button-primary-box-shadow),
32
- none
33
- )
34
- );
35
-
36
- --hover-color: var(--ck-dropdown-button-hover-color, var(--color));
37
- --hover-background: var(
38
- --ck-dropdown-button-hover-background,
39
- var(--background)
40
- );
41
- --hover-box-shadow: var(
42
- --ck-dropdown-button-hover-box-shadow,
43
- var(--box-shadow)
44
- );
45
-
46
- --active-color: var(--ck-dropdown-button-active-color, var(--hover-color));
47
- --active-background: var(
48
- --ck-dropdown-button-active-background,
49
- var(--hover-background)
50
- );
51
- --active-box-shadow: var(
52
- --ck-dropdown-button-active-box-shadow,
53
- var(--hover-box-shadow)
54
- );
55
-
56
- appearance: none;
57
- user-select: none;
58
- position: relative;
59
- display: flex;
60
- align-items: center;
61
- justify-content: space-between;
62
- border-radius: 15px;
63
- width: 52px;
64
- height: 30px;
65
- padding: 2px 6px 2px 3px;
66
- font-size: 16px;
67
- line-height: 19px;
68
- font-weight: 500;
69
- text-decoration: none;
70
- white-space: nowrap;
71
- transform: translateZ(0px);
72
-
73
- transition: 100ms ease;
74
- transition-property: transform, background-color, box-shadow, color;
75
-
76
- color: var(--color);
77
- background: var(--background);
78
- box-shadow: var(--box-shadow);
79
-
80
- svg {
81
- position: relative;
82
- display: block;
83
- }
84
-
85
- ${(props) => props.disabled
86
- ? css `
87
- width: auto;
88
- padding: 3px;
89
- position: relative;
90
- left: -22px;
91
- `
92
- : css `
93
- cursor: pointer;
94
-
95
- @media only screen and (min-width: ${defaultTheme.mobileWidth + 1}px) {
96
- &:hover,
97
- &:focus-visible {
98
- color: var(--hover-color);
99
- background: var(--hover-background);
100
- box-shadow: var(--hover-box-shadow);
101
- }
102
- &:active {
103
- color: var(--active-color);
104
- background: var(--active-background);
105
- box-shadow: var(--active-box-shadow);
106
- }
107
- }
108
- `}
109
- `;
110
18
  const ChevronDown = ({ ...props }) => (jsx("svg", { "aria-hidden": "true", width: "11", height: "6", viewBox: "0 0 11 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M1.5 1L5.5 5L9.5 1", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
111
19
  const ChainSelector = () => {
112
20
  var _a;
@@ -134,7 +42,7 @@ const ChainSelector = () => {
134
42
  else {
135
43
  setIsOpen(!isOpen);
136
44
  }
137
- }, children: [disabled ? (jsx(Tooltip, { message: locales.chainNetwork, xOffset: -6, delay: 0.01, children: jsx(Chain, { id: chain === null || chain === void 0 ? void 0 : chain.id }) })) : (jsx(Chain, { id: chain === null || chain === void 0 ? void 0 : chain.id })), !disabled && jsx(ChevronDown, { style: { top: 1, left: -3 } })] })) }) }));
45
+ }, children: [jsx(Tooltip, { message: locales.chainNetwork, xOffset: -6, delay: 0.01, children: jsx(Chain, { id: chain === null || chain === void 0 ? void 0 : chain.id }) }), !disabled && jsx(ChevronDown, { style: { top: 1, left: -3 } })] })) }) }));
138
46
  };
139
47
 
140
48
  export { ChainSelector as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/react",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "author": "Openfort (https://www.openfort.io)",
5
5
  "license": "BSD-2-Clause license",
6
6
  "description": "The easiest way to integrate Openfort to your project.",