@zkp2p/cash 0.7.0 → 0.7.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 +7 -5
- package/README.md +17 -13
- package/dist/{createCashClient-lYL_Vx2Z.d.cts → createCashClient-Dtqz4TXw.d.cts} +1 -1
- package/dist/{createCashClient-lYL_Vx2Z.d.ts → createCashClient-Dtqz4TXw.d.ts} +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -13
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/docs/partner-integrations.md +7 -5
- package/examples/onchain-demo/package.json +1 -1
- package/llms.txt +10 -7
- package/package.json +2 -2
- package/skills/peer-cash-integration/SKILL.md +7 -5
package/AGENTS.md
CHANGED
|
@@ -352,8 +352,9 @@ Run `cash.prepareVenmoGmailConnect(handle)` when the user selects Venmo, then
|
|
|
352
352
|
call `cash.openVenmoGmailConnect(link.payeeDetails)` directly from a separate
|
|
353
353
|
button click. Re-prepare when the selected handle changes. Use
|
|
354
354
|
`cash.isVenmoGmailConnected(link.payeeDetails)` after returning from a mobile
|
|
355
|
-
tab or an ambiguous closure; service errors reject, and
|
|
356
|
-
Outlook credential counts as connected
|
|
355
|
+
tab or an ambiguous closure; service errors reject, and any active Gmail,
|
|
356
|
+
Outlook or iCloud Mail credential counts as connected (`@zkp2p/sdk` 0.14.7
|
|
357
|
+
`isMailboxSellerCredentialType`). Persist the hash with its environment and user.
|
|
357
358
|
|
|
358
359
|
For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
|
|
359
360
|
open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
|
|
@@ -361,9 +362,10 @@ Register the scheme in your app binary; no registration with Peer is needed.
|
|
|
361
362
|
Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
|
|
362
363
|
tabs that block it keep the success page. Always re-check status on return.
|
|
363
364
|
|
|
364
|
-
The hosted flow offers Gmail, including Google-hosted custom domains,
|
|
365
|
-
|
|
366
|
-
is separate from `CashError`; no emails
|
|
365
|
+
The hosted flow offers Gmail, including Google-hosted custom domains, personal
|
|
366
|
+
Outlook, and iCloud Mail, then verifies actual Venmo receipts.
|
|
367
|
+
`VenmoGmailConnectError` is separate from `CashError`; no emails, mailbox
|
|
368
|
+
tokens or app-specific passwords reach the partner. Configure `venmoGmail: { appearance, popup }`
|
|
367
369
|
for branding and desktop dimensions; omission keeps Peer defaults.
|
|
368
370
|
See the README for error codes, native callbacks, package-free URLs, and
|
|
369
371
|
customization, plus `examples/venmo-link.ts`.
|
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ arbitrary protocol operations.
|
|
|
154
154
|
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
155
155
|
| `prepareVenmoGmailConnect(payee, { returnUrl }?)` | Optional Venmo handle registration; returns the payee hash and hosted URL, with an optional app callback |
|
|
156
156
|
| `openVenmoGmailConnect(payeeDetails)` | Optional browser popup/tab; call directly from a click |
|
|
157
|
-
| `isVenmoGmailConnected(payeeDetails)` | Read whether an active Gmail or
|
|
157
|
+
| `isVenmoGmailConnected(payeeDetails)` | Read whether an active Gmail, Outlook or iCloud Mail receipt credential exists |
|
|
158
158
|
| `capabilities()` | Sync discovery: Base USDC destination/default source, platforms × currencies × payee hints × amount bounds |
|
|
159
159
|
| `capabilities({ includeRelaySources: true })` | Async discovery: adds live Relay SDK EVM source chains/tokens |
|
|
160
160
|
| `capabilities({ includeNearIntentsSources: true })` | Async discovery: adds live NEAR Intents 1Click source assets |
|
|
@@ -196,7 +196,7 @@ mixed historical deposit.
|
|
|
196
196
|
## Optional Venmo receipt linking
|
|
197
197
|
|
|
198
198
|
Partners such as Tailgate can offer **Link Venmo** separately from cash-out.
|
|
199
|
-
`cashout()` and `prepare()` never open
|
|
199
|
+
`cashout()` and `prepare()` never open a mailbox, check receipt
|
|
200
200
|
credentials, or require this step. Skipping or cancelling linking leaves cash-out available.
|
|
201
201
|
|
|
202
202
|
```ts
|
|
@@ -233,19 +233,23 @@ Preparation and status reads also work on the server.
|
|
|
233
233
|
Desktop opens a popup; mobile requests a new browser tab (including Safari).
|
|
234
234
|
The browser controls presentation and may sever the opener connection. In that
|
|
235
235
|
case check status rather than assuming `connection_closed` or
|
|
236
|
-
`connection_timeout` means verification failed. Status is true
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
`connection_timeout` means verification failed. Status is true for any active
|
|
237
|
+
mailbox credential (`google_oauth`, `microsoft_oauth` or `icloud_mail`, per
|
|
238
|
+
`isMailboxSellerCredentialType` in `@zkp2p/sdk` 0.14.7); lookup failures
|
|
239
|
+
reject. Versions before `0.7.2` do not count `icloud_mail`, and versions before
|
|
240
|
+
`0.6.3-rc.2` count only `google_oauth`.
|
|
239
241
|
|
|
240
242
|
The hosted page offers Gmail, including Google-hosted school/custom-domain
|
|
241
|
-
inboxes,
|
|
242
|
-
email-domain precheck. A
|
|
243
|
-
`venmo_google_oauth_receipt_not_found` (Gmail)
|
|
244
|
-
`VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND` (Outlook)
|
|
245
|
-
`
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
243
|
+
inboxes, personal Outlook, and iCloud Mail (with an Apple app-specific
|
|
244
|
+
password). It verifies actual receipts; there is no email-domain precheck. A
|
|
245
|
+
missing receipt reports `venmo_google_oauth_receipt_not_found` (Gmail),
|
|
246
|
+
`VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND` (Outlook) or
|
|
247
|
+
`icloud_receipt_not_found` (iCloud Mail) through `VenmoGmailConnectError.code`;
|
|
248
|
+
other iCloud Mail failures use `icloud_<reason>` codes. Cancellation, popup
|
|
249
|
+
blocking, and other hosted errors retain their codes. This error class is
|
|
250
|
+
separate from `CashError`; registration and status service errors also reject.
|
|
251
|
+
Emails, mailbox tokens and app-specific passwords never pass through the
|
|
252
|
+
partner app or Cash SDK.
|
|
249
253
|
|
|
250
254
|
See [the browser example](examples/venmo-link.ts). JSON codecs are exported for
|
|
251
255
|
`PreparedVenmoGmailConnect` and `VenmoGmailConnectResult`.
|
|
@@ -850,7 +850,7 @@ interface CashClient {
|
|
|
850
850
|
}): Promise<PreparedVenmoGmailConnect>;
|
|
851
851
|
/** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
|
|
852
852
|
openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
|
|
853
|
-
/** True only for an active Gmail or
|
|
853
|
+
/** True only for an active Gmail, Outlook or iCloud Mail receipt credential; errors reject instead of reporting unlinked. */
|
|
854
854
|
isVenmoGmailConnected(payeeDetails: Hash): Promise<boolean>;
|
|
855
855
|
/** 0 - Discovery: sync, static. */
|
|
856
856
|
capabilities(): CashCapabilities;
|
|
@@ -850,7 +850,7 @@ interface CashClient {
|
|
|
850
850
|
}): Promise<PreparedVenmoGmailConnect>;
|
|
851
851
|
/** Optional, browser-only: call directly from a click handler with the prepared payee hash. */
|
|
852
852
|
openVenmoGmailConnect(payeeDetails: Hash): Promise<VenmoGmailConnectResult>;
|
|
853
|
-
/** True only for an active Gmail or
|
|
853
|
+
/** True only for an active Gmail, Outlook or iCloud Mail receipt credential; errors reject instead of reporting unlinked. */
|
|
854
854
|
isVenmoGmailConnected(payeeDetails: Hash): Promise<boolean>;
|
|
855
855
|
/** 0 - Discovery: sync, static. */
|
|
856
856
|
capabilities(): CashCapabilities;
|
package/dist/index.cjs
CHANGED
|
@@ -3154,20 +3154,12 @@ function createCashClient(options) {
|
|
|
3154
3154
|
const { compositeId, escrowAddress, onchainDepositId } = parseDepositId(depositId);
|
|
3155
3155
|
const groupIds = CASH_ACCESS_GROUP_IDS[environment];
|
|
3156
3156
|
try {
|
|
3157
|
-
const
|
|
3158
|
-
const merchantPolicyParams = {
|
|
3157
|
+
const prepared = client.accessPolicy.prepareConfigurePeerPayMerchantDeposit({
|
|
3159
3158
|
escrow: escrowAddress,
|
|
3160
3159
|
depositId: onchainDepositId,
|
|
3161
3160
|
paymentMethod,
|
|
3162
3161
|
txOverrides: attribution
|
|
3163
|
-
};
|
|
3164
|
-
const prepared = accessPolicy.prepareConfigurePeerPayMerchantDeposit ? accessPolicy.prepareConfigurePeerPayMerchantDeposit(merchantPolicyParams) : accessPolicy.prepareConfigureDeposit?.({
|
|
3165
|
-
...merchantPolicyParams,
|
|
3166
|
-
enabled: true,
|
|
3167
|
-
groupIds,
|
|
3168
|
-
takers: []
|
|
3169
3162
|
});
|
|
3170
|
-
if (!prepared) throw new Error("SDK access-policy preparation is unavailable");
|
|
3171
3163
|
return {
|
|
3172
3164
|
to: prepared.to,
|
|
3173
3165
|
data: prepared.data,
|
|
@@ -3254,7 +3246,7 @@ function createCashClient(options) {
|
|
|
3254
3246
|
processorName: "venmo",
|
|
3255
3247
|
payeeDetails
|
|
3256
3248
|
});
|
|
3257
|
-
return responseObject.status === "active" && (responseObject.credentialType
|
|
3249
|
+
return responseObject.status === "active" && sdk.isMailboxSellerCredentialType(responseObject.credentialType);
|
|
3258
3250
|
},
|
|
3259
3251
|
capabilities,
|
|
3260
3252
|
async sourceCapabilities() {
|
|
@@ -3359,7 +3351,11 @@ function createCashClient(options) {
|
|
|
3359
3351
|
mapChainError("resolve same-chain Relay nonce", err)
|
|
3360
3352
|
);
|
|
3361
3353
|
}
|
|
3362
|
-
const attributedParams2 = {
|
|
3354
|
+
const attributedParams2 = {
|
|
3355
|
+
...params2,
|
|
3356
|
+
txOverrides: attribution,
|
|
3357
|
+
enableTrustedGroupBypass: false
|
|
3358
|
+
};
|
|
3363
3359
|
const send2 = async () => {
|
|
3364
3360
|
try {
|
|
3365
3361
|
return (await client.createDeposit(attributedParams2)).hash;
|
|
@@ -3426,7 +3422,11 @@ function createCashClient(options) {
|
|
|
3426
3422
|
const params = await buildDepositParams(client, depositInput);
|
|
3427
3423
|
const escrow = client.escrowV2Address ?? client.escrowAddress;
|
|
3428
3424
|
await settleAllowance(client, params.token, owner, escrow, depositInput.amount);
|
|
3429
|
-
const attributedParams = {
|
|
3425
|
+
const attributedParams = {
|
|
3426
|
+
...params,
|
|
3427
|
+
txOverrides: attribution,
|
|
3428
|
+
enableTrustedGroupBypass: false
|
|
3429
|
+
};
|
|
3430
3430
|
const send = async () => {
|
|
3431
3431
|
try {
|
|
3432
3432
|
return (await client.createDeposit(attributedParams)).hash;
|
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-
|
|
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-
|
|
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-Dtqz4TXw.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-Dtqz4TXw.cjs';
|
|
3
3
|
import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction, VenmoGmailConnectResult } from '@zkp2p/sdk';
|
|
4
4
|
export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
|
|
5
5
|
import { Log, Abi } from 'viem';
|
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-
|
|
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-
|
|
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-Dtqz4TXw.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-Dtqz4TXw.js';
|
|
3
3
|
import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction, VenmoGmailConnectResult } from '@zkp2p/sdk';
|
|
4
4
|
export { CurrencyType, PreparedTransaction, RuntimeEnv, VenmoGmailAppearance, VenmoGmailConnectError, VenmoGmailConnectResult, VenmoGmailPopupOptions } from '@zkp2p/sdk';
|
|
5
5
|
import { Log, Abi } from 'viem';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { MARKET_SPREAD_BPS, ORACLE_MIN_CONVERSION_RATE_SENTINEL, CASH_RETAIN_ON_
|
|
|
2
2
|
export { BASE_CHAIN_ID, BASE_USDC_ADDRESS, CASH_ORDER_POLL_INTERVAL_MS, CASH_ORDER_STATUSES, CASH_RETAIN_ON_EMPTY, CashError, MARKET_SPREAD_BPS, ORACLE_MIN_CONVERSION_RATE_SENTINEL, USDC_DECIMALS, errors, isCashError, isUserRejectedError } from './chunk-UIELF4TY.js';
|
|
3
3
|
import { parseAbi, parseEventLogs, isAddress, http, createWalletClient, encodeFunctionData } from 'viem';
|
|
4
4
|
import { base } from 'viem/chains';
|
|
5
|
-
import { getSpreadOracleConfig, currencyInfo, getGatingServiceAddress, resolvePaymentMethodNameFromHash, getCurrencyCodeFromHash, createCompositeDepositId, appendAttributionToCalldata, openVenmoGmailConnect, getVenmoGmailConnectUrl, Zkp2pClient, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, defaultIndexerEndpoint, IndexerClient, CHAINLINK_ORACLE_FEEDS } from '@zkp2p/sdk';
|
|
5
|
+
import { getSpreadOracleConfig, currencyInfo, getGatingServiceAddress, resolvePaymentMethodNameFromHash, getCurrencyCodeFromHash, createCompositeDepositId, appendAttributionToCalldata, isMailboxSellerCredentialType, openVenmoGmailConnect, getVenmoGmailConnectUrl, Zkp2pClient, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, defaultIndexerEndpoint, IndexerClient, CHAINLINK_ORACLE_FEEDS } from '@zkp2p/sdk';
|
|
6
6
|
export { VenmoGmailConnectError } from '@zkp2p/sdk';
|
|
7
7
|
import { createClient, MAINNET_RELAY_API } from '@relayprotocol/relay-sdk';
|
|
8
8
|
import { fetchChainConfigs, configureDynamicChains } from '@relayprotocol/relay-sdk/chain-utils';
|
|
@@ -2661,20 +2661,12 @@ function createCashClient(options) {
|
|
|
2661
2661
|
const { compositeId, escrowAddress, onchainDepositId } = parseDepositId(depositId);
|
|
2662
2662
|
const groupIds = CASH_ACCESS_GROUP_IDS[environment];
|
|
2663
2663
|
try {
|
|
2664
|
-
const
|
|
2665
|
-
const merchantPolicyParams = {
|
|
2664
|
+
const prepared = client.accessPolicy.prepareConfigurePeerPayMerchantDeposit({
|
|
2666
2665
|
escrow: escrowAddress,
|
|
2667
2666
|
depositId: onchainDepositId,
|
|
2668
2667
|
paymentMethod,
|
|
2669
2668
|
txOverrides: attribution
|
|
2670
|
-
};
|
|
2671
|
-
const prepared = accessPolicy.prepareConfigurePeerPayMerchantDeposit ? accessPolicy.prepareConfigurePeerPayMerchantDeposit(merchantPolicyParams) : accessPolicy.prepareConfigureDeposit?.({
|
|
2672
|
-
...merchantPolicyParams,
|
|
2673
|
-
enabled: true,
|
|
2674
|
-
groupIds,
|
|
2675
|
-
takers: []
|
|
2676
2669
|
});
|
|
2677
|
-
if (!prepared) throw new Error("SDK access-policy preparation is unavailable");
|
|
2678
2670
|
return {
|
|
2679
2671
|
to: prepared.to,
|
|
2680
2672
|
data: prepared.data,
|
|
@@ -2761,7 +2753,7 @@ function createCashClient(options) {
|
|
|
2761
2753
|
processorName: "venmo",
|
|
2762
2754
|
payeeDetails
|
|
2763
2755
|
});
|
|
2764
|
-
return responseObject.status === "active" && (responseObject.credentialType
|
|
2756
|
+
return responseObject.status === "active" && isMailboxSellerCredentialType(responseObject.credentialType);
|
|
2765
2757
|
},
|
|
2766
2758
|
capabilities,
|
|
2767
2759
|
async sourceCapabilities() {
|
|
@@ -2866,7 +2858,11 @@ function createCashClient(options) {
|
|
|
2866
2858
|
mapChainError("resolve same-chain Relay nonce", err)
|
|
2867
2859
|
);
|
|
2868
2860
|
}
|
|
2869
|
-
const attributedParams2 = {
|
|
2861
|
+
const attributedParams2 = {
|
|
2862
|
+
...params2,
|
|
2863
|
+
txOverrides: attribution,
|
|
2864
|
+
enableTrustedGroupBypass: false
|
|
2865
|
+
};
|
|
2870
2866
|
const send2 = async () => {
|
|
2871
2867
|
try {
|
|
2872
2868
|
return (await client.createDeposit(attributedParams2)).hash;
|
|
@@ -2933,7 +2929,11 @@ function createCashClient(options) {
|
|
|
2933
2929
|
const params = await buildDepositParams(client, depositInput);
|
|
2934
2930
|
const escrow = client.escrowV2Address ?? client.escrowAddress;
|
|
2935
2931
|
await settleAllowance(client, params.token, owner, escrow, depositInput.amount);
|
|
2936
|
-
const attributedParams = {
|
|
2932
|
+
const attributedParams = {
|
|
2933
|
+
...params,
|
|
2934
|
+
txOverrides: attribution,
|
|
2935
|
+
enableTrustedGroupBypass: false
|
|
2936
|
+
};
|
|
2937
2937
|
const send = async () => {
|
|
2938
2938
|
try {
|
|
2939
2939
|
return (await client.createDeposit(attributedParams)).hash;
|
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-
|
|
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-Dtqz4TXw.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-
|
|
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-Dtqz4TXw.js';
|
|
3
3
|
import { WalletClient } from 'viem';
|
|
4
4
|
import '@relayprotocol/relay-sdk';
|
|
5
5
|
|
package/dist/tools.cjs
CHANGED
package/dist/tools.js
CHANGED
|
@@ -147,8 +147,9 @@ Run `cash.prepareVenmoGmailConnect(handle)` when the user selects Venmo, then
|
|
|
147
147
|
call `cash.openVenmoGmailConnect(link.payeeDetails)` directly from a separate
|
|
148
148
|
button click. Re-prepare when the selected handle changes. Use
|
|
149
149
|
`cash.isVenmoGmailConnected(link.payeeDetails)` after returning from a mobile
|
|
150
|
-
tab or an ambiguous closure; service errors reject, and
|
|
151
|
-
Outlook credential counts as connected
|
|
150
|
+
tab or an ambiguous closure; service errors reject, and any active Gmail,
|
|
151
|
+
Outlook or iCloud Mail credential counts as connected (`@zkp2p/sdk` 0.14.7
|
|
152
|
+
`isMailboxSellerCredentialType`). Persist the hash with its environment and user.
|
|
152
153
|
|
|
153
154
|
For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
|
|
154
155
|
open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
|
|
@@ -156,9 +157,10 @@ Register the scheme in your app binary; no registration with Peer is needed.
|
|
|
156
157
|
Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
|
|
157
158
|
tabs that block it keep the success page. Always re-check status on return.
|
|
158
159
|
|
|
159
|
-
The hosted flow offers Gmail, including Google-hosted custom domains,
|
|
160
|
-
|
|
161
|
-
is separate from `CashError`; no emails
|
|
160
|
+
The hosted flow offers Gmail, including Google-hosted custom domains, personal
|
|
161
|
+
Outlook, and iCloud Mail, then verifies actual Venmo receipts.
|
|
162
|
+
`VenmoGmailConnectError` is separate from `CashError`; no emails, mailbox
|
|
163
|
+
tokens or app-specific passwords reach the partner. Configure `venmoGmail: { appearance, popup }`
|
|
162
164
|
for branding and desktop dimensions; omission keeps Peer defaults.
|
|
163
165
|
See the README for error codes, native callbacks, package-free URLs, and
|
|
164
166
|
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.7.
|
|
7
|
+
"@zkp2p/cash": "0.7.2",
|
|
8
8
|
"esbuild": "0.28.2",
|
|
9
9
|
"solc": "0.8.36",
|
|
10
10
|
"viem": "2.55.18"
|
package/llms.txt
CHANGED
|
@@ -15,19 +15,22 @@ Key facts:
|
|
|
15
15
|
- Optional Venmo receipt linking: prepareVenmoGmailConnect(handle) registers
|
|
16
16
|
the selected handle and returns { payeeDetails, url }. From a separate click,
|
|
17
17
|
openVenmoGmailConnect(payeeDetails) opens the environment's hosted flow.
|
|
18
|
-
isVenmoGmailConnected(payeeDetails)
|
|
19
|
-
credential
|
|
20
|
-
lookup errors reject. Cashout and prepare
|
|
18
|
+
isVenmoGmailConnected(payeeDetails) is true for any active mailbox
|
|
19
|
+
credential (Gmail, Outlook or iCloud Mail, per @zkp2p/sdk 0.14.7
|
|
20
|
+
isMailboxSellerCredentialType); lookup errors reject. Cashout and prepare
|
|
21
|
+
never call or require these steps.
|
|
21
22
|
Native hosts use prepareVenmoGmailConnect(handle, { returnUrl }) and open
|
|
22
23
|
link.url with Expo openAuthSessionAsync(link.url, returnUrl). Register the
|
|
23
24
|
app scheme in the binary; Peer needs no callback registration and appends
|
|
24
25
|
no data. Omitted/empty callbacks attempt closure; blocked tabs keep the
|
|
25
26
|
success page. Always check status on return or ambiguous popup closure.
|
|
26
27
|
The hosted page offers Gmail, including Google-hosted school/custom domains,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
personal Outlook, and iCloud Mail (Apple app-specific password). Receipt
|
|
29
|
+
failures use VenmoGmailConnectError.code: venmo_google_oauth_receipt_not_found,
|
|
30
|
+
VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND or icloud_receipt_not_found.
|
|
31
|
+
Partner apps receive no emails, mailbox tokens or app-specific passwords.
|
|
32
|
+
Re-prepare when the handle changes; persist payee hash with environment and
|
|
33
|
+
user account.
|
|
31
34
|
Optional createCashClient({ venmoGmail: { appearance, popup } }) shares branding
|
|
32
35
|
between the prepared URL and popup. Defaults use Peer branding; desktop popup
|
|
33
36
|
dimensions do not control mobile tab sizing. See the README customization example.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/cash",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.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 on-chain oracle 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.
|
|
111
|
+
"@zkp2p/sdk": "0.14.7",
|
|
112
112
|
"zod": "^4.4.3"
|
|
113
113
|
},
|
|
114
114
|
"peerDependencies": {
|
|
@@ -291,8 +291,9 @@ Run `cash.prepareVenmoGmailConnect(handle)` when the user selects Venmo, then
|
|
|
291
291
|
call `cash.openVenmoGmailConnect(link.payeeDetails)` directly from a separate
|
|
292
292
|
button click. Re-prepare when the selected handle changes. Use
|
|
293
293
|
`cash.isVenmoGmailConnected(link.payeeDetails)` after returning from a mobile
|
|
294
|
-
tab or an ambiguous closure; service errors reject, and
|
|
295
|
-
Outlook credential counts as connected
|
|
294
|
+
tab or an ambiguous closure; service errors reject, and any active Gmail,
|
|
295
|
+
Outlook or iCloud Mail credential counts as connected (`@zkp2p/sdk` 0.14.7
|
|
296
|
+
`isMailboxSellerCredentialType`). Persist the hash with its environment and user.
|
|
296
297
|
|
|
297
298
|
For native apps, use `prepareVenmoGmailConnect(handle, { returnUrl })` and
|
|
298
299
|
open `link.url` with Expo's `openAuthSessionAsync(link.url, returnUrl)`.
|
|
@@ -300,9 +301,10 @@ Register the scheme in your app binary; no registration with Peer is needed.
|
|
|
300
301
|
Peer appends no data to the callback. Omitted/empty callbacks attempt closure;
|
|
301
302
|
tabs that block it keep the success page. Always re-check status on return.
|
|
302
303
|
|
|
303
|
-
The hosted flow offers Gmail, including Google-hosted custom domains,
|
|
304
|
-
|
|
305
|
-
is separate from `CashError`; no emails
|
|
304
|
+
The hosted flow offers Gmail, including Google-hosted custom domains, personal
|
|
305
|
+
Outlook, and iCloud Mail, then verifies actual Venmo receipts.
|
|
306
|
+
`VenmoGmailConnectError` is separate from `CashError`; no emails, mailbox
|
|
307
|
+
tokens or app-specific passwords reach the partner. Configure `venmoGmail: { appearance, popup }`
|
|
306
308
|
for branding and desktop dimensions; omission keeps Peer defaults.
|
|
307
309
|
See the README for error codes, native callbacks, package-free URLs, and
|
|
308
310
|
customization, plus `examples/venmo-link.ts`.
|