@p2pdotme/sdk 1.0.5 → 1.1.0
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/README.md +71 -41
- package/dist/country.cjs +8 -1
- package/dist/country.cjs.map +1 -1
- package/dist/country.d.cts +35 -10
- package/dist/country.d.ts +35 -10
- package/dist/country.mjs +5 -1
- package/dist/country.mjs.map +1 -1
- package/dist/fraud-engine.cjs +52 -48
- package/dist/fraud-engine.cjs.map +1 -1
- package/dist/fraud-engine.mjs +46 -42
- package/dist/fraud-engine.mjs.map +1 -1
- package/dist/index.cjs +4 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -36
- package/dist/index.d.ts +41 -36
- package/dist/index.mjs +4 -12
- package/dist/index.mjs.map +1 -1
- package/dist/{payload.cjs → orders.cjs} +2357 -253
- package/dist/orders.cjs.map +1 -0
- package/dist/orders.d.cts +399 -0
- package/dist/orders.d.ts +399 -0
- package/dist/{payload.mjs → orders.mjs} +2340 -237
- package/dist/orders.mjs.map +1 -0
- package/dist/prices.cjs +1008 -0
- package/dist/prices.cjs.map +1 -0
- package/dist/prices.d.cts +109 -0
- package/dist/prices.d.ts +109 -0
- package/dist/prices.mjs +980 -0
- package/dist/prices.mjs.map +1 -0
- package/dist/profile.cjs +475 -69
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.d.cts +39 -27
- package/dist/profile.d.ts +39 -27
- package/dist/profile.mjs +468 -62
- package/dist/profile.mjs.map +1 -1
- package/dist/qr-parsers.cjs +6 -6
- package/dist/qr-parsers.cjs.map +1 -1
- package/dist/qr-parsers.d.cts +38 -16
- package/dist/qr-parsers.d.ts +38 -16
- package/dist/qr-parsers.mjs +6 -6
- package/dist/qr-parsers.mjs.map +1 -1
- package/dist/react.cjs +2531 -1105
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +384 -104
- package/dist/react.d.ts +384 -104
- package/dist/react.mjs +2417 -992
- package/dist/react.mjs.map +1 -1
- package/dist/zkkyc.cjs +405 -24
- package/dist/zkkyc.cjs.map +1 -1
- package/dist/zkkyc.d.cts +14 -9
- package/dist/zkkyc.d.ts +14 -9
- package/dist/zkkyc.mjs +405 -24
- package/dist/zkkyc.mjs.map +1 -1
- package/package.json +12 -12
- package/dist/order-routing.cjs +0 -888
- package/dist/order-routing.cjs.map +0 -1
- package/dist/order-routing.d.cts +0 -68
- package/dist/order-routing.d.ts +0 -68
- package/dist/order-routing.mjs +0 -860
- package/dist/order-routing.mjs.map +0 -1
- package/dist/payload.cjs.map +0 -1
- package/dist/payload.d.cts +0 -147
- package/dist/payload.d.ts +0 -147
- package/dist/payload.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Multi-module TypeScript SDK for P2P.me. Published as a single package with subpath exports.
|
|
4
4
|
|
|
5
5
|
- Framework-agnostic core with optional React bindings
|
|
6
|
-
- Wallet-agnostic — consumers bring their own viem client
|
|
6
|
+
- Wallet-agnostic — consumers bring their own viem client; optional `WalletClient` for writes
|
|
7
7
|
- No thrown exceptions — all methods return `Result` / `ResultAsync` via neverthrow
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
@@ -12,34 +12,44 @@ Multi-module TypeScript SDK for P2P.me. Published as a single package with subpa
|
|
|
12
12
|
bun add @p2pdotme/sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Peer
|
|
15
|
+
Peer dependencies (all optional):
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
bun add react
|
|
18
|
+
bun add react # only for @p2pdotme/sdk/react
|
|
19
|
+
bun add @reclaimprotocol/js-sdk # only for zkkyc Reclaim flow
|
|
20
|
+
bun add @zkpassport/sdk # only for zkkyc ZK Passport flow
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
## Modules
|
|
22
24
|
|
|
23
25
|
| Import | Description |
|
|
24
26
|
|--------|-------------|
|
|
25
|
-
| `@p2pdotme/sdk` | Shared types, `SdkError`, `
|
|
26
|
-
| `@p2pdotme/sdk/
|
|
27
|
-
| `@p2pdotme/sdk/
|
|
28
|
-
| `@p2pdotme/sdk/profile` | [
|
|
27
|
+
| `@p2pdotme/sdk` | Shared types, `SdkError`, `VERSION` |
|
|
28
|
+
| `@p2pdotme/sdk/orders` | [Order reads + writes](./src/orders/README.md) — `getOrder`, `getOrders`, `getFeeConfig`, and `prepare`/`execute` pairs for `placeOrder`, `cancelOrder`, `setSellOrderUpi`, `raiseDispute`, `approveUsdc` |
|
|
29
|
+
| `@p2pdotme/sdk/prices` | [Currency price config](./src/prices/README.md) — `getPriceConfig`, `getReputationPerUsdcLimit` |
|
|
30
|
+
| `@p2pdotme/sdk/profile` | [User-scoped reads](./src/profile/README.md) — USDC balance, USDC allowance, fiat conversion, tx limits |
|
|
29
31
|
| `@p2pdotme/sdk/qr-parsers` | [QR code parsers](./src/qr-parsers/README.md) for UPI, QRIS, PIX, MercadoPago, Pago Movil |
|
|
30
32
|
| `@p2pdotme/sdk/fraud-engine` | [Fraud detection](./src/fraud-engine/README.md), device fingerprinting, SEON integration |
|
|
31
|
-
| `@p2pdotme/sdk/zkkyc` | [ZK KYC
|
|
33
|
+
| `@p2pdotme/sdk/zkkyc` | [ZK KYC](./src/zkkyc/README.md) — Reclaim, Anon Aadhaar, ZK Passport |
|
|
32
34
|
| `@p2pdotme/sdk/country` | [Country & currency config](./src/country/README.md) — payment methods, validators, field configs |
|
|
33
35
|
| `@p2pdotme/sdk/react` | Unified React provider (`SdkProvider`) + hooks |
|
|
34
36
|
|
|
37
|
+
Circle-selection routing is an internal implementation detail of `placeOrder` — it is **not** exposed as a public subpath.
|
|
38
|
+
|
|
35
39
|
## Quick Start
|
|
36
40
|
|
|
37
41
|
```tsx
|
|
38
|
-
import { SdkProvider,
|
|
39
|
-
import { createPublicClient, http, parseUnits } from "viem";
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
import { SdkProvider, useOrders, useProfile } from "@p2pdotme/sdk/react";
|
|
43
|
+
import { createPublicClient, createWalletClient, http, parseUnits } from "viem";
|
|
44
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
45
|
+
import { baseSepolia } from "viem/chains";
|
|
46
|
+
|
|
47
|
+
const publicClient = createPublicClient({ chain: baseSepolia, transport: http(RPC_URL) });
|
|
48
|
+
const walletClient = createWalletClient({
|
|
49
|
+
chain: baseSepolia,
|
|
50
|
+
transport: http(RPC_URL),
|
|
51
|
+
account: privateKeyToAccount(PRIVATE_KEY),
|
|
52
|
+
});
|
|
43
53
|
|
|
44
54
|
function App() {
|
|
45
55
|
return (
|
|
@@ -55,48 +65,62 @@ function App() {
|
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
function BuyFlow() {
|
|
68
|
+
const orders = useOrders();
|
|
58
69
|
const profile = useProfile();
|
|
59
|
-
const payload = usePayloadGenerator();
|
|
60
70
|
|
|
61
71
|
async function handleBuy() {
|
|
62
72
|
// 1. Check balance
|
|
63
73
|
const balances = await profile.getBalances({
|
|
64
|
-
|
|
74
|
+
address: "0xUser",
|
|
65
75
|
currency: "INR",
|
|
66
76
|
});
|
|
67
77
|
|
|
68
|
-
// 2.
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
orderType: 0, // BUY
|
|
78
|
+
// 2. Place a BUY order (SDK picks the circle, signs, submits, awaits the receipt)
|
|
79
|
+
const placed = await orders.placeOrder.execute({
|
|
80
|
+
walletClient,
|
|
81
|
+
waitForReceipt: true,
|
|
82
|
+
orderType: 0, // 0 = BUY, 1 = SELL, 2 = PAY
|
|
73
83
|
currency: "INR",
|
|
74
|
-
fiatAmount: parseUnits("850", 6),
|
|
75
84
|
user: "0xUser",
|
|
85
|
+
recipientAddr: "0xRecipient",
|
|
86
|
+
amount: parseUnits("10", 6),
|
|
87
|
+
fiatAmount: parseUnits("850", 6),
|
|
88
|
+
fiatAmountLimit: 0n,
|
|
76
89
|
});
|
|
77
90
|
|
|
78
|
-
|
|
79
|
-
(
|
|
80
|
-
(
|
|
91
|
+
placed.match(
|
|
92
|
+
({ hash, meta }) => console.log("Placed!", { hash, orderId: meta?.orderId }),
|
|
93
|
+
(err) => console.error(`[${err.code}] ${err.message}`),
|
|
81
94
|
);
|
|
82
95
|
}
|
|
83
96
|
}
|
|
84
97
|
```
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
SELL and PAY follow the same shape, but the Diamond pulls USDC via `transferFrom`, so you must approve first — call `orders.approveUsdc.execute({ amount })` (pre-flight the current allowance with `profile.getUsdcAllowance({ owner })` if you want to skip redundant approvals). After the order is accepted, call `orders.setSellOrderUpi.execute({...})` to hand off the (ECIES-encrypted) payment destination to the merchant.
|
|
100
|
+
|
|
101
|
+
See [example/](./example/) for runnable walkthroughs of each flow.
|
|
102
|
+
|
|
103
|
+
## Layered writes: `prepare` vs `execute`
|
|
104
|
+
|
|
105
|
+
Every write action exposes two methods:
|
|
106
|
+
|
|
107
|
+
- **`action.prepare(params)`** — returns a `ResultAsync<PreparedTx, OrdersError>`, where `PreparedTx` is `{ to, data, value, meta }`. No wallet needed. Use this for gasless relayers, multisigs, server-side signing, or anything not wagmi/viem.
|
|
108
|
+
- **`action.execute({ walletClient, waitForReceipt?, ...params })`** — `prepare()` + `walletClient.sendTransaction` + optional `waitForTransactionReceipt`. The fast path when you're signing directly with viem.
|
|
109
|
+
|
|
110
|
+
## React hooks
|
|
87
111
|
|
|
88
112
|
All hooks read from the nearest `<SdkProvider>`:
|
|
89
113
|
|
|
90
114
|
| Hook | Returns |
|
|
91
115
|
|------|---------|
|
|
92
|
-
| `useProfile()` | `Profile` — balance
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
116
|
+
| `useProfile()` | `Profile` — user-scoped balance & limits reads |
|
|
117
|
+
| `usePrices()` | `Prices` — currency price config reads |
|
|
118
|
+
| `useOrders()` | `OrdersClient` — order reads + write actions |
|
|
95
119
|
| `useZkkyc()` | `Zkkyc` — ZK verification (requires `reputationManagerAddress`) |
|
|
96
120
|
| `useFraudEngine()` | `FraudEngine` — fraud detection (requires `fraudEngine` config) |
|
|
97
121
|
| `useSdk()` | Full `Sdk` object |
|
|
98
122
|
|
|
99
|
-
## Order
|
|
123
|
+
## Order types
|
|
100
124
|
|
|
101
125
|
| Value | Type |
|
|
102
126
|
|-------|------|
|
|
@@ -104,9 +128,9 @@ All hooks read from the nearest `<SdkProvider>`:
|
|
|
104
128
|
| `1` | Sell |
|
|
105
129
|
| `2` | Pay |
|
|
106
130
|
|
|
107
|
-
## Supported
|
|
131
|
+
## Supported currencies
|
|
108
132
|
|
|
109
|
-
`INR`
|
|
133
|
+
`INR` · `IDR` · `BRL` · `ARS` · `MEX` · `VEN` · `EUR` · `NGN` · `USD` · `COP`
|
|
110
134
|
|
|
111
135
|
## Development
|
|
112
136
|
|
|
@@ -114,45 +138,51 @@ All hooks read from the nearest `<SdkProvider>`:
|
|
|
114
138
|
bun install # install dependencies
|
|
115
139
|
bun run build # tsup → ESM + CJS + DTS into dist/
|
|
116
140
|
bun run dev # tsup --watch
|
|
117
|
-
bun run typecheck # tsc --noEmit
|
|
141
|
+
bun run typecheck # tsc --noEmit (covers src/, test/, example/)
|
|
118
142
|
bun run lint # biome check src/
|
|
119
143
|
bun run test # vitest run
|
|
120
144
|
bun run size # show per-module bundle sizes
|
|
121
145
|
```
|
|
122
146
|
|
|
123
|
-
###
|
|
147
|
+
### Examples
|
|
148
|
+
|
|
149
|
+
Standalone scripts under [`example/`](./example/) — no Vite, no package.json, just .ts files with inline CONFIG blocks. Build the SDK once, then run any script directly:
|
|
124
150
|
|
|
125
151
|
```bash
|
|
126
|
-
|
|
127
|
-
bun
|
|
128
|
-
bun run
|
|
152
|
+
bun run build
|
|
153
|
+
bun run example/fetch-inr-price.ts
|
|
154
|
+
bun run example/make-buy-order.ts
|
|
155
|
+
# etc.
|
|
129
156
|
```
|
|
130
157
|
|
|
131
|
-
### Git
|
|
158
|
+
### Git hooks
|
|
132
159
|
|
|
133
160
|
- **pre-commit** — lint-staged (biome lint + format on staged files)
|
|
134
161
|
- **pre-push** — typecheck + build
|
|
135
162
|
|
|
136
163
|
### Release
|
|
137
164
|
|
|
138
|
-
Releases are published manually — there is no CI. See [docs/publishing.md](./docs/publishing.md)
|
|
165
|
+
Releases are published manually — there is no CI. See [docs/publishing.md](./docs/publishing.md).
|
|
139
166
|
|
|
140
167
|
```bash
|
|
141
168
|
bun run changeset # describe your change (run on feature branch)
|
|
142
169
|
bunx changeset version # bump version + update CHANGELOG (run on main after merge)
|
|
143
|
-
bun run release # build + publish to npm
|
|
170
|
+
bun run release # build + publish to npm
|
|
144
171
|
```
|
|
145
172
|
|
|
146
173
|
## Dependencies
|
|
147
174
|
|
|
148
175
|
| Package | Purpose |
|
|
149
176
|
|---------|---------|
|
|
150
|
-
| `viem` | Chain abstraction (address utils,
|
|
177
|
+
| `viem` | Chain abstraction (address utils, contract reads/writes, event decoding) |
|
|
151
178
|
| `neverthrow` | Result/ResultAsync types (no thrown exceptions) |
|
|
152
179
|
| `zod` v4 | Runtime validation at SDK boundaries |
|
|
153
180
|
| `@fingerprintjs/fingerprintjs` | Browser fingerprinting (fraud-engine) |
|
|
154
181
|
| `@seontechnologies/seon-javascript-sdk` | SEON behavioral signals (fraud-engine) |
|
|
155
|
-
| `
|
|
182
|
+
| `@noble/ciphers` · `@noble/curves` · `@noble/hashes` | ECIES + AES-GCM (bundled, not re-exported) |
|
|
183
|
+
| `react` | Optional peer (for `./react` export only) |
|
|
184
|
+
| `@reclaimprotocol/js-sdk` | Optional peer (for zkkyc Reclaim flow only) |
|
|
185
|
+
| `@zkpassport/sdk` | Optional peer (for zkkyc ZK Passport flow only) |
|
|
156
186
|
|
|
157
187
|
## License
|
|
158
188
|
|
package/dist/country.cjs
CHANGED
|
@@ -21,11 +21,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var country_exports = {};
|
|
22
22
|
__export(country_exports, {
|
|
23
23
|
COUNTRY_OPTIONS: () => COUNTRY_OPTIONS,
|
|
24
|
+
CURRENCY: () => CURRENCY,
|
|
25
|
+
CURRENCY_CODES: () => CURRENCY_CODES,
|
|
24
26
|
PAYMENT_ID_FIELDS: () => PAYMENT_ID_FIELDS,
|
|
25
27
|
deserializeCompoundPaymentId: () => deserializeCompoundPaymentId,
|
|
26
28
|
formatCompoundPaymentIdForDisplay: () => formatCompoundPaymentIdForDisplay,
|
|
27
29
|
serializeCompoundPaymentId: () => serializeCompoundPaymentId,
|
|
28
30
|
validateArgentinePaymentId: () => validateArgentinePaymentId,
|
|
31
|
+
validateColombianPaymentId: () => validateColombianPaymentId,
|
|
29
32
|
validateIndonesianPhoneNumber: () => validateIndonesianPhoneNumber,
|
|
30
33
|
validateMexicanPaymentId: () => validateMexicanPaymentId,
|
|
31
34
|
validateNigerianAccountNumber: () => validateNigerianAccountNumber,
|
|
@@ -37,7 +40,7 @@ __export(country_exports, {
|
|
|
37
40
|
});
|
|
38
41
|
module.exports = __toCommonJS(country_exports);
|
|
39
42
|
|
|
40
|
-
// src/
|
|
43
|
+
// src/country/currency.ts
|
|
41
44
|
var CURRENCY = {
|
|
42
45
|
IDR: "IDR",
|
|
43
46
|
INR: "INR",
|
|
@@ -50,6 +53,7 @@ var CURRENCY = {
|
|
|
50
53
|
USD: "USD",
|
|
51
54
|
COP: "COP"
|
|
52
55
|
};
|
|
56
|
+
var CURRENCY_CODES = Object.values(CURRENCY);
|
|
53
57
|
|
|
54
58
|
// src/country/currencies/ars.ts
|
|
55
59
|
var ARS_PLACEHOLDER = "juan.perez";
|
|
@@ -596,11 +600,14 @@ function formatCompoundPaymentIdForDisplay(paymentId, labels) {
|
|
|
596
600
|
// Annotate the CommonJS export names for ESM import in node:
|
|
597
601
|
0 && (module.exports = {
|
|
598
602
|
COUNTRY_OPTIONS,
|
|
603
|
+
CURRENCY,
|
|
604
|
+
CURRENCY_CODES,
|
|
599
605
|
PAYMENT_ID_FIELDS,
|
|
600
606
|
deserializeCompoundPaymentId,
|
|
601
607
|
formatCompoundPaymentIdForDisplay,
|
|
602
608
|
serializeCompoundPaymentId,
|
|
603
609
|
validateArgentinePaymentId,
|
|
610
|
+
validateColombianPaymentId,
|
|
604
611
|
validateIndonesianPhoneNumber,
|
|
605
612
|
validateMexicanPaymentId,
|
|
606
613
|
validateNigerianAccountNumber,
|
package/dist/country.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/country/index.ts","../src/constants/currencies.constant.ts","../src/country/currencies/ars.ts","../src/country/currencies/brl.ts","../src/country/currencies/cop.ts","../src/country/currencies/eur.ts","../src/country/currencies/idr.ts","../src/country/currencies/inr.ts","../src/country/currencies/mex.ts","../src/country/currencies/ngn.ts","../src/country/currencies/usd.ts","../src/country/currencies/ven.ts","../src/country/countries.ts","../src/country/payment-fields.ts","../src/country/validators.ts"],"sourcesContent":["// ── Constants ────────────────────────────────────────────────────────────\n\nexport { COUNTRY_OPTIONS } from \"./countries\";\nexport { PAYMENT_ID_FIELDS } from \"./payment-fields\";\n\n// ── Types ───────────────────────────────────────────────────────────────\n\nexport type { CountryOption, PaymentIdFieldConfig } from \"./types\";\n\n// ── Validators ──────────────────────────────────────────────────────────\n\nexport {\n\tdeserializeCompoundPaymentId,\n\tformatCompoundPaymentIdForDisplay,\n\tserializeCompoundPaymentId,\n\tvalidateArgentinePaymentId,\n\tvalidateIndonesianPhoneNumber,\n\tvalidateMexicanPaymentId,\n\tvalidateNigerianAccountNumber,\n\tvalidatePIXId,\n\tvalidateRevolutId,\n\tvalidateUPIId,\n\tvalidateVenezuelanPhoneNumber,\n\tvalidateVenezuelanRif,\n} from \"./validators\";\n","/** All supported currency symbols. Single source of truth for the SDK. */\nexport const CURRENCY = {\n\tIDR: \"IDR\",\n\tINR: \"INR\",\n\tBRL: \"BRL\",\n\tARS: \"ARS\",\n\tMEX: \"MEX\",\n\tVEN: \"VEN\",\n\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\n} as const;\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const ARS_PLACEHOLDER = \"juan.perez\";\nexport const ARS_VALIDATION_ERROR =\n\t\"Please enter a valid CBU/CVU (22 digits) or Alias (6-20 characters)\";\n\n/** Validates CBU (Clave Bancaria Uniforme) — Argentine banking key, 22 digits with checksums. */\nfunction validateCBU(cbu: string): boolean {\n\tif (cbu.length !== 22) return false;\n\tif (/^(\\d)\\1{21}$/.test(cbu)) return false;\n\n\tconst bankCode = cbu.substring(0, 7);\n\tconst bankCheckDigit = parseInt(cbu[7], 10);\n\tlet sum = 0;\n\tconst weights = [7, 1, 3, 9, 7, 1, 3];\n\tfor (let i = 0; i < 7; i++) {\n\t\tsum += parseInt(bankCode[i], 10) * weights[i];\n\t}\n\tconst calculatedBankCheck = (10 - (sum % 10)) % 10;\n\tif (bankCheckDigit !== calculatedBankCheck) return false;\n\n\tconst accountNumber = cbu.substring(8, 21);\n\tconst accountCheckDigit = parseInt(cbu[21], 10);\n\tsum = 0;\n\tconst accountWeights = [3, 9, 7, 1, 3, 9, 7, 1, 3, 9, 7, 1, 3];\n\tfor (let i = 0; i < 13; i++) {\n\t\tsum += parseInt(accountNumber[i], 10) * accountWeights[i];\n\t}\n\tconst calculatedAccountCheck = (10 - (sum % 10)) % 10;\n\tif (accountCheckDigit !== calculatedAccountCheck) return false;\n\n\treturn true;\n}\n\n/**\n * Validates Argentine payment IDs (CBU, CVU, or Alias).\n * CBU/CVU: 22 digits with checksum. Alias: 6-20 alphanumeric characters.\n */\nexport function validateArgentinePaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\n\tconst trimmedPaymentId = paymentId.trim();\n\n\tif (/^\\d{22}$/.test(trimmedPaymentId)) return validateCBU(trimmedPaymentId);\n\tif (/^[a-zA-Z0-9.\\-_]{6,20}$/.test(trimmedPaymentId)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for ARS (Argentina, ALIAS). */\nexport const ARS_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"alias\",\n\t\tlabel: \"ALIAS_ID\",\n\t\tplaceholder: ARS_PLACEHOLDER,\n\t\tdisplayLabel: \"Alias\",\n\t\tvalidate: validateArgentinePaymentId,\n\t\tvalidationErrorMessage: ARS_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Argentina (ARS). */\nexport const ARS_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Argentina\",\n\tcurrency: CURRENCY.ARS,\n\tsymbolNative: \"$\",\n\tlocale: \"es-AR\",\n\tpaymentMethod: \"ALIAS\",\n\tpaymentAddressName: \"ALIAS_ID\",\n\ttimezone: \"America/Argentina/Buenos_Aires\",\n\ttimezone_name: \"ART\",\n\tflag: \"🇦🇷\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e6-1f1f7.png\",\n\tphoneCode: \"+54\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeargentina\",\n\ttwitterUsername: \"p2pmeargentina\",\n\tsmsCountryCodes: [\"AR\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const BRL_PLACEHOLDER = \"Chave pix ou pix copia e cola\";\nexport const BRL_VALIDATION_ERROR = \"Please enter a valid PIX ID\";\n\n/** Validates CPF (Brazilian tax ID for individuals). */\nfunction validateCPF(cpf: string): boolean {\n\tif (cpf.length !== 11) return false;\n\tif (/^(\\d)\\1{10}$/.test(cpf)) return false;\n\n\tlet sum = 0;\n\tfor (let i = 0; i < 9; i++) {\n\t\tsum += parseInt(cpf[i], 10) * (10 - i);\n\t}\n\tlet remainder = sum % 11;\n\tconst firstDigit = remainder < 2 ? 0 : 11 - remainder;\n\tif (parseInt(cpf[9], 10) !== firstDigit) return false;\n\n\tsum = 0;\n\tfor (let i = 0; i < 10; i++) {\n\t\tsum += parseInt(cpf[i], 10) * (11 - i);\n\t}\n\tremainder = sum % 11;\n\tconst secondDigit = remainder < 2 ? 0 : 11 - remainder;\n\treturn parseInt(cpf[10], 10) === secondDigit;\n}\n\n/** Validates CNPJ (Brazilian tax ID for companies). */\nfunction validateCNPJ(cnpj: string): boolean {\n\tif (cnpj.length !== 14) return false;\n\tif (/^(\\d)\\1{13}$/.test(cnpj)) return false;\n\n\tlet sum = 0;\n\tconst weights1 = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];\n\tfor (let i = 0; i < 12; i++) {\n\t\tsum += parseInt(cnpj[i], 10) * weights1[i];\n\t}\n\tlet remainder = sum % 11;\n\tconst firstDigit = remainder < 2 ? 0 : 11 - remainder;\n\tif (parseInt(cnpj[12], 10) !== firstDigit) return false;\n\n\tsum = 0;\n\tconst weights2 = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];\n\tfor (let i = 0; i < 13; i++) {\n\t\tsum += parseInt(cnpj[i], 10) * weights2[i];\n\t}\n\tremainder = sum % 11;\n\tconst secondDigit = remainder < 2 ? 0 : 11 - remainder;\n\treturn parseInt(cnpj[13], 10) === secondDigit;\n}\n\n/**\n * Validates PIX ID format.\n * PIX can be: CPF (11 digits), CNPJ (14 digits), email, phone (10–11 digits or E.164),\n * random key (UUID), or a PIX \"copia e cola\" EMV QR payload (starts with 000201).\n */\nexport function validatePIXId(pixId: string): boolean {\n\tif (!pixId || pixId.trim().length === 0) return false;\n\n\tconst trimmedPixId = pixId.trim();\n\n\t// PIX \"copia e cola\" — EMV QR code payload\n\tif (/^000201/.test(trimmedPixId)) return true;\n\n\t// 11 digits: valid CPF or Brazilian mobile phone key (DDD 11–99 + digit 9 + 8 digits)\n\tif (/^\\d{11}$/.test(trimmedPixId))\n\t\treturn validateCPF(trimmedPixId) || /^[1-9][1-9]9\\d{8}$/.test(trimmedPixId);\n\tif (/^\\d{14}$/.test(trimmedPixId)) return validateCNPJ(trimmedPixId);\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmedPixId)) return true;\n\t// Phone key: 10–11 digits (with or without country code prefix)\n\tif (/^\\d{10,11}$/.test(trimmedPixId)) return true;\n\tif (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(trimmedPixId))\n\t\treturn true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for BRL (Brazil, PIX). */\nexport const BRL_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"pix\",\n\t\tlabel: \"PIX_ID\",\n\t\tplaceholder: BRL_PLACEHOLDER,\n\t\tdisplayLabel: \"PIX ID\",\n\t\tvalidate: validatePIXId,\n\t\tvalidationErrorMessage: BRL_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Brazil (BRL). */\nexport const BRL_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Brazil\",\n\tcurrency: CURRENCY.BRL,\n\tsymbolNative: \"R$\",\n\tlocale: \"pt-BR\",\n\tpaymentMethod: \"PIX\",\n\tpaymentAddressName: \"PIX_ID\",\n\ttimezone: \"America/Sao_Paulo\",\n\ttimezone_name: \"BRT\",\n\tflag: \"🇧🇷\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e7-1f1f7.png\",\n\tphoneCode: \"+55\",\n\ttelegramSupportChannel: \"https://t.me/p2pmebrasil\",\n\ttwitterUsername: \"p2pmebrasil\",\n\tsmsCountryCodes: [\"BR\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const COP_PLACEHOLDER = \"juan.perez@nequi.com.co\";\nexport const COP_VALIDATION_ERROR =\n\t\"Please enter a valid Nequi or Daviplata ID (e.g., 3001234567 or email)\";\n\n/**\n * Validates Colombian payment ID for Nequi or Daviplata.\n * Accepts a 10-digit phone number starting with 3, or a valid email address.\n */\nexport function validateColombianPaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\tconst trimmed = paymentId.trim();\n\tif (/^3\\d{9}$/.test(trimmed)) return true;\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmed)) return true;\n\treturn false;\n}\n\n/** Payment ID field configuration for COP (Colombia, Transferencia). */\nexport const COP_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"alias\",\n\t\tlabel: \"ALIAS_TRANSFERENCIA\",\n\t\tplaceholder: COP_PLACEHOLDER,\n\t\tdisplayLabel: \"Nequi / Daviplata\",\n\t\tvalidate: validateColombianPaymentId,\n\t\tvalidationErrorMessage: COP_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Colombia (COP). */\nexport const COP_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Colombia\",\n\tcurrency: CURRENCY.COP,\n\tsymbolNative: \"$\",\n\tlocale: \"es-CO\",\n\tpaymentMethod: \"TRANSFERENCIA\",\n\tpaymentAddressName: \"ALIAS_TRANSFERENCIA\",\n\ttimezone: \"America/Bogota\",\n\ttimezone_name: \"COT\",\n\tflag: \"🇨🇴\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e8-1f1f4.png\",\n\tphoneCode: \"+57\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeColombia\",\n\ttwitterUsername: \"p2pmeColombia\",\n\tsmsCountryCodes: [\"CO\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const EUR_PLACEHOLDER = \"@username or email\";\nexport const EUR_VALIDATION_ERROR = \"Please enter a valid Revolut ID (username, email, or phone)\";\n\n/**\n * Validates Revolut ID (username, email, or phone number).\n */\nexport function validateRevolutId(revolutId: string): boolean {\n\tif (!revolutId || revolutId.trim().length === 0) return false;\n\n\tconst trimmed = revolutId.trim();\n\n\tif (/^@?[a-zA-Z0-9._-]{3,30}$/.test(trimmed)) return true;\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmed)) return true;\n\tif (/^\\+?\\d{7,15}$/.test(trimmed)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for EUR (Revolut EUR). */\nexport const EUR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"revolut\",\n\t\tlabel: \"REVOLUT_ID\",\n\t\tplaceholder: EUR_PLACEHOLDER,\n\t\tdisplayLabel: \"Revolut ID\",\n\t\tvalidate: validateRevolutId,\n\t\tvalidationErrorMessage: EUR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Revolut EUR. */\nexport const EUR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Revolut EUR\",\n\tcurrency: CURRENCY.EUR,\n\tsymbolNative: \"€\",\n\tlocale: \"de-DE\",\n\tpaymentMethod: \"REVOLUT\",\n\tpaymentAddressName: \"REVOLUT_ID\",\n\ttimezone: \"Europe/Berlin\",\n\ttimezone_name: \"CET\",\n\tflag: \"\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f310.png\",\n\tphoneCode: \"\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const IDR_PLACEHOLDER = \"8123456789\";\nexport const IDR_VALIDATION_ERROR =\n\t\"Please enter a valid Indonesian phone number (e.g., 8123456789)\";\n\n/**\n * Validates Indonesian phone number.\n * Validates just the number part (9-12 digits).\n */\nexport function validateIndonesianPhoneNumber(phoneNumber: string): boolean {\n\tif (!phoneNumber || phoneNumber.trim().length === 0) return false;\n\tif (/[a-zA-Z]/.test(phoneNumber)) return false;\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\treturn /^\\d{9,12}$/.test(cleaned);\n}\n\n/** Payment ID field configuration for IDR (Indonesia, QRIS). */\nexport const IDR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"phone\",\n\t\tlabel: \"PHONE_NUMBER\",\n\t\tplaceholder: IDR_PLACEHOLDER,\n\t\tdisplayLabel: \"Phone Number\",\n\t\tvalidate: validateIndonesianPhoneNumber,\n\t\tvalidationErrorMessage: IDR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Indonesia (IDR). */\nexport const IDR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Indonesia\",\n\tcurrency: CURRENCY.IDR,\n\tsymbolNative: \"Rp\",\n\tlocale: \"id-ID\",\n\tpaymentMethod: \"QRIS\",\n\tpaymentAddressName: \"PHONE_NUMBER\",\n\ttimezone: \"Asia/Jakarta\",\n\ttimezone_name: \"WIB\",\n\tflag: \"🇮🇩\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1ee-1f1e9.png\",\n\tphoneCode: \"+62\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeindonesia\",\n\ttwitterUsername: \"p2pdotmeID\",\n\tsmsCountryCodes: [],\n\tprecision: 0,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const INR_PLACEHOLDER = \"merchant@upi\";\nexport const INR_VALIDATION_ERROR = \"Please enter a valid UPI ID (e.g., username@bankname)\";\n\n/**\n * Validates UPI ID format.\n * UPI ID format: username@bankname (e.g., john@paytm, user@ybl, 8658404239@kotak811)\n */\nexport function validateUPIId(upiId: string): boolean {\n\tif (!upiId || upiId.trim().length === 0) return false;\n\tconst upiRegex = /^[a-zA-Z0-9.\\-_]{2,256}@[a-zA-Z0-9]{2,64}$/;\n\treturn upiRegex.test(upiId.trim());\n}\n\n/** Payment ID field configuration for INR (India, UPI). */\nexport const INR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"upi\",\n\t\tlabel: \"UPI_ID\",\n\t\tplaceholder: INR_PLACEHOLDER,\n\t\tdisplayLabel: \"UPI ID\",\n\t\tvalidate: validateUPIId,\n\t\tvalidationErrorMessage: INR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for India (INR). */\nexport const INR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"India\",\n\tcurrency: CURRENCY.INR,\n\tsymbolNative: \"₹\",\n\tlocale: \"en-IN\",\n\tpaymentMethod: \"UPI\",\n\tpaymentAddressName: \"UPI_ID\",\n\ttimezone: \"Asia/Kolkata\",\n\ttimezone_name: \"IST\",\n\tflag: \"🇮🇳\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1ee-1f1f3.png\",\n\tphoneCode: \"+91\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [\"IN\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const MEX_PLACEHOLDER = \"012345678901234567\";\nexport const MEX_VALIDATION_ERROR =\n\t\"Please enter a valid CLABE (18 digits), card number, or phone number\";\n\n/**\n * Validates Mexican payment IDs (CLABE, card number, or phone number).\n * CLABE: 18 digits. Card: 16 digits. Phone: 10 digits.\n */\nexport function validateMexicanPaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\n\tconst trimmed = paymentId.trim().replace(/\\D/g, \"\");\n\n\tif (/^\\d{18}$/.test(trimmed)) return true;\n\tif (/^\\d{16}$/.test(trimmed)) return true;\n\tif (/^\\d{10}$/.test(trimmed)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for MEX (Mexico, SPEI). */\nexport const MEX_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"clabe\",\n\t\tlabel: \"CLABE_ID\",\n\t\tplaceholder: MEX_PLACEHOLDER,\n\t\tdisplayLabel: \"CLABE\",\n\t\tvalidate: validateMexicanPaymentId,\n\t\tvalidationErrorMessage: MEX_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Mexico (MEX). */\nexport const MEX_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Mexico\",\n\tcurrency: CURRENCY.MEX,\n\tinternationalFormat: \"MXN\",\n\tsymbolNative: \"Mx\",\n\tlocale: \"es-MX\",\n\tpaymentMethod: \"SPEI\",\n\tpaymentAddressName: \"CLABE_ID\",\n\ttimezone: \"America/Mexico_City\",\n\ttimezone_name: \"CST\",\n\tflag: \"🇲🇽\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1f2-1f1fd.png\",\n\tphoneCode: \"+52\",\n\ttelegramSupportChannel: \"https://t.me/p2pmemexico\",\n\ttwitterUsername: \"p2pmemexico\",\n\tsmsCountryCodes: [\"MX\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const NGN_PLACEHOLDER = \"0123456789\";\nexport const NGN_PLACEHOLDER_BANK = \"Bank Name\";\nexport const NGN_VALIDATION_ERROR = \"Please enter a valid 10-digit account number\";\n\n/**\n * Validates Nigerian bank account number (NUBAN format, 10 digits).\n */\nexport function validateNigerianAccountNumber(accountNumber: string): boolean {\n\tif (!accountNumber || accountNumber.trim().length === 0) return false;\n\tconst cleaned = accountNumber.trim().replace(/\\D/g, \"\");\n\treturn /^\\d{10}$/.test(cleaned);\n}\n\n/** Payment ID field configuration for NGN (Nigeria, NIP). */\nexport const NGN_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"account\",\n\t\tlabel: \"ACCOUNT_NUMBER\",\n\t\tplaceholder: NGN_PLACEHOLDER,\n\t\tdisplayLabel: \"Account Number\",\n\t\tvalidate: validateNigerianAccountNumber,\n\t\tvalidationErrorMessage: NGN_VALIDATION_ERROR,\n\t},\n\t{\n\t\tkey: \"bank-name\",\n\t\tlabel: \"BANK_NAME\",\n\t\tplaceholder: NGN_PLACEHOLDER_BANK,\n\t\tdisplayLabel: \"Bank Name\",\n\t\tvalidate: (v: string) => v.trim().length > 0,\n\t\tvalidationErrorMessage: NGN_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Nigeria (NGN). */\nexport const NGN_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Nigeria\",\n\tcurrency: CURRENCY.NGN,\n\tsymbolNative: \"₦\",\n\tlocale: \"en-NG\",\n\tpaymentMethod: \"NIP\",\n\tpaymentAddressName: \"ACCOUNT_NUMBER\",\n\ttimezone: \"Africa/Lagos\",\n\ttimezone_name: \"WAT\",\n\tflag: \"🇳🇬\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1f3-1f1ec.png\",\n\tphoneCode: \"+234\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeNigeria\",\n\ttwitterUsername: \"p2pmeNigeria\",\n\tsmsCountryCodes: [\"NG\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\nimport { EUR_PLACEHOLDER, EUR_VALIDATION_ERROR, validateRevolutId } from \"./eur\";\n\nexport const USD_PLACEHOLDER = EUR_PLACEHOLDER;\nexport const USD_VALIDATION_ERROR = EUR_VALIDATION_ERROR;\n\n/** Payment ID field configuration for USD (Revolut USD). */\nexport const USD_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"revolut\",\n\t\tlabel: \"REVOLUT_ID\",\n\t\tplaceholder: USD_PLACEHOLDER,\n\t\tdisplayLabel: \"Revolut ID\",\n\t\tvalidate: validateRevolutId,\n\t\tvalidationErrorMessage: USD_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Revolut USD. */\nexport const USD_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Revolut USD\",\n\tcurrency: CURRENCY.USD,\n\tsymbolNative: \"$\",\n\tlocale: \"en-US\",\n\tpaymentMethod: \"REVOLUT\",\n\tpaymentAddressName: \"REVOLUT_ID\",\n\ttimezone: \"America/New_York\",\n\ttimezone_name: \"EST\",\n\tflag: \"\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f310.png\",\n\tphoneCode: \"+1\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [\"US\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../../constants\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const VEN_PLACEHOLDER = \"04121234567\";\nexport const VEN_PLACEHOLDER_RIF = \"V12345678\";\nexport const VEN_PLACEHOLDER_BANK = \"Banesco\";\n\nexport const VEN_VALIDATION_ERROR = \"Please enter a valid phone number (e.g., 04121234567)\";\nexport const VEN_VALIDATION_ERROR_RIF = \"Please enter a valid RIF (e.g., V12345678)\";\nexport const VEN_VALIDATION_ERROR_BANK = \"Please enter a bank name\";\n\n/**\n * Validates Venezuelan phone number for Pago Movil.\n * Format: 04XX-XXXXXXX (11 digits starting with 04).\n */\nexport function validateVenezuelanPhoneNumber(phoneNumber: string): boolean {\n\tif (!phoneNumber || phoneNumber.trim().length === 0) return false;\n\n\tconst cleaned = phoneNumber.trim().replace(/\\D/g, \"\");\n\n\tif (/^04\\d{9}$/.test(cleaned)) return true;\n\tif (/^4\\d{9}$/.test(cleaned)) return true;\n\n\treturn false;\n}\n\n/**\n * Validates Venezuelan RIF (Registro de Informacion Fiscal).\n * Format: One letter (J/V/E/G/C) followed by 7-9 digits.\n */\nexport function validateVenezuelanRif(rif: string): boolean {\n\tif (!rif || rif.trim().length === 0) return false;\n\tconst trimmed = rif.trim().toUpperCase();\n\treturn /^[JVEGC]\\d{7,9}$/.test(trimmed);\n}\n\n/** Payment ID field configuration for VEN (Venezuela, Pago Móvil). */\nexport const VEN_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"phone\",\n\t\tlabel: \"PHONE_NUMBER\",\n\t\tplaceholder: VEN_PLACEHOLDER,\n\t\tdisplayLabel: \"Phone\",\n\t\tvalidate: validateVenezuelanPhoneNumber,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR,\n\t},\n\t{\n\t\tkey: \"rif\",\n\t\tlabel: \"RIF_LABEL\",\n\t\tplaceholder: VEN_PLACEHOLDER_RIF,\n\t\tdisplayLabel: \"RIF\",\n\t\tvalidate: validateVenezuelanRif,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR_RIF,\n\t},\n\t{\n\t\tkey: \"bank\",\n\t\tlabel: \"BANK_LABEL\",\n\t\tplaceholder: VEN_PLACEHOLDER_BANK,\n\t\tdisplayLabel: \"Banco\",\n\t\tvalidate: (v: string) => v.trim().length > 0,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR_BANK,\n\t},\n];\n\n/** Country option for Venezuela (VEN). */\nexport const VEN_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Venezuela\",\n\tcurrency: CURRENCY.VEN,\n\tinternationalFormat: \"VES\",\n\tsymbolNative: \"Bs\",\n\tlocale: \"es-VE\",\n\tpaymentMethod: \"PAGO_MOVIL\",\n\tpaymentAddressName: \"PAGO_MOVIL_DETAILS\",\n\ttimezone: \"America/Caracas\",\n\ttimezone_name: \"VET\",\n\tflag: \"🇻🇪\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1fb-1f1ea.png\",\n\tphoneCode: \"+58\",\n\ttelegramSupportChannel: \"https://t.me/p2pmevenezuela\",\n\ttwitterUsername: \"p2pmevenezuela\",\n\tsmsCountryCodes: [\"VE\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import {\n\tARS_COUNTRY_OPTION,\n\tBRL_COUNTRY_OPTION,\n\tCOP_COUNTRY_OPTION,\n\tEUR_COUNTRY_OPTION,\n\tIDR_COUNTRY_OPTION,\n\tINR_COUNTRY_OPTION,\n\tMEX_COUNTRY_OPTION,\n\tNGN_COUNTRY_OPTION,\n\tUSD_COUNTRY_OPTION,\n\tVEN_COUNTRY_OPTION,\n} from \"./currencies\";\nimport type { CountryOption } from \"./types\";\n\n/** All supported countries with their currency metadata, payment methods, and display config. */\nexport const COUNTRY_OPTIONS: readonly CountryOption[] = [\n\tINR_COUNTRY_OPTION,\n\tIDR_COUNTRY_OPTION,\n\tBRL_COUNTRY_OPTION,\n\tARS_COUNTRY_OPTION,\n\tMEX_COUNTRY_OPTION,\n\tVEN_COUNTRY_OPTION,\n\tNGN_COUNTRY_OPTION,\n\tCOP_COUNTRY_OPTION,\n\tEUR_COUNTRY_OPTION,\n\tUSD_COUNTRY_OPTION,\n];\n","import type { CurrencyType } from \"../types\";\nimport {\n\tARS_PAYMENT_FIELDS,\n\tBRL_PAYMENT_FIELDS,\n\tCOP_PAYMENT_FIELDS,\n\tEUR_PAYMENT_FIELDS,\n\tIDR_PAYMENT_FIELDS,\n\tINR_PAYMENT_FIELDS,\n\tMEX_PAYMENT_FIELDS,\n\tNGN_PAYMENT_FIELDS,\n\tUSD_PAYMENT_FIELDS,\n\tVEN_PAYMENT_FIELDS,\n} from \"./currencies\";\nimport type { PaymentIdFieldConfig } from \"./types\";\n\n/** Payment ID field configuration for each supported currency. */\nexport const PAYMENT_ID_FIELDS: Record<CurrencyType, PaymentIdFieldConfig[]> = {\n\tINR: INR_PAYMENT_FIELDS,\n\tIDR: IDR_PAYMENT_FIELDS,\n\tBRL: BRL_PAYMENT_FIELDS,\n\tARS: ARS_PAYMENT_FIELDS,\n\tMEX: MEX_PAYMENT_FIELDS,\n\tVEN: VEN_PAYMENT_FIELDS,\n\tNGN: NGN_PAYMENT_FIELDS,\n\tEUR: EUR_PAYMENT_FIELDS,\n\tUSD: USD_PAYMENT_FIELDS,\n\tCOP: COP_PAYMENT_FIELDS,\n};\n","export {\n\tvalidateArgentinePaymentId,\n\tvalidateColombianPaymentId,\n\tvalidateIndonesianPhoneNumber,\n\tvalidateMexicanPaymentId,\n\tvalidateNigerianAccountNumber,\n\tvalidatePIXId,\n\tvalidateRevolutId,\n\tvalidateUPIId,\n\tvalidateVenezuelanPhoneNumber,\n\tvalidateVenezuelanRif,\n} from \"./currencies\";\n\n/** Serializes multiple fields into a pipe-separated string. */\nexport function serializeCompoundPaymentId(...fields: string[]): string {\n\treturn fields.join(\"|\");\n}\n\n/** Deserializes a pipe-separated payment ID into its component fields. */\nexport function deserializeCompoundPaymentId(paymentId: string): string[] {\n\treturn paymentId.split(\"|\");\n}\n\n/**\n * Formats a compound payment ID for display using optional labels.\n * Fields without a label are shown as-is, fields with a label are shown as \"Label: value\".\n */\nexport function formatCompoundPaymentIdForDisplay(\n\tpaymentId: string,\n\tlabels: (string | null)[],\n): string {\n\tconst parts = de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AAAA,EACzB;AACD;AAGO,IAAM,qBAAoC;AAAA,EAChD,SAAS;AAAA,EACT,UAAU,SAAS;AAAA,EACnB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,eAAe;AAAA,EACf,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,wBAAwB;AAAA,EACxB,iBAAiB;AAAA,EACjB,iBAAiB,CAAC,IAAI;AAAA,EACtB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,sBAAsB,CAAC;AACxB;;;ACtEO,IAAM,kBAA4C;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;;;ACVO,IAAM,oBAAkE;AAAA,EAC9E,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACN;;;ACbO,SAAS,8BAA8B,QAA0B;AACvE,SAAO,OAAO,KAAK,GAAG;AACvB;AAGO,SAAS,6BAA6B,WAA6B;AACzE,SAAO,UAAU,MAAM,GAAG;AAC3B;AAMO,SAAS,kCACf,WACA,QACS;AACT,QAAM,QAAQ,6BAA6B,SAAS;AACpD,SAAO,MAAM,IAAI,CAAC,MAAM,MAAO,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,IAAK,EAAE,KAAK,KAAK;AACvF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/country/index.ts","../src/country/currency.ts","../src/country/currencies/ars.ts","../src/country/currencies/brl.ts","../src/country/currencies/cop.ts","../src/country/currencies/eur.ts","../src/country/currencies/idr.ts","../src/country/currencies/inr.ts","../src/country/currencies/mex.ts","../src/country/currencies/ngn.ts","../src/country/currencies/usd.ts","../src/country/currencies/ven.ts","../src/country/countries.ts","../src/country/payment-fields.ts","../src/country/validators.ts"],"sourcesContent":["// ── Constants ────────────────────────────────────────────────────────────\n\nexport { COUNTRY_OPTIONS } from \"./countries\";\nexport { CURRENCY, CURRENCY_CODES } from \"./currency\";\nexport { PAYMENT_ID_FIELDS } from \"./payment-fields\";\n\n// ── Types ───────────────────────────────────────────────────────────────\n\nexport type { CurrencyCode } from \"./currency\";\nexport type { CountryOption, PaymentIdFieldConfig } from \"./types\";\n\n// ── Validators ──────────────────────────────────────────────────────────\n\nexport {\n\tdeserializeCompoundPaymentId,\n\tformatCompoundPaymentIdForDisplay,\n\tserializeCompoundPaymentId,\n\tvalidateArgentinePaymentId,\n\tvalidateColombianPaymentId,\n\tvalidateIndonesianPhoneNumber,\n\tvalidateMexicanPaymentId,\n\tvalidateNigerianAccountNumber,\n\tvalidatePIXId,\n\tvalidateRevolutId,\n\tvalidateUPIId,\n\tvalidateVenezuelanPhoneNumber,\n\tvalidateVenezuelanRif,\n} from \"./validators\";\n","/**\n * All supported currency symbols. Single source of truth for the SDK.\n *\n * Lives alongside the country metadata so that adding a currency is a\n * single-folder operation: drop a new file in `currencies/<code>.ts`, add it\n * to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up.\n */\nexport const CURRENCY = {\n\tIDR: \"IDR\",\n\tINR: \"INR\",\n\tBRL: \"BRL\",\n\tARS: \"ARS\",\n\tMEX: \"MEX\",\n\tVEN: \"VEN\",\n\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\n} as const;\n\n/** Union of supported currency codes. */\nexport type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY];\n\n/**\n * Tuple form of the currency codes — used by `z.enum(...)` in the shared\n * validation layer. Narrow tuple type required by Zod.\n */\nexport const CURRENCY_CODES = Object.values(CURRENCY) as [CurrencyCode, ...CurrencyCode[]];\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const ARS_PLACEHOLDER = \"juan.perez\";\nexport const ARS_VALIDATION_ERROR =\n\t\"Please enter a valid CBU/CVU (22 digits) or Alias (6-20 characters)\";\n\n/** Validates CBU (Clave Bancaria Uniforme) — Argentine banking key, 22 digits with checksums. */\nfunction validateCBU(cbu: string): boolean {\n\tif (cbu.length !== 22) return false;\n\tif (/^(\\d)\\1{21}$/.test(cbu)) return false;\n\n\tconst bankCode = cbu.substring(0, 7);\n\tconst bankCheckDigit = parseInt(cbu[7], 10);\n\tlet sum = 0;\n\tconst weights = [7, 1, 3, 9, 7, 1, 3];\n\tfor (let i = 0; i < 7; i++) {\n\t\tsum += parseInt(bankCode[i], 10) * weights[i];\n\t}\n\tconst calculatedBankCheck = (10 - (sum % 10)) % 10;\n\tif (bankCheckDigit !== calculatedBankCheck) return false;\n\n\tconst accountNumber = cbu.substring(8, 21);\n\tconst accountCheckDigit = parseInt(cbu[21], 10);\n\tsum = 0;\n\tconst accountWeights = [3, 9, 7, 1, 3, 9, 7, 1, 3, 9, 7, 1, 3];\n\tfor (let i = 0; i < 13; i++) {\n\t\tsum += parseInt(accountNumber[i], 10) * accountWeights[i];\n\t}\n\tconst calculatedAccountCheck = (10 - (sum % 10)) % 10;\n\tif (accountCheckDigit !== calculatedAccountCheck) return false;\n\n\treturn true;\n}\n\n/**\n * Validates Argentine payment IDs (CBU, CVU, or Alias).\n * CBU/CVU: 22 digits with checksum. Alias: 6-20 alphanumeric characters.\n */\nexport function validateArgentinePaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\n\tconst trimmedPaymentId = paymentId.trim();\n\n\tif (/^\\d{22}$/.test(trimmedPaymentId)) return validateCBU(trimmedPaymentId);\n\tif (/^[a-zA-Z0-9.\\-_]{6,20}$/.test(trimmedPaymentId)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for ARS (Argentina, ALIAS). */\nexport const ARS_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"alias\",\n\t\tlabel: \"ALIAS_ID\",\n\t\tplaceholder: ARS_PLACEHOLDER,\n\t\tdisplayLabel: \"Alias\",\n\t\tvalidate: validateArgentinePaymentId,\n\t\tvalidationErrorMessage: ARS_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Argentina (ARS). */\nexport const ARS_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Argentina\",\n\tcurrency: CURRENCY.ARS,\n\tsymbolNative: \"$\",\n\tlocale: \"es-AR\",\n\tpaymentMethod: \"ALIAS\",\n\tpaymentAddressName: \"ALIAS_ID\",\n\ttimezone: \"America/Argentina/Buenos_Aires\",\n\ttimezone_name: \"ART\",\n\tflag: \"🇦🇷\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e6-1f1f7.png\",\n\tphoneCode: \"+54\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeargentina\",\n\ttwitterUsername: \"p2pmeargentina\",\n\tsmsCountryCodes: [\"AR\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const BRL_PLACEHOLDER = \"Chave pix ou pix copia e cola\";\nexport const BRL_VALIDATION_ERROR = \"Please enter a valid PIX ID\";\n\n/** Validates CPF (Brazilian tax ID for individuals). */\nfunction validateCPF(cpf: string): boolean {\n\tif (cpf.length !== 11) return false;\n\tif (/^(\\d)\\1{10}$/.test(cpf)) return false;\n\n\tlet sum = 0;\n\tfor (let i = 0; i < 9; i++) {\n\t\tsum += parseInt(cpf[i], 10) * (10 - i);\n\t}\n\tlet remainder = sum % 11;\n\tconst firstDigit = remainder < 2 ? 0 : 11 - remainder;\n\tif (parseInt(cpf[9], 10) !== firstDigit) return false;\n\n\tsum = 0;\n\tfor (let i = 0; i < 10; i++) {\n\t\tsum += parseInt(cpf[i], 10) * (11 - i);\n\t}\n\tremainder = sum % 11;\n\tconst secondDigit = remainder < 2 ? 0 : 11 - remainder;\n\treturn parseInt(cpf[10], 10) === secondDigit;\n}\n\n/** Validates CNPJ (Brazilian tax ID for companies). */\nfunction validateCNPJ(cnpj: string): boolean {\n\tif (cnpj.length !== 14) return false;\n\tif (/^(\\d)\\1{13}$/.test(cnpj)) return false;\n\n\tlet sum = 0;\n\tconst weights1 = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];\n\tfor (let i = 0; i < 12; i++) {\n\t\tsum += parseInt(cnpj[i], 10) * weights1[i];\n\t}\n\tlet remainder = sum % 11;\n\tconst firstDigit = remainder < 2 ? 0 : 11 - remainder;\n\tif (parseInt(cnpj[12], 10) !== firstDigit) return false;\n\n\tsum = 0;\n\tconst weights2 = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];\n\tfor (let i = 0; i < 13; i++) {\n\t\tsum += parseInt(cnpj[i], 10) * weights2[i];\n\t}\n\tremainder = sum % 11;\n\tconst secondDigit = remainder < 2 ? 0 : 11 - remainder;\n\treturn parseInt(cnpj[13], 10) === secondDigit;\n}\n\n/**\n * Validates PIX ID format.\n * PIX can be: CPF (11 digits), CNPJ (14 digits), email, phone (10–11 digits or E.164),\n * random key (UUID), or a PIX \"copia e cola\" EMV QR payload (starts with 000201).\n */\nexport function validatePIXId(pixId: string): boolean {\n\tif (!pixId || pixId.trim().length === 0) return false;\n\n\tconst trimmedPixId = pixId.trim();\n\n\t// PIX \"copia e cola\" — EMV QR code payload\n\tif (/^000201/.test(trimmedPixId)) return true;\n\n\t// 11 digits: valid CPF or Brazilian mobile phone key (DDD 11–99 + digit 9 + 8 digits)\n\tif (/^\\d{11}$/.test(trimmedPixId))\n\t\treturn validateCPF(trimmedPixId) || /^[1-9][1-9]9\\d{8}$/.test(trimmedPixId);\n\tif (/^\\d{14}$/.test(trimmedPixId)) return validateCNPJ(trimmedPixId);\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmedPixId)) return true;\n\t// Phone key: 10–11 digits (with or without country code prefix)\n\tif (/^\\d{10,11}$/.test(trimmedPixId)) return true;\n\tif (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(trimmedPixId))\n\t\treturn true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for BRL (Brazil, PIX). */\nexport const BRL_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"pix\",\n\t\tlabel: \"PIX_ID\",\n\t\tplaceholder: BRL_PLACEHOLDER,\n\t\tdisplayLabel: \"PIX ID\",\n\t\tvalidate: validatePIXId,\n\t\tvalidationErrorMessage: BRL_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Brazil (BRL). */\nexport const BRL_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Brazil\",\n\tcurrency: CURRENCY.BRL,\n\tsymbolNative: \"R$\",\n\tlocale: \"pt-BR\",\n\tpaymentMethod: \"PIX\",\n\tpaymentAddressName: \"PIX_ID\",\n\ttimezone: \"America/Sao_Paulo\",\n\ttimezone_name: \"BRT\",\n\tflag: \"🇧🇷\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e7-1f1f7.png\",\n\tphoneCode: \"+55\",\n\ttelegramSupportChannel: \"https://t.me/p2pmebrasil\",\n\ttwitterUsername: \"p2pmebrasil\",\n\tsmsCountryCodes: [\"BR\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const COP_PLACEHOLDER = \"juan.perez@nequi.com.co\";\nexport const COP_VALIDATION_ERROR =\n\t\"Please enter a valid Nequi or Daviplata ID (e.g., 3001234567 or email)\";\n\n/**\n * Validates Colombian payment ID for Nequi or Daviplata.\n * Accepts a 10-digit phone number starting with 3, or a valid email address.\n */\nexport function validateColombianPaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\tconst trimmed = paymentId.trim();\n\tif (/^3\\d{9}$/.test(trimmed)) return true;\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmed)) return true;\n\treturn false;\n}\n\n/** Payment ID field configuration for COP (Colombia, Transferencia). */\nexport const COP_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"alias\",\n\t\tlabel: \"ALIAS_TRANSFERENCIA\",\n\t\tplaceholder: COP_PLACEHOLDER,\n\t\tdisplayLabel: \"Nequi / Daviplata\",\n\t\tvalidate: validateColombianPaymentId,\n\t\tvalidationErrorMessage: COP_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Colombia (COP). */\nexport const COP_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Colombia\",\n\tcurrency: CURRENCY.COP,\n\tsymbolNative: \"$\",\n\tlocale: \"es-CO\",\n\tpaymentMethod: \"TRANSFERENCIA\",\n\tpaymentAddressName: \"ALIAS_TRANSFERENCIA\",\n\ttimezone: \"America/Bogota\",\n\ttimezone_name: \"COT\",\n\tflag: \"🇨🇴\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1e8-1f1f4.png\",\n\tphoneCode: \"+57\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeColombia\",\n\ttwitterUsername: \"p2pmeColombia\",\n\tsmsCountryCodes: [\"CO\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const EUR_PLACEHOLDER = \"@username or email\";\nexport const EUR_VALIDATION_ERROR = \"Please enter a valid Revolut ID (username, email, or phone)\";\n\n/**\n * Validates Revolut ID (username, email, or phone number).\n */\nexport function validateRevolutId(revolutId: string): boolean {\n\tif (!revolutId || revolutId.trim().length === 0) return false;\n\n\tconst trimmed = revolutId.trim();\n\n\tif (/^@?[a-zA-Z0-9._-]{3,30}$/.test(trimmed)) return true;\n\tif (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(trimmed)) return true;\n\tif (/^\\+?\\d{7,15}$/.test(trimmed)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for EUR (Revolut EUR). */\nexport const EUR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"revolut\",\n\t\tlabel: \"REVOLUT_ID\",\n\t\tplaceholder: EUR_PLACEHOLDER,\n\t\tdisplayLabel: \"Revolut ID\",\n\t\tvalidate: validateRevolutId,\n\t\tvalidationErrorMessage: EUR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Revolut EUR. */\nexport const EUR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Revolut EUR\",\n\tcurrency: CURRENCY.EUR,\n\tsymbolNative: \"€\",\n\tlocale: \"de-DE\",\n\tpaymentMethod: \"REVOLUT\",\n\tpaymentAddressName: \"REVOLUT_ID\",\n\ttimezone: \"Europe/Berlin\",\n\ttimezone_name: \"CET\",\n\tflag: \"\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f310.png\",\n\tphoneCode: \"\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const IDR_PLACEHOLDER = \"8123456789\";\nexport const IDR_VALIDATION_ERROR =\n\t\"Please enter a valid Indonesian phone number (e.g., 8123456789)\";\n\n/**\n * Validates Indonesian phone number.\n * Validates just the number part (9-12 digits).\n */\nexport function validateIndonesianPhoneNumber(phoneNumber: string): boolean {\n\tif (!phoneNumber || phoneNumber.trim().length === 0) return false;\n\tif (/[a-zA-Z]/.test(phoneNumber)) return false;\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\treturn /^\\d{9,12}$/.test(cleaned);\n}\n\n/** Payment ID field configuration for IDR (Indonesia, QRIS). */\nexport const IDR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"phone\",\n\t\tlabel: \"PHONE_NUMBER\",\n\t\tplaceholder: IDR_PLACEHOLDER,\n\t\tdisplayLabel: \"Phone Number\",\n\t\tvalidate: validateIndonesianPhoneNumber,\n\t\tvalidationErrorMessage: IDR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Indonesia (IDR). */\nexport const IDR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Indonesia\",\n\tcurrency: CURRENCY.IDR,\n\tsymbolNative: \"Rp\",\n\tlocale: \"id-ID\",\n\tpaymentMethod: \"QRIS\",\n\tpaymentAddressName: \"PHONE_NUMBER\",\n\ttimezone: \"Asia/Jakarta\",\n\ttimezone_name: \"WIB\",\n\tflag: \"🇮🇩\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1ee-1f1e9.png\",\n\tphoneCode: \"+62\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeindonesia\",\n\ttwitterUsername: \"p2pdotmeID\",\n\tsmsCountryCodes: [],\n\tprecision: 0,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const INR_PLACEHOLDER = \"merchant@upi\";\nexport const INR_VALIDATION_ERROR = \"Please enter a valid UPI ID (e.g., username@bankname)\";\n\n/**\n * Validates UPI ID format.\n * UPI ID format: username@bankname (e.g., john@paytm, user@ybl, 8658404239@kotak811)\n */\nexport function validateUPIId(upiId: string): boolean {\n\tif (!upiId || upiId.trim().length === 0) return false;\n\tconst upiRegex = /^[a-zA-Z0-9.\\-_]{2,256}@[a-zA-Z0-9]{2,64}$/;\n\treturn upiRegex.test(upiId.trim());\n}\n\n/** Payment ID field configuration for INR (India, UPI). */\nexport const INR_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"upi\",\n\t\tlabel: \"UPI_ID\",\n\t\tplaceholder: INR_PLACEHOLDER,\n\t\tdisplayLabel: \"UPI ID\",\n\t\tvalidate: validateUPIId,\n\t\tvalidationErrorMessage: INR_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for India (INR). */\nexport const INR_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"India\",\n\tcurrency: CURRENCY.INR,\n\tsymbolNative: \"₹\",\n\tlocale: \"en-IN\",\n\tpaymentMethod: \"UPI\",\n\tpaymentAddressName: \"UPI_ID\",\n\ttimezone: \"Asia/Kolkata\",\n\ttimezone_name: \"IST\",\n\tflag: \"🇮🇳\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1ee-1f1f3.png\",\n\tphoneCode: \"+91\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [\"IN\"],\n\tprecision: 2,\n\tisAlpha: false,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const MEX_PLACEHOLDER = \"012345678901234567\";\nexport const MEX_VALIDATION_ERROR =\n\t\"Please enter a valid CLABE (18 digits), card number, or phone number\";\n\n/**\n * Validates Mexican payment IDs (CLABE, card number, or phone number).\n * CLABE: 18 digits. Card: 16 digits. Phone: 10 digits.\n */\nexport function validateMexicanPaymentId(paymentId: string): boolean {\n\tif (!paymentId || paymentId.trim().length === 0) return false;\n\n\tconst trimmed = paymentId.trim().replace(/\\D/g, \"\");\n\n\tif (/^\\d{18}$/.test(trimmed)) return true;\n\tif (/^\\d{16}$/.test(trimmed)) return true;\n\tif (/^\\d{10}$/.test(trimmed)) return true;\n\n\treturn false;\n}\n\n/** Payment ID field configuration for MEX (Mexico, SPEI). */\nexport const MEX_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"clabe\",\n\t\tlabel: \"CLABE_ID\",\n\t\tplaceholder: MEX_PLACEHOLDER,\n\t\tdisplayLabel: \"CLABE\",\n\t\tvalidate: validateMexicanPaymentId,\n\t\tvalidationErrorMessage: MEX_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Mexico (MEX). */\nexport const MEX_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Mexico\",\n\tcurrency: CURRENCY.MEX,\n\tinternationalFormat: \"MXN\",\n\tsymbolNative: \"Mx\",\n\tlocale: \"es-MX\",\n\tpaymentMethod: \"SPEI\",\n\tpaymentAddressName: \"CLABE_ID\",\n\ttimezone: \"America/Mexico_City\",\n\ttimezone_name: \"CST\",\n\tflag: \"🇲🇽\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1f2-1f1fd.png\",\n\tphoneCode: \"+52\",\n\ttelegramSupportChannel: \"https://t.me/p2pmemexico\",\n\ttwitterUsername: \"p2pmemexico\",\n\tsmsCountryCodes: [\"MX\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const NGN_PLACEHOLDER = \"0123456789\";\nexport const NGN_PLACEHOLDER_BANK = \"Bank Name\";\nexport const NGN_VALIDATION_ERROR = \"Please enter a valid 10-digit account number\";\n\n/**\n * Validates Nigerian bank account number (NUBAN format, 10 digits).\n */\nexport function validateNigerianAccountNumber(accountNumber: string): boolean {\n\tif (!accountNumber || accountNumber.trim().length === 0) return false;\n\tconst cleaned = accountNumber.trim().replace(/\\D/g, \"\");\n\treturn /^\\d{10}$/.test(cleaned);\n}\n\n/** Payment ID field configuration for NGN (Nigeria, NIP). */\nexport const NGN_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"account\",\n\t\tlabel: \"ACCOUNT_NUMBER\",\n\t\tplaceholder: NGN_PLACEHOLDER,\n\t\tdisplayLabel: \"Account Number\",\n\t\tvalidate: validateNigerianAccountNumber,\n\t\tvalidationErrorMessage: NGN_VALIDATION_ERROR,\n\t},\n\t{\n\t\tkey: \"bank-name\",\n\t\tlabel: \"BANK_NAME\",\n\t\tplaceholder: NGN_PLACEHOLDER_BANK,\n\t\tdisplayLabel: \"Bank Name\",\n\t\tvalidate: (v: string) => v.trim().length > 0,\n\t\tvalidationErrorMessage: NGN_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Nigeria (NGN). */\nexport const NGN_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Nigeria\",\n\tcurrency: CURRENCY.NGN,\n\tsymbolNative: \"₦\",\n\tlocale: \"en-NG\",\n\tpaymentMethod: \"NIP\",\n\tpaymentAddressName: \"ACCOUNT_NUMBER\",\n\ttimezone: \"Africa/Lagos\",\n\ttimezone_name: \"WAT\",\n\tflag: \"🇳🇬\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1f3-1f1ec.png\",\n\tphoneCode: \"+234\",\n\ttelegramSupportChannel: \"https://t.me/p2pmeNigeria\",\n\ttwitterUsername: \"p2pmeNigeria\",\n\tsmsCountryCodes: [\"NG\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\nimport { EUR_PLACEHOLDER, EUR_VALIDATION_ERROR, validateRevolutId } from \"./eur\";\n\nexport const USD_PLACEHOLDER = EUR_PLACEHOLDER;\nexport const USD_VALIDATION_ERROR = EUR_VALIDATION_ERROR;\n\n/** Payment ID field configuration for USD (Revolut USD). */\nexport const USD_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"revolut\",\n\t\tlabel: \"REVOLUT_ID\",\n\t\tplaceholder: USD_PLACEHOLDER,\n\t\tdisplayLabel: \"Revolut ID\",\n\t\tvalidate: validateRevolutId,\n\t\tvalidationErrorMessage: USD_VALIDATION_ERROR,\n\t},\n];\n\n/** Country option for Revolut USD. */\nexport const USD_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Revolut USD\",\n\tcurrency: CURRENCY.USD,\n\tsymbolNative: \"$\",\n\tlocale: \"en-US\",\n\tpaymentMethod: \"REVOLUT\",\n\tpaymentAddressName: \"REVOLUT_ID\",\n\ttimezone: \"America/New_York\",\n\ttimezone_name: \"EST\",\n\tflag: \"\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f310.png\",\n\tphoneCode: \"+1\",\n\ttelegramSupportChannel: \"https://t.me/P2Pdotme\",\n\ttwitterUsername: \"P2Pdotme\",\n\tsmsCountryCodes: [\"US\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [\"PAY\"],\n};\n","import { CURRENCY } from \"../currency\";\nimport type { CountryOption, PaymentIdFieldConfig } from \"../types\";\n\nexport const VEN_PLACEHOLDER = \"04121234567\";\nexport const VEN_PLACEHOLDER_RIF = \"V12345678\";\nexport const VEN_PLACEHOLDER_BANK = \"Banesco\";\n\nexport const VEN_VALIDATION_ERROR = \"Please enter a valid phone number (e.g., 04121234567)\";\nexport const VEN_VALIDATION_ERROR_RIF = \"Please enter a valid RIF (e.g., V12345678)\";\nexport const VEN_VALIDATION_ERROR_BANK = \"Please enter a bank name\";\n\n/**\n * Validates Venezuelan phone number for Pago Movil.\n * Format: 04XX-XXXXXXX (11 digits starting with 04).\n */\nexport function validateVenezuelanPhoneNumber(phoneNumber: string): boolean {\n\tif (!phoneNumber || phoneNumber.trim().length === 0) return false;\n\n\tconst cleaned = phoneNumber.trim().replace(/\\D/g, \"\");\n\n\tif (/^04\\d{9}$/.test(cleaned)) return true;\n\tif (/^4\\d{9}$/.test(cleaned)) return true;\n\n\treturn false;\n}\n\n/**\n * Validates Venezuelan RIF (Registro de Informacion Fiscal).\n * Format: One letter (J/V/E/G/C) followed by 7-9 digits.\n */\nexport function validateVenezuelanRif(rif: string): boolean {\n\tif (!rif || rif.trim().length === 0) return false;\n\tconst trimmed = rif.trim().toUpperCase();\n\treturn /^[JVEGC]\\d{7,9}$/.test(trimmed);\n}\n\n/** Payment ID field configuration for VEN (Venezuela, Pago Móvil). */\nexport const VEN_PAYMENT_FIELDS: PaymentIdFieldConfig[] = [\n\t{\n\t\tkey: \"phone\",\n\t\tlabel: \"PHONE_NUMBER\",\n\t\tplaceholder: VEN_PLACEHOLDER,\n\t\tdisplayLabel: \"Phone\",\n\t\tvalidate: validateVenezuelanPhoneNumber,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR,\n\t},\n\t{\n\t\tkey: \"rif\",\n\t\tlabel: \"RIF_LABEL\",\n\t\tplaceholder: VEN_PLACEHOLDER_RIF,\n\t\tdisplayLabel: \"RIF\",\n\t\tvalidate: validateVenezuelanRif,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR_RIF,\n\t},\n\t{\n\t\tkey: \"bank\",\n\t\tlabel: \"BANK_LABEL\",\n\t\tplaceholder: VEN_PLACEHOLDER_BANK,\n\t\tdisplayLabel: \"Banco\",\n\t\tvalidate: (v: string) => v.trim().length > 0,\n\t\tvalidationErrorMessage: VEN_VALIDATION_ERROR_BANK,\n\t},\n];\n\n/** Country option for Venezuela (VEN). */\nexport const VEN_COUNTRY_OPTION: CountryOption = {\n\tcountry: \"Venezuela\",\n\tcurrency: CURRENCY.VEN,\n\tinternationalFormat: \"VES\",\n\tsymbolNative: \"Bs\",\n\tlocale: \"es-VE\",\n\tpaymentMethod: \"PAGO_MOVIL\",\n\tpaymentAddressName: \"PAGO_MOVIL_DETAILS\",\n\ttimezone: \"America/Caracas\",\n\ttimezone_name: \"VET\",\n\tflag: \"🇻🇪\",\n\tflagUrl: \"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f1fb-1f1ea.png\",\n\tphoneCode: \"+58\",\n\ttelegramSupportChannel: \"https://t.me/p2pmevenezuela\",\n\ttwitterUsername: \"p2pmevenezuela\",\n\tsmsCountryCodes: [\"VE\"],\n\tprecision: 2,\n\tisAlpha: true,\n\tdisabled: false,\n\tdisabledPaymentTypes: [],\n};\n","import {\n\tARS_COUNTRY_OPTION,\n\tBRL_COUNTRY_OPTION,\n\tCOP_COUNTRY_OPTION,\n\tEUR_COUNTRY_OPTION,\n\tIDR_COUNTRY_OPTION,\n\tINR_COUNTRY_OPTION,\n\tMEX_COUNTRY_OPTION,\n\tNGN_COUNTRY_OPTION,\n\tUSD_COUNTRY_OPTION,\n\tVEN_COUNTRY_OPTION,\n} from \"./currencies\";\nimport type { CountryOption } from \"./types\";\n\n/** All supported countries with their currency metadata, payment methods, and display config. */\nexport const COUNTRY_OPTIONS: readonly CountryOption[] = [\n\tINR_COUNTRY_OPTION,\n\tIDR_COUNTRY_OPTION,\n\tBRL_COUNTRY_OPTION,\n\tARS_COUNTRY_OPTION,\n\tMEX_COUNTRY_OPTION,\n\tVEN_COUNTRY_OPTION,\n\tNGN_COUNTRY_OPTION,\n\tCOP_COUNTRY_OPTION,\n\tEUR_COUNTRY_OPTION,\n\tUSD_COUNTRY_OPTION,\n];\n","import type { CurrencyCode } from \"../types\";\nimport {\n\tARS_PAYMENT_FIELDS,\n\tBRL_PAYMENT_FIELDS,\n\tCOP_PAYMENT_FIELDS,\n\tEUR_PAYMENT_FIELDS,\n\tIDR_PAYMENT_FIELDS,\n\tINR_PAYMENT_FIELDS,\n\tMEX_PAYMENT_FIELDS,\n\tNGN_PAYMENT_FIELDS,\n\tUSD_PAYMENT_FIELDS,\n\tVEN_PAYMENT_FIELDS,\n} from \"./currencies\";\nimport type { PaymentIdFieldConfig } from \"./types\";\n\n/** Payment ID field configuration for each supported currency. */\nexport const PAYMENT_ID_FIELDS: Record<CurrencyCode, PaymentIdFieldConfig[]> = {\n\tINR: INR_PAYMENT_FIELDS,\n\tIDR: IDR_PAYMENT_FIELDS,\n\tBRL: BRL_PAYMENT_FIELDS,\n\tARS: ARS_PAYMENT_FIELDS,\n\tMEX: MEX_PAYMENT_FIELDS,\n\tVEN: VEN_PAYMENT_FIELDS,\n\tNGN: NGN_PAYMENT_FIELDS,\n\tEUR: EUR_PAYMENT_FIELDS,\n\tUSD: USD_PAYMENT_FIELDS,\n\tCOP: COP_PAYMENT_FIELDS,\n};\n","export {\n\tvalidateArgentinePaymentId,\n\tvalidateColombianPaymentId,\n\tvalidateIndonesianPhoneNumber,\n\tvalidateMexicanPaymentId,\n\tvalidateNigerianAccountNumber,\n\tvalidatePIXId,\n\tvalidateRevolutId,\n\tvalidateUPIId,\n\tvalidateVenezuelanPhoneNumber,\n\tvalidateVenezuelanRif,\n} from \"./currencies\";\n\n/** Serializes multiple fields into a pipe-separated string. */\nexport function serializeCompoundPaymentId(...fields: string[]): string {\n\treturn fields.join(\"|\");\n}\n\n/** Deserializes a pipe-separated payment ID into its component fields. */\nexport function deserializeCompoundPaymentId(paymentId: string): string[] {\n\treturn paymentId.split(\"|\");\n}\n\n/**\n * Formats a compound payment ID for display using optional labels.\n * Fields without a label are shown as-is, fields with a label are shown as \"Label: value\".\n */\nexport function formatCompoundPaymentIdForDisplay(\n\tpaymentId: string,\n\tlabels: (string | null)[],\n): string {\n\tconst parts = deserializeCompoundPaym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
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* All supported currency symbols. Single source of truth for the SDK.
|
|
3
|
+
*
|
|
4
|
+
* Lives alongside the country metadata so that adding a currency is a
|
|
5
|
+
* single-folder operation: drop a new file in `currencies/<code>.ts`, add it
|
|
6
|
+
* to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up.
|
|
7
|
+
*/
|
|
8
|
+
declare const CURRENCY: {
|
|
9
|
+
readonly IDR: "IDR";
|
|
10
|
+
readonly INR: "INR";
|
|
11
|
+
readonly BRL: "BRL";
|
|
12
|
+
readonly ARS: "ARS";
|
|
13
|
+
readonly MEX: "MEX";
|
|
14
|
+
readonly VEN: "VEN";
|
|
15
|
+
readonly EUR: "EUR";
|
|
16
|
+
readonly NGN: "NGN";
|
|
17
|
+
readonly USD: "USD";
|
|
18
|
+
readonly COP: "COP";
|
|
19
|
+
};
|
|
20
|
+
/** Union of supported currency codes. */
|
|
21
|
+
type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY];
|
|
22
|
+
/**
|
|
23
|
+
* Tuple form of the currency codes — used by `z.enum(...)` in the shared
|
|
24
|
+
* validation layer. Narrow tuple type required by Zod.
|
|
25
|
+
*/
|
|
26
|
+
declare const CURRENCY_CODES: [CurrencyCode, ...CurrencyCode[]];
|
|
8
27
|
|
|
9
28
|
interface PaymentIdFieldConfig {
|
|
10
29
|
readonly key: string;
|
|
@@ -16,7 +35,7 @@ interface PaymentIdFieldConfig {
|
|
|
16
35
|
}
|
|
17
36
|
interface CountryOption {
|
|
18
37
|
readonly country: string;
|
|
19
|
-
readonly currency:
|
|
38
|
+
readonly currency: CurrencyCode;
|
|
20
39
|
readonly internationalFormat?: string;
|
|
21
40
|
readonly symbolNative: string;
|
|
22
41
|
readonly locale: string;
|
|
@@ -40,7 +59,7 @@ interface CountryOption {
|
|
|
40
59
|
declare const COUNTRY_OPTIONS: readonly CountryOption[];
|
|
41
60
|
|
|
42
61
|
/** Payment ID field configuration for each supported currency. */
|
|
43
|
-
declare const PAYMENT_ID_FIELDS: Record<
|
|
62
|
+
declare const PAYMENT_ID_FIELDS: Record<CurrencyCode, PaymentIdFieldConfig[]>;
|
|
44
63
|
|
|
45
64
|
/**
|
|
46
65
|
* Validates Argentine payment IDs (CBU, CVU, or Alias).
|
|
@@ -55,6 +74,12 @@ declare function validateArgentinePaymentId(paymentId: string): boolean;
|
|
|
55
74
|
*/
|
|
56
75
|
declare function validatePIXId(pixId: string): boolean;
|
|
57
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Validates Colombian payment ID for Nequi or Daviplata.
|
|
79
|
+
* Accepts a 10-digit phone number starting with 3, or a valid email address.
|
|
80
|
+
*/
|
|
81
|
+
declare function validateColombianPaymentId(paymentId: string): boolean;
|
|
82
|
+
|
|
58
83
|
/**
|
|
59
84
|
* Validates Revolut ID (username, email, or phone number).
|
|
60
85
|
*/
|
|
@@ -104,4 +129,4 @@ declare function deserializeCompoundPaymentId(paymentId: string): string[];
|
|
|
104
129
|
*/
|
|
105
130
|
declare function formatCompoundPaymentIdForDisplay(paymentId: string, labels: (string | null)[]): string;
|
|
106
131
|
|
|
107
|
-
export { COUNTRY_OPTIONS, type CountryOption, PAYMENT_ID_FIELDS, type PaymentIdFieldConfig, deserializeCompoundPaymentId, formatCompoundPaymentIdForDisplay, serializeCompoundPaymentId, validateArgentinePaymentId, validateIndonesianPhoneNumber, validateMexicanPaymentId, validateNigerianAccountNumber, validatePIXId, validateRevolutId, validateUPIId, validateVenezuelanPhoneNumber, validateVenezuelanRif };
|
|
132
|
+
export { COUNTRY_OPTIONS, CURRENCY, CURRENCY_CODES, type CountryOption, type CurrencyCode, PAYMENT_ID_FIELDS, type PaymentIdFieldConfig, deserializeCompoundPaymentId, formatCompoundPaymentIdForDisplay, serializeCompoundPaymentId, validateArgentinePaymentId, validateColombianPaymentId, validateIndonesianPhoneNumber, validateMexicanPaymentId, validateNigerianAccountNumber, validatePIXId, validateRevolutId, validateUPIId, validateVenezuelanPhoneNumber, validateVenezuelanRif };
|
package/dist/country.d.ts
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* All supported currency symbols. Single source of truth for the SDK.
|
|
3
|
+
*
|
|
4
|
+
* Lives alongside the country metadata so that adding a currency is a
|
|
5
|
+
* single-folder operation: drop a new file in `currencies/<code>.ts`, add it
|
|
6
|
+
* to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up.
|
|
7
|
+
*/
|
|
8
|
+
declare const CURRENCY: {
|
|
9
|
+
readonly IDR: "IDR";
|
|
10
|
+
readonly INR: "INR";
|
|
11
|
+
readonly BRL: "BRL";
|
|
12
|
+
readonly ARS: "ARS";
|
|
13
|
+
readonly MEX: "MEX";
|
|
14
|
+
readonly VEN: "VEN";
|
|
15
|
+
readonly EUR: "EUR";
|
|
16
|
+
readonly NGN: "NGN";
|
|
17
|
+
readonly USD: "USD";
|
|
18
|
+
readonly COP: "COP";
|
|
19
|
+
};
|
|
20
|
+
/** Union of supported currency codes. */
|
|
21
|
+
type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY];
|
|
22
|
+
/**
|
|
23
|
+
* Tuple form of the currency codes — used by `z.enum(...)` in the shared
|
|
24
|
+
* validation layer. Narrow tuple type required by Zod.
|
|
25
|
+
*/
|
|
26
|
+
declare const CURRENCY_CODES: [CurrencyCode, ...CurrencyCode[]];
|
|
8
27
|
|
|
9
28
|
interface PaymentIdFieldConfig {
|
|
10
29
|
readonly key: string;
|
|
@@ -16,7 +35,7 @@ interface PaymentIdFieldConfig {
|
|
|
16
35
|
}
|
|
17
36
|
interface CountryOption {
|
|
18
37
|
readonly country: string;
|
|
19
|
-
readonly currency:
|
|
38
|
+
readonly currency: CurrencyCode;
|
|
20
39
|
readonly internationalFormat?: string;
|
|
21
40
|
readonly symbolNative: string;
|
|
22
41
|
readonly locale: string;
|
|
@@ -40,7 +59,7 @@ interface CountryOption {
|
|
|
40
59
|
declare const COUNTRY_OPTIONS: readonly CountryOption[];
|
|
41
60
|
|
|
42
61
|
/** Payment ID field configuration for each supported currency. */
|
|
43
|
-
declare const PAYMENT_ID_FIELDS: Record<
|
|
62
|
+
declare const PAYMENT_ID_FIELDS: Record<CurrencyCode, PaymentIdFieldConfig[]>;
|
|
44
63
|
|
|
45
64
|
/**
|
|
46
65
|
* Validates Argentine payment IDs (CBU, CVU, or Alias).
|
|
@@ -55,6 +74,12 @@ declare function validateArgentinePaymentId(paymentId: string): boolean;
|
|
|
55
74
|
*/
|
|
56
75
|
declare function validatePIXId(pixId: string): boolean;
|
|
57
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Validates Colombian payment ID for Nequi or Daviplata.
|
|
79
|
+
* Accepts a 10-digit phone number starting with 3, or a valid email address.
|
|
80
|
+
*/
|
|
81
|
+
declare function validateColombianPaymentId(paymentId: string): boolean;
|
|
82
|
+
|
|
58
83
|
/**
|
|
59
84
|
* Validates Revolut ID (username, email, or phone number).
|
|
60
85
|
*/
|
|
@@ -104,4 +129,4 @@ declare function deserializeCompoundPaymentId(paymentId: string): string[];
|
|
|
104
129
|
*/
|
|
105
130
|
declare function formatCompoundPaymentIdForDisplay(paymentId: string, labels: (string | null)[]): string;
|
|
106
131
|
|
|
107
|
-
export { COUNTRY_OPTIONS, type CountryOption, PAYMENT_ID_FIELDS, type PaymentIdFieldConfig, deserializeCompoundPaymentId, formatCompoundPaymentIdForDisplay, serializeCompoundPaymentId, validateArgentinePaymentId, validateIndonesianPhoneNumber, validateMexicanPaymentId, validateNigerianAccountNumber, validatePIXId, validateRevolutId, validateUPIId, validateVenezuelanPhoneNumber, validateVenezuelanRif };
|
|
132
|
+
export { COUNTRY_OPTIONS, CURRENCY, CURRENCY_CODES, type CountryOption, type CurrencyCode, PAYMENT_ID_FIELDS, type PaymentIdFieldConfig, deserializeCompoundPaymentId, formatCompoundPaymentIdForDisplay, serializeCompoundPaymentId, validateArgentinePaymentId, validateColombianPaymentId, validateIndonesianPhoneNumber, validateMexicanPaymentId, validateNigerianAccountNumber, validatePIXId, validateRevolutId, validateUPIId, validateVenezuelanPhoneNumber, validateVenezuelanRif };
|
package/dist/country.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/country/currency.ts
|
|
2
2
|
var CURRENCY = {
|
|
3
3
|
IDR: "IDR",
|
|
4
4
|
INR: "INR",
|
|
@@ -11,6 +11,7 @@ var CURRENCY = {
|
|
|
11
11
|
USD: "USD",
|
|
12
12
|
COP: "COP"
|
|
13
13
|
};
|
|
14
|
+
var CURRENCY_CODES = Object.values(CURRENCY);
|
|
14
15
|
|
|
15
16
|
// src/country/currencies/ars.ts
|
|
16
17
|
var ARS_PLACEHOLDER = "juan.perez";
|
|
@@ -556,11 +557,14 @@ function formatCompoundPaymentIdForDisplay(paymentId, labels) {
|
|
|
556
557
|
}
|
|
557
558
|
export {
|
|
558
559
|
COUNTRY_OPTIONS,
|
|
560
|
+
CURRENCY,
|
|
561
|
+
CURRENCY_CODES,
|
|
559
562
|
PAYMENT_ID_FIELDS,
|
|
560
563
|
deserializeCompoundPaymentId,
|
|
561
564
|
formatCompoundPaymentIdForDisplay,
|
|
562
565
|
serializeCompoundPaymentId,
|
|
563
566
|
validateArgentinePaymentId,
|
|
567
|
+
validateColombianPaymentId,
|
|
564
568
|
validateIndonesianPhoneNumber,
|
|
565
569
|
validateMexicanPaymentId,
|
|
566
570
|
validateNigerianAccountNumber,
|