@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
34 lines • 1.08 kB
TypeScript
import { Connection } from "@solana/web3.js";
export type Network = "mainnet" | "devnet";
type GetOrCreateConnectionOptions = {
networkOrConnection: Network | Connection;
};
/**
* Get a connection to the Solana network
*
* @param options - The options for the connection
*
* @param options.networkOrConnection - The network to use or a connection
*
* @returns The connection
*/
export declare function getOrCreateConnection({ networkOrConnection, }: GetOrCreateConnectionOptions): Connection;
/**
* Get the network of the connected Solana node
*
* @param connection - The connection to the Solana network
* @throws {Error} If the network is not mainnet or devnet
*
* @returns The network of the connected Solana node
*/
export declare function getConnectedNetwork(connection: Connection): Promise<Network>;
/**
* Get the USDC mint address for the given connection
*
* @param network - The network to use
*
* @returns The USDC mint address
*/
export declare function getUsdcMintAddress(network: Network): string;
export {};
//# sourceMappingURL=utils.d.ts.map