faucet-server-app 0.0.6 → 0.2.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.
Files changed (52) hide show
  1. package/dist/esm/api/index.d.ts +51 -16
  2. package/dist/esm/api/index.d.ts.map +1 -1
  3. package/dist/esm/api/index.js +567 -79
  4. package/dist/esm/api/index.js.map +1 -1
  5. package/dist/esm/calls.d.ts +107 -0
  6. package/dist/esm/calls.d.ts.map +1 -0
  7. package/dist/esm/calls.js +304 -0
  8. package/dist/esm/calls.js.map +1 -0
  9. package/dist/esm/captcha.d.ts +28 -0
  10. package/dist/esm/captcha.d.ts.map +1 -0
  11. package/dist/esm/captcha.js +58 -0
  12. package/dist/esm/captcha.js.map +1 -0
  13. package/dist/esm/chains.d.ts +17552 -0
  14. package/dist/esm/chains.d.ts.map +1 -0
  15. package/dist/esm/chains.js +137 -0
  16. package/dist/esm/chains.js.map +1 -0
  17. package/dist/esm/config.d.ts +12 -0
  18. package/dist/esm/config.d.ts.map +1 -0
  19. package/dist/esm/config.js +28 -0
  20. package/dist/esm/config.js.map +1 -0
  21. package/dist/esm/env.d.ts +56 -0
  22. package/dist/esm/env.d.ts.map +1 -1
  23. package/dist/esm/env.js +81 -1
  24. package/dist/esm/env.js.map +1 -1
  25. package/dist/esm/index.d.ts +135 -42
  26. package/dist/esm/index.d.ts.map +1 -1
  27. package/dist/esm/index.js +39 -16
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/schema/ts/db.sql.d.ts +1 -1
  30. package/dist/esm/schema/ts/db.sql.d.ts.map +1 -1
  31. package/dist/esm/schema/ts/db.sql.js +25 -4
  32. package/dist/esm/schema/ts/db.sql.js.map +1 -1
  33. package/dist/esm/setup.d.ts +2 -0
  34. package/dist/esm/setup.d.ts.map +1 -1
  35. package/dist/esm/setup.js +25 -7
  36. package/dist/esm/setup.js.map +1 -1
  37. package/dist/esm/storage/RemoteSQLStorage.d.ts +49 -0
  38. package/dist/esm/storage/RemoteSQLStorage.d.ts.map +1 -0
  39. package/dist/esm/storage/RemoteSQLStorage.js +158 -0
  40. package/dist/esm/storage/RemoteSQLStorage.js.map +1 -0
  41. package/package.json +1 -1
  42. package/src/api/index.ts +752 -105
  43. package/src/calls.ts +447 -0
  44. package/src/captcha.ts +92 -0
  45. package/src/chains.ts +175 -0
  46. package/src/config.ts +33 -0
  47. package/src/env.ts +129 -0
  48. package/src/index.ts +60 -18
  49. package/src/schema/sql/db.sql +25 -4
  50. package/src/schema/ts/db.sql.ts +25 -4
  51. package/src/setup.ts +28 -11
  52. package/src/storage/RemoteSQLStorage.ts +252 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,KAAK,EAAC,MAAM,MAAM,CAAC;AAC9E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAC;AAE7B,MAAM,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAgB1D;AAED,MAAM,MAAM,iBAAiB,GAC1B;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAC,GACnC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAC,GAC1B;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAqC3E;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,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CAAC,GAC9C,OAAO,CAAC,SAAS,CAAC,CAepB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACzC,YAAY,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAC9C,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,137 @@
