@coinbase/cdp-sdk 1.27.0 → 1.28.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.
@@ -2,13 +2,12 @@ import { Connection } from "@solana/web3.js";
2
2
 
3
3
  import {
4
4
  GENESIS_HASH_MAINNET,
5
- GENESIS_HASH_TESTNET,
6
5
  GENESIS_HASH_DEVNET,
7
6
  USDC_MAINNET_MINT_ADDRESS,
8
7
  USDC_DEVNET_MINT_ADDRESS,
9
8
  } from "./constants.js";
10
9
 
11
- export type Network = "mainnet" | "devnet" | "testnet";
10
+ export type Network = "mainnet" | "devnet";
12
11
 
13
12
  type GetOrCreateConnectionOptions = {
14
13
  networkOrConnection: Network | Connection;
@@ -33,9 +32,7 @@ export function getOrCreateConnection({
33
32
  return new Connection(
34
33
  networkOrConnection === "mainnet"
35
34
  ? "https://api.mainnet-beta.solana.com"
36
- : networkOrConnection === "devnet"
37
- ? "https://api.devnet.solana.com"
38
- : "https://api.testnet.solana.com",
35
+ : "https://api.devnet.solana.com",
39
36
  );
40
37
  }
41
38
 
@@ -43,7 +40,7 @@ export function getOrCreateConnection({
43
40
  * Get the network of the connected Solana node
44
41
  *
45
42
  * @param connection - The connection to the Solana network
46
- * @throws {Error} If the network is not mainnet, devnet, or testnet
43
+ * @throws {Error} If the network is not mainnet or devnet
47
44
  *
48
45
  * @returns The network of the connected Solana node
49
46
  */
@@ -54,11 +51,9 @@ export async function getConnectedNetwork(connection: Connection): Promise<Netwo
54
51
  return "mainnet";
55
52
  } else if (genesisHash === GENESIS_HASH_DEVNET) {
56
53
  return "devnet";
57
- } else if (genesisHash === GENESIS_HASH_TESTNET) {
58
- return "testnet";
59
54
  }
60
55
 
61
- throw new Error("Unknown network");
56
+ throw new Error("Unknown or unsupported network");
62
57
  }
63
58
 
64
59
  /**
@@ -71,9 +66,6 @@ export async function getConnectedNetwork(connection: Connection): Promise<Netwo
71
66
  export function getUsdcMintAddress(network: Network): string {
72
67
  if (network === "mainnet") {
73
68
  return USDC_MAINNET_MINT_ADDRESS;
74
- } else if (network === "devnet") {
75
- return USDC_DEVNET_MINT_ADDRESS;
76
- } else {
77
- throw new Error("Testnet is not supported for USDC");
78
69
  }
70
+ return USDC_DEVNET_MINT_ADDRESS;
79
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-sdk",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "SDK for interacting with the Coinbase Developer Platform Wallet API",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -66,9 +66,9 @@ export const EvmAddressCriterionSchema = z.object({
66
66
  /**
67
67
  * Array of EVM addresses to compare against.
68
68
  * Each address must be a 0x-prefixed 40-character hexadecimal string.
69
- * Limited to a maximum of 100 addresses per criterion.
69
+ * Limited to a maximum of 300 addresses per criterion.
70
70
  */
71
- addresses: z.array(Address).max(100),
71
+ addresses: z.array(Address).max(300),
72
72
  /**
73
73
  * The operator to use for evaluating transaction addresses.
74
74
  * "in" checks if an address is in the provided list.
@@ -128,9 +128,9 @@ export const EvmTypedAddressConditionSchema = z.object({
128
128
  /**
129
129
  * Array of EVM addresses to compare against.
130
130
  * Each address must be a 0x-prefixed 40-character hexadecimal string.
131
- * Limited to a maximum of 100 addresses per condition.
131
+ * Limited to a maximum of 300 addresses per condition.
132
132
  */
133
- addresses: z.array(Address).max(100),
133
+ addresses: z.array(Address).max(300),
134
134
  /**
135
135
  * The operator to use for evaluating addresses.
136
136
  * "in" checks if an address is in the provided list.
@@ -235,9 +235,9 @@ export const SignEvmTypedDataVerifyingContractCriterionSchema = z.object({
235
235
  /**
236
236
  * Array of EVM addresses allowed or disallowed as verifying contracts.
237
237
  * Each address must be a 0x-prefixed 40-character hexadecimal string.
238
- * Limited to a maximum of 100 addresses per criterion.
238
+ * Limited to a maximum of 300 addresses per criterion.
239
239
  */
240
- addresses: z.array(Address).max(100),
240
+ addresses: z.array(Address).max(300),
241
241
  /**
242
242
  * The operator to use for evaluating verifying contract addresses.
243
243
  * "in" checks if the verifying contract is in the provided list.
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.27.0";
1
+ export const version = "1.28.0";