@coinbase/cdp-sdk 1.36.1 → 1.37.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/CHANGELOG.md +6 -0
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +73 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.js +1 -39
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
- package/_cjs/openapi-client/generated/onramp/onramp.js +29 -1
- package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -1
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +43 -0
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -0
- package/_cjs/openapi-client/index.js +1 -0
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/policies/solanaSchema.js +92 -2
- package/_cjs/policies/solanaSchema.js.map +1 -1
- package/_cjs/policies/types.js +1 -0
- package/_cjs/policies/types.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +71 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/onchain-data/onchain-data.js +0 -37
- package/_esm/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
- package/_esm/openapi-client/generated/onramp/onramp.js +27 -0
- package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -1
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +39 -0
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -0
- package/_esm/openapi-client/index.js +1 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/policies/solanaSchema.js +91 -1
- package/_esm/policies/solanaSchema.js.map +1 -1
- package/_esm/policies/types.js +2 -1
- package/_esm/policies/types.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +224 -4
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts +1 -32
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts.map +1 -1
- package/_types/openapi-client/generated/onramp/onramp.d.ts +22 -1
- package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -1
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +43 -0
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +1 -0
- package/_types/openapi-client/index.d.ts +1 -1
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/solanaSchema.d.ts +325 -3
- package/_types/policies/solanaSchema.d.ts.map +1 -1
- package/_types/policies/types.d.ts +337 -0
- package/_types/policies/types.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +291 -3
- package/openapi-client/generated/onchain-data/onchain-data.ts +0 -46
- package/openapi-client/generated/onramp/onramp.ts +38 -0
- package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +60 -0
- package/openapi-client/index.ts +1 -0
- package/package.json +1 -1
- package/policies/solanaSchema.ts +124 -3
- package/policies/types.ts +6 -1
- package/version.ts +1 -1
package/policies/solanaSchema.ts
CHANGED
|
@@ -60,6 +60,35 @@ export const MintAddressOperatorEnum = z.enum(["in", "not in"]);
|
|
|
60
60
|
*/
|
|
61
61
|
export type MintAddressOperator = z.infer<typeof MintAddressOperatorEnum>;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Enum for ProgramIdOperator values
|
|
65
|
+
*/
|
|
66
|
+
export const ProgramIdOperatorEnum = z.enum(["in", "not in"]);
|
|
67
|
+
/**
|
|
68
|
+
* Type representing the operators that can be used for program ID comparisons.
|
|
69
|
+
* These operators determine how transaction program IDs are evaluated against a list.
|
|
70
|
+
*/
|
|
71
|
+
export type ProgramIdOperator = z.infer<typeof ProgramIdOperatorEnum>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Enum for SolNetworkOperator values
|
|
75
|
+
*/
|
|
76
|
+
export const SolNetworkOperatorEnum = z.enum(["in", "not in"]);
|
|
77
|
+
/**
|
|
78
|
+
* Type representing the operators that can be used for Solana network comparisons.
|
|
79
|
+
* These operators determine how transaction networks are evaluated against a list.
|
|
80
|
+
*/
|
|
81
|
+
export type SolNetworkOperator = z.infer<typeof SolNetworkOperatorEnum>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Enum for supported Solana networks
|
|
85
|
+
*/
|
|
86
|
+
export const SolNetworkEnum = z.enum(["solana-devnet", "solana"]);
|
|
87
|
+
/**
|
|
88
|
+
* Type representing the supported Solana networks.
|
|
89
|
+
*/
|
|
90
|
+
export type SolNetwork = z.infer<typeof SolNetworkEnum>;
|
|
91
|
+
|
|
63
92
|
/**
|
|
64
93
|
* Enum for KnownIdlType values
|
|
65
94
|
*/
|
|
@@ -250,6 +279,58 @@ export const SolDataCriterionSchema = z.object({
|
|
|
250
279
|
});
|
|
251
280
|
export type SolDataCriterion = z.infer<typeof SolDataCriterionSchema>;
|
|
252
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Schema for program ID criterions
|
|
284
|
+
*/
|
|
285
|
+
export const ProgramIdCriterionSchema = z.object({
|
|
286
|
+
/** The type of criterion, must be "programId" for program ID-based rules. */
|
|
287
|
+
type: z.literal("programId"),
|
|
288
|
+
/**
|
|
289
|
+
* Array of Solana program IDs to compare against.
|
|
290
|
+
* Each program ID must be a valid Base58-encoded Solana address (32-44 characters).
|
|
291
|
+
*/
|
|
292
|
+
programIds: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
|
|
293
|
+
/**
|
|
294
|
+
* The operator to use for evaluating transaction program IDs.
|
|
295
|
+
* "in" checks if a program ID is in the provided list.
|
|
296
|
+
* "not in" checks if a program ID is not in the provided list.
|
|
297
|
+
*/
|
|
298
|
+
operator: ProgramIdOperatorEnum,
|
|
299
|
+
});
|
|
300
|
+
export type ProgramIdCriterion = z.infer<typeof ProgramIdCriterionSchema>;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Schema for Solana network criterions
|
|
304
|
+
*/
|
|
305
|
+
export const SolNetworkCriterionSchema = z.object({
|
|
306
|
+
/** The type of criterion, must be "solNetwork" for network-based rules. */
|
|
307
|
+
type: z.literal("solNetwork"),
|
|
308
|
+
/**
|
|
309
|
+
* Array of Solana networks to compare against.
|
|
310
|
+
*/
|
|
311
|
+
networks: z.array(SolNetworkEnum),
|
|
312
|
+
/**
|
|
313
|
+
* The operator to use for evaluating transaction network.
|
|
314
|
+
* "in" checks if the network is in the provided list.
|
|
315
|
+
* "not in" checks if the network is not in the provided list.
|
|
316
|
+
*/
|
|
317
|
+
operator: SolNetworkOperatorEnum,
|
|
318
|
+
});
|
|
319
|
+
export type SolNetworkCriterion = z.infer<typeof SolNetworkCriterionSchema>;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Schema for Solana message criterions
|
|
323
|
+
*/
|
|
324
|
+
export const SolMessageCriterionSchema = z.object({
|
|
325
|
+
/** The type of criterion, must be "solMessage" for message-based rules. */
|
|
326
|
+
type: z.literal("solMessage"),
|
|
327
|
+
/**
|
|
328
|
+
* A regular expression pattern to match against the message.
|
|
329
|
+
*/
|
|
330
|
+
match: z.string(),
|
|
331
|
+
});
|
|
332
|
+
export type SolMessageCriterion = z.infer<typeof SolMessageCriterionSchema>;
|
|
333
|
+
|
|
253
334
|
/**
|
|
254
335
|
* Schema for criteria used in SignSolTransaction operations
|
|
255
336
|
*/
|
|
@@ -262,13 +343,14 @@ export const SignSolTransactionCriteriaSchema = z
|
|
|
262
343
|
SplValueCriterionSchema,
|
|
263
344
|
MintAddressCriterionSchema,
|
|
264
345
|
SolDataCriterionSchema,
|
|
346
|
+
ProgramIdCriterionSchema,
|
|
265
347
|
]),
|
|
266
348
|
)
|
|
267
349
|
.max(10)
|
|
268
350
|
.min(1);
|
|
269
351
|
/**
|
|
270
352
|
* Type representing a set of criteria for the signSolTransaction operation.
|
|
271
|
-
* Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and
|
|
353
|
+
* Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, mint addresses, Solana data, and program IDs.
|
|
272
354
|
*/
|
|
273
355
|
export type SignSolTransactionCriteria = z.infer<typeof SignSolTransactionCriteriaSchema>;
|
|
274
356
|
|
|
@@ -284,20 +366,26 @@ export const SendSolTransactionCriteriaSchema = z
|
|
|
284
366
|
SplValueCriterionSchema,
|
|
285
367
|
MintAddressCriterionSchema,
|
|
286
368
|
SolDataCriterionSchema,
|
|
369
|
+
ProgramIdCriterionSchema,
|
|
370
|
+
SolNetworkCriterionSchema,
|
|
287
371
|
]),
|
|
288
372
|
)
|
|
289
373
|
.max(10)
|
|
290
374
|
.min(1);
|
|
291
375
|
/**
|
|
292
376
|
* Type representing a set of criteria for the sendSolTransaction operation.
|
|
293
|
-
* Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and
|
|
377
|
+
* Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, mint addresses, Solana data, program IDs, and network restrictions.
|
|
294
378
|
*/
|
|
295
379
|
export type SendSolTransactionCriteria = z.infer<typeof SendSolTransactionCriteriaSchema>;
|
|
296
380
|
|
|
297
381
|
/**
|
|
298
382
|
* Enum for Solana Operation types
|
|
299
383
|
*/
|
|
300
|
-
export const SolOperationEnum = z.enum([
|
|
384
|
+
export const SolOperationEnum = z.enum([
|
|
385
|
+
"signSolTransaction",
|
|
386
|
+
"sendSolTransaction",
|
|
387
|
+
"signSolMessage",
|
|
388
|
+
]);
|
|
301
389
|
/**
|
|
302
390
|
* Type representing the operations that can be governed by a policy.
|
|
303
391
|
* Defines what Solana operations the policy applies to.
|
|
@@ -349,3 +437,36 @@ export const SendSolTransactionRuleSchema = z.object({
|
|
|
349
437
|
criteria: SendSolTransactionCriteriaSchema,
|
|
350
438
|
});
|
|
351
439
|
export type SendSolTransactionRule = z.infer<typeof SendSolTransactionRuleSchema>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Schema for criteria used in SignSolMessage operations
|
|
443
|
+
*/
|
|
444
|
+
export const SignSolMessageCriteriaSchema = z.array(SolMessageCriterionSchema).max(10).min(1);
|
|
445
|
+
/**
|
|
446
|
+
* Type representing a set of criteria for the signSolMessage operation.
|
|
447
|
+
* Can contain up to 10 individual criterion objects for Solana message matching.
|
|
448
|
+
*/
|
|
449
|
+
export type SignSolMessageCriteria = z.infer<typeof SignSolMessageCriteriaSchema>;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Type representing a 'signSolMessage' policy rule that can accept or reject specific operations
|
|
453
|
+
* based on a set of criteria.
|
|
454
|
+
*/
|
|
455
|
+
export const SignSolMessageRuleSchema = z.object({
|
|
456
|
+
/**
|
|
457
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
458
|
+
* "accept" will allow the message signing, "reject" will block it.
|
|
459
|
+
*/
|
|
460
|
+
action: ActionEnum,
|
|
461
|
+
/**
|
|
462
|
+
* The operation to which this rule applies.
|
|
463
|
+
* Must be "signSolMessage".
|
|
464
|
+
*/
|
|
465
|
+
operation: z.literal("signSolMessage"),
|
|
466
|
+
/**
|
|
467
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
468
|
+
* Must be compatible with the specified operation type.
|
|
469
|
+
*/
|
|
470
|
+
criteria: SignSolMessageCriteriaSchema,
|
|
471
|
+
});
|
|
472
|
+
export type SignSolMessageRule = z.infer<typeof SignSolMessageRuleSchema>;
|
package/policies/types.ts
CHANGED
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
SignEvmTypedDataRuleSchema,
|
|
10
10
|
SendUserOperationRuleSchema,
|
|
11
11
|
} from "./evmSchema.js";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
SendSolTransactionRuleSchema,
|
|
14
|
+
SignSolTransactionRuleSchema,
|
|
15
|
+
SignSolMessageRuleSchema,
|
|
16
|
+
} from "./solanaSchema.js";
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* A single Policy that can be used to govern the behavior of projects and accounts.
|
|
@@ -50,6 +54,7 @@ export const RuleSchema = z.discriminatedUnion("operation", [
|
|
|
50
54
|
SendEvmTransactionRuleSchema,
|
|
51
55
|
SignSolTransactionRuleSchema,
|
|
52
56
|
SendSolTransactionRuleSchema,
|
|
57
|
+
SignSolMessageRuleSchema,
|
|
53
58
|
PrepareUserOperationRuleSchema,
|
|
54
59
|
SendUserOperationRuleSchema,
|
|
55
60
|
]);
|
package/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "1.
|
|
1
|
+
export const version = "1.37.0";
|