@daimo/pay 1.1.3 → 1.1.5

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
@@ -9,8 +9,8 @@ import { CreateTRPCClient } from '@trpc/client';
9
9
  import * as abitype from 'abitype';
10
10
  import { WalletName } from '@solana/wallet-adapter-base';
11
11
  import { CreateConfigParameters } from '@wagmi/core';
12
- import { CoinbaseWalletParameters } from 'wagmi/connectors';
13
12
  import { CreateConnectorFn } from 'wagmi';
13
+ import { CoinbaseWalletParameters } from 'wagmi/connectors';
14
14
 
15
15
  type Hash = `0x${string}`;
16
16
  type CustomAvatarProps = {
@@ -385,9 +385,10 @@ type DefaultConfigProps = {
385
385
  * WalletConnect project ID by default. */
386
386
  walletConnectProjectId?: string;
387
387
  coinbaseWalletPreference?: CoinbaseWalletParameters<"4">["preference"];
388
+ additionalConnectors?: CreateConnectorFn[];
388
389
  } & Partial<CreateConfigParameters>;
389
390
  /** Daimo Pay recommended config, for use with wagmi's createConfig(). */
390
- declare const defaultConfig: ({ appName, appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, chains, client, ...props }: DefaultConfigProps) => CreateConfigParameters;
391
+ declare const defaultConfig: ({ appName, appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, additionalConnectors, chains, client, ...props }: DefaultConfigProps) => CreateConfigParameters;
391
392
 
392
393
  type PayButtonPaymentProps = {
393
394
  /**
@@ -1,5 +1,5 @@
1
1
  var name = "@daimo/pay";
2
- var version = "1.1.3";
2
+ var version = "1.1.5";
3
3
  var author = "Daimo";
4
4
  var homepage = "https://pay.daimo.com";
5
5
  var license = "BSD-2-Clause license";
@@ -38,8 +38,8 @@ var keywords = [
38
38
  "crypto"
39
39
  ];
40
40
  var dependencies = {
41
- "@daimo/common": "0.3.18",
42
- "@daimo/contract": "0.3.18",
41
+ "@daimo/common": "1.1.0",
42
+ "@daimo/contract": "1.1.0",
43
43
  "@solana/wallet-adapter-base": "^0.9.23",
44
44
  "@solana/wallet-adapter-react": "^0.15.35",
45
45
  "@solana/web3.js": "^1.95.4",
@@ -60,7 +60,7 @@ var peerDependencies = {
60
60
  "@tanstack/react-query": ">=5.0.0",
61
61
  react: "17.x || 18.x || 19.x",
62
62
  "react-dom": "17.x || 18.x || 19.x",
63
- viem: "2.x",
63
+ viem: ">=2.22.0",
64
64
  wagmi: "2.x"
65
65
  };
66
66
  var devDependencies = {
@@ -42,6 +42,7 @@ const TextButton = styled(motion.button) `
42
42
  border-radius: 6px;
43
43
  background: none;
44
44
  color: var(--ck-body-color-muted);
45
+ text-decoration-color: var(--ck-body-color-muted);
45
46
  font-size: 15px;
46
47
  line-height: 18px;
47
48
  font-weight: 500;
@@ -51,6 +52,7 @@ const TextButton = styled(motion.button) `
51
52
  transform 100ms ease;
52
53
  &:hover {
53
54
  color: var(--ck-body-color-muted-hover);
55
+ text-decoration-color: var(--ck-body-color-muted-hover);
54
56
  }
55
57
  &:active {
56
58
  transform: scale(0.96);
@@ -65,7 +67,8 @@ const TextButton = styled(motion.button) `
65
67
  animation: ${fadeIn} 300ms ease both;
66
68
  }
67
69
  `;
68
- const Underline = styled.span `
70
+ const Underline = styled(motion.span) `
71
+ text-underline-offset: 2px;
69
72
  text-decoration: underline;
70
73
  `;
71
74
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -160,9 +160,9 @@ const DaimoPayProviderWithoutSolana = ({ children, theme = "auto", mode = "auto"
160
160
  setTimeout(() => retryBackoff("refreshOrder", () => paymentState.refreshOrder()), intervalMs);
161
161
  }, [daimoPayOrder]);
162
162
  const showPayment = async (modalOptions) => {
163
- const { daimoPayOrder, payParams } = paymentState;
163
+ const { daimoPayOrder } = paymentState;
164
164
  const id = daimoPayOrder?.id;
165
- log(`[PAY] showing payment ${debugJson({ id, payParams, modalOptions })}`);
165
+ log(`[PAY] showing payment ${debugJson({ id, modalOptions })}`);
166
166
  paymentState.setModalOptions(modalOptions);
167
167
  if (daimoPayOrder &&
168
168
  daimoPayOrder.mode === DaimoPayOrderMode.HYDRATED &&
@@ -19,7 +19,7 @@ const REQUIRED_CHAINS = [
19
19
  blast,
20
20
  ];
21
21
  /** Daimo Pay recommended config, for use with wagmi's createConfig(). */
22
- const defaultConfig = ({ appName = "Daimo Pay", appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, chains = REQUIRED_CHAINS, client, ...props }) => {
22
+ const defaultConfig = ({ appName = "Daimo Pay", appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, additionalConnectors, chains = REQUIRED_CHAINS, client, ...props }) => {
23
23
  globalAppName = appName;
24
24
  const paddedChains = [...chains];
25
25
  for (const chain of REQUIRED_CHAINS) {
@@ -47,6 +47,7 @@ const defaultConfig = ({ appName = "Daimo Pay", appIcon, appDescription, appUrl,
47
47
  },
48
48
  walletConnectProjectId: walletConnectProjectId ?? "ea6c5b36001c18b96e06128f14c06f40",
49
49
  coinbaseWalletPreference,
50
+ additionalConnectors,
50
51
  });
51
52
  const config = {
52
53
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"defaultConfig.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"defaultConfig.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { safe, injected, coinbaseWallet, walletConnect } from '@wagmi/connectors';
2
2
 
3
- const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, }) => {
3
+ const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, additionalConnectors, }) => {
4
4
  const hasAllAppData = app.name && app.icon && app.description && app.url;
5
5
  const shouldUseSafeConnector = !(typeof window === "undefined") && window?.parent !== window;
6
- const connectors = [];
6
+ const connectors = additionalConnectors ?? [];
7
7
  // If we're in an iframe, include the SafeConnector
8
8
  if (shouldUseSafeConnector) {
9
9
  connectors.push(safe({
@@ -1,4 +1,4 @@
1
- import { readDaimoPayOrderID, assert, assertNotNull, debugJson } from '@daimo/common';
1
+ import { readDaimoPayOrderID, assert, assertNotNull } from '@daimo/common';
2
2
  import { ethereum } from '@daimo/contract';
3
3
  import { useWallet } from '@solana/wallet-adapter-react';
4
4
  import { useState, useEffect, useCallback } from 'react';
@@ -178,7 +178,6 @@ function usePaymentState({ trpc, daimoPayOrder, setDaimoPayOrder, setOpen, log,
178
178
  }, [daimoPayOrder]);
179
179
  /** Called whenever params change. */
180
180
  const setPayParams = async (payParams) => {
181
- console.log(`[CHECKOUT] setting payParams: ${debugJson(payParams)}`);
182
181
  assert(payParams != null);
183
182
  setPayParamsState(payParams);
184
183
  const newPayId = generatePayId();
@@ -1 +1 @@
1
- {"version":3,"file":"usePaymentState.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"usePaymentState.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -30,6 +30,7 @@ const useWallets = () => {
30
30
  iconShape: "squircle",
31
31
  isInstalled: connector.type === "mock" ||
32
32
  (connector.type === "injected" && connector.id !== "metaMask") ||
33
+ connector.type === "farcasterFrame" ||
33
34
  isCoinbaseWalletConnector(connector.id), // always run coinbase wallet SDK
34
35
  };
35
36
  if (walletId) {
@@ -62,6 +63,9 @@ const useWallets = () => {
62
63
  // remove wallet with id io.metamask if wallet with id 'metaMask' exists
63
64
  .filter((wallet, index, self) => !((wallet.id === "metaMaskSDK" || wallet.id === "metaMask") &&
64
65
  self.find((w) => w.id === "io.metamask" || w.id === "io.metamask.mobile")))
66
+ // remove wallet with id 'com.warpcast.mobile' if wallet with id 'farcaster' exists
67
+ .filter((wallet, index, self) => !(wallet.id === "com.warpcast.mobile" &&
68
+ self.find((w) => w.id === "farcaster")))
65
69
  // order by isInstalled injected connectors first
66
70
  .sort((a, b) => {
67
71
  const AisInstalled = a.isInstalled && isInjectedConnector(a.connector.type);
@@ -1 +1 @@
1
- {"version":3,"file":"useWallets.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"useWallets.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.1.3",
4
+ "version": "1.1.5",
5
5
  "author": "Daimo",
6
6
  "homepage": "https://pay.daimo.com",
7
7
  "license": "BSD-2-Clause license",
@@ -40,8 +40,8 @@
40
40
  "crypto"
41
41
  ],
42
42
  "dependencies": {
43
- "@daimo/common": "0.3.18",
44
- "@daimo/contract": "0.3.18",
43
+ "@daimo/common": "1.1.0",
44
+ "@daimo/contract": "1.1.0",
45
45
  "@solana/wallet-adapter-base": "^0.9.23",
46
46
  "@solana/wallet-adapter-react": "^0.15.35",
47
47
  "@solana/web3.js": "^1.95.4",
@@ -62,7 +62,7 @@
62
62
  "@tanstack/react-query": ">=5.0.0",
63
63
  "react": "17.x || 18.x || 19.x",
64
64
  "react-dom": "17.x || 18.x || 19.x",
65
- "viem": "2.x",
65
+ "viem": ">=2.22.0",
66
66
  "wagmi": "2.x"
67
67
  },
68
68
  "devDependencies": {
@@ -80,4 +80,4 @@
80
80
  "rollup-plugin-visualizer": "^5.5.4",
81
81
  "typescript-plugin-styled-components": "^3.0.0"
82
82
  }
83
- }
83
+ }