1
+ import { createPublicClient, createWalletClient, http } from 'viem';
2
+ /**
3
+ * A chain id, from a url segment, a json body or a CHAIN_<id> variable name.
4
+ *
5
+ * Strict for the same reason the limits are: parseInt partial parses, so
6
+ * '31337x' used to resolve to chain 31337, and a CHAIN_1_TEST variable used to
7
+ * register itself as chain 1. Numbers are accepted as well as strings, because
8
+ * a json body may carry either.
9
+ */
10
+ export function parseChainId(value) {
11
+ if (typeof value === 'number') {
12
+ return Number.isSafeInteger(value) && value > 0 ? value : null;
13
+ }
14
+ if (typeof value !== 'string') {
15
+ return null;
16
+ }
17
+ const trimmed = value.trim();
18
+ if (!/^[0-9]+$/.test(trimmed)) {
19
+ return null;
20
+ }
21
+ const parsed = Number(trimmed);
22
+ if (!Number.isSafeInteger(parsed) || parsed <= 0) {
23
+ return null;
24
+ }
25
+ return parsed;
26
+ }
27
+ /**
28
+ * Chains are configured as CHAIN_<CHAIN_ID>=<amount_in_wei>:<rpc_endpoint>.
29
+ *
30
+ * The rpc endpoint is a SERVER side secret: it usually embeds an api key and is
31
+ * never returned to clients.
32
+ */
33
+ export function getChainConfig(env, chainId) {
34
+ const key = `CHAIN_${chainId}`;
35
+ const value = env[key];
36
+ if (!value) {
37
+ return { status: 'not-configured' };
38
+ }
39
+ const colonIndex = value.indexOf(':');
40
+ if (colonIndex === -1) {
41
+ return {
42
+ status: 'invalid',
43
+ details: `expected <amount>:<rpc_endpoint>, got no separator`,
44
+ };
45
+ }
46
+ const amountStr = value.substring(0, colonIndex).trim();
47
+ const rpcUrl = value.substring(colonIndex + 1).trim();
48
+ if (!amountStr || !rpcUrl) {
49
+ return {
50
+ status: 'invalid',
51
+ details: `expected <amount>:<rpc_endpoint>`,
52
+ };
53
+ }
54
+ let amount;
55
+ try {
56
+ amount = BigInt(amountStr);
57
+ }
58
+ catch (err) {
59
+ return {
60
+ status: 'invalid',
61
+ details: `amount "${amountStr}" is not a number`,
62
+ };
63
+ }
64
+ if (amount <= 0n) {
65
+ return { status: 'invalid', details: `amount must be greater than zero` };
66
+ }
67
+ return { status: 'ok', config: { chainId, amount, rpcUrl } };
68
+ }
69
+ export function getViemChain(config) {
70
+ return {
71
+ id: config.chainId,
72
+ name: `Chain ${config.chainId}`,
73
+ nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 },
74
+ rpcUrls: { default: { http: [config.rpcUrl] } },
75
+ };
76
+ }
77
+ export function getPublicClient(config) {
78
+ return createPublicClient({
79
+ chain: getViemChain(config),
80
+ transport: http(config.rpcUrl),
81
+ });
82
+ }
83
+ export function getWalletClient(config, account) {
84
+ return createWalletClient({
85
+ account,
86
+ chain: getViemChain(config),
87
+ transport: http(config.rpcUrl),
88
+ });
89
+ }
90
+ export async function getFeeParams(publicClient) {
91
+ try {
92
+ const fees = await publicClient.estimateFeesPerGas();
93
+ if (fees.maxFeePerGas) {
94
+ return {
95
+ type: 'eip1559',
96
+ maxFeePerGas: fees.maxFeePerGas,
97
+ maxPriorityFeePerGas: fees.maxPriorityFeePerGas,
98
+ };
99
+ }
100
+ }
101
+ catch (err) {
102
+ // chain without eip-1559 support, fall through to gas price
103
+ }
104
+ const gasPrice = await publicClient.getGasPrice();
105
+ return { type: 'legacy', gasPrice };
106
+ }
107
+ /**
108
+ * The per gas price a spending ceiling has to be computed against: the most
109
+ * the chain can charge for one unit of gas on this transaction.
110
+ */
111
+ export function feePerGas(fees) {
112
+ return fees.type === 'eip1559' ? fees.maxFeePerGas : fees.gasPrice;
113
+ }
114
+ /**
115
+ * Worst case cost of a plain value transfer, used to check the faucet can still
116
+ * pay for the transaction it is about to broadcast.
117
+ */
118
+ export async function estimateTransferCost(publicClient) {
119
+ const gasLimit = 21000n;
120
+ try {
121
+ const fees = await publicClient.estimateFeesPerGas();
122
+ if (fees.maxFeePerGas) {
123
+ return gasLimit * fees.maxFeePerGas;
124
+ }
125
+ }
126
+ catch (err) {
127
+ // chain without eip-1559 support, fall through to gas price
128
+ }
129
+ try {
130
+ const gasPrice = await publicClient.getGasPrice();
131
+ return gasLimit * gasPrice;
132
+ }
133
+ catch (err) {
134
+ return 0n;
135
+ }
136
+ }
137
+ //# sourceMappingURL=chains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chains.js","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAE,IAAI,EAAa,MAAM,MAAM,CAAC;AAU9E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAOD;;;;;GAKG;AACH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O,EAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,IAAe;IACxC,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,YAAgD;IAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,kBAAkB,EAAE,CAAC;QACrD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,CAAC;IACF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,4DAA4D;IAC7D,CAAC;IACD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC;QAClD,OAAO,QAAQ,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Env } from './env.js';
2
+ import { type ConfigIssues } from './calls.js';
3
+ /**
4
+ * Every configuration check the server can make without touching the network,
5
+ * so a typo in a spending limit stops the process instead of surfacing as a
6
+ * failed claim later.
7
+ *
8
+ * Cloudflare Workers has no boot hook, so there the same problems surface as a
9
+ * 500 plus a console error on the first request that reads them.
10
+ */
11
+ export declare function checkConfig(env: Env): ConfigIssues;
12
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AAC9D,OAAO,EAA4B,KAAK,YAAY,EAAC,MAAM,YAAY,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAqBlD"}
@@ -0,0 +1,28 @@
1
+ import { getBigIntEnv, getCooldowns } from './env.js';
2
+ import { checkArbitraryCallsConfig } from './calls.js';
3
+ /**
4
+ * Every configuration check the server can make without touching the network,
5
+ * so a typo in a spending limit stops the process instead of surfacing as a
6
+ * failed claim later.
7
+ *
8
+ * Cloudflare Workers has no boot hook, so there the same problems surface as a
9
+ * 500 plus a console error on the first request that reads them.
10
+ */
11
+ export function checkConfig(env) {
12
+ const issues = checkArbitraryCallsConfig(env);
13
+ // A malformed ceiling used to throw out of BigInt() on every claim, which
14
+ // reached the error handler as an unhandled exception: a 500 with a stack
15
+ // instead of a clear answer, on a faucet that had started up happily.
16
+ const maxRecipientBalance = getBigIntEnv(env.MAX_RECIPIENT_BALANCE);
17
+ if (maxRecipientBalance.status === 'invalid') {
18
+ issues.errors.push(`MAX_RECIPIENT_BALANCE must be a wei amount, got "${env.MAX_RECIPIENT_BALANCE}"`);
19
+ }
20
+ // These used to go through parseInt, which partial parses: '1h' meant one
21
+ // second, so a plausible looking typo removed the cooldown almost entirely.
22
+ const cooldowns = getCooldowns(env);
23
+ if (cooldowns.status === 'invalid') {
24
+ issues.errors.push(cooldowns.details);
25
+ }
26
+ return issues;
27
+ }
28
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,YAAY,EAAW,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAC,yBAAyB,EAAoB,MAAM,YAAY,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,GAAQ;IACnC,MAAM,MAAM,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC;IAE9C,0EAA0E;IAC1E,0EAA0E;IAC1E,sEAAsE;IACtE,MAAM,mBAAmB,GAAG,YAAY,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpE,IAAI,mBAAmB,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,CACjB,oDAAoD,GAAG,CAAC,qBAAqB,GAAG,CAChF,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,4EAA4E;IAC5E,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
package/dist/esm/env.d.ts CHANGED
@@ -3,6 +3,62 @@ export type Env = {
3
3
  PROSOPO_SITE_PRIVATE_KEY?: string;
4
4
  FAUCET_PRIVATE_KEY?: string;
5
5
  DISABLE_CAPTCHA?: string;
6
+ CAPTCHA_FAIL_OPEN?: string;
7
+ CORS_ORIGINS?: string;
8
+ CLAIM_COOLDOWN_SECONDS?: string;
9
+ IP_COOLDOWN_SECONDS?: string;
10
+ MAX_RECIPIENT_BALANCE?: string;
11
+ ENABLE_ARBITRARY_CALLS?: string;
12
+ MAX_CALL_GAS?: string;
6
13
  [key: `CHAIN_${string}`]: string | undefined;
14
+ [key: `CALL_ALLOWLIST_${string}`]: string | undefined;
15
+ [key: `MAX_CALL_TOTAL_SPEND_${string}`]: string | undefined;
16
+ [key: `MAX_CALL_VALUE_${string}`]: string | undefined;
7
17
  };
