@alchemy/common 0.0.0-alpha.9 → 5.0.0-beta.2

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/LICENSE +1 -1
  2. package/README.md +36 -0
  3. package/dist/esm/chains.d.ts +54 -0
  4. package/dist/esm/index.d.ts +0 -11
  5. package/dist/esm/index.js +4 -9
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/esm/internal.d.ts +6 -0
  8. package/dist/esm/internal.js +6 -0
  9. package/dist/esm/internal.js.map +1 -0
  10. package/dist/esm/tracing/traceHeader.d.ts +8 -4
  11. package/dist/esm/tracing/traceHeader.js +8 -4
  12. package/dist/esm/tracing/traceHeader.js.map +1 -1
  13. package/dist/esm/transport/chainRegistry.d.ts +2 -1
  14. package/dist/esm/transport/chainRegistry.js +85 -49
  15. package/dist/esm/transport/chainRegistry.js.map +1 -1
  16. package/dist/esm/utils/bigint.js +3 -2
  17. package/dist/esm/utils/bigint.js.map +1 -1
  18. package/dist/esm/version.d.ts +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/types/chains.d.ts +54 -0
  22. package/dist/types/chains.d.ts.map +1 -1
  23. package/dist/types/index.d.ts +0 -11
  24. package/dist/types/index.d.ts.map +1 -1
  25. package/dist/types/internal.d.ts +7 -0
  26. package/dist/types/internal.d.ts.map +1 -0
  27. package/dist/types/tracing/traceHeader.d.ts +8 -4
  28. package/dist/types/tracing/traceHeader.d.ts.map +1 -1
  29. package/dist/types/transport/chainRegistry.d.ts +2 -1
  30. package/dist/types/transport/chainRegistry.d.ts.map +1 -1
  31. package/dist/types/utils/bigint.d.ts.map +1 -1
  32. package/dist/types/version.d.ts +1 -1
  33. package/dist/types/version.d.ts.map +1 -1
  34. package/package.json +11 -5
  35. package/src/index.ts +4 -24
  36. package/src/internal.ts +15 -0
  37. package/src/tracing/traceHeader.ts +8 -4
  38. package/src/transport/chainRegistry.ts +103 -52
  39. package/src/utils/bigint.ts +4 -2
  40. package/src/version.ts +1 -1
  41. package/dist/esm/transport/connection.d.ts +0 -20
  42. package/dist/esm/transport/connection.js +0 -2
  43. package/dist/esm/transport/connection.js.map +0 -1
  44. package/dist/esm/utils/createEip1193HandlerFactory.d.ts +0 -18
  45. package/dist/esm/utils/createEip1193HandlerFactory.js +0 -11
  46. package/dist/esm/utils/createEip1193HandlerFactory.js.map +0 -1
  47. package/dist/types/transport/connection.d.ts +0 -21
  48. package/dist/types/transport/connection.d.ts.map +0 -1
  49. package/dist/types/utils/createEip1193HandlerFactory.d.ts +0 -19
  50. package/dist/types/utils/createEip1193HandlerFactory.d.ts.map +0 -1
  51. package/src/transport/connection.ts +0 -19
  52. package/src/utils/createEip1193HandlerFactory.ts +0 -25
@@ -1,82 +1,134 @@
1
1
  /**
2
2
  * Internal registry mapping chain IDs to Alchemy RPC base URLs.
3
3
  * This replaces the need for custom chain exports with embedded Alchemy URLs.
4
+ *
5
+ * Auto-generated by the ws-tools CLI — do not manually edit.
4
6
  */
