@zkp2p/cash 0.6.0 → 0.6.2

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/AGENTS.md CHANGED
@@ -353,9 +353,15 @@ button click. Re-prepare when the selected handle changes. Use
353
353
  tab or an ambiguous closure; service errors reject, and only an active Google
354
354
  credential counts as connected. Persist the hash with its environment and user.
355
355
 
356
- The hosted flow accepts Google-hosted school/custom domains and verifies actual
357
- Venmo receipts. `VenmoGmailConnectError` retains codes such as
358
- `venmo_google_oauth_receipt_not_found`, `popup_blocked`, `connection_closed`,
359
- and `connection_timeout`; it is separate from `CashError`. No emails or Google
360
- tokens reach the partner. `link.url` supports redirect/native hosts, which
361
- must check status on return. See the README and `examples/venmo-link.ts`.
356
+ For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
357
+ open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
358
+ Register the scheme in your app binary; no registration with Peer is needed.
359
+ Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
360
+ tabs that block it keep the success page. Always re-check status on return.
361
+
362
+ The hosted flow verifies actual Venmo receipts, including Google-hosted custom
363
+ inboxes. `VenmoGmailConnectError` is separate from `CashError`; no emails or
364
+ Google tokens reach the partner. Configure `venmoGmail: { appearance, popup }`
365
+ for branding and desktop dimensions; omission keeps Peer defaults.
366
+ See the README for error codes, native callbacks, package-free URLs, and
367
+ customization, plus `examples/venmo-link.ts`.
package/README.md CHANGED
@@ -144,7 +144,7 @@ arbitrary protocol operations.
144
144
 
145
145
  | Verb | What it does |
146
146
  | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
147
- | `prepareVenmoGmailConnect(payee)` | Optional Venmo handle registration; returns the payee hash and hosted URL |
147
+ | `prepareVenmoGmailConnect(payee, { returnUrl }?)` | Optional Venmo handle registration; returns the payee hash and hosted URL, with an optional app callback |
148
148
  | `openVenmoGmailConnect(payeeDetails)` | Optional browser popup/tab; call directly from a click |
149
149
  | `isVenmoGmailConnected(payeeDetails)` | Read whether an active Google receipt credential exists |
150
150
  | `capabilities()` | Sync discovery: Base USDC destination/default source, platforms × currencies × payee hints × amount bounds |
@@ -239,6 +239,83 @@ never pass through the partner app or Cash SDK.
239
239
  See [the browser example](examples/venmo-link.ts). JSON codecs are exported for
240
240
  `PreparedVenmoGmailConnect` and `VenmoGmailConnectResult`.
241
241
 
