@@ -18,29 +18,50 @@ import { EdgeSpendInfo } from 'edge-core-js/types'
1818import {
1919 asIntegerString ,
2020 asSafeCommonWalletInfo ,
21+ asServiceKeys ,
22+ ServiceKeys ,
2123 WalletConnectPayload
2224} from '../common/types'
2325import { FeeAlgorithmConfig } from './feeAlgorithms/feeAlgorithmTypes'
2426import type { NetworkAdapterConfig } from './networkAdapters/networkAdapterTypes'
2527
2628export interface EthereumInitOptions {
29+ serviceKeys : ServiceKeys
30+ infuraProjectId ?: string
31+
32+ /** @deprecated Use serviceKeys instead */
2733 alchemyApiKey ?: string
34+ /** @deprecated Use serviceKeys instead */
2835 amberdataApiKey ?: string
36+ /** @deprecated Use serviceKeys instead */
2937 blockchairApiKey ?: string
38+ /** @deprecated Use serviceKeys instead */
3039 blockcypherApiKey ?: string
40+ /** @deprecated Use serviceKeys instead */
3141 drpcApiKey ?: string
32- /** For Etherscan v2 API */
42+ /** For Etherscan v2 API
43+ * @deprecated Use serviceKeys instead
44+ */
3345 etherscanApiKey ?: string | string [ ]
34- /** For bespoke scan APIs unsupported by Etherscan v2 API (e.g. fantomscan) */
46+ /** For bespoke scan APIs unsupported by Etherscan v2 API (e.g. fantomscan)
47+ * @deprecated Use serviceKeys instead
48+ */
3549 evmScanApiKey ?: string | string [ ]
50+ /** @deprecated Use serviceKeys instead */
3651 gasStationApiKey ?: string
37- infuraProjectId ?: string
52+ /** @deprecated Use serviceKeys instead */
3853 nowNodesApiKey ?: string
54+ /** @deprecated Use serviceKeys instead */
3955 poktPortalApiKey ?: string
56+ /** @deprecated Use serviceKeys instead */
4057 quiknodeApiKey ?: string
4158}
4259
4360export const asEthereumInitOptions = asObject < EthereumInitOptions > ( {
61+ serviceKeys : asOptional ( asServiceKeys , ( ) => ( { } ) ) ,
62+ infuraProjectId : asOptional ( asString ) ,
63+
64+ // Deprecated:
4465 alchemyApiKey : asOptional ( asString ) ,
4566 amberdataApiKey : asOptional ( asString ) ,
4667 blockchairApiKey : asOptional ( asString ) ,
@@ -49,7 +70,6 @@ export const asEthereumInitOptions = asObject<EthereumInitOptions>({
4970 etherscanApiKey : asOptional ( asEither ( asString , asArray ( asString ) ) ) ,
5071 evmScanApiKey : asOptional ( asEither ( asString , asArray ( asString ) ) ) ,
5172 gasStationApiKey : asOptional ( asString ) ,
52- infuraProjectId : asOptional ( asString ) ,
5373 nowNodesApiKey : asOptional ( asString ) ,
5474 poktPortalApiKey : asOptional ( asString ) ,
5575 quiknodeApiKey : asOptional ( asString )
0 commit comments