@provex/utils 1.9.0 → 1.9.1-rc.20260612150709.70dd1a7
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/dist/payment.d.ts +10 -0
- package/dist/payment.js +30 -0
- package/package.json +1 -1
package/dist/payment.d.ts
CHANGED
|
@@ -565,6 +565,16 @@ export declare function resolveApiProviderKey(key: string): string;
|
|
|
565
565
|
* @returns The platform key to use with the PeerAuth extension
|
|
566
566
|
*/
|
|
567
567
|
export declare function getExtensionPlatform(key: ProviderKey | SubProviderKey): PlatformKey;
|
|
568
|
+
/**
|
|
569
|
+
* Whether a provider's Buyer TEE proof params should carry the metadata
|
|
570
|
+
* `index` (the selected row's `originalIndex`). Sending it for a provider that
|
|
571
|
+
* does not expect it — or omitting it for one that does — makes the enclave
|
|
572
|
+
* reject the capture, so this gate is per-provider, never blanket.
|
|
573
|
+
*
|
|
574
|
+
* @param key - Provider or sub-provider key (e.g. `'cashapp'`, `'zelle-chase'`).
|
|
575
|
+
* @returns True when the index must be included.
|
|
576
|
+
*/
|
|
577
|
+
export declare function providerRequiresMetadataIndex(key: ProviderKey | SubProviderKey): boolean;
|
|
568
578
|
/**
|
|
569
579
|
* Get icon and color info for both parent and sub-provider.
|
|
570
580
|
* Returns array of icon configs: [parent, subProvider] for sub-providers, [provider] for main providers.
|
package/dist/payment.js
CHANGED
|
@@ -397,6 +397,10 @@ export const providerConfigs = (chainId) => {
|
|
|
397
397
|
capMultiplier: 1,
|
|
398
398
|
hasCooldown: true,
|
|
399
399
|
minimumTier: null,
|
|
400
|
+
// Cash App sends amounts as integer cents (e.g. 1000 for $10.00) — same as
|
|
401
|
+
// Revolut. Without this the transaction-selector display and the auto-match
|
|
402
|
+
// are 100x off.
|
|
403
|
+
amountInCents: true,
|
|
400
404
|
},
|
|
401
405
|
revolut: {
|
|
402
406
|
key: providers.REVOLUT,
|
|
@@ -1234,6 +1238,32 @@ export function getExtensionPlatform(key) {
|
|
|
1234
1238
|
// Main provider - use the key as the platform
|
|
1235
1239
|
return key;
|
|
1236
1240
|
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Parent providers whose Buyer TEE proof params MUST include the metadata
|
|
1243
|
+
* `index`. Per the zkp2p 0.6.0 Buyer TEE spec (onramp-llm.md §2): include the
|
|
1244
|
+
* index ONLY for Venmo, Cash App, Revolut, and Zelle; OMIT it for PayPal,
|
|
1245
|
+
* Wise, Monzo, and Chime. Keyed on the PARENT provider so every Zelle sub-bank
|
|
1246
|
+
* (`zelle-chase`, `zelle-bofa`, …) qualifies via its `zelle-` prefix.
|
|
1247
|
+
*/
|
|
1248
|
+
const METADATA_INDEX_PARENT_PROVIDERS = new Set([
|
|
1249
|
+
providers.VENMO,
|
|
1250
|
+
providers.CASHAPP,
|
|
1251
|
+
providers.REVOLUT,
|
|
1252
|
+
providers.ZELLE,
|
|
1253
|
+
]);
|
|
1254
|
+
/**
|
|
1255
|
+
* Whether a provider's Buyer TEE proof params should carry the metadata
|
|
1256
|
+
* `index` (the selected row's `originalIndex`). Sending it for a provider that
|
|
1257
|
+
* does not expect it — or omitting it for one that does — makes the enclave
|
|
1258
|
+
* reject the capture, so this gate is per-provider, never blanket.
|
|
1259
|
+
*
|
|
1260
|
+
* @param key - Provider or sub-provider key (e.g. `'cashapp'`, `'zelle-chase'`).
|
|
1261
|
+
* @returns True when the index must be included.
|
|
1262
|
+
*/
|
|
1263
|
+
export function providerRequiresMetadataIndex(key) {
|
|
1264
|
+
const parent = key.includes('-') ? key.split('-')[0] : key;
|
|
1265
|
+
return METADATA_INDEX_PARENT_PROVIDERS.has(parent.toLowerCase());
|
|
1266
|
+
}
|
|
1237
1267
|
/**
|
|
1238
1268
|
* Get icon and color info for both parent and sub-provider.
|
|
1239
1269
|
* Returns array of icon configs: [parent, subProvider] for sub-providers, [provider] for main providers.
|