@klappay/types 4.0.0 → 4.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 CHANGED
@@ -39,6 +39,9 @@ already have it if you use any of them directly.
39
39
  `charge.created`. `TypedWebhookPayload`/`WebhookEventDataMap` give the
40
40
  exact `data` shape per event, keyed by `event` (a discriminated union —
41
41
  see the webhook example below).
42
+ - Deployment metadata and helpers (`TOKEN_DEPLOYMENTS`, `TokenDeployment`,
43
+ `getTokenDeployment`, `isPaymentDeploymentEnabled`) that resolve a
44
+ token contract and its decimals per network/environment.
42
45
  - A handful of small constants (`TOKEN_ADDRESSES`, `NETWORK_EXPLORERS`,
43
46
  `EVM_NETWORKS`, `OPERATIONAL_NETWORKS`, `CHAIN_IDS`,
44
47
  `CHARGE_ACCEPTED_PAYMENTS_MAX`) that mirror values the API itself uses —
@@ -123,14 +126,15 @@ needed. See the live API reference for details.
123
126
 
124
127
  ## Zero-dependency constants
125
128
 
126
- Every plain-object constant this package exports (`TOKEN_ADDRESSES`,
129
+ Every plain constant and deployment resolver this package exports (`TOKEN_DEPLOYMENTS`,
130
+ `getTokenDeployment`, `isPaymentDeploymentEnabled`, `TOKEN_ADDRESSES`,
127
131
  `ALT_TOKEN_ADDRESSES`, `CHAIN_IDS`, `NETWORK_LABELS`, `NETWORK_EXPLORERS`,
128
132
  `EVM_NETWORKS`, `OPERATIONAL_NETWORKS`, `TOKEN_DECIMALS`,
129
133
  `ALT_TOKEN_DECIMALS`) is also available from a second entry point that
130
134
  carries zero `zod` in its bundle:
131
135
 
132
136
  ```ts
133
- import { CHAIN_IDS, TOKEN_ADDRESSES } from '@klappay/types/constants'
137
+ import { CHAIN_IDS, getTokenDeployment } from '@klappay/types/constants'
134
138
  ```
135
139
 
136
140
  Useful for a browser/wallet-side bundle that only needs these plain
@@ -139,6 +143,20 @@ with the main entry. Everything exported here is identical to (and stays
139
143
  in sync with) the same name imported from `@klappay/types` — nothing is
140
144
  exclusive to this subpath, it's just a smaller bundle of the same values.
141
145
 
146
+ Use `getTokenDeployment(token, network, environment)?.decimals` for token
147
+ amounts. The legacy `TOKEN_DECIMALS = 6` export is deprecated: the BNB
148
+ contracts in the catalog use 18 decimals, and both BNB payment pairs are
149
+ currently disabled. `TOKEN_ADDRESSES` is an address-only compatibility
150
+ view, not a payment-availability matrix. Check `GET /v1/networks` before
151
+ offering a payment method.
152
+
153
+ Charge responses provide optional `amountExact`, `amountReceivedExact`,
154
+ and `paymentUnavailable`; swap quotes provide optional exact amount and
155
+ fee strings. Prefer the decimal strings for calculations. The original
156
+ numeric fields remain for compatibility and can lose precision. See the
157
+ [charge documentation](https://api.klappay.com/types/charges) for units and
158
+ availability handling.
159
+
142
160
  ## Versioning
143
161
 
144
162
  This package follows the API's own versioning. A breaking change to a
@@ -0,0 +1,137 @@
1
+ // src/networks.constants.ts
2
+ var NETWORK_LABELS = {
3
+ base: "Base",
4
+ optimism: "Optimism",
5
+ polygon: "Polygon",
6
+ ethereum: "Ethereum",
7
+ arbitrum: "Arbitrum",
8
+ avalanche: "Avalanche",
9
+ bnb: "BNB Chain"
10
+ };
11
+ var NETWORK_EXPLORERS = {
12
+ base: "https://basescan.org",
13
+ optimism: "https://optimistic.etherscan.io",
14
+ polygon: "https://polygonscan.com",
15
+ ethereum: "https://etherscan.io",
16
+ arbitrum: "https://arbiscan.io",
17
+ avalanche: "https://snowtrace.io",
18
+ bnb: "https://bscscan.com"
19
+ };
20
+ var EVM_NETWORKS = [
21
+ "base",
22
+ "optimism",
23
+ "polygon",
24
+ "ethereum",
25
+ "arbitrum",
26
+ "avalanche",
27
+ "bnb"
28
+ ];
29
+ var OPERATIONAL_NETWORKS = [
30
+ "base",
31
+ "arbitrum",
32
+ "optimism",
33
+ "polygon",
34
+ "ethereum",
35
+ "avalanche",
36
+ "bnb"
37
+ ];
38
+ var CHAIN_IDS = {
39
+ base: { live: 8453, test: 84532 },
40
+ optimism: { live: 10, test: 11155420 },
41
+ ethereum: { live: 1, test: 11155111 },
42
+ polygon: { live: 137 },
43
+ arbitrum: { live: 42161 },
44
+ avalanche: { live: 43114 },
45
+ bnb: { live: 56 }
46
+ };
47
+
48
+ // src/tokens.constants.ts
49
+ var TOKEN_DECIMALS = 6;
50
+ var TOKEN_DEPLOYMENTS = {
51
+ USDC: {
52
+ base: {
53
+ live: { address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", decimals: 6 },
54
+ test: { address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", decimals: 6 }
55
+ },
56
+ optimism: {
57
+ live: { address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", decimals: 6 },
58
+ test: { address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", decimals: 6 }
59
+ },
60
+ polygon: { live: { address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", decimals: 6 } },
61
+ ethereum: {
62
+ live: { address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", decimals: 6 },
63
+ test: { address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", decimals: 6 }
64
+ },
65
+ arbitrum: { live: { address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", decimals: 6 } },
66
+ avalanche: { live: { address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", decimals: 6 } },
67
+ bnb: { live: { address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", decimals: 18 } }
68
+ },
69
+ USDT: {
70
+ base: { live: { address: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2", decimals: 6 } },
71
+ optimism: { live: { address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", decimals: 6 } },
72
+ polygon: { live: { address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", decimals: 6 } },
73
+ ethereum: { live: { address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", decimals: 6 } },
74
+ arbitrum: { live: { address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", decimals: 6 } },
75
+ avalanche: { live: { address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", decimals: 6 } },
76
+ bnb: { live: { address: "0x55d398326f99059fF775485246999027B3197955", decimals: 18 } }
77
+ }
78
+ };
79
+ function getTokenDeployment(token, network, environment) {
80
+ return TOKEN_DEPLOYMENTS[token][network]?.[environment];
81
+ }
82
+ function isPaymentDeploymentEnabled(token, network, environment) {
83
+ if (network === "bnb" && environment === "live") return false;
84
+ return getTokenDeployment(token, network, environment) !== void 0;
85
+ }
86
+ function deriveAddresses(deployments) {
87
+ const addresses = {};
88
+ for (const network of EVM_NETWORKS) {
89
+ const byEnvironment = deployments[network];
90
+ if (!byEnvironment) continue;
91
+ const networkAddresses = {};
92
+ for (const environment of ["live", "test"]) {
93
+ const deployment = byEnvironment[environment];
94
+ if (deployment) networkAddresses[environment] = deployment.address;
95
+ }
96
+ addresses[network] = networkAddresses;
97
+ }
98
+ return addresses;
99
+ }
100
+ var TOKEN_ADDRESSES = {
101
+ USDC: deriveAddresses(TOKEN_DEPLOYMENTS.USDC),
102
+ USDT: deriveAddresses(TOKEN_DEPLOYMENTS.USDT)
103
+ };
104
+
105
+ // src/alt-tokens.constants.ts
106
+ var ALT_TOKEN_DECIMALS = {
107
+ ETH: 18,
108
+ BNB: 18,
109
+ MATIC: 18,
110
+ AVAX: 18,
111
+ BTC: 8
112
+ };
113
+ var ALT_TOKEN_ADDRESSES = {
114
+ base: { ETH: "native", BTC: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf" },
115
+ optimism: { ETH: "native", BTC: "0x68f180fcCe6836688e9084f035309E29Bf0A2095" },
116
+ ethereum: { ETH: "native", BTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" },
117
+ arbitrum: { ETH: "native", BTC: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f" },
118
+ polygon: { MATIC: "native", BTC: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6" },
119
+ avalanche: { AVAX: "native" },
120
+ bnb: { BNB: "native" }
121
+ };
122
+
123
+ export {
124
+ NETWORK_LABELS,
125
+ NETWORK_EXPLORERS,
126
+ EVM_NETWORKS,
127
+ OPERATIONAL_NETWORKS,
128
+ CHAIN_IDS,
129
+ TOKEN_DECIMALS,
130
+ TOKEN_DEPLOYMENTS,
131
+ getTokenDeployment,
132
+ isPaymentDeploymentEnabled,
133
+ TOKEN_ADDRESSES,
134
+ ALT_TOKEN_DECIMALS,
135
+ ALT_TOKEN_ADDRESSES
136
+ };
137
+ //# sourceMappingURL=chunk-WKIOAEJ3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/networks.constants.ts","../src/tokens.constants.ts","../src/alt-tokens.constants.ts"],"sourcesContent":["import type { Environment } from './environment'\nimport type { Network } from './networks'\n\nexport const NETWORK_LABELS: Record<Network, string> = {\n base: 'Base',\n optimism: 'Optimism',\n polygon: 'Polygon',\n ethereum: 'Ethereum',\n arbitrum: 'Arbitrum',\n avalanche: 'Avalanche',\n bnb: 'BNB Chain',\n}\n\nexport const NETWORK_EXPLORERS: Record<Network, string> = {\n base: 'https://basescan.org',\n optimism: 'https://optimistic.etherscan.io',\n polygon: 'https://polygonscan.com',\n ethereum: 'https://etherscan.io',\n arbitrum: 'https://arbiscan.io',\n avalanche: 'https://snowtrace.io',\n bnb: 'https://bscscan.com',\n}\n\nexport const EVM_NETWORKS = [\n 'base',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'arbitrum',\n 'avalanche',\n 'bnb',\n] as const\nexport type EvmNetwork = (typeof EVM_NETWORKS)[number]\n\nexport const OPERATIONAL_NETWORKS = [\n 'base',\n 'arbitrum',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'avalanche',\n 'bnb',\n] as const\nexport type OperationalNetwork = (typeof OPERATIONAL_NETWORKS)[number]\n\nexport const CHAIN_IDS: Record<EvmNetwork, Partial<Record<Environment, number>>> = {\n base: { live: 8453, test: 84532 },\n optimism: { live: 10, test: 11155420 },\n ethereum: { live: 1, test: 11155111 },\n polygon: { live: 137 },\n arbitrum: { live: 42161 },\n avalanche: { live: 43114 },\n bnb: { live: 56 },\n}\n","import type { Environment } from './environment'\nimport type { Network } from './networks'\nimport { EVM_NETWORKS } from './networks.constants'\nimport type { Token } from './tokens'\n\nexport const TOKEN_DECIMALS = 6\n\nexport type TokenDeployment = { address: `0x${string}`; decimals: number }\n\ntype DeploymentsByNetwork = Partial<Record<Network, Partial<Record<Environment, TokenDeployment>>>>\ntype AddressesByNetwork = Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>\n\nexport const TOKEN_DEPLOYMENTS: Record<Token, DeploymentsByNetwork> = {\n USDC: {\n base: {\n live: { address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', decimals: 6 },\n test: { address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', decimals: 6 },\n },\n optimism: {\n live: { address: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', decimals: 6 },\n test: { address: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7', decimals: 6 },\n },\n polygon: { live: { address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', decimals: 6 } },\n ethereum: {\n live: { address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', decimals: 6 },\n test: { address: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', decimals: 6 },\n },\n arbitrum: { live: { address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', decimals: 6 } },\n avalanche: { live: { address: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', decimals: 6 } },\n bnb: { live: { address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', decimals: 18 } },\n },\n USDT: {\n base: { live: { address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2', decimals: 6 } },\n optimism: { live: { address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', decimals: 6 } },\n polygon: { live: { address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F', decimals: 6 } },\n ethereum: { live: { address: '0xdAC17F958D2ee523a2206206994597C13D831ec7', decimals: 6 } },\n arbitrum: { live: { address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', decimals: 6 } },\n avalanche: { live: { address: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', decimals: 6 } },\n bnb: { live: { address: '0x55d398326f99059fF775485246999027B3197955', decimals: 18 } },\n },\n}\n\nexport function getTokenDeployment(\n token: Token,\n network: Network,\n environment: Environment,\n): TokenDeployment | undefined {\n return TOKEN_DEPLOYMENTS[token][network]?.[environment]\n}\n\nexport function isPaymentDeploymentEnabled(\n token: Token,\n network: Network,\n environment: Environment,\n): boolean {\n if (network === 'bnb' && environment === 'live') return false\n return getTokenDeployment(token, network, environment) !== undefined\n}\n\nfunction deriveAddresses(deployments: DeploymentsByNetwork): AddressesByNetwork {\n const addresses: AddressesByNetwork = {}\n for (const network of EVM_NETWORKS) {\n const byEnvironment = deployments[network]\n if (!byEnvironment) continue\n const networkAddresses: Partial<Record<Environment, `0x${string}`>> = {}\n for (const environment of ['live', 'test'] as const) {\n const deployment = byEnvironment[environment]\n if (deployment) networkAddresses[environment] = deployment.address\n }\n addresses[network] = networkAddresses\n }\n return addresses\n}\n\nexport const TOKEN_ADDRESSES: Record<Token, AddressesByNetwork> = {\n USDC: deriveAddresses(TOKEN_DEPLOYMENTS.USDC),\n USDT: deriveAddresses(TOKEN_DEPLOYMENTS.USDT),\n}\n","import type { AltToken } from './alt-tokens'\nimport type { Network } from './networks'\n\nexport const ALT_TOKEN_DECIMALS: Record<AltToken, number> = {\n ETH: 18,\n BNB: 18,\n MATIC: 18,\n AVAX: 18,\n BTC: 8,\n}\n\nexport const ALT_TOKEN_ADDRESSES: Record<\n Network,\n Partial<Record<AltToken, 'native' | `0x${string}`>>\n> = {\n base: { ETH: 'native', BTC: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' },\n optimism: { ETH: 'native', BTC: '0x68f180fcCe6836688e9084f035309E29Bf0A2095' },\n ethereum: { ETH: 'native', BTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' },\n arbitrum: { ETH: 'native', BTC: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f' },\n polygon: { MATIC: 'native', BTC: '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6' },\n avalanche: { AVAX: 'native' },\n bnb: { BNB: 'native' },\n}\n"],"mappings":";AAGO,IAAM,iBAA0C;AAAA,EACrD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,KAAK;AACP;AAEO,IAAM,oBAA6C;AAAA,EACxD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,KAAK;AACP;AAEO,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,YAAsE;AAAA,EACjF,MAAM,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,EAChC,UAAU,EAAE,MAAM,IAAI,MAAM,SAAS;AAAA,EACrC,UAAU,EAAE,MAAM,GAAG,MAAM,SAAS;AAAA,EACpC,SAAS,EAAE,MAAM,IAAI;AAAA,EACrB,UAAU,EAAE,MAAM,MAAM;AAAA,EACxB,WAAW,EAAE,MAAM,MAAM;AAAA,EACzB,KAAK,EAAE,MAAM,GAAG;AAClB;;;AChDO,IAAM,iBAAiB;AAOvB,IAAM,oBAAyD;AAAA,EACpE,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,MAAM,EAA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IAAI,WAAW;AACxD;AAEO,SAAS,2BACd,OACA,SACA,aACS;AACT,MAAI,YAAY,SAAS,gBAAgB,OAAQ,QAAO;AACxD,SAAO,mBAAmB,OAAO,SAAS,WAAW,MAAM;AAC7D;AAEA,SAAS,gBAAgB,aAAuD;AAC9E,QAAM,YAAgC,CAAC;AACvC,aAAW,WAAW,cAAc;AAClC,UAAM,gBAAgB,YAAY,OAAO;AACzC,QAAI,CAAC,cAAe;AACpB,UAAM,mBAAgE,CAAC;AACvE,eAAW,eAAe,CAAC,QAAQ,MAAM,GAAY;AACnD,YAAM,aAAa,cAAc,WAAW;AAC5C,UAAI,WAAY,kBAAiB,WAAW,IAAI,WAAW;AAAA,IAC7D;AACA,cAAU,OAAO,IAAI;AAAA,EACvB;AACA,SAAO;AACT;AAEO,IAAM,kBAAqD;AAAA,EAChE,MAAM,gBAAgB,kBAAkB,IAAI;AAAA,EAC5C,MAAM,gBAAgB,kBAAkB,IAAI;AAC9C;;;AC1EO,IAAM,qBAA+C;AAAA,EAC1D,KAAK;AAAA,EACL,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AACP;AAEO,IAAM,sBAGT;AAAA,EACF,MAAM,EAAE,KAAK,UAAU,KAAK,6CAA6C;AAAA,EACzE,UAAU,EAAE,KAAK,UAAU,KAAK,6CAA6C;AAAA,EAC7E,UAAU,EAAE,KAAK,UAAU,KAAK,6CAA6C;AAAA,EAC7E,UAAU,EAAE,KAAK,UAAU,KAAK,6CAA6C;AAAA,EAC7E,SAAS,EAAE,OAAO,UAAU,KAAK,6CAA6C;AAAA,EAC9E,WAAW,EAAE,MAAM,SAAS;AAAA,EAC5B,KAAK,EAAE,KAAK,SAAS;AACvB;","names":[]}
@@ -18,7 +18,16 @@ declare const TokenSchema: z.ZodEnum<["USDC", "USDT"]>;
18
18
  type Token = z.infer<typeof TokenSchema>;
19
19
 
20
20
  declare const TOKEN_DECIMALS = 6;
21
- declare const TOKEN_ADDRESSES: Record<Token, Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>>;
21
+ type TokenDeployment = {
22
+ address: `0x${string}`;
23
+ decimals: number;
24
+ };
25
+ type DeploymentsByNetwork = Partial<Record<Network, Partial<Record<Environment, TokenDeployment>>>>;
26
+ type AddressesByNetwork = Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>;
27
+ declare const TOKEN_DEPLOYMENTS: Record<Token, DeploymentsByNetwork>;
28
+ declare function getTokenDeployment(token: Token, network: Network, environment: Environment): TokenDeployment | undefined;
29
+ declare function isPaymentDeploymentEnabled(token: Token, network: Network, environment: Environment): boolean;
30
+ declare const TOKEN_ADDRESSES: Record<Token, AddressesByNetwork>;
22
31
 
23
32
  declare const AltTokenSchema: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
24
33
  type AltToken = z.infer<typeof AltTokenSchema>;
@@ -38,4 +47,4 @@ declare function listSwapAlternatives(networks: readonly Network[]): SwapAlterna
38
47
  declare const ALT_TOKEN_DECIMALS: Record<AltToken, number>;
39
48
  declare const ALT_TOKEN_ADDRESSES: Record<Network, Partial<Record<AltToken, 'native' | `0x${string}`>>>;
40
49
 
41
- export { ALT_TOKEN_ADDRESSES as A, CHAIN_IDS as C, EVM_NETWORKS as E, NETWORK_EXPLORERS as N, OPERATIONAL_NETWORKS as O, type SwapAlternative as S, TOKEN_ADDRESSES as T, ALT_TOKEN_DECIMALS as a, type AltToken as b, AltTokenSchema as c, type Environment as d, EnvironmentSchema as e, type EvmNetwork as f, NETWORK_LABELS as g, type Network as h, NetworkSchema as i, type OperationalNetwork as j, SwapAlternativeSchema as k, TOKEN_DECIMALS as l, type Token as m, TokenSchema as n, listSwapAlternatives as o };
50
+ export { ALT_TOKEN_ADDRESSES as A, CHAIN_IDS as C, EVM_NETWORKS as E, NETWORK_EXPLORERS as N, OPERATIONAL_NETWORKS as O, type SwapAlternative as S, TOKEN_ADDRESSES as T, ALT_TOKEN_DECIMALS as a, type AltToken as b, AltTokenSchema as c, type Environment as d, EnvironmentSchema as e, type EvmNetwork as f, NETWORK_LABELS as g, type Network as h, NetworkSchema as i, type OperationalNetwork as j, SwapAlternativeSchema as k, TOKEN_DECIMALS as l, TOKEN_DEPLOYMENTS as m, type Token as n, type TokenDeployment as o, TokenSchema as p, getTokenDeployment as q, isPaymentDeploymentEnabled as r, listSwapAlternatives as s };
@@ -18,7 +18,16 @@ declare const TokenSchema: z.ZodEnum<["USDC", "USDT"]>;
18
18
  type Token = z.infer<typeof TokenSchema>;
19
19
 
20
20
  declare const TOKEN_DECIMALS = 6;
21
- declare const TOKEN_ADDRESSES: Record<Token, Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>>;
21
+ type TokenDeployment = {
22
+ address: `0x${string}`;
23
+ decimals: number;
24
+ };
25
+ type DeploymentsByNetwork = Partial<Record<Network, Partial<Record<Environment, TokenDeployment>>>>;
26
+ type AddressesByNetwork = Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>;
27
+ declare const TOKEN_DEPLOYMENTS: Record<Token, DeploymentsByNetwork>;
28
+ declare function getTokenDeployment(token: Token, network: Network, environment: Environment): TokenDeployment | undefined;
29
+ declare function isPaymentDeploymentEnabled(token: Token, network: Network, environment: Environment): boolean;
30
+ declare const TOKEN_ADDRESSES: Record<Token, AddressesByNetwork>;
22
31
 
23
32
  declare const AltTokenSchema: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
24
33
  type AltToken = z.infer<typeof AltTokenSchema>;
@@ -38,4 +47,4 @@ declare function listSwapAlternatives(networks: readonly Network[]): SwapAlterna
38
47
  declare const ALT_TOKEN_DECIMALS: Record<AltToken, number>;
39
48
  declare const ALT_TOKEN_ADDRESSES: Record<Network, Partial<Record<AltToken, 'native' | `0x${string}`>>>;
40
49
 
41
- export { ALT_TOKEN_ADDRESSES as A, CHAIN_IDS as C, EVM_NETWORKS as E, NETWORK_EXPLORERS as N, OPERATIONAL_NETWORKS as O, type SwapAlternative as S, TOKEN_ADDRESSES as T, ALT_TOKEN_DECIMALS as a, type AltToken as b, AltTokenSchema as c, type Environment as d, EnvironmentSchema as e, type EvmNetwork as f, NETWORK_LABELS as g, type Network as h, NetworkSchema as i, type OperationalNetwork as j, SwapAlternativeSchema as k, TOKEN_DECIMALS as l, type Token as m, TokenSchema as n, listSwapAlternatives as o };
50
+ export { ALT_TOKEN_ADDRESSES as A, CHAIN_IDS as C, EVM_NETWORKS as E, NETWORK_EXPLORERS as N, OPERATIONAL_NETWORKS as O, type SwapAlternative as S, TOKEN_ADDRESSES as T, ALT_TOKEN_DECIMALS as a, type AltToken as b, AltTokenSchema as c, type Environment as d, EnvironmentSchema as e, type EvmNetwork as f, NETWORK_LABELS as g, type Network as h, NetworkSchema as i, type OperationalNetwork as j, SwapAlternativeSchema as k, TOKEN_DECIMALS as l, TOKEN_DEPLOYMENTS as m, type Token as n, type TokenDeployment as o, TokenSchema as p, getTokenDeployment as q, isPaymentDeploymentEnabled as r, listSwapAlternatives as s };
@@ -1,2 +1,2 @@
1
- export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, C as CHAIN_IDS, E as EVM_NETWORKS, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS } from './constants-DQGVNS9O.mjs';
1
+ export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, C as CHAIN_IDS, E as EVM_NETWORKS, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as TOKEN_DEPLOYMENTS, o as TokenDeployment, q as getTokenDeployment, r as isPaymentDeploymentEnabled } from './constants-021Ybu31.mjs';
2
2
  import 'zod';
@@ -1,2 +1,2 @@
1
- export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, C as CHAIN_IDS, E as EVM_NETWORKS, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS } from './constants-DQGVNS9O.js';
1
+ export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, C as CHAIN_IDS, E as EVM_NETWORKS, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as TOKEN_DEPLOYMENTS, o as TokenDeployment, q as getTokenDeployment, r as isPaymentDeploymentEnabled } from './constants-021Ybu31.js';
2
2
  import 'zod';
package/dist/constants.js CHANGED
@@ -28,7 +28,10 @@ __export(constants_exports, {
28
28
  NETWORK_LABELS: () => NETWORK_LABELS,
29
29
  OPERATIONAL_NETWORKS: () => OPERATIONAL_NETWORKS,
30
30
  TOKEN_ADDRESSES: () => TOKEN_ADDRESSES,
31
- TOKEN_DECIMALS: () => TOKEN_DECIMALS
31
+ TOKEN_DECIMALS: () => TOKEN_DECIMALS,
32
+ TOKEN_DEPLOYMENTS: () => TOKEN_DEPLOYMENTS,
33
+ getTokenDeployment: () => getTokenDeployment,
34
+ isPaymentDeploymentEnabled: () => isPaymentDeploymentEnabled
32
35
  });
33
36
  module.exports = __toCommonJS(constants_exports);
34
37
 
@@ -81,34 +84,59 @@ var CHAIN_IDS = {
81
84
 
82
85
  // src/tokens.constants.ts
83
86
  var TOKEN_DECIMALS = 6;
84
- var TOKEN_ADDRESSES = {
87
+ var TOKEN_DEPLOYMENTS = {
85
88
  USDC: {
86
89
  base: {
87
- live: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
88
- test: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
90
+ live: { address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", decimals: 6 },
91
+ test: { address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", decimals: 6 }
89
92
  },
90
93
  optimism: {
91
- live: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
92
- test: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7"
94
+ live: { address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", decimals: 6 },
95
+ test: { address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", decimals: 6 }
93
96
  },
94
- polygon: { live: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" },
97
+ polygon: { live: { address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", decimals: 6 } },
95
98
  ethereum: {
96
- live: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
97
- test: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"
99
+ live: { address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", decimals: 6 },
100
+ test: { address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", decimals: 6 }
98
101
  },
99
- arbitrum: { live: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" },
100
- avalanche: { live: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E" },
101
- bnb: { live: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" }
102
+ arbitrum: { live: { address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", decimals: 6 } },
103
+ avalanche: { live: { address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", decimals: 6 } },
104
+ bnb: { live: { address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", decimals: 18 } }
102
105
  },
103
106
  USDT: {
104
- base: { live: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2" },
105
- optimism: { live: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" },
106
- polygon: { live: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F" },
107
- ethereum: { live: "0xdAC17F958D2ee523a2206206994597C13D831ec7" },
108
- arbitrum: { live: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9" },
109
- avalanche: { live: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7" },
110
- bnb: { live: "0x55d398326f99059fF775485246999027B3197955" }
107
+ base: { live: { address: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2", decimals: 6 } },
108
+ optimism: { live: { address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", decimals: 6 } },
109
+ polygon: { live: { address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", decimals: 6 } },
110
+ ethereum: { live: { address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", decimals: 6 } },
111
+ arbitrum: { live: { address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", decimals: 6 } },
112
+ avalanche: { live: { address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", decimals: 6 } },
113
+ bnb: { live: { address: "0x55d398326f99059fF775485246999027B3197955", decimals: 18 } }
114
+ }
115
+ };
116
+ function getTokenDeployment(token, network, environment) {
117
+ return TOKEN_DEPLOYMENTS[token][network]?.[environment];
118
+ }
119
+ function isPaymentDeploymentEnabled(token, network, environment) {
120
+ if (network === "bnb" && environment === "live") return false;
121
+ return getTokenDeployment(token, network, environment) !== void 0;
122
+ }
123
+ function deriveAddresses(deployments) {
124
+ const addresses = {};
125
+ for (const network of EVM_NETWORKS) {
126
+ const byEnvironment = deployments[network];
127
+ if (!byEnvironment) continue;
128
+ const networkAddresses = {};
129
+ for (const environment of ["live", "test"]) {
130
+ const deployment = byEnvironment[environment];
131
+ if (deployment) networkAddresses[environment] = deployment.address;
132
+ }
133
+ addresses[network] = networkAddresses;
111
134
  }
135
+ return addresses;
136
+ }
137
+ var TOKEN_ADDRESSES = {
138
+ USDC: deriveAddresses(TOKEN_DEPLOYMENTS.USDC),
139
+ USDT: deriveAddresses(TOKEN_DEPLOYMENTS.USDT)
112
140
  };
113
141
 
114
142
  // src/alt-tokens.constants.ts
@@ -138,6 +166,9 @@ var ALT_TOKEN_ADDRESSES = {
138
166
  NETWORK_LABELS,
139
167
  OPERATIONAL_NETWORKS,
140
168
  TOKEN_ADDRESSES,
141
- TOKEN_DECIMALS
169
+ TOKEN_DECIMALS,
170
+ TOKEN_DEPLOYMENTS,
171
+ getTokenDeployment,
172
+ isPaymentDeploymentEnabled
142
173
  });
143
174
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants.ts","../src/networks.constants.ts","../src/tokens.constants.ts","../src/alt-tokens.constants.ts"],"sourcesContent":["export * from './networks.constants'\nexport * from './tokens.constants'\nexport * from './alt-tokens.constants'\n","import type { Environment } from './environment'\nimport type { Network } from './networks'\n\nexport const NETWORK_LABELS: Record<Network, string> = {\n base: 'Base',\n optimism: 'Optimism',\n polygon: 'Polygon',\n ethereum: 'Ethereum',\n arbitrum: 'Arbitrum',\n avalanche: 'Avalanche',\n bnb: 'BNB Chain',\n}\n\nexport const NETWORK_EXPLORERS: Record<Network, string> = {\n base: 'https://basescan.org',\n optimism: 'https://optimistic.etherscan.io',\n polygon: 'https://polygonscan.com',\n ethereum: 'https://etherscan.io',\n arbitrum: 'https://arbiscan.io',\n avalanche: 'https://snowtrace.io',\n bnb: 'https://bscscan.com',\n}\n\nexport const EVM_NETWORKS = [\n 'base',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'arbitrum',\n 'avalanche',\n 'bnb',\n] as const\nexport type EvmNetwork = (typeof EVM_NETWORKS)[number]\n\nexport const OPERATIONAL_NETWORKS = [\n 'base',\n 'arbitrum',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'avalanche',\n 'bnb',\n] as const\nexport type OperationalNetwork = (typeof OPERATIONAL_NETWORKS)[number]\n\nexport const CHAIN_IDS: Record<EvmNetwork, Partial<Record<Environment, number>>> = {\n base: { live: 8453, test: 84532 },\n optimism: { live: 10, test: 11155420 },\n ethereum: { live: 1, test: 11155111 },\n polygon: { live: 137 },\n arbitrum: { live: 42161 },\n avalanche: { live: 43114 },\n bnb: { live: 56 },\n}\n","import type { Environment } from './environment'\nimport type { Network } from './networks'\nimport type { Token } from './tokens'\n\nexport const TOKEN_DECIMALS = 6\n\nexport const TOKEN_ADDRESSES: Record<\n Token,\n Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>\n> = {\n USDC: {\n base: {\n live: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n test: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n },\n optimism: {\n live: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',\n test: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7',\n },\n polygon: { live: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' },\n ethereum: {\n live: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n test: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',\n },\n arbitrum: { live: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' },\n avalanche: { live: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' },\n bnb: { live: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' },\n },\n USDT: {\n base: { live: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2' },\n optimism: { live: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58' },\n polygon: { live: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F' },\n ethereum: { live: '0xdAC17F958D2ee523a2206206994597C13D831ec7' },\n arbitrum: { live: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9' },\n avalanche: { live: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7' },\n bnb: { live: '0x55d398326f99059fF775485246999027B3197955' },\n },\n}\n","import type { AltToken } from './alt-tokens'\nimport type { Network } from './networks'\n\nexport const ALT_TOKEN_DECIMALS: Record<AltToken, number> = {\n ETH: 18,\n BNB: 18,\n MATIC: 18,\n AVAX: 18,\n BTC: 8,\n}\n\nexport const ALT_TOKEN_ADDRESSES: Record<\n Network,\n Partial<Record<AltToken, 'native' | `0x${string}`>>\n> = {\n base: { ETH: 'native', BTC: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' },\n optimism: { ETH: 'native', BTC: '0x68f180fcCe6836688e9084f035309E29Bf0A2095' },\n ethereum: { ETH: 'native', BTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' },\n arbitrum: { ETH: 'native', BTC: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f' },\n polygon: { MATIC: 'native', BTC: '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6' },\n avalanche: { AVAX: 'native' },\n bnb: { BNB: 'native' },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,iBAA0C;AAAA,EACrD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,KAAK;AACP;AAEO,IAAM,oBAA6C;AAAA,EACxD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,KAAK;AACP;AAEO,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,YAAsE;AAAA,EACjF,MAAM,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,EAChC,UAAU,EAAE,MAAM,IAAI,MAAM,SAAS;AAAA,EACrC,UAAU,EAAE,MAA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C;AAAA,EAC7E,SAAS,EAAE,OAAO,UAAU,KAAK,6CAA6C;AAAA,EAC9E,WAAW,EAAE,MAAM,SAAS;AAAA,EAC5B,KAAK,EAAE,KAAK,SAAS;AACvB;","names":[]}
1
+ {"version":3,"sources":["../src/constants.ts","../src/networks.constants.ts","../src/tokens.constants.ts","../src/alt-tokens.constants.ts"],"sourcesContent":["export * from './networks.constants'\nexport * from './tokens.constants'\nexport * from './alt-tokens.constants'\n","import type { Environment } from './environment'\nimport type { Network } from './networks'\n\nexport const NETWORK_LABELS: Record<Network, string> = {\n base: 'Base',\n optimism: 'Optimism',\n polygon: 'Polygon',\n ethereum: 'Ethereum',\n arbitrum: 'Arbitrum',\n avalanche: 'Avalanche',\n bnb: 'BNB Chain',\n}\n\nexport const NETWORK_EXPLORERS: Record<Network, string> = {\n base: 'https://basescan.org',\n optimism: 'https://optimistic.etherscan.io',\n polygon: 'https://polygonscan.com',\n ethereum: 'https://etherscan.io',\n arbitrum: 'https://arbiscan.io',\n avalanche: 'https://snowtrace.io',\n bnb: 'https://bscscan.com',\n}\n\nexport const EVM_NETWORKS = [\n 'base',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'arbitrum',\n 'avalanche',\n 'bnb',\n] as const\nexport type EvmNetwork = (typeof EVM_NETWORKS)[number]\n\nexport const OPERATIONAL_NETWORKS = [\n 'base',\n 'arbitrum',\n 'optimism',\n 'polygon',\n 'ethereum',\n 'avalanche',\n 'bnb',\n] as const\nexport type OperationalNetwork = (typeof OPERATIONAL_NETWORKS)[number]\n\nexport const CHAIN_IDS: Record<EvmNetwork, Partial<Record<Environment, number>>> = {\n base: { live: 8453, test: 84532 },\n optimism: { live: 10, test: 11155420 },\n ethereum: { live: 1, test: 11155111 },\n polygon: { live: 137 },\n arbitrum: { live: 42161 },\n avalanche: { live: 43114 },\n bnb: { live: 56 },\n}\n","import type { Environment } from './environment'\nimport type { Network } from './networks'\nimport { EVM_NETWORKS } from './networks.constants'\nimport type { Token } from './tokens'\n\nexport const TOKEN_DECIMALS = 6\n\nexport type TokenDeployment = { address: `0x${string}`; decimals: number }\n\ntype DeploymentsByNetwork = Partial<Record<Network, Partial<Record<Environment, TokenDeployment>>>>\ntype AddressesByNetwork = Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>\n\nexport const TOKEN_DEPLOYMENTS: Record<Token, DeploymentsByNetwork> = {\n USDC: {\n base: {\n live: { address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', decimals: 6 },\n test: { address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', decimals: 6 },\n },\n optimism: {\n live: { address: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', decimals: 6 },\n test: { address: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7', decimals: 6 },\n },\n polygon: { live: { address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', decimals: 6 } },\n ethereum: {\n live: { address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', decimals: 6 },\n test: { address: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', decimals: 6 },\n },\n arbitrum: { live: { address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', decimals: 6 } },\n avalanche: { live: { address: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', decimals: 6 } },\n bnb: { live: { address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', decimals: 18 } },\n },\n USDT: {\n base: { live: { address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2', decimals: 6 } },\n optimism: { live: { address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', decimals: 6 } },\n polygon: { live: { address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F', decimals: 6 } },\n ethereum: { live: { address: '0xdAC17F958D2ee523a2206206994597C13D831ec7', decimals: 6 } },\n arbitrum: { live: { address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', decimals: 6 } },\n avalanche: { live: { address: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', decimals: 6 } },\n bnb: { live: { address: '0x55d398326f99059fF775485246999027B3197955', decimals: 18 } },\n },\n}\n\nexport function getTokenDeployment(\n token: Token,\n network: Network,\n environment: Environment,\n): TokenDeployment | undefined {\n return TOKEN_DEPLOYMENTS[token][network]?.[environment]\n}\n\nexport function isPaymentDeploymentEnabled(\n token: Token,\n network: Network,\n environment: Environment,\n): boolean {\n if (network === 'bnb' && environment === 'live') return false\n return getTokenDeployment(token, network, environment) !== undefined\n}\n\nfunction deriveAddresses(deployments: DeploymentsByNetwork): AddressesByNetwork {\n const addresses: AddressesByNetwork = {}\n for (const network of EVM_NETWORKS) {\n const byEnvironment = deployments[network]\n if (!byEnvironment) continue\n const networkAddresses: Partial<Record<Environment, `0x${string}`>> = {}\n for (const environment of ['live', 'test'] as const) {\n const deployment = byEnvironment[environment]\n if (deployment) networkAddresses[environment] = deployment.address\n }\n addresses[network] = networkAddresses\n }\n return addresses\n}\n\nexport const TOKEN_ADDRESSES: Record<Token, AddressesByNetwork> = {\n USDC: deriveAddresses(TOKEN_DEPLOYMENTS.USDC),\n USDT: deriveAddresses(TOKEN_DEPLOYMENTS.USDT),\n}\n","import type { AltToken } from './alt-tokens'\nimport type { Network } from './networks'\n\nexport const ALT_TOKEN_DECIMALS: Record<AltToken, number> = {\n ETH: 18,\n BNB: 18,\n MATIC: 18,\n AVAX: 18,\n BTC: 8,\n}\n\nexport const ALT_TOKEN_ADDRESSES: Record<\n Network,\n Partial<Record<AltToken, 'native' | `0x${string}`>>\n> = {\n base: { ETH: 'native', BTC: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' },\n optimism: { ETH: 'native', BTC: '0x68f180fcCe6836688e9084f035309E29Bf0A2095' },\n ethereum: { ETH: 'native', BTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' },\n arbitrum: { ETH: 'native', BTC: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f' },\n polyg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from "./chunk-WKIOAEJ3.mjs";
12
15
  export {
13
16
  ALT_TOKEN_ADDRESSES,
14
17
  ALT_TOKEN_DECIMALS,
@@ -18,6 +21,9 @@ export {
18
21
  NETWORK_LABELS,
19
22
  OPERATIONAL_NETWORKS,
20
23
  TOKEN_ADDRESSES,
21
- TOKEN_DECIMALS
24
+ TOKEN_DECIMALS,
25
+ TOKEN_DEPLOYMENTS,
26
+ getTokenDeployment,
27
+ isPaymentDeploymentEnabled
22
28
  };
23
29
  //# sourceMappingURL=constants.mjs.map
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, b as AltToken, c as AltTokenSchema, C as CHAIN_IDS, E as EVM_NETWORKS, d as Environment, e as EnvironmentSchema, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, h as Network, i as NetworkSchema, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, S as SwapAlternative, k as SwapAlternativeSchema, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as Token, n as TokenSchema, o as listSwapAlternatives } from './constants-DQGVNS9O.mjs';
2
+ export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, b as AltToken, c as AltTokenSchema, C as CHAIN_IDS, E as EVM_NETWORKS, d as Environment, e as EnvironmentSchema, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, h as Network, i as NetworkSchema, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, S as SwapAlternative, k as SwapAlternativeSchema, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as TOKEN_DEPLOYMENTS, n as Token, o as TokenDeployment, p as TokenSchema, q as getTokenDeployment, r as isPaymentDeploymentEnabled, s as listSwapAlternatives } from './constants-021Ybu31.mjs';
3
3
 
4
4
  declare const ErrorPayloadSchema: z.ZodObject<{
5
5
  error: z.ZodObject<{
@@ -359,11 +359,14 @@ type CreateChargeRequest = z.input<typeof CreateChargeSchema>;
359
359
  declare const ChargeSchema: z.ZodObject<{
360
360
  id: z.ZodString;
361
361
  amount: z.ZodNumber;
362
+ amountExact: z.ZodOptional<z.ZodString>;
362
363
  feePayer: z.ZodEnum<["merchant", "payer"]>;
363
364
  feePercent: z.ZodNumber;
364
365
  feeAmount: z.ZodNumber;
365
366
  merchantAmount: z.ZodNumber;
366
367
  amountReceived: z.ZodNullable<z.ZodNumber>;
368
+ amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
369
+ paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
367
370
  isOverpaid: z.ZodBoolean;
368
371
  currency: z.ZodString;
369
372
  acceptedPayments: z.ZodArray<z.ZodObject<{
@@ -598,6 +601,9 @@ declare const ChargeSchema: z.ZodObject<{
598
601
  confirmedAt: string | null;
599
602
  settledAt: string | null;
600
603
  lastActivityAt: string;
604
+ amountExact?: string | undefined;
605
+ amountReceivedExact?: string | null | undefined;
606
+ paymentUnavailable?: boolean | undefined;
601
607
  }, {
602
608
  status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
603
609
  address: string;
@@ -674,6 +680,9 @@ declare const ChargeSchema: z.ZodObject<{
674
680
  confirmedAt: string | null;
675
681
  settledAt: string | null;
676
682
  lastActivityAt: string;
683
+ amountExact?: string | undefined;
684
+ amountReceivedExact?: string | null | undefined;
685
+ paymentUnavailable?: boolean | undefined;
677
686
  }>;
678
687
  type Charge = z.infer<typeof ChargeSchema>;
679
688
  declare const ListChargesSchema: z.ZodObject<{
@@ -711,11 +720,14 @@ declare const PaginatedChargesSchema: z.ZodObject<{
711
720
  data: z.ZodArray<z.ZodObject<{
712
721
  id: z.ZodString;
713
722
  amount: z.ZodNumber;
723
+ amountExact: z.ZodOptional<z.ZodString>;
714
724
  feePayer: z.ZodEnum<["merchant", "payer"]>;
715
725
  feePercent: z.ZodNumber;
716
726
  feeAmount: z.ZodNumber;
717
727
  merchantAmount: z.ZodNumber;
718
728
  amountReceived: z.ZodNullable<z.ZodNumber>;
729
+ amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
730
+ paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
719
731
  isOverpaid: z.ZodBoolean;
720
732
  currency: z.ZodString;
721
733
  acceptedPayments: z.ZodArray<z.ZodObject<{
@@ -950,6 +962,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
950
962
  confirmedAt: string | null;
951
963
  settledAt: string | null;
952
964
  lastActivityAt: string;
965
+ amountExact?: string | undefined;
966
+ amountReceivedExact?: string | null | undefined;
967
+ paymentUnavailable?: boolean | undefined;
953
968
  }, {
954
969
  status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
955
970
  address: string;
@@ -1026,6 +1041,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
1026
1041
  confirmedAt: string | null;
1027
1042
  settledAt: string | null;
1028
1043
  lastActivityAt: string;
1044
+ amountExact?: string | undefined;
1045
+ amountReceivedExact?: string | null | undefined;
1046
+ paymentUnavailable?: boolean | undefined;
1029
1047
  }>, "many">;
1030
1048
  nextCursor: z.ZodNullable<z.ZodString>;
1031
1049
  hasMore: z.ZodBoolean;
@@ -1106,6 +1124,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
1106
1124
  confirmedAt: string | null;
1107
1125
  settledAt: string | null;
1108
1126
  lastActivityAt: string;
1127
+ amountExact?: string | undefined;
1128
+ amountReceivedExact?: string | null | undefined;
1129
+ paymentUnavailable?: boolean | undefined;
1109
1130
  }[];
1110
1131
  nextCursor: string | null;
1111
1132
  hasMore: boolean;
@@ -1186,6 +1207,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
1186
1207
  confirmedAt: string | null;
1187
1208
  settledAt: string | null;
1188
1209
  lastActivityAt: string;
1210
+ amountExact?: string | undefined;
1211
+ amountReceivedExact?: string | null | undefined;
1212
+ paymentUnavailable?: boolean | undefined;
1189
1213
  }[];
1190
1214
  nextCursor: string | null;
1191
1215
  hasMore: boolean;
@@ -1224,11 +1248,14 @@ type CheckChargeRequest = z.infer<typeof CheckChargeRequestSchema>;
1224
1248
  declare const CheckChargeResponseSchema: z.ZodObject<{
1225
1249
  id: z.ZodString;
1226
1250
  amount: z.ZodNumber;
1251
+ amountExact: z.ZodOptional<z.ZodString>;
1227
1252
  feePayer: z.ZodEnum<["merchant", "payer"]>;
1228
1253
  feePercent: z.ZodNumber;
1229
1254
  feeAmount: z.ZodNumber;
1230
1255
  merchantAmount: z.ZodNumber;
1231
1256
  amountReceived: z.ZodNullable<z.ZodNumber>;
1257
+ amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1258
+ paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
1232
1259
  isOverpaid: z.ZodBoolean;
1233
1260
  currency: z.ZodString;
1234
1261
  acceptedPayments: z.ZodArray<z.ZodObject<{
@@ -1488,6 +1515,9 @@ declare const CheckChargeResponseSchema: z.ZodObject<{
1488
1515
  blocksSeen: number;
1489
1516
  blocksRequired: number;
1490
1517
  } | null;
1518
+ amountExact?: string | undefined;
1519
+ amountReceivedExact?: string | null | undefined;
1520
+ paymentUnavailable?: boolean | undefined;
1491
1521
  }, {
1492
1522
  status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
1493
1523
  address: string;
@@ -1571,6 +1601,9 @@ declare const CheckChargeResponseSchema: z.ZodObject<{
1571
1601
  blocksSeen: number;
1572
1602
  blocksRequired: number;
1573
1603
  } | null;
1604
+ amountExact?: string | undefined;
1605
+ amountReceivedExact?: string | null | undefined;
1606
+ paymentUnavailable?: boolean | undefined;
1574
1607
  }>;
1575
1608
  type CheckChargeResponse = z.infer<typeof CheckChargeResponseSchema>;
1576
1609
 
@@ -3079,18 +3112,26 @@ declare const SwapQuoteSchema: z.ZodObject<{
3079
3112
  inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
3080
3113
  inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
3081
3114
  inputAmount: z.ZodNumber;
3115
+ inputAmountExact: z.ZodOptional<z.ZodString>;
3082
3116
  outputToken: z.ZodEnum<["USDC", "USDT"]>;
3083
3117
  outputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
3084
3118
  outputAmount: z.ZodNumber;
3119
+ outputAmountExact: z.ZodOptional<z.ZodString>;
3085
3120
  fees: z.ZodObject<{
3086
3121
  klappayFee: z.ZodNumber;
3122
+ klappayFeeExact: z.ZodOptional<z.ZodString>;
3087
3123
  zeroExFee: z.ZodNullable<z.ZodNumber>;
3124
+ zeroExFeeExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3088
3125
  }, "strip", z.ZodTypeAny, {
3089
3126
  klappayFee: number;
3090
3127
  zeroExFee: number | null;
3128
+ klappayFeeExact?: string | undefined;
3129
+ zeroExFeeExact?: string | null | undefined;
3091
3130
  }, {
3092
3131
  klappayFee: number;
3093
3132
  zeroExFee: number | null;
3133
+ klappayFeeExact?: string | undefined;
3134
+ zeroExFeeExact?: string | null | undefined;
3094
3135
  }>;
3095
3136
  expiresAt: z.ZodString;
3096
3137
  transaction: z.ZodObject<{
@@ -3124,12 +3165,16 @@ declare const SwapQuoteSchema: z.ZodObject<{
3124
3165
  fees: {
3125
3166
  klappayFee: number;
3126
3167
  zeroExFee: number | null;
3168
+ klappayFeeExact?: string | undefined;
3169
+ zeroExFeeExact?: string | null | undefined;
3127
3170
  };
3128
3171
  transaction: {
3129
3172
  value: string;
3130
3173
  data: string;
3131
3174
  to: string;
3132
3175
  };
3176
+ inputAmountExact?: string | undefined;
3177
+ outputAmountExact?: string | undefined;
3133
3178
  permit2?: {
3134
3179
  eip712: Record<string, unknown>;
3135
3180
  } | null | undefined;
@@ -3144,12 +3189,16 @@ declare const SwapQuoteSchema: z.ZodObject<{
3144
3189
  fees: {
3145
3190
  klappayFee: number;
3146
3191
  zeroExFee: number | null;
3192
+ klappayFeeExact?: string | undefined;
3193
+ zeroExFeeExact?: string | null | undefined;
3147
3194
  };
3148
3195
  transaction: {
3149
3196
  value: string;
3150
3197
  data: string;
3151
3198
  to: string;
3152
3199
  };
3200
+ inputAmountExact?: string | undefined;
3201
+ outputAmountExact?: string | undefined;
3153
3202
  permit2?: {
3154
3203
  eip712: Record<string, unknown>;
3155
3204
  } | null | undefined;