@dj-test/payment-sdk 1.0.6 → 1.0.7

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/dist/index.d.mts CHANGED
@@ -1638,7 +1638,11 @@ declare const supportedChains: ({
1638
1638
  };
1639
1639
  readonly network: "base-sepolia";
1640
1640
  })[];
1641
- declare const createWagmiConfig: (projectId?: string) => Config$1;
1641
+ /**
1642
+ * Create wagmi config following Daimo Pay approach
1643
+ * Uses injected connectors + deep links, no WalletConnect dependency
1644
+ */
1645
+ declare const createWagmiConfig: () => Config$1;
1642
1646
  declare const getEvmChainById: (chainId: number) => {
1643
1647
  blockExplorers: {
1644
1648
  readonly default: {
@@ -3594,7 +3598,6 @@ declare const PaymentModal: React.FC<PaymentModalProps>;
3594
3598
 
3595
3599
  interface WalletProviderProps {
3596
3600
  children: ReactNode;
3597
- projectId?: string;
3598
3601
  queryClient?: QueryClient;
3599
3602
  }
3600
3603
  declare const WalletProvider: React.FC<WalletProviderProps>;
package/dist/index.d.ts CHANGED
@@ -1638,7 +1638,11 @@ declare const supportedChains: ({
1638
1638
  };
1639
1639
  readonly network: "base-sepolia";
1640
1640
  })[];
1641
- declare const createWagmiConfig: (projectId?: string) => Config$1;
1641
+ /**
1642
+ * Create wagmi config following Daimo Pay approach
1643
+ * Uses injected connectors + deep links, no WalletConnect dependency
1644
+ */
1645
+ declare const createWagmiConfig: () => Config$1;
1642
1646
  declare const getEvmChainById: (chainId: number) => {
1643
1647
  blockExplorers: {
1644
1648
  readonly default: {
@@ -3594,7 +3598,6 @@ declare const PaymentModal: React.FC<PaymentModalProps>;
3594
3598
 
3595
3599
  interface WalletProviderProps {
3596
3600
  children: ReactNode;
3597
- projectId?: string;
3598
3601
  queryClient?: QueryClient;
3599
3602
  }
3600
3603
  declare const WalletProvider: React.FC<WalletProviderProps>;
package/dist/index.js CHANGED
@@ -166,28 +166,32 @@ var supportedEvmChains = [
166
166
  import_chains.baseSepolia
167
167
  ];
168
168
  var supportedChains = supportedEvmChains;
169
- var createWagmiConfig = (projectId) => {
170
- const connectors = [(0, import_connectors.injected)()];
171
- if (projectId) {
172
- const sdkConfig = config.getConfig();
173
- const environment = sdkConfig.environment || "sandbox";
174
- const paymentDomain = PAYMENT_DOMAINS[environment];
175
- connectors.push(
176
- (0, import_connectors.walletConnect)({
177
- projectId,
178
- metadata: {
179
- name: "Payment SDK",
180
- description: "Multi-chain Payment SDK",
181
- url: paymentDomain,
182
- icons: [`${paymentDomain}/icon.png`]
183
- },
184
- showQrModal: true
185
- })
186
- );
187
- }
169
+ var createWagmiConfig = () => {
188
170
  return (0, import_wagmi.createConfig)({
189
171
  chains: [import_chains.mainnet, import_chains.sepolia, import_chains.polygon, import_chains.polygonAmoy, import_chains.base, import_chains.baseSepolia],
190
- connectors,
172
+ connectors: [
173
+ // Injected connector - primary method for both web and mobile in-app browsers
174
+ (0, import_connectors.injected)({
175
+ target() {
176
+ return {
177
+ id: "injected",
178
+ name: "Browser Wallet",
179
+ provider: typeof window !== "undefined" ? window.ethereum : void 0
180
+ };
181
+ }
182
+ }),
183
+ // MetaMask specific connector
184
+ (0, import_connectors.metaMask)({
185
+ dappMetadata: {
186
+ name: "Payment SDK",
187
+ url: typeof window !== "undefined" ? window.location.origin : ""
188
+ }
189
+ }),
190
+ // Coinbase Wallet
191
+ (0, import_connectors.coinbaseWallet)({
192
+ appName: "Payment SDK"
193
+ })
194
+ ],
191
195
  transports: {
192
196
  [import_chains.mainnet.id]: (0, import_wagmi.http)(),
193
197
  [import_chains.sepolia.id]: (0, import_wagmi.http)(),
@@ -3515,13 +3519,9 @@ var defaultQueryClient = new import_react_query.QueryClient({
3515
3519
  });
3516
3520
  var WalletProvider = ({
3517
3521
  children,
3518
- projectId,
3519
3522
  queryClient = defaultQueryClient
3520
3523
  }) => {
3521
- const wagmiConfig = (0, import_react12.useMemo)(
3522
- () => createWagmiConfig(projectId),
3523
- [projectId]
3524
- );
3524
+ const wagmiConfig = (0, import_react12.useMemo)(() => createWagmiConfig(), []);
3525
3525
  const adapterFactory = (0, import_react12.useMemo)(() => {
3526
3526
  const factory = new WalletAdapterFactory();
3527
3527
  factory.initializeEvmAdapter(wagmiConfig);
package/dist/index.mjs CHANGED
@@ -86,7 +86,7 @@ import {
86
86
  base,
87
87
  baseSepolia
88
88
  } from "wagmi/chains";
89
- import { injected, walletConnect } from "@wagmi/connectors";
89
+ import { injected, coinbaseWallet, metaMask } from "@wagmi/connectors";
90
90
  var supportedEvmChains = [
91
91
  mainnet,
92
92
  sepolia,
@@ -96,28 +96,32 @@ var supportedEvmChains = [
96
96
  baseSepolia
97
97
  ];
98
98
  var supportedChains = supportedEvmChains;
99
- var createWagmiConfig = (projectId) => {
100
- const connectors = [injected()];
101
- if (projectId) {
102
- const sdkConfig = config.getConfig();
103
- const environment = sdkConfig.environment || "sandbox";
104
- const paymentDomain = PAYMENT_DOMAINS[environment];
105
- connectors.push(
106
- walletConnect({
107
- projectId,
108
- metadata: {
109
- name: "Payment SDK",
110
- description: "Multi-chain Payment SDK",
111
- url: paymentDomain,
112
- icons: [`${paymentDomain}/icon.png`]
113
- },
114
- showQrModal: true
115
- })
116
- );
117
- }
99
+ var createWagmiConfig = () => {
118
100
  return createConfig({
119
101
  chains: [mainnet, sepolia, polygon, polygonAmoy, base, baseSepolia],
120
- connectors,
102
+ connectors: [
103
+ // Injected connector - primary method for both web and mobile in-app browsers
104
+ injected({
105
+ target() {
106
+ return {
107
+ id: "injected",
108
+ name: "Browser Wallet",
109
+ provider: typeof window !== "undefined" ? window.ethereum : void 0
110
+ };
111
+ }
112
+ }),
113
+ // MetaMask specific connector
114
+ metaMask({
115
+ dappMetadata: {
116
+ name: "Payment SDK",
117
+ url: typeof window !== "undefined" ? window.location.origin : ""
118
+ }
119
+ }),
120
+ // Coinbase Wallet
121
+ coinbaseWallet({
122
+ appName: "Payment SDK"
123
+ })
124
+ ],
121
125
  transports: {
122
126
  [mainnet.id]: http(),
123
127
  [sepolia.id]: http(),
@@ -3456,13 +3460,9 @@ var defaultQueryClient = new QueryClient({
3456
3460
  });
3457
3461
  var WalletProvider = ({
3458
3462
  children,
3459
- projectId,
3460
3463
  queryClient = defaultQueryClient
3461
3464
  }) => {
3462
- const wagmiConfig = useMemo2(
3463
- () => createWagmiConfig(projectId),
3464
- [projectId]
3465
- );
3465
+ const wagmiConfig = useMemo2(() => createWagmiConfig(), []);
3466
3466
  const adapterFactory = useMemo2(() => {
3467
3467
  const factory = new WalletAdapterFactory();
3468
3468
  factory.initializeEvmAdapter(wagmiConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dj-test/payment-sdk",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Payment SDK for blockchain-based payment system",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",