@paywithglide/glide-react 0.0.51 → 0.0.52

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/core.js CHANGED
@@ -272,7 +272,7 @@ function Ie(s) {
272
272
  );
273
273
  }
274
274
  }
275
- const Pe = "@paywithglide/glide-react", xe = "0.0.51", Ee = "module", Ce = ["dist"], ke = "dist/glide.js", Me = "dist/glide.d.ts", Ae = { ".": { types: "./dist/glide.d.ts", default: "./dist/glide.js" }, "./core": { types: "./dist/core.d.ts", default: "./dist/core.js" }, "./package.json": "./package.json" }, Ue = !1, Te = { dev: "vite", build: "bun run lint && vite build", "build-web": "tsc --p ./tsconfig.build.json && vite build --mode web", "build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background", lint: "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json", preview: "vite preview", prepublishOnly: "bun run build" }, We = { "@paywithglide/glide-js": "0.13.32" }, De = { "@antiwork/shortest": "^0.2.1", "@eslint/js": "^9.15.0", "@privy-io/react-auth": "^3.10.1", "@solana-program/memo": "^0.10.0", "@solana-program/system": "^0.10.0", "@solana-program/token": "^0.9.0", "@solana/kit": "^5.1.0", "@tanstack/react-query": "^5.61.5", "@types/chrome": "^0.0.299", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", eslint: "^9.15.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.14", globals: "^15.12.0", prettier: "^3.6.2", react: "^18.3.1", "react-dom": "^18.3.1", typescript: "~5.6.2", "typescript-eslint": "^8.15.0", viem: "^2.21.51", vite: "^6.0.1", "vite-plugin-dts": "^4.3.0", "vite-plugin-static-copy": "^2.2.0", wagmi: "^2.13.0" }, je = {
275
+ const Pe = "@paywithglide/glide-react", xe = "0.0.52", Ee = "module", Ce = ["dist"], ke = "dist/glide.js", Me = "dist/glide.d.ts", Ae = { ".": { types: "./dist/glide.d.ts", default: "./dist/glide.js" }, "./core": { types: "./dist/core.d.ts", default: "./dist/core.js" }, "./package.json": "./package.json" }, Ue = !1, Te = { dev: "vite", build: "bun run lint && vite build", "build-web": "tsc --p ./tsconfig.build.json && vite build --mode web", "build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background", lint: "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json", preview: "vite preview", prepublishOnly: "bun run build" }, We = { "@paywithglide/glide-js": "0.13.32" }, De = { "@antiwork/shortest": "^0.2.1", "@eslint/js": "^9.15.0", "@privy-io/react-auth": "^3.10.1", "@solana-program/memo": "^0.10.0", "@solana-program/system": "^0.10.0", "@solana-program/token": "^0.9.0", "@solana/kit": "^5.1.0", "@tanstack/react-query": "^5.61.5", "@types/chrome": "^0.0.299", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", eslint: "^9.15.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.14", globals: "^15.12.0", prettier: "^3.6.2", react: "^18.3.1", "react-dom": "^18.3.1", typescript: "~5.6.2", "typescript-eslint": "^8.15.0", viem: "^2.21.51", vite: "^6.0.1", "vite-plugin-dts": "^4.3.0", "vite-plugin-static-copy": "^2.2.0", wagmi: "^2.13.0" }, je = {
276
276
  name: Pe,
277
277
  version: xe,
278
278
  type: Ee,
package/dist/glide.js CHANGED
@@ -1,7 +1,7 @@
1
- import { GlideDeposit as I } from "./core.js";
1
+ import { GlideDeposit as P } from "./core.js";
2
2
  import { browserLocalStorageProvider as c, initializeParentBridge as d } from "./core.js";
3
- import { useMemo as y } from "react";
4
- const i = ({
3
+ import { useMemo as t } from "react";
4
+ const l = ({
5
5
  app: G,
6
6
  recipient: U,
7
7
  chainId: z,
@@ -33,15 +33,15 @@ const i = ({
33
33
  walletProvider: A,
34
34
  solanaWalletProvider: b,
35
35
  localStorageProvider: g,
36
- onOpen: W,
37
- onSuccess: P,
38
- onClose: t,
39
- autoCloseOnSuccess: v,
36
+ onOpen: I,
37
+ onSuccess: O,
38
+ onClose: W,
39
+ autoCloseOnSuccess: y,
40
40
  popupsBlocked: m,
41
41
  baseUrl: S,
42
42
  debug: C
43
43
  }) => {
44
- const O = y(() => new I({
44
+ const v = t(() => new P({
45
45
  app: G,
46
46
  recipient: U,
47
47
  chainId: z,
@@ -73,10 +73,10 @@ const i = ({
73
73
  walletProvider: A,
74
74
  solanaWalletProvider: b,
75
75
  localStorageProvider: g,
76
- onOpen: W,
77
- onSuccess: P,
78
- onClose: t,
79
- autoCloseOnSuccess: v,
76
+ onOpen: I,
77
+ onSuccess: O,
78
+ onClose: W,
79
+ autoCloseOnSuccess: y,
80
80
  popupsBlocked: m,
81
81
  baseUrl: S,
82
82
  debug: C
@@ -112,20 +112,20 @@ const i = ({
112
112
  A,
113
113
  b,
114
114
  g,
115
+ I,
116
+ O,
115
117
  W,
116
- P,
117
- t,
118
- v,
118
+ y,
119
119
  m,
120
120
  S,
121
121
  C
122
122
  ]);
123
123
  return {
124
- openGlideDeposit: O.open,
125
- externalUrl: O.externalUrl,
126
- opts: O.opts
124
+ openGlideDeposit: v.open,
125
+ externalUrl: v.externalUrl,
126
+ opts: v.opts
127
127
  };
128
- }, l = ({
128
+ }, i = ({
129
129
  app: G,
130
130
  preferGaslessPayment: U,
131
131
  chainIds: z,
@@ -134,31 +134,33 @@ const i = ({
134
134
  excludeFundingSources: B,
135
135
  fundingSources: H,
136
136
  allowedPaymentCurrencies: J,
137
- appMetadata: N,
138
- enableRefundEmails: Q,
139
- payerEmail: V,
140
- hideSettlementCopy: X,
141
- showAppLogo: Y,
142
- showOnrampFirst: Z,
143
- debitCardAlias: _,
144
- copyOverrides: $,
145
- amount: K,
146
- amountUSD: k,
147
- sessionId: x,
148
- sessionMetadata: L,
149
- theme: R,
150
- walletProvider: E,
151
- solanaWalletProvider: M,
152
- localStorageProvider: D,
153
- onOpen: T,
154
- onSuccess: f,
155
- onClose: F,
156
- autoCloseOnSuccess: w,
157
- popupsBlocked: A,
158
- baseUrl: b,
159
- debug: g
137
+ chainId: N,
138
+ currencyId: Q,
139
+ appMetadata: V,
140
+ enableRefundEmails: X,
141
+ payerEmail: Y,
142
+ hideSettlementCopy: Z,
143
+ showAppLogo: _,
144
+ showOnrampFirst: $,
145
+ debitCardAlias: K,
146
+ copyOverrides: k,
147
+ amount: x,
148
+ amountUSD: L,
149
+ sessionId: R,
150
+ sessionMetadata: E,
151
+ theme: M,
152
+ walletProvider: D,
153
+ solanaWalletProvider: T,
154
+ localStorageProvider: f,
155
+ onOpen: F,
156
+ onSuccess: w,
157
+ onClose: A,
158
+ autoCloseOnSuccess: b,
159
+ popupsBlocked: g,
160
+ baseUrl: I,
161
+ debug: O
160
162
  }) => {
161
- const W = y(() => new I({
163
+ const W = t(() => new P({
162
164
  app: G,
163
165
  preferGaslessPayment: U,
164
166
  chainIds: z,
@@ -167,30 +169,32 @@ const i = ({
167
169
  excludeFundingSources: B,
168
170
  fundingSources: H,
169
171
  allowedPaymentCurrencies: J,
170
- appMetadata: N,
171
- enableRefundEmails: Q,
172
- payerEmail: V,
172
+ chainId: N,
173
+ currencyId: Q,
174
+ appMetadata: V,
175
+ enableRefundEmails: X,
176
+ payerEmail: Y,
173
177
  mode: "pay",
174
- hideSettlementCopy: X,
175
- showAppLogo: Y,
176
- showOnrampFirst: Z,
177
- debitCardAlias: _,
178
- copyOverrides: $,
179
- sessionId: x,
180
- amount: K,
181
- amountUSD: k,
182
- sessionMetadata: L,
183
- theme: R,
184
- walletProvider: E,
185
- solanaWalletProvider: M,
186
- localStorageProvider: D,
187
- onOpen: T,
188
- onSuccess: f,
189
- onClose: F,
190
- autoCloseOnSuccess: w,
191
- popupsBlocked: A,
192
- baseUrl: b,
193
- debug: g
178
+ hideSettlementCopy: Z,
179
+ showAppLogo: _,
180
+ showOnrampFirst: $,
181
+ debitCardAlias: K,
182
+ copyOverrides: k,
183
+ sessionId: R,
184
+ amount: x,
185
+ amountUSD: L,
186
+ sessionMetadata: E,
187
+ theme: M,
188
+ walletProvider: D,
189
+ solanaWalletProvider: T,
190
+ localStorageProvider: f,
191
+ onOpen: F,
192
+ onSuccess: w,
193
+ onClose: A,
194
+ autoCloseOnSuccess: b,
195
+ popupsBlocked: g,
196
+ baseUrl: I,
197
+ debug: O
194
198
  }), [
195
199
  G,
196
200
  U,
@@ -208,11 +212,11 @@ const i = ({
208
212
  Z,
209
213
  _,
210
214
  $,
211
- x,
212
215
  K,
213
216
  k,
214
- L,
215
217
  R,
218
+ x,
219
+ L,
216
220
  E,
217
221
  M,
218
222
  D,
@@ -222,7 +226,9 @@ const i = ({
222
226
  w,
223
227
  A,
224
228
  b,
225
- g
229
+ g,
230
+ I,
231
+ O
226
232
  ]);
227
233
  return {
228
234
  openGlidePay: W.open,
@@ -255,7 +261,7 @@ const i = ({
255
261
  baseUrl: M,
256
262
  debug: D
257
263
  }) => {
258
- const T = y(() => new I({
264
+ const T = t(() => new P({
259
265
  app: G,
260
266
  evm: U,
261
267
  approval: z,
@@ -337,7 +343,7 @@ const i = ({
337
343
  autoCloseOnSuccess: E,
338
344
  baseUrl: M
339
345
  }) => {
340
- const D = y(() => new I({
346
+ const D = t(() => new P({
341
347
  app: G,
342
348
  recipient: U,
343
349
  chainId: z,
@@ -394,11 +400,11 @@ const i = ({
394
400
  };
395
401
  };
396
402
  export {
397
- I as GlideDeposit,
403
+ P as GlideDeposit,
398
404
  c as browserLocalStorageProvider,
399
405
  d as initializeParentBridge,
400
406
  n as useGlideBuy,
401
407
  u as useGlideCall,
402
- i as useGlideDeposit,
403
- l as useGlidePay
408
+ l as useGlideDeposit,
409
+ i as useGlidePay
404
410
  };
@@ -17,6 +17,20 @@ type UseGlidePayProps = {
17
17
  excludeFundingSources?: FundingSource[];
18
18
  fundingSources?: FundingSource[];
19
19
  allowedPaymentCurrencies?: string[];
20
+ /**
21
+ * Override the destination chain. Required when the target currency lives on
22
+ * a different chain than the app's default (e.g. an Ethereum-only token when
23
+ * the app is configured for Base). Must be a CAIP-2 chain ID (e.g.
24
+ * "eip155:1" for Ethereum mainnet). Applied before the currency lookup, so
25
+ * pairing this with `currencyId` always resolves correctly.
26
+ */
27
+ chainId?: CAIP2;
28
+ /**
29
+ * Lock the payment to a specific currency. Pass the currency ID (e.g. the
30
+ * RAILS token ID) to force the widget to only accept that currency. If the
31
+ * token lives on a different chain than the app default, also pass `chainId`.
32
+ */
33
+ currencyId?: string;
20
34
  appMetadata?: {
21
35
  name?: string;
22
36
  logoUrl?: string;
@@ -43,7 +57,7 @@ type UseGlidePayProps = {
43
57
  baseUrl?: string;
44
58
  debug?: boolean;
45
59
  };
46
- export declare const useGlidePay: ({ app, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, allowedPaymentCurrencies, appMetadata, enableRefundEmails, payerEmail, hideSettlementCopy, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, amount, amountUSD, sessionId, sessionMetadata, theme, walletProvider, solanaWalletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
60
+ export declare const useGlidePay: ({ app, preferGaslessPayment, chainIds, excludeChainIds, excludeCurrencyTiers, excludeFundingSources, fundingSources, allowedPaymentCurrencies, chainId, currencyId, appMetadata, enableRefundEmails, payerEmail, hideSettlementCopy, showAppLogo, showOnrampFirst, debitCardAlias, copyOverrides, amount, amountUSD, sessionId, sessionMetadata, theme, walletProvider, solanaWalletProvider, localStorageProvider, onOpen, onSuccess, onClose, autoCloseOnSuccess, popupsBlocked, baseUrl, debug, }: UseGlidePayProps) => {
47
61
  openGlidePay: () => void;
48
62
  externalUrl: string;
49
63
  opts: import('./GlideDeposit.ts').GlideDepositOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paywithglide/glide-react",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"