5
7
  export const ALCHEMY_RPC_MAPPING: Record<number, string> = {
6
- // Ethereum networks
7
- 1: "https://eth-mainnet.g.alchemy.com/v2", // mainnet
8
- 11155111: "https://eth-sepolia.g.alchemy.com/v2", // sepolia
9
- 5: "https://eth-goerli.g.alchemy.com/v2", // goerli
10
-
11
- // Arbitrum networks
12
- 42161: "https://arb-mainnet.g.alchemy.com/v2", // arbitrum
13
- 421613: "https://arb-goerli.g.alchemy.com/v2", // arbitrumGoerli
14
- 421614: "https://arb-sepolia.g.alchemy.com/v2", // arbitrumSepolia
15
-
16
- // Optimism networks
17
- 10: "https://opt-mainnet.g.alchemy.com/v2", // optimism
18
- 420: "https://opt-goerli.g.alchemy.com/v2", // optimismGoerli
19
- 11155420: "https://opt-sepolia.g.alchemy.com/v2", // optimismSepolia
20
-
21
- // Base networks
22
- 8453: "https://base-mainnet.g.alchemy.com/v2", // base
23
- 84531: "https://base-goerli.g.alchemy.com/v2", // baseGoerli
8
+ // ANIME networks
9
+ 6900: "https://anime-sepolia.g.alchemy.com/v2", // animeSepolia
10
+ 69000: "https://anime-mainnet.g.alchemy.com/v2", // animeMainnet
11
+
12
+ // APECHAIN networks
13
+ 33139: "https://apechain-mainnet.g.alchemy.com/v2", // apechainMainnet
14
+ 33111: "https://apechain-curtis.g.alchemy.com/v2", // apechainCurtis
15
+
16
+ // ARB networks
17
+ 421614: "https://arb-sepolia.g.alchemy.com/v2", // arbSepolia
18
+ 42161: "https://arb-mainnet.g.alchemy.com/v2", // arbMainnet
19
+
20
+ // ARBNOVA networks
21
+ 42170: "https://arbnova-mainnet.g.alchemy.com/v2", // arbnovaMainnet
22
+
23
+ // ARC networks
24
+ 5042002: "https://arc-testnet.g.alchemy.com/v2", // arcTestnet
25
+
26
+ // BASE networks
27
+ 8453: "https://base-mainnet.g.alchemy.com/v2", // baseMainnet
24
28
  84532: "https://base-sepolia.g.alchemy.com/v2", // baseSepolia
25
29
 
26
- // Polygon networks
27
- 137: "https://polygon-mainnet.g.alchemy.com/v2", // polygon
28
- 80001: "https://polygon-mumbai.g.alchemy.com/v2", // polygonMumbai
29
- 80002: "https://polygon-amoy.g.alchemy.com/v2", // polygonAmoy
30
+ // BERACHAIN networks
31
+ 80094: "https://berachain-mainnet.g.alchemy.com/v2", // berachainMainnet
32
+ 80069: "https://berachain-bepolia.g.alchemy.com/v2", // berachainBepolia
30
33
 
31
- // World Chain networks
32
- 480: "https://worldchain-mainnet.g.alchemy.com/v2", // worldChain
33
- 4801: "https://worldchain-sepolia.g.alchemy.com/v2", // worldChainSepolia
34
+ // BNB networks
35
+ 97: "https://bnb-testnet.g.alchemy.com/v2", // bnbTestnet
36
+ 56: "https://bnb-mainnet.g.alchemy.com/v2", // bnbMainnet
34
37
 
35
- // Shape networks
36
- 360: "https://shape-mainnet.g.alchemy.com/v2", // shape
37
- 11011: "https://shape-sepolia.g.alchemy.com/v2", // shapeSepolia
38
+ // CELO networks
39
+ 11142220: "https://celo-sepolia.g.alchemy.com/v2", // celoSepolia
40
+ 42220: "https://celo-mainnet.g.alchemy.com/v2", // celoMainnet
38
41
 
39
- // Unichain networks
40
- 130: "https://unichain-mainnet.g.alchemy.com/v2", // unichainMainnet
41
- 1301: "https://unichain-sepolia.g.alchemy.com/v2", // unichainSepolia
42
+ // CLANKERMON networks
43
+ 510525: "https://clankermon-mainnet.g.alchemy.com/v2", // clankermonMainnet
42
44
 
43
- // Soneium networks
44
- 1868: "https://soneium-mainnet.g.alchemy.com/v2", // soneiumMainnet
45
- 1946: "https://soneium-minato.g.alchemy.com/v2", // soneiumMinato
45
+ // ETH networks
46
+ 1: "https://eth-mainnet.g.alchemy.com/v2", // ethMainnet
47
+ 11155111: "https://eth-sepolia.g.alchemy.com/v2", // ethSepolia
46
48
 
47
- // OPBNB networks
48
- 204: "https://opbnb-mainnet.g.alchemy.com/v2", // opbnbMainnet
49
- 5611: "https://opbnb-testnet.g.alchemy.com/v2", // opbnbTestnet
49
+ // FRAX networks
50
+ 252: "https://frax-mainnet.g.alchemy.com/v2", // fraxMainnet
50
51
 
51
- // BeraChain networks
52
- 80084: "https://berachain-bartio.g.alchemy.com/v2", // beraChainBartio
52
+ // GENSYN networks
53
+ 685685: "https://gensyn-testnet.g.alchemy.com/v2", // gensynTestnet
54
+
55
+ // HYPERLIQUID networks
56
+ 999: "https://hyperliquid-mainnet.g.alchemy.com/v2", // hyperliquidMainnet
53
57
 
54
- // Ink networks
58
+ // INK networks
55
59
  57073: "https://ink-mainnet.g.alchemy.com/v2", // inkMainnet
56
60
  763373: "https://ink-sepolia.g.alchemy.com/v2", // inkSepolia
57
61
 
58
- // Monad networks
62
+ // MATIC networks
63
+ 80002: "https://polygon-amoy.g.alchemy.com/v2", // maticAmoy
64
+ 137: "https://polygon-mainnet.g.alchemy.com/v2", // maticMainnet
65
+
66
+ // MEGAETH networks
67
+ 4326: "https://megaeth-mainnet.g.alchemy.com/v2", // megaethMainnet
68
+ 6343: "https://megaeth-testnet.g.alchemy.com/v2", // megaethTestnet
69
+
70
+ // MONAD networks
59
71
  10143: "https://monad-testnet.g.alchemy.com/v2", // monadTestnet
72
+ 143: "https://monad-mainnet.g.alchemy.com/v2", // monadMainnet
73
+
74
+ // MYTHOS networks
75
+ 42018: "https://mythos-mainnet.g.alchemy.com/v2", // mythosMainnet
60
76
 
61
- // Openloot networks
77
+ // OPBNB networks
78
+ 5611: "https://opbnb-testnet.g.alchemy.com/v2", // opbnbTestnet
79
+ 204: "https://opbnb-mainnet.g.alchemy.com/v2", // opbnbMainnet
80
+
81
+ // OPENLOOT networks
62
82
  905905: "https://openloot-sepolia.g.alchemy.com/v2", // openlootSepolia
63
83
 
64
- // Gensyn networks
65
- 685685: "https://gensyn-testnet.g.alchemy.com/v2", // gensynTestnet
84
+ // OPT networks
85
+ 10: "https://opt-mainnet.g.alchemy.com/v2", // optMainnet
86
+ 11155420: "https://opt-sepolia.g.alchemy.com/v2", // optSepolia
66
87
 
67
- // Rise networks
88
+ // PLASMA networks
89
+ 9746: "https://plasma-testnet.g.alchemy.com/v2", // plasmaTestnet
90
+ 9745: "https://plasma-mainnet.g.alchemy.com/v2", // plasmaMainnet
91
+
92
+ // POLYNOMIAL networks
93
+ 8008: "https://polynomial-mainnet.g.alchemy.com/v2", // polynomialMainnet
94
+ 80008: "https://polynomial-sepolia.g.alchemy.com/v2", // polynomialSepolia
95
+
96
+ // RISE networks
68
97
  11155931: "https://rise-testnet.g.alchemy.com/v2", // riseTestnet
69
98
 
70
- // Story networks
99
+ // ROBINHOOD networks
100
+ 46630: "https://robinhood-testnet.g.alchemy.com/v2", // robinhoodTestnet
101
+
102
+ // SHAPE networks
103
+ 11011: "https://shape-sepolia.g.alchemy.com/v2", // shapeSepolia
104
+ 360: "https://shape-mainnet.g.alchemy.com/v2", // shapeMainnet
105
+
106
+ // SONEIUM networks
107
+ 1946: "https://soneium-minato.g.alchemy.com/v2", // soneiumMinato
108
+ 1868: "https://soneium-mainnet.g.alchemy.com/v2", // soneiumMainnet
109
+
110
+ // STABLE networks
111
+ 988: "https://stable-mainnet.g.alchemy.com/v2", // stableMainnet
112
+ 2201: "https://stable-testnet.g.alchemy.com/v2", // stableTestnet
113
+
114
+ // STORY networks
71
115
  1514: "https://story-mainnet.g.alchemy.com/v2", // storyMainnet
72
116
  1315: "https://story-aeneid.g.alchemy.com/v2", // storyAeneid
73
117
 
74
- // Celo networks
75
- 42220: "https://celo-mainnet.g.alchemy.com/v2", // celoMainnet
76
- 44787: "https://celo-alfajores.g.alchemy.com/v2", // celoAlfajores
118
+ // UNICHAIN networks
119
+ 1301: "https://unichain-sepolia.g.alchemy.com/v2", // unichainSepolia
120
+ 130: "https://unichain-mainnet.g.alchemy.com/v2", // unichainMainnet
121
+
122
+ // WORLDCHAIN networks
123
+ 4801: "https://worldchain-sepolia.g.alchemy.com/v2", // worldchainSepolia
124
+ 480: "https://worldchain-mainnet.g.alchemy.com/v2", // worldchainMainnet
125
+
126
+ // WORLDMOBILECHAIN networks
127
+ 869: "https://worldmobilechain-mainnet.g.alchemy.com/v2", // worldmobilechainMainnet
77
128
 
78
- // Tea networks
79
- 10218: "https://tea-sepolia.g.alchemy.com/v2", // teaSepolia
129
+ // ZORA networks
130
+ 7777777: "https://zora-mainnet.g.alchemy.com/v2", // zoraMainnet
131
+ 999999999: "https://zora-sepolia.g.alchemy.com/v2", // zoraSepolia
80
132
  };
