@dynamic-labs/sdk-react-core 4.0.0-alpha.2 → 4.0.0-alpha.3

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/CHANGELOG.md CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ ## [4.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.2...v4.0.0-alpha.3) (2024-09-20)
3
+
4
+
5
+ ### Features
6
+
7
+ * developers provide global connectivity appkit project id ([#6941](https://github.com/dynamic-labs/DynamicAuth/issues/6941)) ([83760ea](https://github.com/dynamic-labs/DynamicAuth/commit/83760ea57591685b12caee945f173f6a7f9312d1))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * don't try to set up event listeners if wallet provider doesn't support it ([#6943](https://github.com/dynamic-labs/DynamicAuth/issues/6943)) ([439f1bb](https://github.com/dynamic-labs/DynamicAuth/commit/439f1bbb3c765959756cfc6eeb8429e4018e0379))
13
+ * dont verify all signatures for solana embedded multisig tx ([#6953](https://github.com/dynamic-labs/DynamicAuth/issues/6953)) ([7a7973e](https://github.com/dynamic-labs/DynamicAuth/commit/7a7973e05f0960421b348a55c6a00c9fd873b0b7))
14
+
2
15
  ## [4.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2024-09-18)
3
16
 
4
17
 
package/package.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.2";
6
+ var version = "4.0.0-alpha.3";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.530",
8
+ "@dynamic-labs/sdk-api-core": "0.0.534",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "country-list": "2.3.0",
11
11
  formik: "2.2.9",
package/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.2";
2
+ var version = "4.0.0-alpha.3";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.530",
4
+ "@dynamic-labs/sdk-api-core": "0.0.534",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
6
6
  "country-list": "2.3.0",
7
7
  formik: "2.2.9",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
7
7
  "directory": "packages/sdk-react-core"
8
8
  },
9
9
  "dependencies": {
10
- "@dynamic-labs/sdk-api-core": "0.0.530",
10
+ "@dynamic-labs/sdk-api-core": "0.0.534",
11
11
  "@hcaptcha/react-hcaptcha": "1.4.4",
12
12
  "country-list": "2.3.0",
13
13
  "formik": "2.2.9",
@@ -17,16 +17,16 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/iconic": "4.0.0-alpha.2",
21
- "@dynamic-labs/logger": "4.0.0-alpha.2",
22
- "@dynamic-labs/message-transport": "4.0.0-alpha.2",
23
- "@dynamic-labs/multi-wallet": "4.0.0-alpha.2",
24
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.2",
25
- "@dynamic-labs/store": "4.0.0-alpha.2",
26
- "@dynamic-labs/types": "4.0.0-alpha.2",
27
- "@dynamic-labs/utils": "4.0.0-alpha.2",
28
- "@dynamic-labs/wallet-book": "4.0.0-alpha.2",
29
- "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.2",
20
+ "@dynamic-labs/iconic": "4.0.0-alpha.3",
21
+ "@dynamic-labs/logger": "4.0.0-alpha.3",
22
+ "@dynamic-labs/message-transport": "4.0.0-alpha.3",
23
+ "@dynamic-labs/multi-wallet": "4.0.0-alpha.3",
24
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.3",
25
+ "@dynamic-labs/store": "4.0.0-alpha.3",
26
+ "@dynamic-labs/types": "4.0.0-alpha.3",
27
+ "@dynamic-labs/utils": "4.0.0-alpha.3",
28
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.3",
29
+ "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.3",
30
30
  "eventemitter3": "5.0.1"
31
31
  },
32
32
  "devDependencies": {
@@ -103,7 +103,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
103
103
  ? rows.push([key])
104
104
  : rows[rows.length - 1].push(key)) && rows, []);
105
105
  };
106
- const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletKey = undefined, showQrCodeImage, }) => {
106
+ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor = 'currentColor', walletKey = undefined, showQrCodeImage, }) => {
107
107
  const { data } = usePromise.usePromise(() => QRCodeUtil__default["default"].toDataURL(value));
108
108
  const dots = React.useMemo(() => {
109
109
  const dots = [];
@@ -118,7 +118,7 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
118
118
  const x1 = (matrix.length - 7) * cellSize * x;
119
119
  const y1 = (matrix.length - 7) * cellSize * y;
120
120
  for (let i = 0; i < 3; i++) {
121
- dots.push(jsxRuntime.jsx("rect", { fill: i % 2 !== 0 ? 'currentColor' : accentColor, height: cellSize * (7 - i * 2), rx: i === 0 ? 10 : i === 1 ? 7 : 20, ry: i === 0 ? 10 : i === 1 ? 7 : 20, width: cellSize * (7 - i * 2), x: x1 + cellSize * i, y: y1 + cellSize * i }, `corner-square-${x}-${y}-${i}`));
121
+ dots.push(jsxRuntime.jsx("rect", { "data-key": `corner-square-${x}-${y}-${i}`, fill: i % 2 !== 0 ? 'var(--background)' : accentColor, height: cellSize * (7 - i * 2), rx: i === 0 ? 10 : i === 1 ? 7 : 20, ry: i === 0 ? 10 : i === 1 ? 7 : 20, width: cellSize * (7 - i * 2), x: x1 + cellSize * i, y: y1 + cellSize * i }, `corner-square-${x}-${y}-${i}`));
122
122
  }
123
123
  });
124
124
  const clearArenaSize = Math.floor((logoSize * 1.5) / cellSize);
@@ -95,7 +95,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
95
95
  ? rows.push([key])
96
96
  : rows[rows.length - 1].push(key)) && rows, []);
