diff --git a/.changeset/bright-moles-remain.md b/.changeset/bright-moles-remain.md new file mode 100644 index 0000000..028d4bc --- /dev/null +++ b/.changeset/bright-moles-remain.md @@ -0,0 +1,5 @@ +--- +"gill": patch +--- + +refactored client type names diff --git a/packages/gill/src/core/create-solana-client.ts b/packages/gill/src/core/create-solana-client.ts index d533365..3a648a5 100644 --- a/packages/gill/src/core/create-solana-client.ts +++ b/packages/gill/src/core/create-solana-client.ts @@ -4,9 +4,9 @@ import type { DevnetUrl, MainnetUrl, TestnetUrl } from "@solana/rpc-types"; import type { LocalnetUrl, + SolanaClient, ModifiedClusterUrl, CreateSolanaClientArgs, - CreateSolanaClientResult, } from "../types/rpc"; import { sendAndConfirmTransactionFactory } from "../kit"; import { getPublicSolanaRpcUrl } from "./rpc"; @@ -18,25 +18,25 @@ export function createSolanaClient( props: Omit, "urlOrMoniker"> & { urlOrMoniker: "mainnet"; }, -): CreateSolanaClientResult; +): SolanaClient; export function createSolanaClient( props: Omit, "urlOrMoniker"> & { urlOrMoniker: "devnet"; }, -): CreateSolanaClientResult; +): SolanaClient; export function createSolanaClient( props: Omit, "urlOrMoniker"> & { urlOrMoniker: "testnet"; }, -): CreateSolanaClientResult; +): SolanaClient; export function createSolanaClient( props: Omit, "urlOrMoniker"> & { urlOrMoniker: "localnet"; }, -): CreateSolanaClientResult; +): SolanaClient; export function createSolanaClient( props: CreateSolanaClientArgs, -): CreateSolanaClientResult; +): SolanaClient; export function createSolanaClient({ urlOrMoniker, rpcConfig, diff --git a/packages/gill/src/types/rpc.ts b/packages/gill/src/types/rpc.ts index 2a3f963..26d2636 100644 --- a/packages/gill/src/types/rpc.ts +++ b/packages/gill/src/types/rpc.ts @@ -21,18 +21,18 @@ export type GenericUrl = string & {}; export type ModifiedClusterUrl = MainnetUrl | DevnetUrl | TestnetUrl | LocalnetUrl | GenericUrl; -export type CreateSolanaClientArgs< - TClusterUrl extends ModifiedClusterUrl | SolanaClusterMoniker = GenericUrl, -> = { +export type SolanaClientUrlOrMoniker = SolanaClusterMoniker | URL | ModifiedClusterUrl; + +export type CreateSolanaClientArgs = { /** Full RPC URL (for a private RPC endpoint) or the Solana moniker (for a public RPC endpoint) */ - urlOrMoniker: SolanaClusterMoniker | TClusterUrl | URL | ModifiedClusterUrl; + urlOrMoniker: SolanaClientUrlOrMoniker | TClusterUrl; /** Configuration used to create the `rpc` client */ rpcConfig?: Parameters[1] & { port?: number }; /** Configuration used to create the `rpcSubscriptions` client */ rpcSubscriptionsConfig?: Parameters[1] & { port?: number }; }; -export type CreateSolanaClientResult = { +export type SolanaClient = { /** Used to make RPC calls to your RPC provider */ rpc: RpcFromTransport< SolanaRpcApiFromTransport>, diff --git a/packages/react/src/types/providers.ts b/packages/react/src/types/providers.ts index 9e39933..099e027 100644 --- a/packages/react/src/types/providers.ts +++ b/packages/react/src/types/providers.ts @@ -1,8 +1,8 @@ // import {} from "react"; -import { CreateSolanaClientResult } from "gill"; +import { SolanaClient } from "gill"; /** * Initial configuration settings for utilizing gill hooks */ -export type GillConfig = CreateSolanaClientResult; +export type GillConfig = SolanaClient;