18
+ export declare const DEFAULT_CORS_ORIGINS: string[];
19
+ export declare const DEFAULT_CLAIM_COOLDOWN_SECONDS: number;
20
+ export declare const USED_TOKEN_RETENTION_SECONDS: number;
21
+ export declare const CLAIM_RETENTION_SECONDS: number;
22
+ export declare const CHAIN_LOCK_TIMEOUT_SECONDS = 30;
23
+ /**
24
+ * Parses a non-negative integer, refusing anything else.
25
+ *
26
+ * Deliberately not parseInt: that partial parses, so CLAIM_COOLDOWN_SECONDS=1h
27
+ * used to mean ONE SECOND rather than the 86400 default. A typo in a limit has
28
+ * to be refused, not silently turned into a much weaker limit.
29
+ */
30
+ export declare function getIntEnv(value: string | undefined): {
31
+ status: 'unset';
32
+ } | {
33
+ status: 'ok';
34
+ value: number;
35
+ } | {
36
+ status: 'invalid';
37
+ };
38
+ export type Cooldowns = {
39
+ status: 'ok';
40
+ addressCooldown: number;
41
+ ipCooldown: number;
42
+ } | {
43
+ status: 'invalid';
44
+ details: string;
45
+ };
46
+ /**
47
+ * The two rate limiting windows. The ip window defaults to the address one, so
48
+ * they are resolved together.
49
+ */
50
+ export declare function getCooldowns(env: Env): Cooldowns;
51
+ /**
52
+ * Parses a wei amount, refusing a malformed value instead of falling back:
53
+ * every caller here is a spending limit and a typo must not silently widen it.
54
+ */
55
+ export declare function getBigIntEnv(value: string | undefined): {
56
+ status: 'unset';
57
+ } | {
58
+ status: 'ok';
59
+ value: bigint;
60
+ } | {
61
+ status: 'invalid';
62
+ };
63
+ export declare function getCorsOrigins(env: Env): string[] | '*';
8
64
  //# sourceMappingURL=env.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG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,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,GAC3D;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC;AAExC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CAqBhD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB;IAAC,MAAM,EAAE,OAAO,CAAA;CAAC,GAAG;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,CASzE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,GAAG,CAYvD"}