97
97
  };
98
- const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletKey = undefined, showQrCodeImage, }) => {
98
+ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor = 'currentColor', walletKey = undefined, showQrCodeImage, }) => {
99
99
  const { data } = usePromise(() => QRCodeUtil.toDataURL(value));
100
100
  const dots = useMemo(() => {
101
101
  const dots = [];
@@ -110,7 +110,7 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
110
110
  const x1 = (matrix.length - 7) * cellSize * x;
111
111
  const y1 = (matrix.length - 7) * cellSize * y;
112
112
  for (let i = 0; i < 3; i++) {
113
- dots.push(jsx("rect", { fill: i % 2 !== 0 ? 'currentColor' : accentColor, height: cellSize * (7 - i * 2), rx: i === 0 ? 10 : i === 1 ? 7 : 20, ry: i === 0 ? 10 : i === 1 ? 7 : 20, width: cellSize * (7 - i * 2), x: x1 + cellSize * i, y: y1 + cellSize * i }, `corner-square-${x}-${y}-${i}`));
113
+ dots.push(jsx("rect", { "data-key": `corner-square-${x}-${y}-${i}`, fill: i % 2 !== 0 ? 'var(--background)' : accentColor, height: cellSize * (7 - i * 2), rx: i === 0 ? 10 : i === 1 ? 7 : 20, ry: i === 0 ? 10 : i === 1 ? 7 : 20, width: cellSize * (7 - i * 2), x: x1 + cellSize * i, y: y1 + cellSize * i }, `corner-square-${x}-${y}-${i}`));
114
114
  }
115
115
  });
116
116
  const clearArenaSize = Math.floor((logoSize * 1.5) / cellSize);
@@ -153,7 +153,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
153
153
  }),
154
154
  });
155
155
  }, [decimals, validateAddress, validateAmount]);
