@zkp2p/cash 0.6.1 → 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,15 +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`.
362
-
363
- Configure optional `venmoGmail: { appearance, popup }` on `createCashClient()`
364
- to share partner branding between the prepared URL and popup. Omit it for Peer
365
- branding; omit `appearance.logoUrl` to keep the Peer logo beside Venmo. Popup
366
- width/height apply to desktop; mobile browsers control tab sizing. See the
367
- README's "Customize the hosted popup" section for the configuration example.
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,46 @@ 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
+
242
282
  ### Customize the hosted popup
243
283
 
244
284
  With `@zkp2p/cash@0.6.1`, configure branding once on the client. The same
@@ -861,8 +861,10 @@ interface OrdersOptions {
861
861
  limit?: number;
862
862
  }
863
863
  interface CashClient {
864
- /** Optional: register the Venmo handle before enabling a separate link button. No deposit. */
865
- 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>;
866
868
  /** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
867
869
  openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
868
870
  /** True only for an active Google receipt credential; errors reject instead of reporting unlinked. */
@@ -861,8 +861,10 @@ interface OrdersOptions {
861
861
  limit?: number;
862
862
  }
863
863
  interface CashClient {
864
- /** Optional: register the Venmo handle before enabling a separate link button. No deposit. */
865
- 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>;
866
868
  /** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
867
869
  openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
868
870
  /** True only for an active Google receipt credential; errors reject instead of reporting unlinked. */
package/dist/index.cjs CHANGED
@@ -3429,7 +3429,7 @@ 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)]
@@ -3437,6 +3437,7 @@ function createCashClient(options) {
3437
3437
  const payeeDetails = hashedOnchainIds[0];
3438
3438
  const url = sdk.getVenmoGmailConnectUrl({
3439
3439
  ...options.venmoGmail,
3440
+ ...connectOptions,
3440
3441
  payeeDetails,
3441
3442
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
3442
3443
  });
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
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-LTZshulP.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-LTZshulP.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
5
  export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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-LTZshulP.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-LTZshulP.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
5
  export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
package/dist/index.js CHANGED
@@ -2936,7 +2936,7 @@ 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)]
@@ -2944,6 +2944,7 @@ function createCashClient(options) {
2944
2944
  const payeeDetails = hashedOnchainIds[0];
2945
2945
  const url = getVenmoGmailConnectUrl({
2946
2946
  ...options.venmoGmail,
2947
+ ...connectOptions,
2947
2948
  payeeDetails,
2948
2949
  peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
2949
2950
  });
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-LTZshulP.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-LTZshulP.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.1"};
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.1"};
3
+ version: "0.6.2"};
4
4
 
5
5
  // src/tools/index.ts
6
6
  var bigintString = {
@@ -150,15 +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`.
159
-
160
- Configure optional `venmoGmail: { appearance, popup }` on `createCashClient()`
161
- to share partner branding between the prepared URL and popup. Omit it for Peer
162
- branding; omit `appearance.logoUrl` to keep the Peer logo beside Venmo. Popup
163
- width/height apply to desktop; mobile browsers control tab sizing. See the
164
- README's "Customize the hosted popup" section for the configuration example.
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';
@@ -18,6 +18,11 @@ export async function prepareVenmoLink(handle: string) {
18
18
  return cash.prepareVenmoGmailConnect(handle);
19
19
  }
20
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
+
21
26
  /** Bind this to a click. Keep registration/other awaits outside the handler. */
22
27
  export function linkVenmo(link: PreparedVenmoGmailConnect) {
23
28
  return cash.openVenmoGmailConnect(link.payeeDetails).catch((error: unknown) => {
package/llms.txt CHANGED
@@ -17,7 +17,11 @@ 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/cash",
3
- "version": "0.6.1",
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",
111
+ "@zkp2p/sdk": "0.14.3",
112
112
  "zod": "^4.4.3"
113
113
  },
114
114
  "peerDependencies": {
@@ -293,15 +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`.
302
-
303
- Configure optional `venmoGmail: { appearance, popup }` on `createCashClient()`
304
- to share partner branding between the prepared URL and popup. Omit it for Peer
305
- branding; omit `appearance.logoUrl` to keep the Peer logo beside Venmo. Popup
306
- width/height apply to desktop; mobile browsers control tab sizing. See the
307
- README's "Customize the hosted popup" section for the configuration example.
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`.