package/dist/esm/env.js CHANGED
@@ -1,2 +1,82 @@
1
- export {};
1
+ export const DEFAULT_CORS_ORIGINS = ['https://jolly-roger.eth.limo'];
2
+ // one day
3
+ export const DEFAULT_CLAIM_COOLDOWN_SECONDS = 24 * 60 * 60;
4
+ // how long a captcha token stays burnt before being garbage collected.
5
+ // Prosopo tokens are short lived, an hour is plenty to block replays.
6
+ export const USED_TOKEN_RETENTION_SECONDS = 60 * 60;
7
+ // how long claim history is kept around, past every plausible cooldown
8
+ export const CLAIM_RETENTION_SECONDS = 30 * 24 * 60 * 60;
9
+ // how long a claim may hold the per chain send lock
10
+ export const CHAIN_LOCK_TIMEOUT_SECONDS = 30;
11
+ /**
12
+ * Parses a non-negative integer, refusing anything else.
13
+ *
14
+ * Deliberately not parseInt: that partial parses, so CLAIM_COOLDOWN_SECONDS=1h
15
+ * used to mean ONE SECOND rather than the 86400 default. A typo in a limit has
16
+ * to be refused, not silently turned into a much weaker limit.
17
+ */
18
+ export function getIntEnv(value) {
19
+ if (value === undefined || value.trim() === '') {
20
+ return { status: 'unset' };
21
+ }
22
+ const trimmed = value.trim();
23
+ if (!/^[0-9]+$/.test(trimmed)) {
24
+ return { status: 'invalid' };
25
+ }
26
+ const parsed = Number(trimmed);
27
+ if (!Number.isSafeInteger(parsed)) {
28
+ return { status: 'invalid' };
29
+ }
30
+ return { status: 'ok', value: parsed };
31
+ }
32
+ /**
33
+ * The two rate limiting windows. The ip window defaults to the address one, so
34
+ * they are resolved together.
35
+ */
36
+ export function getCooldowns(env) {
37
+ const claim = getIntEnv(env.CLAIM_COOLDOWN_SECONDS);
38
+ if (claim.status === 'invalid') {
39
+ return {
40
+ status: 'invalid',
41
+ details: `CLAIM_COOLDOWN_SECONDS must be a whole number of seconds, got "${env.CLAIM_COOLDOWN_SECONDS}"`,
42
+ };
43
+ }
44
+ const addressCooldown = claim.status === 'ok' ? claim.value : DEFAULT_CLAIM_COOLDOWN_SECONDS;
45
+ const ip = getIntEnv(env.IP_COOLDOWN_SECONDS);
46
+ if (ip.status === 'invalid') {
47
+ return {
48
+ status: 'invalid',
49
+ details: `IP_COOLDOWN_SECONDS must be a whole number of seconds, got "${env.IP_COOLDOWN_SECONDS}"`,
50
+ };
51
+ }
52
+ const ipCooldown = ip.status === 'ok' ? ip.value : addressCooldown;
53
+ return { status: 'ok', addressCooldown, ipCooldown };
54
+ }
55
+ /**
56
+ * Parses a wei amount, refusing a malformed value instead of falling back:
57
+ * every caller here is a spending limit and a typo must not silently widen it.
58
+ */
59
+ export function getBigIntEnv(value) {
60
+ if (value === undefined || value.trim() === '') {
61
+ return { status: 'unset' };
62
+ }
63
+ const trimmed = value.trim();
64
+ if (!/^[0-9]+$/.test(trimmed)) {
65
+ return { status: 'invalid' };
66
+ }
67
+ return { status: 'ok', value: BigInt(trimmed) };
68
+ }
69
+ export function getCorsOrigins(env) {
70
+ const configured = env.CORS_ORIGINS;
71
+ if (configured === undefined || configured.trim() === '') {
72
+ return DEFAULT_CORS_ORIGINS;
73
+ }
74
+ if (configured.trim() === '*') {
75
+ return '*';
76
+ }
77
+ return configured
78
+ .split(',')
79
+ .map((v) => v.trim())
80
+ .filter((v) => v.length > 0);
81
+ }
2
82
  //# sourceMappingURL=env.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAErE,UAAU;AACV,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE3D,uEAAuE;AACvE,sEAAsE;AACtE,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,CAAC;AAEpD,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzD,oDAAoD;AACpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACxB,KAAyB;IAEzB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;IAC1B,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,CAAC;IAC5B,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,CAAC;IAC5B,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,E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AAM,EAAE,SAAS,EAAC,CAAC;IAC5B,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAQ;IACtC,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAAC;IACpC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1D,OAAO,oBAAoB,CAAC;IAC7B,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,UAAU;SACf,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,7 +1,22 @@