156
- return (jsxRuntime.jsx(formik.Formik, { initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false, children: ({ errors, touched, values, handleChange, setFieldValue, setErrors, }) => {
156
+ return (jsxRuntime.jsx(formik.Formik, { initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false, children: ({ errors, touched, values, handleChange, setFieldValue, setErrors, handleBlur, setFieldTouched, validateField, }) => {
157
157
  var _a;
158
158
  return (jsxRuntime.jsxs(formik.Form, { className: 'send-balance-form', children: [jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__balance-container', children: [jsxRuntime.jsx(FormFieldLabel.FormFieldLabel, { children: "Select any token" }), jsxRuntime.jsx(TokensBalanceDropdown.TokensBalanceDropdown, { tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, setFieldValue: setFieldValue, setErrors: setErrors })] }), jsxRuntime.jsxs("div", { className: 'send-balance-form__amount-container', children: [jsxRuntime.jsx(formik.Field, { variant: 'regular', className: `send-balance-form__amount-container__field ${showFiat ? 'fiat' : ''}`, name: 'amount', id: 'amount', onChange: (e) => {
159
159
  const newValue = e.target.value;
@@ -168,6 +168,10 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
168
168
  return;
169
169
  }
170
170
  sendBalances.setSendBalanceVariable('amount', (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? Number(newValue) : undefined);
171
+ }, onBlur: (e) => {
172
+ handleBlur(e);
173
+ setFieldTouched('amount', true);
174
+ validateField('amount');
171
175
  }, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input.Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
172
176
  getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
173
177
  paddingLeft: `${leftSymbolPadding}px`,
@@ -149,7 +149,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
149
149
  }),
150
150
  });
151
151
  }, [decimals, validateAddress, validateAmount]);
152
- return (jsx(Formik, { initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false, children: ({ errors, touched, values, handleChange, setFieldValue, setErrors, }) => {
152
+ return (jsx(Formik, { initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false, children: ({ errors, touched, values, handleChange, setFieldValue, setErrors, handleBlur, setFieldTouched, validateField, }) => {
153
153
  var _a;
154
154
  return (jsxs(Form, { className: 'send-balance-form', children: [jsxs("div", { className: 'send-balance-page-layout__balance-container', children: [jsx(FormFieldLabel, { children: "Select any token" }), jsx(TokensBalanceDropdown, { tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, setFieldValue: setFieldValue, setErrors: setErrors })] }), jsxs("div", { className: 'send-balance-form__amount-container', children: [jsx(Field, { variant: 'regular', className: `send-balance-form__amount-container__field ${showFiat ? 'fiat' : ''}`, name: 'amount', id: 'amount', onChange: (e) => {
155
155
  const newValue = e.target.value;
@@ -164,6 +164,10 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
164
164
  return;
165
165
  }
166
166
  setSendBalanceVariable('amount', (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? Number(newValue) : undefined);
167
+ }, onBlur: (e) => {
168
+ handleBlur(e);
169
+ setFieldTouched('amount', true);
170
+ validateField('amount');
167
171
  }, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
168
172
  getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
169
173
  paddingLeft: `${leftSymbolPadding}px`,
@@ -198,10 +198,10 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
198
198
  const { user: user$1, userWithMissingInfo } = user.useUser();
199
199
  const isAuthenticated = Boolean(user$1);
200
200
  if (user$1) {
201
- logger$1.logger.setMetaData('user', user$1);
201
+ logger$1.logger.metaData.set('user', user$1);
202
202
  }
203
203
  else {
204
- logger$1.logger.setMetaData('user', undefined);
204
+ logger$1.logger.metaData.set('user', undefined);
205
205
  }
206
206
  const { consumeNonce } = useFetchNonce.useFetchNonce(environmentId);
207
207
  const [qrcodeUri, setQrcodeUri] = React.useState('');
@@ -194,10 +194,10 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
194
194
  const { user, userWithMissingInfo } = useUser();
195
195
  const isAuthenticated = Boolean(user);
196
196
  if (user) {
197
- logger.setMetaData('user', user);
197
+ logger.metaData.set('user', user);
198
198
  }
199
199
  else {
200
- logger.setMetaData('user', undefined);
200
+ logger.metaData.set('user', undefined);
201
201
  }
202
202
  const { consumeNonce } = useFetchNonce(environmentId);
203
203
  const [qrcodeUri, setQrcodeUri] = useState('');