81
133
 
82
134
  /**
@@ -88,7 +140,6 @@ export const ALCHEMY_RPC_MAPPING: Record<number, string> = {
88
140
  * @example
89
141
  * ```ts
90
142
  * const rpcUrl = getAlchemyRpcUrl(1); // "https://eth-mainnet.g.alchemy.com/v2"
91
- * const customUrl = getAlchemyRpcUrl(999); // undefined
92
143
  * ```
93
144
  */
94
145
  export function getAlchemyRpcUrl(chainId: number): string | undefined {
@@ -1,3 +1,5 @@
1
+ import { BaseError } from "../errors/BaseError.js";
2
+
1
3
  /**
2
4
  * BigNumberish represents values that can be converted to BigInt
3
5
  */
@@ -42,7 +44,7 @@ export const bigIntMultiply = (
42
44
  roundingMode: RoundingMode = RoundingMode.ROUND_UP,
43
45
  ) => {
44
46
  if (!isValidMultiplier({ multiplier })) {
45
- throw new Error(
47
+ throw new BaseError(
46
48
  "bigIntMultiply requires a multiplier validated number as the second argument (max 4 decimal places)",
47
49
  );
48
50
  }
@@ -65,7 +67,7 @@ export const bigIntMultiply = (
65
67
  */
66
68
  export const bigIntMax = (...args: bigint[]): bigint => {
67
69
  if (!args.length) {
68
- throw new Error("bigIntMax requires at least one argument");
70
+ throw new BaseError("bigIntMax requires at least one argument");
69
71
  }
70
72
 
71
73
  return args.reduce((m, c) => (m > c ? m : c));
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "0.0.0-alpha.8";
3
+ export const VERSION = "5.0.0-beta.2";
@@ -1,20 +0,0 @@
1
- import type { Never } from "../utils/types";
2
- type AlchemyConnectionBaseConfig = {
3
- proxyUrl: string;
4
- apiKey?: never;
5
- jwt?: never;
6
- } | {
7
- proxyUrl?: never;
8
- apiKey: string;
9
- jwt?: never;
10
- } | {
11
- proxyUrl?: never;
12
- apiKey?: never;
13
- jwt: string;
14
- };
15
- type AAOnlyChainConfig = {
16
- alchemyConnection: AlchemyConnectionBaseConfig;
17
- nodeRpcUrl: string;
18
- };
19
- export type AlchemyConnectionConfig = (AlchemyConnectionBaseConfig & Never<AAOnlyChainConfig>) | (AAOnlyChainConfig & Never<AlchemyConnectionBaseConfig>);
20
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=connection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/transport/connection.ts"],"names":[],"mappings":"","sourcesContent":["import type { Never } from \"../utils/types\";\n\n// TODO(v5): remove this file and use connectionSchema.ts instead once other packages are migrated over\ntype AlchemyConnectionBaseConfig =\n // TODO(v5): is this really the best devex? can we do better?\n // basic configuration for connecting to alchemy.\n // proxyUrl is used when making calls to the developer backend.\n | { proxyUrl: string; apiKey?: never; jwt?: never }\n | { proxyUrl?: never; apiKey: string; jwt?: never }\n | { proxyUrl?: never; apiKey?: never; jwt: string };\n\ntype AAOnlyChainConfig = {\n alchemyConnection: AlchemyConnectionBaseConfig;\n nodeRpcUrl: string;\n};\n\nexport type AlchemyConnectionConfig =\n | (AlchemyConnectionBaseConfig & Never<AAOnlyChainConfig>)\n | (AAOnlyChainConfig & Never<AlchemyConnectionBaseConfig>);\n"]}
@@ -1,18 +0,0 @@
1
- /**
2
- * Creates a typed handler factory for EIP1193 request methods.
3
- * This helps with Viem's typing within custom EIP1193 request functions by
4
- * automatically casting input params and ensuring the result matches what is required.
5
- *
6
- * @returns {(params: unknown) => unknown} A function that creates a handler factory for specific methods
7
- */
8
- export declare const createEip1193HandlerFactory: <TMethods extends readonly {
9
- Method: string;
10
- Parameters?: unknown;
11
- ReturnType?: unknown;
12
- }[]>() => <TMethod extends TMethods[number]["Method"]>(handle: (params: Extract<TMethods[number], {
13
- Method: TMethod;
14
- }>["Parameters"]) => Promise<Extract<TMethods[number], {
15
- Method: TMethod;
16
- }>["ReturnType"]>) => (params: unknown) => Promise<Extract<TMethods[number], {
17
- Method: TMethod;
18
- }>["ReturnType"]>;
@@ -1,11 +0,0 @@
1
- /**
2
- * Creates a typed handler factory for EIP1193 request methods.
3
- * This helps with Viem's typing within custom EIP1193 request functions by
4
- * automatically casting input params and ensuring the result matches what is required.
5
- *
6
- * @returns {(params: unknown) => unknown} A function that creates a handler factory for specific methods
7
- */
8
- export const createEip1193HandlerFactory = () => (handle) => (params) => {
9
- return handle(params);
10
- };
11
- //# sourceMappingURL=createEip1193HandlerFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createEip1193HandlerFactory.js","sourceRoot":"","sources":["../../../src/utils/createEip1193HandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,GAMI,EAAE,CACN,CACE,MAE0E,EAC1E,EAAE,CACJ,CAAC,MAAe,EAAE,EAAE;IAClB,OAAO,MAAM,CACX,MAAsE,CACvE,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * Creates a typed handler factory for EIP1193 request methods.\n * This helps with Viem's typing within custom EIP1193 request functions by\n * automatically casting input params and ensuring the result matches what is required.\n *\n * @returns {(params: unknown) => unknown} A function that creates a handler factory for specific methods\n */\nexport const createEip1193HandlerFactory =\n <\n TMethods extends readonly {\n Method: string;\n Parameters?: unknown;\n ReturnType?: unknown;\n }[],\n >() =>\n <TMethod extends TMethods[number][\"Method\"]>(\n handle: (\n params: Extract<TMethods[number], { Method: TMethod }>[\"Parameters\"],\n ) => Promise<Extract<TMethods[number], { Method: TMethod }>[\"ReturnType\"]>,\n ) =>\n (params: unknown) => {\n return handle(\n params as Extract<TMethods[number], { Method: TMethod }>[\"Parameters\"],\n );\n };\n"]}
@@ -1,21 +0,0 @@
1
- import type { Never } from "../utils/types";
2
- type AlchemyConnectionBaseConfig = {
3
- proxyUrl: string;
4
- apiKey?: never;
5
- jwt?: never;
6
- } | {
7
- proxyUrl?: never;
8
- apiKey: string;
9
- jwt?: never;
10
- } | {
11
- proxyUrl?: never;
12
- apiKey?: never;
13
- jwt: string;
14
- };
15
- type AAOnlyChainConfig = {
16
- alchemyConnection: AlchemyConnectionBaseConfig;
17
- nodeRpcUrl: string;
18
- };
19
- export type AlchemyConnectionConfig = (AlchemyConnectionBaseConfig & Never<AAOnlyChainConfig>) | (AAOnlyChainConfig & Never<AlchemyConnectionBaseConfig>);
20
- export {};
21
- //# sourceMappingURL=connection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/transport/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,KAAK,2BAA2B,GAI5B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,KAAK,iBAAiB,GAAG;IACvB,iBAAiB,EAAE,2BAA2B,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,CAAC,2BAA2B,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC,GACxD,CAAC,iBAAiB,GAAG,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Creates a typed handler factory for EIP1193 request methods.
3
- * This helps with Viem's typing within custom EIP1193 request functions by
4
- * automatically casting input params and ensuring the result matches what is required.
5
- *
6
- * @returns {(params: unknown) => unknown} A function that creates a handler factory for specific methods
7
- */
8
- export declare const createEip1193HandlerFactory: <TMethods extends readonly {
9
- Method: string;
10
- Parameters?: unknown;
11
- ReturnType?: unknown;
12
- }[]>() => <TMethod extends TMethods[number]["Method"]>(handle: (params: Extract<TMethods[number], {
13
- Method: TMethod;
14
- }>["Parameters"]) => Promise<Extract<TMethods[number], {
15
- Method: TMethod;
16
- }>["ReturnType"]>) => (params: unknown) => Promise<Extract<TMethods[number], {
17
- Method: TMethod;
18
- }>["ReturnType"]>;
19
- //# sourceMappingURL=createEip1193HandlerFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createEip1193HandlerFactory.d.ts","sourceRoot":"","sources":["../../../src/utils/createEip1193HandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GAEpC,QAAQ,SAAS,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,EAAE,QAEJ,OAAO,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzC,QAAQ,CACN,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,YAAY,CAAC,KACjE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,YAAY,CAAC,CAAC,MAE3E,QAAQ,OAAO;YAFmC,OAAO;iBAMzD,CAAC"}
@@ -1,19 +0,0 @@
1
- import type { Never } from "../utils/types";
2
-
3
- // TODO(v5): remove this file and use connectionSchema.ts instead once other packages are migrated over
4
- type AlchemyConnectionBaseConfig =
5
- // TODO(v5): is this really the best devex? can we do better?
6
- // basic configuration for connecting to alchemy.
7
- // proxyUrl is used when making calls to the developer backend.
8
- | { proxyUrl: string; apiKey?: never; jwt?: never }
9
- | { proxyUrl?: never; apiKey: string; jwt?: never }
10
- | { proxyUrl?: never; apiKey?: never; jwt: string };
11
-
12
- type AAOnlyChainConfig = {
13
- alchemyConnection: AlchemyConnectionBaseConfig;
14
- nodeRpcUrl: string;
15
- };
16
-
17
- export type AlchemyConnectionConfig =
18
- | (AlchemyConnectionBaseConfig & Never<AAOnlyChainConfig>)
19
- | (AAOnlyChainConfig & Never<AlchemyConnectionBaseConfig>);
@@ -1,25 +0,0 @@
1
- /**
2
- * Creates a typed handler factory for EIP1193 request methods.
3
- * This helps with Viem's typing within custom EIP1193 request functions by
4
- * automatically casting input params and ensuring the result matches what is required.
5
- *
6
- * @returns {(params: unknown) => unknown} A function that creates a handler factory for specific methods
7
- */
8
- export const createEip1193HandlerFactory =
9
- <
10
- TMethods extends readonly {
11
- Method: string;
12
- Parameters?: unknown;
13
- ReturnType?: unknown;
14
- }[],
15
- >() =>
16
- <TMethod extends TMethods[number]["Method"]>(
17
- handle: (
18
- params: Extract<TMethods[number], { Method: TMethod }>["Parameters"],
19
- ) => Promise<Extract<TMethods[number], { Method: TMethod }>["ReturnType"]>,
20
- ) =>
21
- (params: unknown) => {
22
- return handle(
23
- params as Extract<TMethods[number], { Method: TMethod }>["Parameters"],
24
- );
25
- };