1
1
  import { ServerOptions } from './types.js';
2
2
  import { hc } from 'hono/client';
3
3
  import { Env } from './env.js';
4
+ import { RemoteSQL } from 'remote-sql';
5
+ import { RemoteSQLStorage } from './storage/RemoteSQLStorage.js';
4
6
  export type { Env };
7
+ export { RemoteSQLStorage };
8
+ export { verifyProsopoCaptcha } from './captcha.js';
9
+ export type { CaptchaVerification } from './captcha.js';
10
+ export { DEFAULT_CORS_ORIGINS, DEFAULT_CLAIM_COOLDOWN_SECONDS } from './env.js';
11
+ export { getArbitraryCallsMode, getCallAllowlist, getCallLimits, isCallAllowed, parseCallRequest, planGas, selectorOf, DEFAULT_MAX_CALL_GAS, GAS_BUFFER_PERCENT, SIMPLE_TRANSFER_GAS, } from './calls.js';
12
+ export type { ArbitraryCallsMode, CallLimits, ConfigIssues, GasPlan, } from './calls.js';
13
+ export { checkConfig } from './config.js';
14
+ export { parseChainId } from './chains.js';
15
+ export type { ChainConfig } from './chains.js';
16
+ /**
17
+ * Creates the tables the faucet needs. Idempotent, safe to call on every boot.
18
+ */
19
+ export declare function setupDB(db: RemoteSQL): Promise<void>;
5
20
  export declare function createServer<CustomEnv extends Env>(options: ServerOptions<CustomEnv>): import("hono/hono-base").HonoBase<import("hono/utils/types").IfAnyThenEmptyObject<{
6
21
  Bindings: CustomEnv;
7
22
  } extends infer T ? T extends {
@@ -9,6 +24,13 @@ export declare function createServer<CustomEnv extends Env>(options: ServerOptio
9
24
  } ? T extends import("hono").Env ? import("hono").Env extends T ? {} : T : T : never : never> & {}, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
10
25
  "/config": {
11
26
  $get: {
27
+ input: {};
28
+ output: {
29
+ error: string;
30
+ };
31
+ outputFormat: "json";
32
+ status: 500;
33
+ } | {
12
34
  input: {};
13
35
  output: {
14
36
  captchaDisabled: boolean;
@@ -59,52 +81,87 @@ export declare function createServer<CustomEnv extends Env>(options: ServerOptio
59
81
  };
60
82
  };
61
83
  output: {
62
- rpcUrl: string;
63
84
  chainId: number;
85
+ amount: string;
64
86
  };
65
87
  outputFormat: "json";
66
88
  status: import("hono/utils/http-status").ContentfulStatusCode;
67
89
  };
68
90
  };
69
91
  } & {
70
- "/claim": {
71
- $post: {
72
- input: {};
73
- output: {
74
- error: string;
92
+ "/tx/:chainId/:txHash": {
93
+ $get: {
94
+ input: {
95
+ param: {
96
+ chainId: string;
97
+ } & {
98
+ txHash: string;
99
+ };
75
100
  };
76
- outputFormat: "json";
77
- status: 500;
78
- } | {
79
- input: {};
80
101
  output: {
81
102
  error: string;
82
103
  };
83
104
  outputFormat: "json";
84
105
  status: 400;
85
106
  } | {
86
- input: {};
107
+ input: {
108
+ param: {
109
+ chainId: string;
110
+ } & {
111
+ txHash: string;
112
+ };
113
+ };
87
114
  output: {
88
115
  error: string;
89
116
  };
90
117
  outputFormat: "json";
91
- status: 401;
118
+ status: 404;
92
119
  } | {
93
- input: {};
120
+ input: {
121
+ param: {
122
+ chainId: string;
123
+ } & {
124
+ txHash: string;
125
+ };
126
+ };
94
127
  output: {
95
- success: true;
96
- txHash: `0x${string}`;
128
+ status: string;
97
129
  };
98
130
  outputFormat: "json";
99
131
  status: import("hono/utils/http-status").ContentfulStatusCode;
100
132
  };
101
133
  };
134
+ } & {
135
+ "/claim": {
136
+ $post: {
137
+ input: {};
138
+ output: {};
139
+ outputFormat: string;
140
+ status: import("hono/utils/http-status").StatusCode;
141
+ };
142
+ };
143
+ } & {
144
+ "/execute": {
145
+ $post: {
146
+ input: {};
147
+ output: {};
148
+ outputFormat: string;
149
+ status: import("hono/utils/http-status").StatusCode;
150
+ };
151
+ };
102
152
  }, "/api/">, "/", "/api/*">;
103
153
  export type App = ReturnType<typeof createServer>;
104
154
  declare const client: {
105
155
  api: {
106
156
  config: import("hono/client").ClientRequest<string, "/api/config", {
107
157
  $get: {
158
+ input: {};
159
+ output: {
160
+ error: string;
161
+ };
162
+ outputFormat: "json";
163
+ status: 500;
164
+ } | {
108
165
  input: {};
109
166
  output: {
110
167
  captchaDisabled: boolean;
@@ -158,8 +215,8 @@ declare const client: {
158
215
  };
159
216
  };
160
217
  output: {
161
- rpcUrl: string;
162
218
  chainId: number;
219
+ amount: string;
163
220
  };
164
221
  outputFormat: "json";
165
222
  status: import("hono/utils/http-status").ContentfulStatusCode;
@@ -167,38 +224,74 @@ declare const client: {
167
224
  }>;
168
225
  };
169
226
  };
227
+ } & {
228
+ api: {
229
+ tx: {
230
+ ":chainId": {
231
+ ":txHash": import("hono/client").ClientRequest<string, "/api/tx/:chainId/:txHash", {
232
+ $get: {
233
+ input: {
234
+ param: {
235
+ chainId: string;
236
+ } & {
237
+ txHash: string;
238
+ };
239
+ };
240
+ output: {
241
+ error: string;
242
+ };
243
+ outputFormat: "json";
244
+ status: 400;
245
+ } | {
246
+ input: {
247
+ param: {
248
+ chainId: string;
249
+ } & {
250
+ txHash: string;
251
+ };
252
+ };
253
+ output: {
254
+ error: string;
255
+ };
256
+ outputFormat: "json";
257
+ status: 404;
258
+ } | {
259
+ input: {
260
+ param: {
261
+ chainId: string;
262
+ } & {
263
+ txHash: string;
264
+ };
265
+ };
266
+ output: {
267
+ status: string;
268
+ };
269
+ outputFormat: "json";
270
+ status: import("hono/utils/http-status").ContentfulStatusCode;
271
+ };
272
+ }>;
273
+ };
274
+ };
275
+ };
170
276
  } & {
171
277
  api: {
172
278
  claim: import("hono/client").ClientRequest<string, "/api/claim", {
173
279
  $post: {
174
280
  input: {};
175
- output: {
176
- error: string;
177
- };
178
- outputFormat: "json";
179
- status: 500;
180
- } | {
181
- input: {};
182
- output: {
183
- error: string;
184
- };
185
- outputFormat: "json";
186
- status: 400;
187
- } | {
188
- input: {};
189
- output: {
190
- error: string;
191
- };
192
- outputFormat: "json";
193
- status: 401;
194
- } | {
281
+ output: {};
282
+ outputFormat: string;
283
+ status: import("hono/utils/http-status").StatusCode;
284
+ };
285
+ }>;
286
+ };
287
+ } & {
288
+ api: {
289
+ execute: import("hono/client").ClientRequest<string, "/api/execute", {
290
+ $post: {
195
291
  input: {};
196
- output: {
197
- success: true;
198
- txHash: `0x${string}`;
199
- };
200
- outputFormat: "json";
201
- status: import("hono/utils/http-status").ContentfulStatusCode;
292
+ output: {};
293
+ outputFormat: string;
294
+ status: import("hono/utils/http-status").StatusCode;
202
295
  };
203
296
  }>;
204
297
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAE/B,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAC;AAG7B,YAAY,EAAC,GAAG,EAAC,CAAC;AAkBlB,wBAAgB,YAAY,CAAC,SAAS,SAAS,GAAG,EACjD,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;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