@zkp2p/cash 0.6.0 → 0.6.1
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 +6 -0
- package/README.md +37 -0
- package/dist/{createCashClient-CZgoTClw.d.cts → createCashClient-LTZshulP.d.cts} +6 -1
- package/dist/{createCashClient-CZgoTClw.d.ts → createCashClient-LTZshulP.d.ts} +6 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -0
- 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 +6 -0
- package/examples/venmo-link.ts +9 -3
- package/llms.txt +3 -0
- package/package.json +2 -2
- package/skills/peer-cash-integration/SKILL.md +6 -0
package/AGENTS.md
CHANGED
|
@@ -359,3 +359,9 @@ Venmo receipts. `VenmoGmailConnectError` retains codes such as
|
|
|
359
359
|
and `connection_timeout`; it is separate from `CashError`. No emails or Google
|
|
360
360
|
tokens reach the partner. `link.url` supports redirect/native hosts, which
|
|
361
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.
|
package/README.md
CHANGED
|
@@ -239,6 +239,43 @@ 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
|
+
### Customize the hosted popup
|
|
243
|
+
|
|
244
|
+
With `@zkp2p/cash@0.6.1`, configure branding once on the client. The same
|
|
245
|
+
appearance is used by `link.url` and `openVenmoGmailConnect()`.
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
const cash = createCashClient({
|
|
249
|
+
environment: 'production',
|
|
250
|
+
venmoGmail: {
|
|
251
|
+
appearance: {
|
|
252
|
+
logoUrl: 'https://your-app.example/logo.png',
|
|
253
|
+
logoAlt: 'Your app',
|
|
254
|
+
backgroundColor: '#FFFFFF',
|
|
255
|
+
textColor: '#172033',
|
|
256
|
+
secondaryTextColor: '#636B7A',
|
|
257
|
+
buttonColor: '#6246EA',
|
|
258
|
+
buttonTextColor: '#FFFFFF',
|
|
259
|
+
fontFamily: 'Inter, sans-serif',
|
|
260
|
+
headingTextTransform: 'none',
|
|
261
|
+
buttonTextTransform: 'none',
|
|
262
|
+
buttonBorderRadius: 12,
|
|
263
|
+
buttonHeight: 52,
|
|
264
|
+
},
|
|
265
|
+
popup: { width: 500, height: 620 },
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Your hosted logo appears beside Venmo with three connecting dots. Without a
|
|
271
|
+
partner logo, the page shows Peer beside Venmo. Colors use
|
|
272
|
+
hex values and dimensions use pixels. Optional `fontUrl` accepts a hosted
|
|
273
|
+
WOFF/WOFF2 font with cross-origin loading enabled. Popup dimensions apply to
|
|
274
|
+
desktop; mobile browsers control the new tab's size. Styling never changes
|
|
275
|
+
consent, account selection, or receipt verification.
|
|
276
|
+
|
|
277
|
+
See the [full appearance options](https://www.npmjs.com/package/@zkp2p/sdk#popup-customization).
|
|
278
|
+
|
|
242
279
|
## Payout rails and access policies
|
|
243
280
|
|
|
244
281
|
| 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. */
|
|
@@ -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. */
|
package/dist/index.cjs
CHANGED
|
@@ -3436,6 +3436,7 @@ function createCashClient(options) {
|
|
|
3436
3436
|
});
|
|
3437
3437
|
const payeeDetails = hashedOnchainIds[0];
|
|
3438
3438
|
const url = sdk.getVenmoGmailConnectUrl({
|
|
3439
|
+
...options.venmoGmail,
|
|
3439
3440
|
payeeDetails,
|
|
3440
3441
|
peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
|
|
3441
3442
|
});
|
|
@@ -3443,6 +3444,7 @@ function createCashClient(options) {
|
|
|
3443
3444
|
},
|
|
3444
3445
|
openVenmoGmailConnect(payeeDetails) {
|
|
3445
3446
|
return sdk.openVenmoGmailConnect({
|
|
3447
|
+
...options.venmoGmail,
|
|
3446
3448
|
payeeDetails,
|
|
3447
3449
|
peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
|
|
3448
3450
|
});
|
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-
|
|
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-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';
|
|
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-
|
|
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-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';
|
|
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
|
@@ -2943,6 +2943,7 @@ function createCashClient(options) {
|
|
|
2943
2943
|
});
|
|
2944
2944
|
const payeeDetails = hashedOnchainIds[0];
|
|
2945
2945
|
const url = getVenmoGmailConnectUrl({
|
|
2946
|
+
...options.venmoGmail,
|
|
2946
2947
|
payeeDetails,
|
|
2947
2948
|
peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
|
|
2948
2949
|
});
|
|
@@ -2950,6 +2951,7 @@ function createCashClient(options) {
|
|
|
2950
2951
|
},
|
|
2951
2952
|
openVenmoGmailConnect(payeeDetails) {
|
|
2952
2953
|
return openVenmoGmailConnect({
|
|
2954
|
+
...options.venmoGmail,
|
|
2953
2955
|
payeeDetails,
|
|
2954
2956
|
peerOrigin: options.peerOrigin ?? DEFAULT_PEER_ORIGINS[environment]
|
|
2955
2957
|
});
|
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-LTZshulP.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-LTZshulP.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
|
@@ -156,3 +156,9 @@ Venmo receipts. `VenmoGmailConnectError` retains codes such as
|
|
|
156
156
|
and `connection_timeout`; it is separate from `CashError`. No emails or Google
|
|
157
157
|
tokens reach the partner. `link.url` supports redirect/native hosts, which
|
|
158
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.
|
package/examples/venmo-link.ts
CHANGED
|
@@ -4,15 +4,22 @@ 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
|
|
|
13
21
|
/** Bind this to a click. Keep registration/other awaits outside the handler. */
|
|
14
22
|
export function linkVenmo(link: PreparedVenmoGmailConnect) {
|
|
15
|
-
const cash = createCashClient({ environment: 'production' });
|
|
16
23
|
return cash.openVenmoGmailConnect(link.payeeDetails).catch((error: unknown) => {
|
|
17
24
|
if (error instanceof VenmoGmailConnectError) {
|
|
18
25
|
// Render error.message. For an ambiguous closure/timeout, offer a status refresh.
|
|
@@ -25,7 +32,6 @@ export function linkVenmo(link: PreparedVenmoGmailConnect) {
|
|
|
25
32
|
|
|
26
33
|
/** Also call when returning from a mobile tab or redirect opened with link.url. */
|
|
27
34
|
export function checkVenmoLink(link: PreparedVenmoGmailConnect) {
|
|
28
|
-
const cash = createCashClient({ environment: 'production' });
|
|
29
35
|
return cash.isVenmoGmailConnected(link.payeeDetails);
|
|
30
36
|
}
|
|
31
37
|
|
package/llms.txt
CHANGED
|
@@ -22,6 +22,9 @@ Key facts:
|
|
|
22
22
|
use VenmoGmailConnectError.code, including venmo_google_oauth_receipt_not_found.
|
|
23
23
|
Partner apps receive neither emails nor Google tokens. Re-prepare when the
|
|
24
24
|
handle changes; persist payee hash with environment and user account.
|
|
25
|
+
Optional createCashClient({ venmoGmail: { appearance, popup } }) shares branding
|
|
26
|
+
between the prepared URL and popup. Defaults use Peer branding; desktop popup
|
|
27
|
+
dimensions do not control mobile tab sizing. See the README customization example.
|
|
25
28
|
|
|
26
29
|
- The cashing-out user is the MAKER: their USDC becomes a protocol-held order;
|
|
27
30
|
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.
|
|
3
|
+
"version": "0.6.1",
|
|
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.2",
|
|
112
112
|
"zod": "^4.4.3"
|
|
113
113
|
},
|
|
114
114
|
"peerDependencies": {
|
|
@@ -299,3 +299,9 @@ Venmo receipts. `VenmoGmailConnectError` retains codes such as
|
|
|
299
299
|
and `connection_timeout`; it is separate from `CashError`. No emails or Google
|
|
300
300
|
tokens reach the partner. `link.url` supports redirect/native hosts, which
|
|
301
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.
|