@zkp2p/cash 0.5.4-rc.2 → 0.6.0-rc.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 +3 -4
- package/README.md +11 -13
- package/dist/{createCashClient-ECL3HN5H.d.cts → createCashClient-94tPE0dH.d.cts} +2 -10
- package/dist/{createCashClient-ECL3HN5H.d.ts → createCashClient-94tPE0dH.d.ts} +2 -10
- package/dist/index.cjs +15 -27
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -27
- 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/examples/upi-staging-cashout.ts +0 -1
- package/llms.txt +3 -3
- package/package.json +1 -1
- package/skills/peer-cash-integration/SKILL.md +2 -3
- package/skills/upi-preprod-qa/SKILL.md +6 -10
package/AGENTS.md
CHANGED
|
@@ -8,7 +8,7 @@ You are integrating Peer Cash: an offramp that routes Relay-supported EVM
|
|
|
8
8
|
assets or NEAR Intents 1Click external deposits into Base USDC, then converts
|
|
9
9
|
Base USDC to fiat (Venmo, Revolut, Wise, Alipay, Zelle, ...) at a zero-spread
|
|
10
10
|
Chainlink market rate. Existing corridors bind at intent signal; Alipay/CNY
|
|
11
|
-
fixes a fresh Ethereum Chainlink snapshot during deposit preparation;
|
|
11
|
+
fixes a fresh Ethereum Chainlink snapshot during deposit preparation; UPI/INR uses Polygon Chainlink. The user whose USDC you
|
|
12
12
|
manage is the **maker**; a buyer pays them fiat and proves it with TEE-TLS; the
|
|
13
13
|
protocol releases the USDC. Funds are held by the protocol, and only the maker
|
|
14
14
|
can withdraw an unmatched deposit.
|
|
@@ -70,8 +70,7 @@ deposit-level integration share instead of applying maker L1/L2.
|
|
|
70
70
|
- **Venmo, Revolut, Cash App, Monzo** validate the handle against the live
|
|
71
71
|
platform at registration - the account must exist. The rest (Zelle, Chime,
|
|
72
72
|
etc.) are format-checked only. Match handles to the `payeeHint`.
|
|
73
|
-
- **UPI is
|
|
74
|
-
`features: { upi: true }`. Any valid UPI ID from any bank can receive; there
|
|
73
|
+
- **UPI is available in every environment without a rollout flag.** Any valid UPI ID from any bank can receive; there
|
|
75
74
|
is no seller bank login, extension, identity attestation, or prior
|
|
76
75
|
registration flow. Buyers pay and verify through Amazon Pay using standard UPI.
|
|
77
76
|
|
|
@@ -342,4 +341,4 @@ read-only RPC with `upiCreationRateRpcUrl` or `upiCreationRateTransport`.
|
|
|
342
341
|
Alipay/CNY retains the Ethereum registry and `creationRateRpcUrl` /
|
|
343
342
|
`creationRateTransport`. UPI rejects the wrong chain, invalid rounds, and
|
|
344
343
|
observations older than 24 hours; market closures do not bypass freshness.
|
|
345
|
-
UPI
|
|
344
|
+
UPI is available in production, preproduction, and staging without a feature flag.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Route Relay-supported EVM assets or NEAR Intents 1Click external deposits into
|
|
|
4
4
|
Base USDC, then cash out to fiat on Venmo, Revolut, Wise, Alipay, Zelle, and
|
|
5
5
|
more at a zero-spread Chainlink market rate with no centralized off-ramp
|
|
6
6
|
provider. Existing corridors bind the live oracle when a buyer signals;
|
|
7
|
-
Alipay/CNY and
|
|
7
|
+
Alipay/CNY and UPI/INR fix fresh Chainlink snapshots when the SDK prepares
|
|
8
8
|
the deposit (Ethereum for CNY; Polygon for INR).
|
|
9
9
|
|
|
10
10
|
Peer Cash is an **offramp-only** SDK for the [ZKP2P](https://peer.xyz)
|
|
@@ -98,15 +98,13 @@ for await (const order of cash.watch(depositId)) {
|
|
|
98
98
|
|
|
99
99
|
UPI requires the canonical UPI/INR catalog from `@zkp2p/sdk` 0.14.2-rc.1
|
|
100
100
|
or its approved successor; a missing catalog entry keeps the corridor disabled.
|
|
101
|
-
UPI is an opt-in
|
|
102
|
-
pending rollout review. Any valid UPI ID from any bank can receive a cash-out. The seller
|
|
101
|
+
UPI is available in every environment without an opt-in. Any valid UPI ID from any bank can receive a cash-out. The seller
|
|
103
102
|
does not connect a bank account, install an extension, or complete a separate
|
|
104
103
|
registration flow:
|
|
105
104
|
|
|
106
105
|
```ts
|
|
107
106
|
const cash = createCashClient({
|
|
108
107
|
environment: 'preproduction',
|
|
109
|
-
features: { upi: true },
|
|
110
108
|
});
|
|
111
109
|
|
|
112
110
|
await cash.cashout(
|
|
@@ -186,14 +184,14 @@ mixed historical deposit.
|
|
|
186
184
|
|
|
187
185
|
## Payout rails and access policies
|
|
188
186
|
|
|
189
|
-
| Payout rail
|
|
190
|
-
|
|
|
191
|
-
| Venmo
|
|
192
|
-
| PayPal
|
|
193
|
-
| Cash App
|
|
194
|
-
| Wise
|
|
195
|
-
| UPI
|
|
196
|
-
| Other supported rails
|
|
187
|
+
| Payout rail | Access-policy behavior | New payee registration |
|
|
188
|
+
| --------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
189
|
+
| Venmo | Peer Pay merchant policy attaches for that payment method | Curator validates the live handle |
|
|
190
|
+
| PayPal | Same method-scoped Peer Pay follow-up | Requires a Peer TEE browser-extension identity attestation |
|
|
191
|
+
| Cash App | No access-policy follow-up; non-chargebackable and no stake required | Curator validates the live handle |
|
|
192
|
+
| Wise | No access-policy follow-up | Requires a Peer TEE browser-extension identity attestation |
|
|
193
|
+
| UPI | No access-policy follow-up | Any valid UPI ID; no account connection or identity attestation |
|
|
194
|
+
| Other supported rails | No access-policy follow-up; use `capabilities()` for currencies and format | Follow the `payeeHint`; live-validation behavior is described in the integration guide |
|
|
197
195
|
|
|
198
196
|
No platform requires an atomic access-policy flow. `cashout()` and `prepare()`
|
|
199
197
|
work with any viem `WalletClient`, including a local or externally connected
|
|
@@ -483,7 +481,7 @@ is the default source and the only destination asset for cashout orders.
|
|
|
483
481
|
Runnable first-party examples in [`examples/`](examples):
|
|
484
482
|
|
|
485
483
|
- [`node-cashout.ts`](examples/node-cashout.ts) - server-side cash-out with a private-key signer, plus order tracking.
|
|
486
|
-
- [`upi-staging-cashout.ts`](examples/upi-staging-cashout.ts) -
|
|
484
|
+
- [`upi-staging-cashout.ts`](examples/upi-staging-cashout.ts) - UPI/INR cash-out to any valid UPI ID on staging or preproduction.
|
|
487
485
|
- [`agent-tool-use.ts`](examples/agent-tool-use.ts) - wiring the verbs into an agent tool-use loop with host-side signing.
|
|
488
486
|
- [`carpe-diem-provider-cashout`](examples/carpe-diem-provider-cashout) - cash out confirmed Carpe Diem provider DIEM revenue through the connected Base wallet.
|
|
489
487
|
- [`mpp-merchant-cashout`](examples/mpp-merchant-cashout) - turn confirmed MPP merchant revenue into an unsigned Peer Cash plan while the merchant keeps custody and signing.
|
|
@@ -468,16 +468,10 @@ declare function quoteNearIntentsToBaseUsdc(input: NearIntentsQuoteInput, option
|
|
|
468
468
|
declare function submitNearIntentsDeposit(input: NearIntentsDepositInput, options?: NearIntentsOptions): Promise<NearIntentsStatus>;
|
|
469
469
|
declare function readNearIntentsStatus(input: NearIntentsStatusInput, options?: NearIntentsOptions): Promise<NearIntentsStatus>;
|
|
470
470
|
|
|
471
|
-
interface CashCatalogFeatures {
|
|
472
|
-
upi?: boolean;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
471
|
/** Hard floor: below one cent a deposit is dust and can never fill. */
|
|
476
472
|
declare const MIN_CASHOUT_AMOUNT = 10000n;
|
|
477
473
|
/** Recommended floor: sub-1-USDC deposits force min==max fills and starve matching. */
|
|
478
474
|
declare const RECOMMENDED_MIN_CASHOUT_AMOUNT = 1000000n;
|
|
479
|
-
/** Opt-in product surfaces that are not yet available on production contracts. */
|
|
480
|
-
type CashFeatureFlags = CashCatalogFeatures;
|
|
481
475
|
type CashCorridorPricing = {
|
|
482
476
|
kind: 'oracle-at-intent-signal';
|
|
483
477
|
spreadBps: 0;
|
|
@@ -560,7 +554,7 @@ interface CashCapabilities {
|
|
|
560
554
|
spreadBps: 0;
|
|
561
555
|
};
|
|
562
556
|
}
|
|
563
|
-
declare function buildCapabilities(environment: RuntimeEnv
|
|
557
|
+
declare function buildCapabilities(environment: RuntimeEnv): CashCapabilities;
|
|
564
558
|
|
|
565
559
|
interface CashPairFillStats {
|
|
566
560
|
/** Fulfilled intents through this pair or currency set inside the rolling 30-day window. */
|
|
@@ -674,8 +668,6 @@ declare function toCashReferralAttributionCode(rawCode: string): string;
|
|
|
674
668
|
interface CashClientOptions {
|
|
675
669
|
/** `'production' | 'preproduction' | 'staging'` - selects contracts, curator, and indexer. */
|
|
676
670
|
environment: RuntimeEnv;
|
|
677
|
-
/** Fail-closed opt-ins for corridors that are not deployed to production. */
|
|
678
|
-
features?: CashFeatureFlags;
|
|
679
671
|
/** viem transport for RPC reads; defaults to the public Base RPC. */
|
|
680
672
|
transport?: Transport;
|
|
681
673
|
/** Convenience alternative to `transport`. */
|
|
@@ -949,4 +941,4 @@ interface CashClient {
|
|
|
949
941
|
}
|
|
950
942
|
declare function createCashClient(options: CashClientOptions): CashClient;
|
|
951
943
|
|
|
952
|
-
export { type
|
|
944
|
+
export { type EstimateOptions as $, type CashClient as A, BASE_CHAIN_ID as B, type CashPayoutInfo as C, type CashClientOptions as D, type CashCorridorPricing as E, type CashFillEta as F, type CashLeg as G, type CashMultiCurrencyLeg as H, type IntentEntity as I, type CashNextAction as J, type CashOrderState as K, type CashPairFillStats as L, type CashPayeeInput as M, type NearIntentsSourceCapabilities as N, type CashPayout as O, type PrepareResult as P, type CashPayoutPricing as Q, type RelayExecutionResult as R, type CashPlatformCapability as S, type TopUpResult as T, type CashPreparedStepKind as U, type CashReceiveLeg as V, type WithdrawResult as W, type CashoutInput as X, type CashoutOptions as Y, type CuratorPayeeDataInput as Z, type EstimateInput as _, type CashBuyerProfile as a, MARKET_SPREAD_BPS as a0, MIN_CASHOUT_AMOUNT as a1, NEAR_INTENTS_API_URL as a2, NEAR_INTENTS_BASE_USDC_ASSET_ID as a3, NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS as a4, NEAR_INTENTS_STATUSES as a5, type NearIntentsClient as a6, type NearIntentsOptions as a7, type NearIntentsQuoteRequest as a8, type NearIntentsStatusCode as a9, type NearIntentsToken as aa, type NearIntentsTradeType as ab, type NearIntentsTransaction as ac, ORACLE_MIN_CONVERSION_RATE_SENTINEL as ad, type OrdersOptions as ae, type PreparedCashoutReceipt as af, RECOMMENDED_MIN_CASHOUT_AMOUNT as ag, type RelayOptions as ah, type RelayQuoteInput as ai, type RelaySourceInput as aj, type RelayTransaction as ak, type SignerOptions as al, USDC_DECIMALS as am, type WatchOptions as an, type WithdrawOptions as ao, buildCapabilities as ap, createCashClient as aq, createNearIntentsClient as ar, normalizeCashPayee as as, quoteNearIntentsToBaseUsdc as at, readNearIntentsSourceCapabilities as au, readNearIntentsStatus as av, submitNearIntentsDeposit as aw, toCashReferralAttributionCode as ax, type CashDepositInput as b, type CreateDepositParamsArg as c, type CashOrder as d, type CashFill as e, type CashCapabilities as f, type CashoutResult as g, type CashEstimate as h, type CashFillStats as i, type NearIntentsDepositInput as j, type NearIntentsQuote as k, type NearIntentsQuoteInput as l, type NearIntentsStatus as m, type NearIntentsStatusInput as n, type CashPreparedStep as o, type RelayQuote as p, type RelayStatus as q, type CashSourceCapabilities as r, BASE_USDC_ADDRESS as s, CASH_ATTRIBUTION_CODE as t, CASH_ORDER_POLL_INTERVAL_MS as u, CASH_ORDER_STATUSES as v, CASH_REFERRAL_ATTRIBUTION_PREFIX as w, CASH_RETAIN_ON_EMPTY as x, type CashAsset as y, type CashChain as z };
|
|
@@ -468,16 +468,10 @@ declare function quoteNearIntentsToBaseUsdc(input: NearIntentsQuoteInput, option
|
|
|
468
468
|
declare function submitNearIntentsDeposit(input: NearIntentsDepositInput, options?: NearIntentsOptions): Promise<NearIntentsStatus>;
|
|
469
469
|
declare function readNearIntentsStatus(input: NearIntentsStatusInput, options?: NearIntentsOptions): Promise<NearIntentsStatus>;
|
|
470
470
|
|
|
471
|
-
interface CashCatalogFeatures {
|
|
472
|
-
upi?: boolean;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
471
|
/** Hard floor: below one cent a deposit is dust and can never fill. */
|
|
476
472
|
declare const MIN_CASHOUT_AMOUNT = 10000n;
|
|
477
473
|
/** Recommended floor: sub-1-USDC deposits force min==max fills and starve matching. */
|
|
478
474
|
declare const RECOMMENDED_MIN_CASHOUT_AMOUNT = 1000000n;
|
|
479
|
-
/** Opt-in product surfaces that are not yet available on production contracts. */
|
|
480
|
-
type CashFeatureFlags = CashCatalogFeatures;
|
|
481
475
|
type CashCorridorPricing = {
|
|
482
476
|
kind: 'oracle-at-intent-signal';
|
|
483
477
|
spreadBps: 0;
|
|
@@ -560,7 +554,7 @@ interface CashCapabilities {
|
|
|
560
554
|
spreadBps: 0;
|
|
561
555
|
};
|
|
562
556
|
}
|
|
563
|
-
declare function buildCapabilities(environment: RuntimeEnv
|
|
557
|
+
declare function buildCapabilities(environment: RuntimeEnv): CashCapabilities;
|
|
564
558
|
|
|
565
559
|
interface CashPairFillStats {
|
|
566
560
|
/** Fulfilled intents through this pair or currency set inside the rolling 30-day window. */
|
|
@@ -674,8 +668,6 @@ declare function toCashReferralAttributionCode(rawCode: string): string;
|
|
|
674
668
|
interface CashClientOptions {
|
|
675
669
|
/** `'production' | 'preproduction' | 'staging'` - selects contracts, curator, and indexer. */
|
|
676
670
|
environment: RuntimeEnv;
|
|
677
|
-
/** Fail-closed opt-ins for corridors that are not deployed to production. */
|
|
678
|
-
features?: CashFeatureFlags;
|
|
679
671
|
/** viem transport for RPC reads; defaults to the public Base RPC. */
|
|
680
672
|
transport?: Transport;
|
|
681
673
|
/** Convenience alternative to `transport`. */
|
|
@@ -949,4 +941,4 @@ interface CashClient {
|
|
|
949
941
|
}
|
|
950
942
|
declare function createCashClient(options: CashClientOptions): CashClient;
|
|
951
943
|
|
|
952
|
-
export { type
|
|
944
|
+
export { type EstimateOptions as $, type CashClient as A, BASE_CHAIN_ID as B, type CashPayoutInfo as C, type CashClientOptions as D, type CashCorridorPricing as E, type CashFillEta as F, type CashLeg as G, type CashMultiCurrencyLeg as H, type IntentEntity as I, type CashNextAction as J, type CashOrderState as K, type CashPairFillStats as L, type CashPayeeInput as M, type NearIntentsSourceCapabilities as N, type CashPayout as O, type PrepareResult as P, type CashPayoutPricing as Q, type RelayExecutionResult as R, type CashPlatformCapability as S, type TopUpResult as T, type CashPreparedStepKind as U, type CashReceiveLeg as V, type WithdrawResult as W, type CashoutInput as X, type CashoutOptions as Y, type CuratorPayeeDataInput as Z, type EstimateInput as _, type CashBuyerProfile as a, MARKET_SPREAD_BPS as a0, MIN_CASHOUT_AMOUNT as a1, NEAR_INTENTS_API_URL as a2, NEAR_INTENTS_BASE_USDC_ASSET_ID as a3, NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS as a4, NEAR_INTENTS_STATUSES as a5, type NearIntentsClient as a6, type NearIntentsOptions as a7, type NearIntentsQuoteRequest as a8, type NearIntentsStatusCode as a9, type NearIntentsToken as aa, type NearIntentsTradeType as ab, type NearIntentsTransaction as ac, ORACLE_MIN_CONVERSION_RATE_SENTINEL as ad, type OrdersOptions as ae, type PreparedCashoutReceipt as af, RECOMMENDED_MIN_CASHOUT_AMOUNT as ag, type RelayOptions as ah, type RelayQuoteInput as ai, type RelaySourceInput as aj, type RelayTransaction as ak, type SignerOptions as al, USDC_DECIMALS as am, type WatchOptions as an, type WithdrawOptions as ao, buildCapabilities as ap, createCashClient as aq, createNearIntentsClient as ar, normalizeCashPayee as as, quoteNearIntentsToBaseUsdc as at, readNearIntentsSourceCapabilities as au, readNearIntentsStatus as av, submitNearIntentsDeposit as aw, toCashReferralAttributionCode as ax, type CashDepositInput as b, type CreateDepositParamsArg as c, type CashOrder as d, type CashFill as e, type CashCapabilities as f, type CashoutResult as g, type CashEstimate as h, type CashFillStats as i, type NearIntentsDepositInput as j, type NearIntentsQuote as k, type NearIntentsQuoteInput as l, type NearIntentsStatus as m, type NearIntentsStatusInput as n, type CashPreparedStep as o, type RelayQuote as p, type RelayStatus as q, type CashSourceCapabilities as r, BASE_USDC_ADDRESS as s, CASH_ATTRIBUTION_CODE as t, CASH_ORDER_POLL_INTERVAL_MS as u, CASH_ORDER_STATUSES as v, CASH_REFERRAL_ATTRIBUTION_PREFIX as w, CASH_RETAIN_ON_EMPTY as x, type CashAsset as y, type CashChain as z };
|
package/dist/index.cjs
CHANGED
|
@@ -142,14 +142,8 @@ async function readCashCreationRate(publicClient, platform, currency, nowSeconds
|
|
|
142
142
|
async function readAlipayCnyCreationRate(publicClient, nowSeconds = Math.floor(Date.now() / 1e3)) {
|
|
143
143
|
return readCashCreationRate(publicClient, "alipay", "CNY", nowSeconds);
|
|
144
144
|
}
|
|
145
|
-
function getCashPaymentMethodsCatalog(environment
|
|
146
|
-
|
|
147
|
-
if ((environment === "staging" || environment === "preproduction") && features.upi === true) {
|
|
148
|
-
return catalog;
|
|
149
|
-
}
|
|
150
|
-
const enabledCatalog = { ...catalog };
|
|
151
|
-
delete enabledCatalog.upi;
|
|
152
|
-
return enabledCatalog;
|
|
145
|
+
function getCashPaymentMethodsCatalog(environment) {
|
|
146
|
+
return sdk.getPaymentMethodsCatalog(8453, environment);
|
|
153
147
|
}
|
|
154
148
|
function resolveCashPaymentMethodHash(processorName, catalog) {
|
|
155
149
|
if (processorName.trim().toLowerCase() === "upi" && !catalog.upi) {
|
|
@@ -192,12 +186,12 @@ function buildIntentAmountRange(amount) {
|
|
|
192
186
|
const min = amount < DEFAULT_MIN_ORDER_FLOOR ? amount : DEFAULT_MIN_ORDER_FLOOR;
|
|
193
187
|
return { min, max: amount };
|
|
194
188
|
}
|
|
195
|
-
async function prepareCashDepositParams(client, input, adapters, creationRateReader
|
|
189
|
+
async function prepareCashDepositParams(client, input, adapters, creationRateReader) {
|
|
196
190
|
const { payouts } = input;
|
|
197
191
|
if (!payouts.length) throw new Error("At least one payout is required");
|
|
198
192
|
const chainId = client.chainId;
|
|
199
193
|
const runtimeEnv = client.runtimeEnv;
|
|
200
|
-
const catalog = getCashPaymentMethodsCatalog(runtimeEnv
|
|
194
|
+
const catalog = getCashPaymentMethodsCatalog(runtimeEnv);
|
|
201
195
|
const intentGatingService = sdk.getGatingServiceAddress(chainId, runtimeEnv);
|
|
202
196
|
const processorNames = payouts.map((p) => p.processorName);
|
|
203
197
|
const paymentMethodsOverride = processorNames.map(
|
|
@@ -633,8 +627,8 @@ var IDENTITY_ATTESTATION_PLATFORMS = /* @__PURE__ */ new Set(["wise", "paypal",
|
|
|
633
627
|
function platformRequiresIdentityAttestation(platform) {
|
|
634
628
|
return IDENTITY_ATTESTATION_PLATFORMS.has(platform.toLowerCase());
|
|
635
629
|
}
|
|
636
|
-
function buildCapabilities(environment
|
|
637
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
630
|
+
function buildCapabilities(environment) {
|
|
631
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
638
632
|
const platforms = Object.entries(catalog).map(([platform, entry]) => {
|
|
639
633
|
const currencies2 = (entry.currencies ?? []).map((hash) => sdk.getCurrencyCodeFromHash(hash)).filter(
|
|
640
634
|
(code) => code != null && (isMarketRateSupported(code) || isCreationRateCorridor(platform, code))
|
|
@@ -2913,8 +2907,8 @@ async function submitAndConfirm(client, verb, send) {
|
|
|
2913
2907
|
function isKnownPreBroadcastFailure(mapped) {
|
|
2914
2908
|
return mapped.code === "TRANSACTION_REJECTED" || mapped.code === "INSUFFICIENT_TOKEN_BALANCE" || mapped.code === "ALLOWANCE_NOT_VISIBLE" || mapped.code === "ESCROW_PAUSED";
|
|
2915
2909
|
}
|
|
2916
|
-
function cashoutAccessPolicyPaymentMethods(depositInput, environment
|
|
2917
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
2910
|
+
function cashoutAccessPolicyPaymentMethods(depositInput, environment) {
|
|
2911
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
2918
2912
|
return [
|
|
2919
2913
|
...new Set(
|
|
2920
2914
|
depositInput.payouts.filter((payout) => CASH_RESTRICTED_PLATFORMS.has(payout.processorName.toLowerCase())).map((payout) => resolveCashPaymentMethodHash(payout.processorName, catalog))
|
|
@@ -3011,7 +3005,7 @@ function createCashClient(options) {
|
|
|
3011
3005
|
if (legs.length === 0) {
|
|
3012
3006
|
throw errors.invalidPayoutPlatforms("at least one payout leg is required");
|
|
3013
3007
|
}
|
|
3014
|
-
const capabilities2 = buildCapabilities(environment
|
|
3008
|
+
const capabilities2 = buildCapabilities(environment);
|
|
3015
3009
|
const seenPlatforms = /* @__PURE__ */ new Set();
|
|
3016
3010
|
const payouts = legs.map((leg) => {
|
|
3017
3011
|
const platform = capabilities2.platforms.find(
|
|
@@ -3092,8 +3086,7 @@ function createCashClient(options) {
|
|
|
3092
3086
|
} catch (err) {
|
|
3093
3087
|
throw errors.oracleReadFailed(currency, err);
|
|
3094
3088
|
}
|
|
3095
|
-
}
|
|
3096
|
-
options.features
|
|
3089
|
+
}
|
|
3097
3090
|
);
|
|
3098
3091
|
} catch (err) {
|
|
3099
3092
|
if (isCashError(err)) throw err;
|
|
@@ -3145,7 +3138,7 @@ function createCashClient(options) {
|
|
|
3145
3138
|
const payouts = derivePayouts(
|
|
3146
3139
|
deposit.paymentMethods ?? [],
|
|
3147
3140
|
deposit.currencies ?? [],
|
|
3148
|
-
getCashPaymentMethodsCatalog(environment
|
|
3141
|
+
getCashPaymentMethodsCatalog(environment)
|
|
3149
3142
|
);
|
|
3150
3143
|
let attributedToCash = false;
|
|
3151
3144
|
if (!isCashPayoutSet(payouts)) {
|
|
@@ -3203,7 +3196,7 @@ function createCashClient(options) {
|
|
|
3203
3196
|
return escrowContext(depositId);
|
|
3204
3197
|
}
|
|
3205
3198
|
function capabilities(capabilityOptions) {
|
|
3206
|
-
const baseCapabilities = buildCapabilities(environment
|
|
3199
|
+
const baseCapabilities = buildCapabilities(environment);
|
|
3207
3200
|
if (!capabilityOptions?.includeRelaySources && !capabilityOptions?.includeNearIntentsSources) {
|
|
3208
3201
|
return baseCapabilities;
|
|
3209
3202
|
}
|
|
@@ -3381,11 +3374,7 @@ function createCashClient(options) {
|
|
|
3381
3374
|
}
|
|
3382
3375
|
async function configureCashoutAccess(client, signer, depositInput, depositId, source) {
|
|
3383
3376
|
const groupIds = CASH_ACCESS_GROUP_IDS[environment];
|
|
3384
|
-
const paymentMethods = cashoutAccessPolicyPaymentMethods(
|
|
3385
|
-
depositInput,
|
|
3386
|
-
environment,
|
|
3387
|
-
options.features
|
|
3388
|
-
);
|
|
3377
|
+
const paymentMethods = cashoutAccessPolicyPaymentMethods(depositInput, environment);
|
|
3389
3378
|
const hashes = [];
|
|
3390
3379
|
for (const paymentMethod of paymentMethods) {
|
|
3391
3380
|
const prepared = prepareCashoutAccess(depositId, paymentMethod, client, source);
|
|
@@ -3691,8 +3680,7 @@ function createCashClient(options) {
|
|
|
3691
3680
|
const hashedOnchainIds = (params.paymentMethodDataOverride ?? []).map((d) => d.payeeDetails);
|
|
3692
3681
|
const accessPolicyPaymentMethods = cashoutAccessPolicyPaymentMethods(
|
|
3693
3682
|
depositInput,
|
|
3694
|
-
environment
|
|
3695
|
-
options.features
|
|
3683
|
+
environment
|
|
3696
3684
|
);
|
|
3697
3685
|
return {
|
|
3698
3686
|
txs: [approve, prepared],
|
|
@@ -3763,7 +3751,7 @@ function createCashClient(options) {
|
|
|
3763
3751
|
} catch (err) {
|
|
3764
3752
|
throw errors.indexerUnavailable("orders", err);
|
|
3765
3753
|
}
|
|
3766
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
3754
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
3767
3755
|
let attributedCashDeposits = /* @__PURE__ */ new Set();
|
|
3768
3756
|
const fixedRateCandidates = deposits.filter((deposit) => {
|
|
3769
3757
|
const payouts = derivePayouts(
|
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
|
|
2
|
-
export { B as BASE_CHAIN_ID,
|
|
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, R as RelayExecutionResult, p as RelayQuote, q as RelayStatus, r as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-94tPE0dH.cjs';
|
|
2
|
+
export { B as BASE_CHAIN_ID, s as BASE_USDC_ADDRESS, t as CASH_ATTRIBUTION_CODE, u as CASH_ORDER_POLL_INTERVAL_MS, v as CASH_ORDER_STATUSES, w as CASH_REFERRAL_ATTRIBUTION_PREFIX, x as CASH_RETAIN_ON_EMPTY, y as CashAsset, z as CashChain, A as CashClient, D as CashClientOptions, E as CashCorridorPricing, F as CashFillEta, G as CashLeg, H as CashMultiCurrencyLeg, J as CashNextAction, K as CashOrderState, L as CashPairFillStats, M as CashPayeeInput, O as CashPayout, Q as CashPayoutPricing, S as CashPlatformCapability, U as CashPreparedStepKind, V as CashReceiveLeg, X as CashoutInput, Y as CashoutOptions, Z as CuratorPayeeDataInput, _ as EstimateInput, $ as EstimateOptions, a0 as MARKET_SPREAD_BPS, a1 as MIN_CASHOUT_AMOUNT, a2 as NEAR_INTENTS_API_URL, a3 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a4 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a5 as NEAR_INTENTS_STATUSES, a6 as NearIntentsClient, a7 as NearIntentsOptions, a8 as NearIntentsQuoteRequest, a9 as NearIntentsStatusCode, aa as NearIntentsToken, ab as NearIntentsTradeType, ac as NearIntentsTransaction, ad as ORACLE_MIN_CONVERSION_RATE_SENTINEL, ae as OrdersOptions, af as PreparedCashoutReceipt, ag as RECOMMENDED_MIN_CASHOUT_AMOUNT, ah as RelayOptions, ai as RelayQuoteInput, aj as RelaySourceInput, ak as RelayTransaction, al as SignerOptions, am as USDC_DECIMALS, an as WatchOptions, ao as WithdrawOptions, ap as buildCapabilities, aq as createCashClient, ar as createNearIntentsClient, as as normalizeCashPayee, at as quoteNearIntentsToBaseUsdc, au as readNearIntentsSourceCapabilities, av as readNearIntentsStatus, aw as submitNearIntentsDeposit, ax as toCashReferralAttributionCode } from './createCashClient-94tPE0dH.cjs';
|
|
3
3
|
import { PublicClient, Log, Abi } from 'viem';
|
|
4
4
|
import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction } from '@zkp2p/sdk';
|
|
5
5
|
export { CurrencyType, PreparedTransaction, RuntimeEnv } from '@zkp2p/sdk';
|
|
@@ -258,7 +258,7 @@ declare function buildIntentAmountRange(amount: bigint): {
|
|
|
258
258
|
* arrays with signal-time oracle configs. Alipay/CNY and UPI/INR instead fix
|
|
259
259
|
* fresh Chainlink snapshots from Ethereum and Polygon as their maker floors.
|
|
260
260
|
*/
|
|
261
|
-
declare function prepareCashDepositParams(client: Zkp2pClient, input: CashDepositInput, adapters?: OracleAdapterOverrides, creationRateReader?: CreationRateReader
|
|
261
|
+
declare function prepareCashDepositParams(client: Zkp2pClient, input: CashDepositInput, adapters?: OracleAdapterOverrides, creationRateReader?: CreationRateReader): Promise<CreateDepositParamsArg>;
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Whether a signaled fill can still be completed by its buyer. Uses the
|
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
|
|
2
|
-
export { B as BASE_CHAIN_ID,
|
|
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, R as RelayExecutionResult, p as RelayQuote, q as RelayStatus, r as CashSourceCapabilities, T as TopUpResult, W as WithdrawResult } from './createCashClient-94tPE0dH.js';
|
|
2
|
+
export { B as BASE_CHAIN_ID, s as BASE_USDC_ADDRESS, t as CASH_ATTRIBUTION_CODE, u as CASH_ORDER_POLL_INTERVAL_MS, v as CASH_ORDER_STATUSES, w as CASH_REFERRAL_ATTRIBUTION_PREFIX, x as CASH_RETAIN_ON_EMPTY, y as CashAsset, z as CashChain, A as CashClient, D as CashClientOptions, E as CashCorridorPricing, F as CashFillEta, G as CashLeg, H as CashMultiCurrencyLeg, J as CashNextAction, K as CashOrderState, L as CashPairFillStats, M as CashPayeeInput, O as CashPayout, Q as CashPayoutPricing, S as CashPlatformCapability, U as CashPreparedStepKind, V as CashReceiveLeg, X as CashoutInput, Y as CashoutOptions, Z as CuratorPayeeDataInput, _ as EstimateInput, $ as EstimateOptions, a0 as MARKET_SPREAD_BPS, a1 as MIN_CASHOUT_AMOUNT, a2 as NEAR_INTENTS_API_URL, a3 as NEAR_INTENTS_BASE_USDC_ASSET_ID, a4 as NEAR_INTENTS_DEFAULT_SLIPPAGE_BPS, a5 as NEAR_INTENTS_STATUSES, a6 as NearIntentsClient, a7 as NearIntentsOptions, a8 as NearIntentsQuoteRequest, a9 as NearIntentsStatusCode, aa as NearIntentsToken, ab as NearIntentsTradeType, ac as NearIntentsTransaction, ad as ORACLE_MIN_CONVERSION_RATE_SENTINEL, ae as OrdersOptions, af as PreparedCashoutReceipt, ag as RECOMMENDED_MIN_CASHOUT_AMOUNT, ah as RelayOptions, ai as RelayQuoteInput, aj as RelaySourceInput, ak as RelayTransaction, al as SignerOptions, am as USDC_DECIMALS, an as WatchOptions, ao as WithdrawOptions, ap as buildCapabilities, aq as createCashClient, ar as createNearIntentsClient, as as normalizeCashPayee, at as quoteNearIntentsToBaseUsdc, au as readNearIntentsSourceCapabilities, av as readNearIntentsStatus, aw as submitNearIntentsDeposit, ax as toCashReferralAttributionCode } from './createCashClient-94tPE0dH.js';
|
|
3
3
|
import { PublicClient, Log, Abi } from 'viem';
|
|
4
4
|
import { PaymentMethodCatalog, CurrencyType, OracleAdapterOverrides, OnchainCurrency, Zkp2pClient, PreparedTransaction } from '@zkp2p/sdk';
|
|
5
5
|
export { CurrencyType, PreparedTransaction, RuntimeEnv } from '@zkp2p/sdk';
|
|
@@ -258,7 +258,7 @@ declare function buildIntentAmountRange(amount: bigint): {
|
|
|
258
258
|
* arrays with signal-time oracle configs. Alipay/CNY and UPI/INR instead fix
|
|
259
259
|
* fresh Chainlink snapshots from Ethereum and Polygon as their maker floors.
|
|
260
260
|
*/
|
|
261
|
-
declare function prepareCashDepositParams(client: Zkp2pClient, input: CashDepositInput, adapters?: OracleAdapterOverrides, creationRateReader?: CreationRateReader
|
|
261
|
+
declare function prepareCashDepositParams(client: Zkp2pClient, input: CashDepositInput, adapters?: OracleAdapterOverrides, creationRateReader?: CreationRateReader): Promise<CreateDepositParamsArg>;
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Whether a signaled fill can still be completed by its buyer. Uses the
|
package/dist/index.js
CHANGED
|
@@ -120,14 +120,8 @@ async function readCashCreationRate(publicClient, platform, currency, nowSeconds
|
|
|
120
120
|
async function readAlipayCnyCreationRate(publicClient, nowSeconds = Math.floor(Date.now() / 1e3)) {
|
|
121
121
|
return readCashCreationRate(publicClient, "alipay", "CNY", nowSeconds);
|
|
122
122
|
}
|
|
123
|
-
function getCashPaymentMethodsCatalog(environment
|
|
124
|
-
|
|
125
|
-
if ((environment === "staging" || environment === "preproduction") && features.upi === true) {
|
|
126
|
-
return catalog;
|
|
127
|
-
}
|
|
128
|
-
const enabledCatalog = { ...catalog };
|
|
129
|
-
delete enabledCatalog.upi;
|
|
130
|
-
return enabledCatalog;
|
|
123
|
+
function getCashPaymentMethodsCatalog(environment) {
|
|
124
|
+
return getPaymentMethodsCatalog(8453, environment);
|
|
131
125
|
}
|
|
132
126
|
function resolveCashPaymentMethodHash(processorName, catalog) {
|
|
133
127
|
if (processorName.trim().toLowerCase() === "upi" && !catalog.upi) {
|
|
@@ -170,12 +164,12 @@ function buildIntentAmountRange(amount) {
|
|
|
170
164
|
const min = amount < DEFAULT_MIN_ORDER_FLOOR ? amount : DEFAULT_MIN_ORDER_FLOOR;
|
|
171
165
|
return { min, max: amount };
|
|
172
166
|
}
|
|
173
|
-
async function prepareCashDepositParams(client, input, adapters, creationRateReader
|
|
167
|
+
async function prepareCashDepositParams(client, input, adapters, creationRateReader) {
|
|
174
168
|
const { payouts } = input;
|
|
175
169
|
if (!payouts.length) throw new Error("At least one payout is required");
|
|
176
170
|
const chainId = client.chainId;
|
|
177
171
|
const runtimeEnv = client.runtimeEnv;
|
|
178
|
-
const catalog = getCashPaymentMethodsCatalog(runtimeEnv
|
|
172
|
+
const catalog = getCashPaymentMethodsCatalog(runtimeEnv);
|
|
179
173
|
const intentGatingService = getGatingServiceAddress(chainId, runtimeEnv);
|
|
180
174
|
const processorNames = payouts.map((p) => p.processorName);
|
|
181
175
|
const paymentMethodsOverride = processorNames.map(
|
|
@@ -611,8 +605,8 @@ var IDENTITY_ATTESTATION_PLATFORMS = /* @__PURE__ */ new Set(["wise", "paypal",
|
|
|
611
605
|
function platformRequiresIdentityAttestation(platform) {
|
|
612
606
|
return IDENTITY_ATTESTATION_PLATFORMS.has(platform.toLowerCase());
|
|
613
607
|
}
|
|
614
|
-
function buildCapabilities(environment
|
|
615
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
608
|
+
function buildCapabilities(environment) {
|
|
609
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
616
610
|
const platforms = Object.entries(catalog).map(([platform, entry]) => {
|
|
617
611
|
const currencies2 = (entry.currencies ?? []).map((hash) => getCurrencyCodeFromHash(hash)).filter(
|
|
618
612
|
(code) => code != null && (isMarketRateSupported(code) || isCreationRateCorridor(platform, code))
|
|
@@ -2419,8 +2413,8 @@ async function submitAndConfirm(client, verb, send) {
|
|
|
2419
2413
|
function isKnownPreBroadcastFailure(mapped) {
|
|
2420
2414
|
return mapped.code === "TRANSACTION_REJECTED" || mapped.code === "INSUFFICIENT_TOKEN_BALANCE" || mapped.code === "ALLOWANCE_NOT_VISIBLE" || mapped.code === "ESCROW_PAUSED";
|
|
2421
2415
|
}
|
|
2422
|
-
function cashoutAccessPolicyPaymentMethods(depositInput, environment
|
|
2423
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
2416
|
+
function cashoutAccessPolicyPaymentMethods(depositInput, environment) {
|
|
2417
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
2424
2418
|
return [
|
|
2425
2419
|
...new Set(
|
|
2426
2420
|
depositInput.payouts.filter((payout) => CASH_RESTRICTED_PLATFORMS.has(payout.processorName.toLowerCase())).map((payout) => resolveCashPaymentMethodHash(payout.processorName, catalog))
|
|
@@ -2517,7 +2511,7 @@ function createCashClient(options) {
|
|
|
2517
2511
|
if (legs.length === 0) {
|
|
2518
2512
|
throw errors.invalidPayoutPlatforms("at least one payout leg is required");
|
|
2519
2513
|
}
|
|
2520
|
-
const capabilities2 = buildCapabilities(environment
|
|
2514
|
+
const capabilities2 = buildCapabilities(environment);
|
|
2521
2515
|
const seenPlatforms = /* @__PURE__ */ new Set();
|
|
2522
2516
|
const payouts = legs.map((leg) => {
|
|
2523
2517
|
const platform = capabilities2.platforms.find(
|
|
@@ -2598,8 +2592,7 @@ function createCashClient(options) {
|
|
|
2598
2592
|
} catch (err) {
|
|
2599
2593
|
throw errors.oracleReadFailed(currency, err);
|
|
2600
2594
|
}
|
|
2601
|
-
}
|
|
2602
|
-
options.features
|
|
2595
|
+
}
|
|
2603
2596
|
);
|
|
2604
2597
|
} catch (err) {
|
|
2605
2598
|
if (isCashError(err)) throw err;
|
|
@@ -2651,7 +2644,7 @@ function createCashClient(options) {
|
|
|
2651
2644
|
const payouts = derivePayouts(
|
|
2652
2645
|
deposit.paymentMethods ?? [],
|
|
2653
2646
|
deposit.currencies ?? [],
|
|
2654
|
-
getCashPaymentMethodsCatalog(environment
|
|
2647
|
+
getCashPaymentMethodsCatalog(environment)
|
|
2655
2648
|
);
|
|
2656
2649
|
let attributedToCash = false;
|
|
2657
2650
|
if (!isCashPayoutSet(payouts)) {
|
|
@@ -2709,7 +2702,7 @@ function createCashClient(options) {
|
|
|
2709
2702
|
return escrowContext(depositId);
|
|
2710
2703
|
}
|
|
2711
2704
|
function capabilities(capabilityOptions) {
|
|
2712
|
-
const baseCapabilities = buildCapabilities(environment
|
|
2705
|
+
const baseCapabilities = buildCapabilities(environment);
|
|
2713
2706
|
if (!capabilityOptions?.includeRelaySources && !capabilityOptions?.includeNearIntentsSources) {
|
|
2714
2707
|
return baseCapabilities;
|
|
2715
2708
|
}
|
|
@@ -2887,11 +2880,7 @@ function createCashClient(options) {
|
|
|
2887
2880
|
}
|
|
2888
2881
|
async function configureCashoutAccess(client, signer, depositInput, depositId, source) {
|
|
2889
2882
|
const groupIds = CASH_ACCESS_GROUP_IDS[environment];
|
|
2890
|
-
const paymentMethods = cashoutAccessPolicyPaymentMethods(
|
|
2891
|
-
depositInput,
|
|
2892
|
-
environment,
|
|
2893
|
-
options.features
|
|
2894
|
-
);
|
|
2883
|
+
const paymentMethods = cashoutAccessPolicyPaymentMethods(depositInput, environment);
|
|
2895
2884
|
const hashes = [];
|
|
2896
2885
|
for (const paymentMethod of paymentMethods) {
|
|
2897
2886
|
const prepared = prepareCashoutAccess(depositId, paymentMethod, client, source);
|
|
@@ -3197,8 +3186,7 @@ function createCashClient(options) {
|
|
|
3197
3186
|
const hashedOnchainIds = (params.paymentMethodDataOverride ?? []).map((d) => d.payeeDetails);
|
|
3198
3187
|
const accessPolicyPaymentMethods = cashoutAccessPolicyPaymentMethods(
|
|
3199
3188
|
depositInput,
|
|
3200
|
-
environment
|
|
3201
|
-
options.features
|
|
3189
|
+
environment
|
|
3202
3190
|
);
|
|
3203
3191
|
return {
|
|
3204
3192
|
txs: [approve, prepared],
|
|
@@ -3269,7 +3257,7 @@ function createCashClient(options) {
|
|
|
3269
3257
|
} catch (err) {
|
|
3270
3258
|
throw errors.indexerUnavailable("orders", err);
|
|
3271
3259
|
}
|
|
3272
|
-
const catalog = getCashPaymentMethodsCatalog(environment
|
|
3260
|
+
const catalog = getCashPaymentMethodsCatalog(environment);
|
|
3273
3261
|
let attributedCashDeposits = /* @__PURE__ */ new Set();
|
|
3274
3262
|
const fixedRateCandidates = deposits.filter((deposit) => {
|
|
3275
3263
|
const payouts = derivePayouts(
|
package/dist/react.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CurrencyType } from '@zkp2p/sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { A as CashClient, _ as EstimateInput, h as CashEstimate, Y as CashoutOptions, g as CashoutResult, X as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-94tPE0dH.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 {
|
|
2
|
+
import { A as CashClient, _ as EstimateInput, h as CashEstimate, Y as CashoutOptions, g as CashoutResult, X as CashoutInput, T as TopUpResult, W as WithdrawResult, d as CashOrder } from './createCashClient-94tPE0dH.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
package/llms.txt
CHANGED
|
@@ -38,8 +38,8 @@ Key facts:
|
|
|
38
38
|
fillStats() separately.
|
|
39
39
|
- capabilities() exposes one Zelle platform. A zelle cashout attaches only the
|
|
40
40
|
generic Zelle payment method to the on-chain deposit.
|
|
41
|
-
- UPI/INR is
|
|
42
|
-
`createCashClient({ environment: 'preproduction'
|
|
41
|
+
- UPI/INR is available without feature flags. For example, use
|
|
42
|
+
`createCashClient({ environment: 'preproduction' })`.
|
|
43
43
|
Any valid UPI ID from any bank can receive without a seller login,
|
|
44
44
|
extension, identity attestation, or prior registration flow. Buyers
|
|
45
45
|
pay and verify through Amazon Pay using standard UPI.
|
|
@@ -136,4 +136,4 @@ read-only RPC with `upiCreationRateRpcUrl` or `upiCreationRateTransport`.
|
|
|
136
136
|
Alipay/CNY retains the Ethereum registry and `creationRateRpcUrl` /
|
|
137
137
|
`creationRateTransport`. UPI rejects the wrong chain, invalid rounds, and
|
|
138
138
|
observations older than 24 hours; market closures do not bypass freshness.
|
|
139
|
-
UPI
|
|
139
|
+
UPI is available in production, preproduction, and staging without a feature flag.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/cash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-rc.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)",
|
|
@@ -183,8 +183,7 @@ platforms outright: a previously registered handle can be reused with bare
|
|
|
183
183
|
payee data. Handle `PAYEE_VERIFICATION_REQUIRED` when registration is still
|
|
184
184
|
needed.
|
|
185
185
|
|
|
186
|
-
UPI is
|
|
187
|
-
with `features: { upi: true }` on a staging or preproduction client. Accept any locally valid
|
|
186
|
+
UPI is available on production, preproduction, and staging clients without feature flags. Accept any locally valid
|
|
188
187
|
UPI ID from any bank; do not add a seller bank-login, extension, identity
|
|
189
188
|
attestation, or pre-registration step. Buyers pay and verify through Amazon Pay using standard UPI; UPI Lite and
|
|
190
189
|
merchant payments are unsupported.
|
|
@@ -273,7 +272,7 @@ read-only RPC with `upiCreationRateRpcUrl` or `upiCreationRateTransport`.
|
|
|
273
272
|
Alipay/CNY retains the Ethereum registry and `creationRateRpcUrl` /
|
|
274
273
|
`creationRateTransport`. UPI rejects the wrong chain, invalid rounds, and
|
|
275
274
|
observations older than 24 hours; market closures do not bypass freshness.
|
|
276
|
-
UPI
|
|
275
|
+
UPI is available in production, preproduction, and staging without a feature flag.
|
|
277
276
|
|
|
278
277
|
Before a funded UPI QA run, call
|
|
279
278
|
`cash.estimate({ amount: 1000000n, platform: 'upi', currency: 'INR' }, { includeEta: false })`
|
|
@@ -6,9 +6,8 @@ description: Verify the Cash SDK Amazon Pay UPI corridor on preproduction, inclu
|
|
|
6
6
|
# UPI preproduction QA
|
|
7
7
|
|
|
8
8
|
Use the exact published Cash candidate and record its SDK/contracts versions.
|
|
9
|
-
Require `createCashClient({ environment: 'preproduction'
|
|
10
|
-
|
|
11
|
-
UPI must be absent and unsigned preparation must reject before registration or rate reads.
|
|
9
|
+
Require `createCashClient({ environment: 'preproduction' })` to advertise UPI/INR.
|
|
10
|
+
UPI is available without feature flags in every environment.
|
|
12
11
|
The canonical contracts catalog must contain the live UPI method and INR currency;
|
|
13
12
|
never invent a catalog entry when the package or registry omits one.
|
|
14
13
|
|
|
@@ -19,13 +18,10 @@ any transaction:
|
|
|
19
18
|
import { createCashClient } from '@zkp2p/cash';
|
|
20
19
|
|
|
21
20
|
for (const environment of ['staging', 'preproduction', 'production'] as const) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (Boolean(method?.currencies.includes('INR')) !== expected) {
|
|
27
|
-
throw new Error(`Unexpected UPI catalog for ${environment}, flag=${upi}`);
|
|
28
|
-
}
|
|
21
|
+
const client = createCashClient({ environment });
|
|
22
|
+
const method = client.capabilities().platforms.find((item) => item.platform === 'upi');
|
|
23
|
+
if (!method?.currencies.includes('INR')) {
|
|
24
|
+
throw new Error(`Missing UPI catalog for ${environment}`);
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
27
|
```
|