The Coinbase SDK.

Constructors

  • Initializes the Coinbase SDK.

    Parameters

    Returns Coinbase

    Deprecated

    as of v0.5.0, use configure or configureFromJson instead.

    Throws

    If the configuration is invalid.

    Throws

    If not able to create JWT token.

Properties

apiClients: ApiClients = ...
apiKeyPrivateKey: string

The CDP API key Private Key.

Constant

assets: {
    Cbbtc: string;
    Eth: string;
    Eurc: string;
    Gwei: string;
    Lamport: string;
    Sol: string;
    Usdc: string;
    Wei: string;
    Weth: string;
} = ...

The list of supported assets.

Type declaration

  • Cbbtc: string
  • Eth: string
  • Eurc: string
  • Gwei: string
  • Lamport: string
  • Sol: string
  • Usdc: string
  • Wei: string
  • Weth: string

Constant

defaultPageLimit: number = 100

The default page limit for list methods.

Constant

networks: {
    ArbitrumMainnet: "arbitrum-mainnet";
    ArbitrumSepolia: "arbitrum-sepolia";
    BaseMainnet: "base-mainnet";
    BaseSepolia: "base-sepolia";
    BitcoinMainnet: "bitcoin-mainnet";
    EthereumHolesky: "ethereum-holesky";
    EthereumMainnet: "ethereum-mainnet";
    EthereumSepolia: "ethereum-sepolia";
    NearMainnet: "near-mainnet";
    NearTestnet: "near-testnet";
    PolygonMainnet: "polygon-mainnet";
    SolanaDevnet: "solana-devnet";
    SolanaMainnet: "solana-mainnet";
} = NetworkIdentifier

The map of supported networks to network ID. Generated from the OpenAPI spec.

Type declaration

  • Readonly ArbitrumMainnet: "arbitrum-mainnet"
  • Readonly ArbitrumSepolia: "arbitrum-sepolia"
  • Readonly BaseMainnet: "base-mainnet"
  • Readonly BaseSepolia: "base-sepolia"
  • Readonly BitcoinMainnet: "bitcoin-mainnet"
  • Readonly EthereumHolesky: "ethereum-holesky"
  • Readonly EthereumMainnet: "ethereum-mainnet"
  • Readonly EthereumSepolia: "ethereum-sepolia"
  • Readonly NearMainnet: "near-mainnet"
  • Readonly NearTestnet: "near-testnet"
  • Readonly PolygonMainnet: "polygon-mainnet"
  • Readonly SolanaDevnet: "solana-devnet"
  • Readonly SolanaMainnet: "solana-mainnet"

Constant

Example

Coinbase.networks.BaseMainnet
useServerSigner: boolean

Whether to use a server signer or not.

Constant

Methods

  • Reads the API key and private key from a JSON file and initializes the Coinbase SDK.

    Parameters

    Returns Coinbase

    A new instance of the Coinbase SDK.

    Throws

    If the file does not exist or the configuration values are missing/invalid.

    Throws

    If the configuration is invalid.

    Throws

    If not able to create JWT token.

  • Converts a network symbol to a string, replacing underscores with hyphens.

    Parameters

    • network: string

      The network symbol to convert

    Returns string

    the converted string

  • Converts a string to a symbol, replacing hyphens with underscores.

    Parameters

    • asset: string

      The string to convert

    Returns string

    the converted symbol