@daimo/pay 1.0.1 → 1.0.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/build/index.d.ts CHANGED
@@ -188,6 +188,8 @@ type PayButtonCommonProps = PayButtonPaymentProps & {
188
188
  onPaymentCompleted?: (event: PaymentCompletedEvent) => void;
189
189
  /** Called when destination call reverts and funds are refunded */
190
190
  onPaymentBounced?: (event: PaymentBouncedEvent) => void;
191
+ /** Automatically close the modal after a successful payment. */
192
+ closeOnSuccess?: boolean;
191
193
  };
192
194
  type DaimoPayButtonProps = PayButtonCommonProps & {
193
195
  /** Light mode, dark mode, or auto. */
@@ -196,14 +198,10 @@ type DaimoPayButtonProps = PayButtonCommonProps & {
196
198
  theme?: Theme;
197
199
  /** Custom theme. See docs for options. */
198
200
  customTheme?: CustomTheme;
199
- /** Automatically close the modal after a successful payment. */
200
- closeOnSuccess?: boolean;
201
201
  /** Disable interaction. */
202
202
  disabled?: boolean;
203
203
  };
204
204
  type DaimoPayButtonCustomProps = PayButtonCommonProps & {
205
- /** Automatically close the modal after a successful payment. */
206
- closeOnSuccess?: boolean;
207
205
  /** Custom renderer */
208
206
  children: (renderProps: {
209
207
  show: () => void;
@@ -259,7 +257,8 @@ declare const wallets: {
259
257
  [key: string]: CreateConnectorFn;
260
258
  };
261
259
 
260
+ declare const daimoPayVersion: string;
262
261
  /** Generates a globally-unique payId. */
263
262
  declare function generatePayId(): string;
264
263
 
265
- export { Avatar, Chain as ChainIcon, DaimoPayButton, DaimoPayProvider, types_d as Types, generatePayId, defaultConfig as getDefaultConfig, useModal as useDaimoPayModal, useDaimoPayStatus, wallets };
264
+ export { Avatar, Chain as ChainIcon, DaimoPayButton, DaimoPayProvider, types_d as Types, daimoPayVersion, generatePayId, defaultConfig as getDefaultConfig, useModal as useDaimoPayModal, useDaimoPayStatus, wallets };
@@ -1,5 +1,5 @@
1
1
  var name = "@daimo/pay";
2
- var version = "1.0.1";
2
+ var version = "1.0.3";
3
3
  var author = "Daimo";
4
4
  var homepage = "https://pay.daimo.com";
5
5
  var license = "BSD-2-Clause license";
@@ -58,8 +58,8 @@ var dependencies = {
58
58
  };
59
59
  var peerDependencies = {
60
60
  "@tanstack/react-query": ">=5.0.0",
61
- react: "17.x || 18.x",
62
- "react-dom": "17.x || 18.x",
61
+ react: "17.x || 18.x || 19.x",
62
+ "react-dom": "17.x || 18.x || 19.x",
63
63
  viem: "2.x",
64
64
  wagmi: "2.x"
65
65
  };
@@ -6,5 +6,5 @@ export { useModal as useDaimoPayModal } from './hooks/useModal.js';
6
6
  export { default as Avatar } from './components/Common/Avatar/index.js';
7
7
  export { default as ChainIcon } from './components/Common/Chain/index.js';
8
8
  export { wallets } from './wallets/index.js';
9
- export { generatePayId } from './utils/exports.js';
9
+ export { daimoPayVersion, generatePayId } from './utils/exports.js';
10
10
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,14 @@
1
1
  import { writeDaimoPayOrderID } from '@daimo/common';
2
2
  import { bytesToBigInt } from 'viem';
3
+ import packageJson from '../../package.json.js';
3
4
 
4
5
  // Exported utilities, useful for @daimo/pay users.
6
+ const daimoPayVersion = packageJson.version;
5
7
  /** Generates a globally-unique payId. */
6
8
  function generatePayId() {
7
9
  const id = bytesToBigInt(crypto.getRandomValues(new Uint8Array(32)));
8
10
  return writeDaimoPayOrderID(id);
9
11
  }
10
12
 
11
- export { generatePayId };
13
+ export { daimoPayVersion, generatePayId };
12
14
  //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"exports.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -1,10 +1,14 @@
1
1
  import { createTRPCClient, httpBatchLink } from '@trpc/client';
2
+ import { daimoPayVersion } from './exports.js';
2
3
 
3
4
  function createTrpcClient(apiUrl) {
4
5
  return createTRPCClient({
5
6
  links: [
6
7
  httpBatchLink({
7
8
  url: apiUrl,
9
+ headers: {
10
+ "x-pay-version": daimoPayVersion,
11
+ },
8
12
  }),
9
13
  ],
10
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"trpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"trpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daimo/pay",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "author": "Daimo",
6
6
  "homepage": "https://pay.daimo.com",
7
7
  "license": "BSD-2-Clause license",
@@ -60,8 +60,8 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@tanstack/react-query": ">=5.0.0",
63
- "react": "17.x || 18.x",
64
- "react-dom": "17.x || 18.x",
63
+ "react": "17.x || 18.x || 19.x",
64
+ "react-dom": "17.x || 18.x || 19.x",
65
65
  "viem": "2.x",
66
66
  "wagmi": "2.x"
67
67
  },