@elsoul/erpc-sdk 0.3.0 → 0.5.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 +17 -3
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -139,12 +139,14 @@ declare class CloudCatalogClient {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
declare const DEFAULT_ENDPOINT = "https://edge.erpc.global";
|
|
142
|
+
declare const DEFAULT_AVALANCHE_ENDPOINT = "https://ava-rpc.erpc.global";
|
|
142
143
|
declare const DEFAULT_ACCOUNT_ENDPOINT = "https://solana-rpc.erpc.global";
|
|
143
144
|
declare const DEFAULT_USER_ENDPOINT = "https://user-api.erpc.global";
|
|
144
145
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
145
146
|
interface ErpcClientConfig {
|
|
146
147
|
readonly accountEndpoint?: string;
|
|
147
148
|
readonly apiKey: string;
|
|
149
|
+
readonly avalancheEndpoint?: string;
|
|
148
150
|
readonly endpoint?: string;
|
|
149
151
|
readonly fetch?: typeof globalThis.fetch;
|
|
150
152
|
readonly headers?: Readonly<Record<string, string>>;
|
|
@@ -843,8 +845,10 @@ interface ErpcSolanaClient extends SolanaClient {
|
|
|
843
845
|
interface ErpcEthereumClient extends EthereumClient {
|
|
844
846
|
readonly subscriptions: EthereumSubscriptions;
|
|
845
847
|
}
|
|
848
|
+
type ErpcAvalancheClient = ErpcEthereumClient;
|
|
846
849
|
interface ErpcClient {
|
|
847
850
|
readonly account: AccountClient;
|
|
851
|
+
readonly avalanche: ErpcAvalancheClient;
|
|
848
852
|
readonly ethereum: ErpcEthereumClient;
|
|
849
853
|
readonly price: PriceClient;
|
|
850
854
|
readonly solana: ErpcSolanaClient;
|
|
@@ -918,4 +922,4 @@ declare class ErpcBatchPolicyError extends ErpcError {
|
|
|
918
922
|
constructor(message: string);
|
|
919
923
|
}
|
|
920
924
|
|
|
921
|
-
export { AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, type NumericFilter, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type SubscriptionId, type SubscriptionListener, type TokenBalance, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient };
|
|
925
|
+
export { AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_AVALANCHE_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, type ErpcAvalancheClient, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, type NumericFilter, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type SubscriptionId, type SubscriptionListener, type TokenBalance, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -139,12 +139,14 @@ declare class CloudCatalogClient {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
declare const DEFAULT_ENDPOINT = "https://edge.erpc.global";
|
|
142
|
+
declare const DEFAULT_AVALANCHE_ENDPOINT = "https://ava-rpc.erpc.global";
|
|
142
143
|
declare const DEFAULT_ACCOUNT_ENDPOINT = "https://solana-rpc.erpc.global";
|
|
143
144
|
declare const DEFAULT_USER_ENDPOINT = "https://user-api.erpc.global";
|
|
144
145
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
145
146
|
interface ErpcClientConfig {
|
|
146
147
|
readonly accountEndpoint?: string;
|
|
147
148
|
readonly apiKey: string;
|
|
149
|
+
readonly avalancheEndpoint?: string;
|
|
148
150
|
readonly endpoint?: string;
|
|
149
151
|
readonly fetch?: typeof globalThis.fetch;
|
|
150
152
|
readonly headers?: Readonly<Record<string, string>>;
|
|
@@ -843,8 +845,10 @@ interface ErpcSolanaClient extends SolanaClient {
|
|
|
843
845
|
interface ErpcEthereumClient extends EthereumClient {
|
|
844
846
|
readonly subscriptions: EthereumSubscriptions;
|
|
845
847
|
}
|
|
848
|
+
type ErpcAvalancheClient = ErpcEthereumClient;
|
|
846
849
|
interface ErpcClient {
|
|
847
850
|
readonly account: AccountClient;
|
|
851
|
+
readonly avalanche: ErpcAvalancheClient;
|
|
848
852
|
readonly ethereum: ErpcEthereumClient;
|
|
849
853
|
readonly price: PriceClient;
|
|
850
854
|
readonly solana: ErpcSolanaClient;
|
|
@@ -918,4 +922,4 @@ declare class ErpcBatchPolicyError extends ErpcError {
|
|
|
918
922
|
constructor(message: string);
|
|
919
923
|
}
|
|
920
924
|
|
|
921
|
-
export { AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, type NumericFilter, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type SubscriptionId, type SubscriptionListener, type TokenBalance, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient };
|
|
925
|
+
export { AccountClient, type AddressTransaction, type AddressTransactionPage, type AddressTransactionsOptions, type AddressTransfer, type AddressTransferPage, type AddressTransfersOptions, type AnalyticsTimeBound, type AssetBatchRequest, type AssetListRequest, type AssetRequest, type BinaryUpdate, CloudCatalogClient, type CloudCredit, type CloudCreditAlertLevel, CloudCreditClient, type CloudOffering, type CloudOfferingBilling, type CloudOfferingCompute, type CloudOfferingSolana, type CloudResource, type CloudResourceKind, type CloudResourceMode, type CloudResourceStatus, type CloudResourceStatusBilling, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_AVALANCHE_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, type EpochSummary, ErpcAbortedError, type ErpcAvalancheClient, ErpcBatchPolicyError, type ErpcClient, type ErpcClientConfig, type ErpcCloudClient, type ErpcCloudClientConfig, type ErpcCloudRequestOptions, ErpcConfigError, ErpcError, type ErpcErrorCode, type ErpcEthereumClient, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, type ErpcPlan, type ErpcSolanaClient, ErpcTimeoutError, ErpcTransportError, type EthereumAddress, type EthereumBlockTag, type EthereumClient, type EthereumFilter, type EthereumObject, type EthereumRpcSchema, type EthereumSubscriptionSchema, EthereumSubscriptions, type EthereumTransactionRequest, type Hex, type IndexedAsset, type IndexedAssetList, type IndexedAssetProof, type JsonObject, type JsonPrimitive, type JsonRpcErrorObject, type JsonRpcFailure, type JsonRpcId, type JsonRpcParams, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type JsonRpcTransport, type JsonValue, type LeaderSlot, type LeaderSlotsResult, type MonthlyApiKeyChainUsage, type MonthlyApiKeyMethodUsage, type MonthlyApiKeyUsage, type MonthlyApiKeyUsageEntry, type MonthlyApiKeyUsageParams, type NumericFilter, type ParsedPriceUpdate, PendingRpcBatchRequest, PendingRpcRequest, type PingMeasurement, type PriceAssetType, PriceClient, type PriceEncoding, type PriceFeedMetadata, type PricePoint, type PriceStreamEvent, type PriceStreamOptions, type PriceUpdateOptions, type PriceUpdateResponse, type PriorityFeeEstimate, type ProgramStatsBucket, type ProgramStatsOptions, type PublisherStakeCap, type PublisherStakeCapsResponse, type RpcBatchCall, type RpcMethodSpec, type RpcNamespace, type RpcNamespaceBase, type RpcNotification, type RpcNotificationListener, type RpcParams, type RpcResult, type RpcSendOptions, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, type SlotStatsOptions, type SlotStatsRow, type SolanaAnalyticsSchema, type SolanaClient, type SolanaCommitment, type SolanaConfig, type SolanaContext, type SolanaContextResult, type SolanaDasSchema, type SolanaEncoding, type SolanaEnhancedSubscriptionSchema, type SolanaHistorySchema, type SolanaLeaderSchema, type SolanaRpcSchema, SolanaSubscriptions, type SubscriptionId, type SubscriptionListener, type TokenBalance, type TopProgramRow, type TopProgramsOptions, type TpsBucket, type TpsTimeseriesOptions, UsageClient, type ValidatorInformation, type ValidatorsInformationOptions, type ValidatorsInformationResult, createErpcClient, createErpcCloudClient };
|
package/dist/index.js
CHANGED
|
@@ -314,6 +314,7 @@ var CloudCatalogClient = class {
|
|
|
314
314
|
|
|
315
315
|
// src/config.ts
|
|
316
316
|
var DEFAULT_ENDPOINT = "https://edge.erpc.global";
|
|
317
|
+
var DEFAULT_AVALANCHE_ENDPOINT = "https://ava-rpc.erpc.global";
|
|
317
318
|
var DEFAULT_ACCOUNT_ENDPOINT = "https://solana-rpc.erpc.global";
|
|
318
319
|
var DEFAULT_USER_ENDPOINT = "https://user-api.erpc.global";
|
|
319
320
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
@@ -330,10 +331,14 @@ var resolveConfig = (config) => {
|
|
|
330
331
|
const apiKey = config.apiKey.trim();
|
|
331
332
|
if (!apiKey) throw new ErpcConfigError("apiKey must not be empty");
|
|
332
333
|
let endpoint;
|
|
334
|
+
let avalancheEndpoint;
|
|
333
335
|
let accountEndpoint;
|
|
334
336
|
let userEndpoint;
|
|
335
337
|
try {
|
|
336
338
|
endpoint = new URL(config.endpoint ?? DEFAULT_ENDPOINT);
|
|
339
|
+
avalancheEndpoint = new URL(
|
|
340
|
+
config.avalancheEndpoint ?? DEFAULT_AVALANCHE_ENDPOINT
|
|
341
|
+
);
|
|
337
342
|
accountEndpoint = new URL(
|
|
338
343
|
config.accountEndpoint ?? DEFAULT_ACCOUNT_ENDPOINT
|
|
339
344
|
);
|
|
@@ -344,6 +349,9 @@ var resolveConfig = (config) => {
|
|
|
344
349
|
if (endpoint.protocol !== "https:" && endpoint.protocol !== "http:") {
|
|
345
350
|
throw new ErpcConfigError("endpoint must use HTTP or HTTPS");
|
|
346
351
|
}
|
|
352
|
+
if (avalancheEndpoint.protocol !== "https:" && avalancheEndpoint.protocol !== "http:") {
|
|
353
|
+
throw new ErpcConfigError("avalancheEndpoint must use HTTP or HTTPS");
|
|
354
|
+
}
|
|
347
355
|
if (accountEndpoint.protocol !== "https:" && accountEndpoint.protocol !== "http:") {
|
|
348
356
|
throw new ErpcConfigError("accountEndpoint must use HTTP or HTTPS");
|
|
349
357
|
}
|
|
@@ -353,6 +361,9 @@ var resolveConfig = (config) => {
|
|
|
353
361
|
endpoint.search = "";
|
|
354
362
|
endpoint.hash = "";
|
|
355
363
|
endpoint.pathname = endpoint.pathname.replace(/\/+$/, "") || "/";
|
|
364
|
+
avalancheEndpoint.search = "";
|
|
365
|
+
avalancheEndpoint.hash = "";
|
|
366
|
+
avalancheEndpoint.pathname = avalancheEndpoint.pathname.replace(/\/+$/, "") || "/";
|
|
356
367
|
accountEndpoint.search = "";
|
|
357
368
|
accountEndpoint.hash = "";
|
|
358
369
|
accountEndpoint.pathname = accountEndpoint.pathname.replace(/\/+$/, "") || "/";
|
|
@@ -366,6 +377,7 @@ var resolveConfig = (config) => {
|
|
|
366
377
|
return {
|
|
367
378
|
accountEndpoint,
|
|
368
379
|
apiKey,
|
|
380
|
+
avalancheEndpoint,
|
|
369
381
|
endpoint,
|
|
370
382
|
fetch: requireFetch(config.fetch),
|
|
371
383
|
headers: config.headers ?? {},
|
|
@@ -1392,6 +1404,10 @@ var createErpcClient = (config) => {
|
|
|
1392
1404
|
...sharedTransport,
|
|
1393
1405
|
endpoint: ethereumEndpoint
|
|
1394
1406
|
});
|
|
1407
|
+
const avalancheTransport = new HttpJsonRpcTransport({
|
|
1408
|
+
...sharedTransport,
|
|
1409
|
+
endpoint: endpointWithPath(resolved.avalancheEndpoint, "/ava")
|
|
1410
|
+
});
|
|
1395
1411
|
const solanaWebSocket = new WebSocketJsonRpcTransport({
|
|
1396
1412
|
endpoint: websocketUrl(resolved.endpoint, resolved.apiKey),
|
|
1397
1413
|
timeoutMs: resolved.timeoutMs,
|
|
@@ -1402,6 +1418,15 @@ var createErpcClient = (config) => {
|
|
|
1402
1418
|
timeoutMs: resolved.timeoutMs,
|
|
1403
1419
|
...resolved.webSocket === void 0 ? {} : { webSocket: resolved.webSocket }
|
|
1404
1420
|
});
|
|
1421
|
+
const avalancheWebSocket = new WebSocketJsonRpcTransport({
|
|
1422
|
+
endpoint: websocketUrl(
|
|
1423
|
+
resolved.avalancheEndpoint,
|
|
1424
|
+
resolved.apiKey,
|
|
1425
|
+
"/ava-ws"
|
|
1426
|
+
),
|
|
1427
|
+
timeoutMs: resolved.timeoutMs,
|
|
1428
|
+
...resolved.webSocket === void 0 ? {} : { webSocket: resolved.webSocket }
|
|
1429
|
+
});
|
|
1405
1430
|
const priceTransport = new RestTransport({
|
|
1406
1431
|
...sharedTransport,
|
|
1407
1432
|
endpoint: resolved.endpoint
|
|
@@ -1422,15 +1447,21 @@ var createErpcClient = (config) => {
|
|
|
1422
1447
|
...createEthereumClient(ethereumTransport),
|
|
1423
1448
|
subscriptions: new EthereumSubscriptions(ethereumWebSocket)
|
|
1424
1449
|
};
|
|
1450
|
+
const avalanche = {
|
|
1451
|
+
...createEthereumClient(avalancheTransport),
|
|
1452
|
+
subscriptions: new EthereumSubscriptions(avalancheWebSocket)
|
|
1453
|
+
};
|
|
1425
1454
|
return {
|
|
1426
1455
|
solana,
|
|
1427
1456
|
ethereum,
|
|
1457
|
+
avalanche,
|
|
1428
1458
|
price: new PriceClient(priceTransport),
|
|
1429
1459
|
account: new AccountClient(accountTransport),
|
|
1430
1460
|
usage: new UsageClient(userTransport),
|
|
1431
1461
|
close: () => {
|
|
1432
1462
|
solana.subscriptions.close();
|
|
1433
1463
|
ethereum.subscriptions.close();
|
|
1464
|
+
avalanche.subscriptions.close();
|
|
1434
1465
|
}
|
|
1435
1466
|
};
|
|
1436
1467
|
};
|
|
@@ -1651,6 +1682,6 @@ var createErpcCloudClient = (config) => {
|
|
|
1651
1682
|
};
|
|
1652
1683
|
};
|
|
1653
1684
|
|
|
1654
|
-
export { AccountClient, CloudCatalogClient, CloudCreditClient, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, ErpcAbortedError, ErpcBatchPolicyError, ErpcConfigError, ErpcError, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, ErpcTimeoutError, ErpcTransportError, EthereumSubscriptions, PendingRpcBatchRequest, PendingRpcRequest, PriceClient, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, SolanaSubscriptions, UsageClient, createErpcClient, createErpcCloudClient };
|
|
1685
|
+
export { AccountClient, CloudCatalogClient, CloudCreditClient, CloudResourcesClient, DEFAULT_ACCOUNT_ENDPOINT, DEFAULT_AVALANCHE_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_TIMEOUT_MS, DEFAULT_USER_ENDPOINT, ETHEREUM_RPC_METHODS, ETHEREUM_SUBSCRIPTION_METHODS, ErpcAbortedError, ErpcBatchPolicyError, ErpcConfigError, ErpcError, ErpcHttpError, ErpcInvalidResponseError, ErpcJsonRpcError, ErpcTimeoutError, ErpcTransportError, EthereumSubscriptions, PendingRpcBatchRequest, PendingRpcRequest, PriceClient, RpcSubscription, SOLANA_ANALYTICS_METHODS, SOLANA_DAS_METHODS, SOLANA_ENHANCED_SUBSCRIPTION_METHODS, SOLANA_HISTORY_METHODS, SOLANA_LEADER_METHODS, SOLANA_RPC_METHODS, SolanaSubscriptions, UsageClient, createErpcClient, createErpcCloudClient };
|
|
1655
1686
|
//# sourceMappingURL=index.js.map
|
|
1656
1687
|
//# sourceMappingURL=index.js.map
|