242
+ ### Return to an Expo / React Native app
243
+
244
+ Cash `0.6.2` supports an optional callback on the prepared URL. The popup
245
+ helper is browser-only; native apps open the URL using their system browser
246
+ session:
247
+
248
+ ```ts
249
+ import { createCashClient } from '@zkp2p/cash';
250
+ import * as WebBrowser from 'expo-web-browser';
251
+
252
+ const cash = createCashClient({ environment: 'production' });
253
+ const returnUrl = 'partner-app://venmo-linked';
254
+ const link = await cash.prepareVenmoGmailConnect('@yourhandle', { returnUrl });
255
+ await WebBrowser.openAuthSessionAsync(link.url, returnUrl);
256
+ const connected = await cash.isVenmoGmailConnected(link.payeeDetails);
257
+ ```
258
+
259
+ Register the callback scheme in your app binary and test on iOS and Android;
260
+ see [Expo's callback requirements](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options).
261
+ Peer requires no callback registration or deployment configuration. After
262
+ verification, the hosted page navigates to `returnUrl` unchanged: no Google
263
+ credentials, email, account hash, or status are appended. Errors remain on
264
+ the page with a manual return button. Always re-check connection status on
265
+ return or dismissal; a browser return alone is not proof of linking.
266
+
267
+ Preparation and status checks can stay on your backend. If it already has
268
+ `payeeDetails`, your app needs no Cash package:
269
+
270
+ ```ts
271
+ const connectUrl = new URL('https://app.peer.xyz/connect/venmo');
272
+ connectUrl.searchParams.set('returnUrl', returnUrl);
273
+ connectUrl.hash = payeeDetails;
274
+ await WebBrowser.openAuthSessionAsync(connectUrl.toString(), returnUrl);
275
+ // Re-check seller-credential/status through your backend.
276
+ ```
277
+
278
+ Without a callback, or with an empty one, the hosted page attempts to close
279
+ after verification. Script-opened desktop popups can close; mobile tabs that
280
+ block closure retain the success page for manual dismissal.
281
+
282
+ ### Customize the hosted popup
283
+
284
+ With `@zkp2p/cash@0.6.1`, configure branding once on the client. The same
285
+ appearance is used by `link.url` and `openVenmoGmailConnect()`.
286
+
287
+ ```ts
288
+ const cash = createCashClient({
289
+ environment: 'production',
290
+ venmoGmail: {
291
+ appearance: {
292
+ logoUrl: 'https://your-app.example/logo.png',
293
+ logoAlt: 'Your app',
294
+ backgroundColor: '#FFFFFF',
295
+ textColor: '#172033',
296
+ secondaryTextColor: '#636B7A',
297
+ buttonColor: '#6246EA',
298
+ buttonTextColor: '#FFFFFF',
299
+ fontFamily: 'Inter, sans-serif',
300
+ headingTextTransform: 'none',
301
+ buttonTextTransform: 'none',
302
+ buttonBorderRadius: 12,
303
+ buttonHeight: 52,
304
+ },
305
+ popup: { width: 500, height: 620 },
306
+ },
307
+ });
308
+ ```
309
+
310
+ Your hosted logo appears beside Venmo with three connecting dots. Without a
311
+ partner logo, the page shows Peer beside Venmo. Colors use
312
+ hex values and dimensions use pixels. Optional `fontUrl` accepts a hosted
313
+ WOFF/WOFF2 font with cross-origin loading enabled. Popup dimensions apply to
314
+ desktop; mobile browsers control the new tab's size. Styling never changes
315
+ consent, account selection, or receipt verification.
316
+
317
+ See the [full appearance options](https://www.npmjs.com/package/@zkp2p/sdk#popup-customization).
318
+
242
319
  ## Payout rails and access policies
243
320
 
244
321
  | Payout rail | Access-policy behavior | New payee registration |
@@ -1,5 +1,5 @@
1
1
  import { Address, Hash, WalletClient, Hex, Log, Transport } from 'viem';
2
- import { IndexerIntentStatus, Zkp2pClient, IndexerIntent, CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectResult } from '@zkp2p/sdk';
2
+ import { IndexerIntentStatus, Zkp2pClient, IndexerIntent, CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectResult, VenmoGmailAppearance, VenmoGmailPopupOptions } from '@zkp2p/sdk';
3
3
  import { Execute, RelayClient, RelayChain, ProgressData } from '@relayprotocol/relay-sdk';
4
4
 
5
5
  /**
@@ -684,6 +684,11 @@ interface CashClientOptions {
684
684
  curatorUrl?: string;
685
685
  /** Peer web origin override for optional Venmo receipt linking. Defaults by environment. */
686
686
  peerOrigin?: string;
687
+ /** Optional branding shared by prepared URLs and browser linking. Never affects cash-out. */
688
+ venmoGmail?: {
689
+ appearance?: VenmoGmailAppearance;
690
+ popup?: VenmoGmailPopupOptions;
691
+ };
687
692
  /** Optional ZKP2P API key. */
688
693
  apiKey?: string;
689
694
  /** Ethereum transport used only to snapshot Alipay/CNY's creation-time rate. */
@@ -856,8 +861,10 @@ interface OrdersOptions {
856
861
  limit?: number;
857
862
  }
858
863
  interface CashClient {
859
- /** Optional: register the Venmo handle before enabling a separate link button. No deposit. */
860
- prepareVenmoGmailConnect(payee: string): Promise<PreparedVenmoGmailConnect>;
864
+ /** Register a Venmo handle and prepare a hosted URL, optionally returning to a native app. No deposit. */
865
+ prepareVenmoGmailConnect(payee: string, options?: {
866
+ returnUrl?: string;
867
+ }): Promise<PreparedVenmoGmailConnect>;
861
868
  /** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
862
869
  openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
863
870
  /** True only for an active Google receipt credential; errors reject instead of reporting unlinked. */
@@ -1,5 +1,5 @@
1
1
  import { Address, Hash, WalletClient, Hex, Log, Transport } from 'viem';
2
- import { IndexerIntentStatus, Zkp2pClient, IndexerIntent, CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectResult } from '@zkp2p/sdk';
2
+ import { IndexerIntentStatus, Zkp2pClient, IndexerIntent, CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectResult, VenmoGmailAppearance, VenmoGmailPopupOptions } from '@zkp2p/sdk';
3
3
  import { Execute, RelayClient, RelayChain, ProgressData } from '@relayprotocol/relay-sdk';
4
4
 
5
5
  /**
@@ -684,6 +684,11 @@ interface CashClientOptions {
684
684
  curatorUrl?: string;
685
685
  /** Peer web origin override for optional Venmo receipt linking. Defaults by environment. */
686
686
  peerOrigin?: string;
687
+ /** Optional branding shared by prepared URLs and browser linking. Never affects cash-out. */
688
+ venmoGmail?: {
689
+ appearance?: VenmoGmailAppearance;
690
+ popup?: VenmoGmailPopupOptions;
691
+ };
687
692
  /** Optional ZKP2P API key. */
688
693
  apiKey?: string;
689
694
  /** Ethereum transport used only to snapshot Alipay/CNY's creation-time rate. */
@@ -856,8 +861,10 @@ interface OrdersOptions {
856
861
  limit?: number;
857
862
  }
858
863
  interface CashClient {
859
- /** Optional: register the Venmo handle before enabling a separate link button. No deposit. */
860
- prepareVenmoGmailConnect(payee: string): Promise<PreparedVenmoGmailConnect>;
864
+ /** Register a Venmo handle and prepare a hosted URL, optionally returning to a native app. No deposit. */
865
+ prepareVenmoGmailConnect(payee: string, options?: {
866
+ returnUrl?: string;
867
+ }): Promise<PreparedVenmoGmailConnect>;
861
868
  /** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
862
869
  openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
863
870
  /** True only for an active Google receipt credential; errors reject instead of reporting unlinked. */
package/dist/index.cjs CHANGED
@@ -3429,13 +3429,15 @@ function createCashClient(options) {
3429
3429
  return hashes;
3430
3430
  }
3431
3431
  return {
3432
- async prepareVenmoGmailConnect(payee) {
3432
+ async prepareVenmoGmailConnect(payee, connectOptions) {
3433
3433
  const { hashedOnchainIds } = await readClient.registerPayeeDetails({
3434
3434
  processorNames: ["venmo"],
3435
3435
  payeeData: [normalizeCashPayee("venmo", payee)]
3436
3436
  });
3437
3437
  const payeeDetails = hashedOnchainIds[0];
3438
3438
  const url = sdk.getVenmoGmailConnectUrl({
3439
+ ...options.venmoGmail,
3440
+ ...connectOptions,
3439
3441
  payeeDetails,
3440
3442
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
3441
3443
  });
@@ -3443,6 +3445,7 @@ function createCashClient(options) {
3443
3445
  },
3444
3446
  openVenmoGmailConnect(payeeDetails) {
3445
3447
  return sdk.openVenmoGmailConnect({
3448
+ ...options.venmoGmail,
3446
3449
  payeeDetails,
3447
3450
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
3448
3451
  });
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CashPayoutInfo, I as IntentEntity, a as CashBuyerProfile, b as CashDepositInput, c as CreateDepositParamsArg, d as CashOrder, e as CashFill, f as CashCapabilities, g as CashoutResult, h as CashEstimate, i as CashFillStats, N as NearIntentsSourceCapabilities, j as NearIntentsDepositInput, k as NearIntentsQuote, l as NearIntentsQuoteInput, m as NearIntentsStatus, n as NearIntentsStatusInput, P as PrepareResult, o as CashPreparedStep, p as PreparedVenmoGmailConnect, R as RelayExecutionResult, q as RelayQuote, r as RelayStatus, s as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-CZgoTClw.cjs';
2
- export { B as BASE_CHAIN_ID, t as BASE_USDC_ADDRESS, u as CASH_ATTRIBUTION_CODE, v as CASH_ORDER_POLL_INTERVAL_MS, w as CASH_ORDER_STATUSES, x as CASH_REFERRAL_ATTRIBUTION_PREFIX, y as CASH_RETAIN_ON_EMPTY, z as CashAsset, A as CashChain, D as CashClient, E as CashClientOptions, F as CashCorridorPricing, G as CashFillEta, H as CashLeg, J as CashMultiCurrencyLeg, K as CashNextAction, L as CashOrderState, M as CashPairFillStats, O as CashPayeeInput, Q as CashPayout, S as CashPayoutPricing, U as CashPlatformCapability, V as CashPreparedStepKind, X as CashReceiveLeg, Y as CashoutInput, Z as CashoutOptions, _ as CuratorPayeeDataInput, $ as EstimateInput, a0 as EstimateOptions, a1 as MARKET_SPREAD_BPS, a2 as MIN_CASHOUT_AMOUNT, a3 as NEAR_INTENTS_API_URL, a4 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a5 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a6 as NEAR_INTENTS_STATUSES, a7 as NearIntentsClient, a8 as NearIntentsOptions, a9 as NearIntentsQuoteRequest, aa as NearIntentsStatusCode, ab as NearIntentsToken, ac as NearIntentsTradeType, ad as NearIntentsTransaction, ae as ORACLE_MIN_CONVERSION_RATE_SENTINEL, af as OrdersOptions, ag as PreparedCashoutReceipt, ah as RECOMMENDED_MIN_CASHOUT_AMOUNT, ai as RelayOptions, aj as RelayQuoteInput, ak as RelaySourceInput, al as RelayTransaction, am as SignerOptions, an as USDC_DECIMALS, ao as WatchOptions, ap as WithdrawOptions, aq as buildCapabilities, ar as createCashClient, as as createNearIntentsClient, at as normalizeCashPayee, au as quoteNearIntentsToBaseUsdc, av as readNearIntentsSourceCapabilities, aw as readNearIntentsStatus, ax as submitNearIntentsDeposit, ay as toCashReferralAttributionCode } from './createCashClient-CZgoTClw.cjs';
1
+ import { C as CashPayoutInfo, I as IntentEntity, a as CashBuyerProfile, b as CashDepositInput, c as CreateDepositParamsArg, d as CashOrder, e as CashFill, f as CashCapabilities, g as CashoutResult, h as CashEstimate, i as CashFillStats, N as NearIntentsSourceCapabilities, j as NearIntentsDepositInput, k as NearIntentsQuote, l as NearIntentsQuoteInput, m as NearIntentsStatus, n as NearIntentsStatusInput, P as PrepareResult, o as CashPreparedStep, p as PreparedVenmoGmailConnect, R as RelayExecutionResult, q as RelayQuote, r as RelayStatus, s as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-p7RZVUmC.cjs';
2
+ export { B as BASE_CHAIN_ID, t as BASE_USDC_ADDRESS, u as CASH_ATTRIBUTION_CODE, v as CASH_ORDER_POLL_INTERVAL_MS, w as CASH_ORDER_STATUSES, x as CASH_REFERRAL_ATTRIBUTION_PREFIX, y as CASH_RETAIN_ON_EMPTY, z as CashAsset, A as CashChain, D as CashClient, E as CashClientOptions, F as CashCorridorPricing, G as CashFillEta, H as CashLeg, J as CashMultiCurrencyLeg, K as CashNextAction, L as CashOrderState, M as CashPairFillStats, O as CashPayeeInput, Q as CashPayout, S as CashPayoutPricing, U as CashPlatformCapability, V as CashPreparedStepKind, X as CashReceiveLeg, Y as CashoutInput, Z as CashoutOptions, _ as CuratorPayeeDataInput, $ as EstimateInput, a0 as EstimateOptions, a1 as MARKET_SPREAD_BPS, a2 as MIN_CASHOUT_AMOUNT, a3 as NEAR_INTENTS_API_URL, a4 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a5 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a6 as NEAR_INTENTS_STATUSES, a7 as NearIntentsClient, a8 as NearIntentsOptions, a9 as NearIntentsQuoteRequest, aa as NearIntentsStatusCode, ab as NearIntentsToken, ac as NearIntentsTradeType, ad as NearIntentsTransaction, ae as ORACLE_MIN_CONVERSION_RATE_SENTINEL, af as OrdersOptions, ag as PreparedCashoutReceipt, ah as RECOMMENDED_MIN_CASHOUT_AMOUNT, ai as RelayOptions, aj as RelayQuoteInput, ak as RelaySourceInput, al as RelayTransaction, am as SignerOptions, an as USDC_DECIMALS, ao as WatchOptions, ap as WithdrawOptions, aq as buildCapabilities, ar as createCashClient, as as createNearIntentsClient, at as normalizeCashPayee, au as quoteNearIntentsToBaseUsdc, av as readNearIntentsSourceCapabilities, aw as readNearIntentsStatus, ax as submitNearIntentsDeposit, ay as toCashReferralAttributionCode } from './createCashClient-p7RZVUmC.cjs';
3
3
  import { PublicClient, Log, Abi } from 'viem';
4
4
  import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction, VenmoGmailConnectResult } from '@zkp2p/sdk';
5
- export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectError, VenmoGmailConnectResult } from '@zkp2p/sdk';
5
+ export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
6
6
  import { z } from 'zod';
7
7
  import '@relayprotocol/relay-sdk';
8
8
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CashPayoutInfo, I as IntentEntity, a as CashBuyerProfile, b as CashDepositInput, c as CreateDepositParamsArg, d as CashOrder, e as CashFill, f as CashCapabilities, g as CashoutResult, h as CashEstimate, i as CashFillStats, N as NearIntentsSourceCapabilities, j as NearIntentsDepositInput, k as NearIntentsQuote, l as NearIntentsQuoteInput, m as NearIntentsStatus, n as NearIntentsStatusInput, P as PrepareResult, o as CashPreparedStep, p as PreparedVenmoGmailConnect, R as RelayExecutionResult, q as RelayQuote, r as RelayStatus, s as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-CZgoTClw.js';
2
- export { B as BASE_CHAIN_ID, t as BASE_USDC_ADDRESS, u as CASH_ATTRIBUTION_CODE, v as CASH_ORDER_POLL_INTERVAL_MS, w as CASH_ORDER_STATUSES, x as CASH_REFERRAL_ATTRIBUTION_PREFIX, y as CASH_RETAIN_ON_EMPTY, z as CashAsset, A as CashChain, D as CashClient, E as CashClientOptions, F as CashCorridorPricing, G as CashFillEta, H as CashLeg, J as CashMultiCurrencyLeg, K as CashNextAction, L as CashOrderState, M as CashPairFillStats, O as CashPayeeInput, Q as CashPayout, S as CashPayoutPricing, U as CashPlatformCapability, V as CashPreparedStepKind, X as CashReceiveLeg, Y as CashoutInput, Z as CashoutOptions, _ as CuratorPayeeDataInput, $ as EstimateInput, a0 as EstimateOptions, a1 as MARKET_SPREAD_BPS, a2 as MIN_CASHOUT_AMOUNT, a3 as NEAR_INTENTS_API_URL, a4 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a5 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a6 as NEAR_INTENTS_STATUSES, a7 as NearIntentsClient, a8 as NearIntentsOptions, a9 as NearIntentsQuoteRequest, aa as NearIntentsStatusCode, ab as NearIntentsToken, ac as NearIntentsTradeType, ad as NearIntentsTransaction, ae as ORACLE_MIN_CONVERSION_RATE_SENTINEL, af as OrdersOptions, ag as PreparedCashoutReceipt, ah as RECOMMENDED_MIN_CASHOUT_AMOUNT, ai as RelayOptions, aj as RelayQuoteInput, ak as RelaySourceInput, al as RelayTransaction, am as SignerOptions, an as USDC_DECIMALS, ao as WatchOptions, ap as WithdrawOptions, aq as buildCapabilities, ar as createCashClient, as as createNearIntentsClient, at as normalizeCashPayee, au as quoteNearIntentsToBaseUsdc, av as readNearIntentsSourceCapabilities, aw as readNearIntentsStatus, ax as submitNearIntentsDeposit, ay as toCashReferralAttributionCode } from './createCashClient-CZgoTClw.js';
1
+ import { C as CashPayoutInfo, I as IntentEntity, a as CashBuyerProfile, b as CashDepositInput, c as CreateDepositParamsArg, d as CashOrder, e as CashFill, f as CashCapabilities, g as CashoutResult, h as CashEstimate, i as CashFillStats, N as NearIntentsSourceCapabilities, j as NearIntentsDepositInput, k as NearIntentsQuote, l as NearIntentsQuoteInput, m as NearIntentsStatus, n as NearIntentsStatusInput, P as PrepareResult, o as CashPreparedStep, p as PreparedVenmoGmailConnect, R as RelayExecutionResult, q as RelayQuote, r as RelayStatus, s as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-p7RZVUmC.js';
2
+ export { B as BASE_CHAIN_ID, t as BASE_USDC_ADDRESS, u as CASH_ATTRIBUTION_CODE, v as CASH_ORDER_POLL_INTERVAL_MS, w as CASH_ORDER_STATUSES, x as CASH_REFERRAL_ATTRIBUTION_PREFIX, y as CASH_RETAIN_ON_EMPTY, z as CashAsset, A as CashChain, D as CashClient, E as CashClientOptions, F as CashCorridorPricing, G as CashFillEta, H as CashLeg, J as CashMultiCurrencyLeg, K as CashNextAction, L as CashOrderState, M as CashPairFillStats, O as CashPayeeInput, Q as CashPayout, S as CashPayoutPricing, U as CashPlatformCapability, V as CashPreparedStepKind, X as CashReceiveLeg, Y as CashoutInput, Z as CashoutOptions, _ as CuratorPayeeDataInput, $ as EstimateInput, a0 as EstimateOptions, a1 as MARKET_SPREAD_BPS, a2 as MIN_CASHOUT_AMOUNT, a3 as NEAR_INTENTS_API_URL, a4 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a5 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a6 as NEAR_INTENTS_STATUSES, a7 as NearIntentsClient, a8 as NearIntentsOptions, a9 as NearIntentsQuoteRequest, aa as NearIntentsStatusCode, ab as NearIntentsToken, ac as NearIntentsTradeType, ad as NearIntentsTransaction, ae as ORACLE_MIN_CONVERSION_RATE_SENTINEL, af as OrdersOptions, ag as PreparedCashoutReceipt, ah as RECOMMENDED_MIN_CASHOUT_AMOUNT, ai as RelayOptions, aj as RelayQuoteInput, ak as RelaySourceInput, al as RelayTransaction, am as SignerOptions, an as USDC_DECIMALS, ao as WatchOptions, ap as WithdrawOptions, aq as buildCapabilities, ar as createCashClient, as as createNearIntentsClient, at as normalizeCashPayee, au as quoteNearIntentsToBaseUsdc, av as readNearIntentsSourceCapabilities, aw as readNearIntentsStatus, ax as submitNearIntentsDeposit, ay as toCashReferralAttributionCode } from './createCashClient-p7RZVUmC.js';
3
3
  import { PublicClient, Log, Abi } from 'viem';
4
4
  import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction, VenmoGmailConnectResult } from '@zkp2p/sdk';
5
- export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailConnectError, VenmoGmailConnectResult } from '@zkp2p/sdk';
5
+ export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
6
6
  import { z } from 'zod';
7
7
  import '@relayprotocol/relay-sdk';
8
8
 
package/dist/index.js CHANGED
@@ -2936,13 +2936,15 @@ function createCashClient(options) {
2936
2936
  return hashes;
2937
2937
  }
2938
2938
  return {
2939
- async prepareVenmoGmailConnect(payee) {
2939
+ async prepareVenmoGmailConnect(payee, connectOptions) {
2940
2940
  const { hashedOnchainIds } = await readClient.registerPayeeDetails({
2941
2941
  processorNames: ["venmo"],
2942
2942
  payeeData: [normalizeCashPayee("venmo", payee)]
2943
2943
  });
2944
2944
  const payeeDetails = hashedOnchainIds[0];
2945
2945
  const url = getVenmoGmailConnectUrl({
2946
+ ...options.venmoGmail,
2947
+ ...connectOptions,
2946
2948
  payeeDetails,
2947
2949
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
2948
2950
  });
@@ -2950,6 +2952,7 @@ function createCashClient(options) {
2950
2952
  },
2951
2953
  openVenmoGmailConnect(payeeDetails) {
2952
2954
  return openVenmoGmailConnect({
2955
+ ...options.venmoGmail,
2953
2956
  payeeDetails,
2954
2957
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
2955
2958
  });
package/dist/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CurrencyType } from '@zkp2p/sdk';
2
- import { D as CashClient, $ as EstimateInput, h as CashEstimate, Z as CashoutOptions, g as CashoutResult, Y as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-CZgoTClw.cjs';
2
+ import { D as CashClient, $ as EstimateInput, h as CashEstimate, Z as CashoutOptions, g as CashoutResult, Y as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-p7RZVUmC.cjs';
3
3
  import { WalletClient } from 'viem';
4
4
  import '@relayprotocol/relay-sdk';
5
5
 
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CurrencyType } from '@zkp2p/sdk';
2
- import { D as CashClient, $ as EstimateInput, h as CashEstimate, Z as CashoutOptions, g as CashoutResult, Y as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-CZgoTClw.js';
2
+ import { D as CashClient, $ as EstimateInput, h as CashEstimate, Z as CashoutOptions, g as CashoutResult, Y as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-p7RZVUmC.js';
3
3
  import { WalletClient } from 'viem';
4
4
  import '@relayprotocol/relay-sdk';
5
5
 
package/dist/tools.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // package.json
4
4
  var package_default = {
5
- version: "0.6.0"};
5
+ version: "0.6.2"};
6
6
 
7
7
  // src/tools/index.ts
8
8
  var bigintString = {
package/dist/tools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var package_default = {
3
- version: "0.6.0"};
3
+ version: "0.6.2"};
4
4
 
5
5
  // src/tools/index.ts
6
6
  var bigintString = {
@@ -150,9 +150,15 @@ button click. Re-prepare when the selected handle changes. Use
150
150
  tab or an ambiguous closure; service errors reject, and only an active Google
151
151
  credential counts as connected. Persist the hash with its environment and user.
152
152
 
153
- The hosted flow accepts Google-hosted school/custom domains and verifies actual
154
- Venmo receipts. `VenmoGmailConnectError` retains codes such as
155
- `venmo_google_oauth_receipt_not_found`, `popup_blocked`, `connection_closed`,
156
- and `connection_timeout`; it is separate from `CashError`. No emails or Google
157
- tokens reach the partner. `link.url` supports redirect/native hosts, which
158
- must check status on return. See the README and `examples/venmo-link.ts`.
153
+ For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
154
+ open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
155
+ Register the scheme in your app binary; no registration with Peer is needed.
156
+ Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
157
+ tabs that block it keep the success page. Always re-check status on return.
158
+
159
+ The hosted flow verifies actual Venmo receipts, including Google-hosted custom
160
+ inboxes. `VenmoGmailConnectError` is separate from `CashError`; no emails or
161
+ Google tokens reach the partner. Configure `venmoGmail: { appearance, popup }`
162
+ for branding and desktop dimensions; omission keeps Peer defaults.
163
+ See the README for error codes, native callbacks, package-free URLs, and
164
+ customization, plus `examples/venmo-link.ts`.
@@ -4,7 +4,7 @@
4
4
  "type": "module",
5
5
  "description": "Peer Cash Demo: the express sell flow stored entirely onchain on Base, after zSwap by z0r0z",
6
6
  "dependencies": {
7
- "@zkp2p/cash": "0.5.3",
7
+ "@zkp2p/cash": "0.6.1",
8
8
  "esbuild": "0.28.2",
9
9
  "solc": "0.8.36",
10
10
  "viem": "2.55.18"
@@ -1,7 +1,8 @@
1
1
  // Slim stand-in for viem/chains. The full catalog is ~700 chain definitions
2
2
  // (~250 KB minified) and every byte of this page is paid for in deploy gas;
3
- // the app and its SDKs only ever import these two.
3
+ // the app and its SDKs only ever import these.
4
4
  export { base } from '../../node_modules/viem/_esm/chains/definitions/base.js';
5
5
  export { hardhat } from '../../node_modules/viem/_esm/chains/definitions/hardhat.js';
6
6
  export { mainnet } from '../../node_modules/viem/_esm/chains/definitions/mainnet.js';
7
+ export { polygon } from '../../node_modules/viem/_esm/chains/definitions/polygon.js';
7
8
  export { sepolia } from '../../node_modules/viem/_esm/chains/definitions/sepolia.js';
@@ -4,15 +4,27 @@ import {
4
4
  type PreparedVenmoGmailConnect,
5
5
  } from '@zkp2p/cash';
6
6
 
7
+ const cash = createCashClient({
8
+ environment: 'production',
9
+ // Optional: omit venmoGmail for Peer branding and the default popup size.
10
+ venmoGmail: {
11
+ appearance: { buttonColor: '#6246EA', buttonTextColor: '#FFFFFF' },
12
+ popup: { width: 500, height: 620 },
13
+ },
14
+ });
15
+
7
16
  /** Optional onboarding: call with the selected handle before enabling the link button. */
8
17
  export async function prepareVenmoLink(handle: string) {
9
- const cash = createCashClient({ environment: 'production' });
10
18
  return cash.prepareVenmoGmailConnect(handle);
11
19
  }
12
20
 
21
+ /** Native: open link.url with expo-web-browser's openAuthSessionAsync(url, returnUrl). */
22
+ export async function prepareNativeVenmoLink(handle: string, returnUrl: string) {
23
+ return cash.prepareVenmoGmailConnect(handle, { returnUrl });
24
+ }
25
+
13
26
  /** Bind this to a click. Keep registration/other awaits outside the handler. */
14
27
  export function linkVenmo(link: PreparedVenmoGmailConnect) {
15
- const cash = createCashClient({ environment: 'production' });
16
28
  return cash.openVenmoGmailConnect(link.payeeDetails).catch((error: unknown) => {
17
29
  if (error instanceof VenmoGmailConnectError) {
18
30
  // Render error.message. For an ambiguous closure/timeout, offer a status refresh.
@@ -25,7 +37,6 @@ export function linkVenmo(link: PreparedVenmoGmailConnect) {
25
37
 
26
38
  /** Also call when returning from a mobile tab or redirect opened with link.url. */
27
39
  export function checkVenmoLink(link: PreparedVenmoGmailConnect) {
28
- const cash = createCashClient({ environment: 'production' });
29
40
  return cash.isVenmoGmailConnected(link.payeeDetails);
30
41
  }
31
42
 
package/llms.txt CHANGED
@@ -17,11 +17,18 @@ Key facts:
17
17
  openVenmoGmailConnect(payeeDetails) opens the environment's hosted flow.
18
18
  isVenmoGmailConnected(payeeDetails) checks for an active Google credential;
19
19
  lookup errors reject. Cashout and prepare never call or require these steps.
20
- Mobile may open a tab; check status on return or ambiguous popup closure.
20
+ Native hosts use prepareVenmoGmailConnect(handle, { returnUrl }) and open
21
+ link.url with Expo openAuthSessionAsync(link.url, returnUrl). Register the
22
+ app scheme in the binary; Peer needs no callback registration and appends
23
+ no data. Omitted/empty callbacks attempt closure; blocked tabs keep the
24
+ success page. Always check status on return or ambiguous popup closure.
21
25
  Google-hosted school/custom domains are supported; actual receipt failures
22
26
  use VenmoGmailConnectError.code, including venmo_google_oauth_receipt_not_found.
23
27
  Partner apps receive neither emails nor Google tokens. Re-prepare when the
24
28
  handle changes; persist payee hash with environment and user account.
29
+ Optional createCashClient({ venmoGmail: { appearance, popup } }) shares branding
30
+ between the prepared URL and popup. Defaults use Peer branding; desktop popup
31
+ dimensions do not control mobile tab sizing. See the README customization example.
25
32
 
26
33
  - The cashing-out user is the MAKER: their USDC becomes a protocol-held order;
27
34
  a buyer pays fiat and proves it with TEE-TLS; the protocol releases the USDC.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/cash",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Peer Cash - offramp-only SDK for routing Relay or NEAR Intents assets to Base USDC, then cashing out to fiat at zero-spread Chainlink market rates.",
5
5
  "license": "MIT",
6
6
  "author": "Peer (https://peer.xyz)",
@@ -108,7 +108,7 @@
108
108
  },
109
109
  "dependencies": {
110
110
  "@relayprotocol/relay-sdk": "^7.0.1",
111
- "@zkp2p/sdk": "0.14.2-rc.4",
111
+ "@zkp2p/sdk": "0.14.3",
112
112
  "zod": "^4.4.3"
113
113
  },
114
114
  "peerDependencies": {
@@ -293,9 +293,15 @@ button click. Re-prepare when the selected handle changes. Use
293
293
  tab or an ambiguous closure; service errors reject, and only an active Google
294
294
  credential counts as connected. Persist the hash with its environment and user.
295
295
 
296
- The hosted flow accepts Google-hosted school/custom domains and verifies actual
297
- Venmo receipts. `VenmoGmailConnectError` retains codes such as
298
- `venmo_google_oauth_receipt_not_found`, `popup_blocked`, `connection_closed`,
299
- and `connection_timeout`; it is separate from `CashError`. No emails or Google
300
- tokens reach the partner. `link.url` supports redirect/native hosts, which
301
- must check status on return. See the README and `examples/venmo-link.ts`.
296
+ For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
297
+ open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
298
+ Register the scheme in your app binary; no registration with Peer is needed.
299
+ Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
300
+ tabs that block it keep the success page. Always re-check status on return.
301
+
302
+ The hosted flow verifies actual Venmo receipts, including Google-hosted custom
303
+ inboxes. `VenmoGmailConnectError` is separate from `CashError`; no emails or
304
+ Google tokens reach the partner. Configure `venmoGmail: { appearance, popup }`
305
+ for branding and desktop dimensions; omission keeps Peer defaults.
306
+ See the README for error codes, native callbacks, package-free URLs, and
307
+ customization, plus `examples/venmo-link.ts`.