@cubist-labs/cubesigner-sdk 0.4.209 → 0.4.217

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.
Files changed (45) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/acl.d.ts +12 -0
  3. package/dist/src/acl.d.ts.map +1 -0
  4. package/dist/src/acl.js +3 -0
  5. package/dist/src/client/api_client.d.ts +24 -6
  6. package/dist/src/client/api_client.d.ts.map +1 -1
  7. package/dist/src/client/api_client.js +40 -14
  8. package/dist/src/client/base_client.d.ts +1 -0
  9. package/dist/src/client/base_client.d.ts.map +1 -1
  10. package/dist/src/client/base_client.js +1 -1
  11. package/dist/src/contact.d.ts +9 -1
  12. package/dist/src/contact.d.ts.map +1 -1
  13. package/dist/src/contact.js +14 -1
  14. package/dist/src/evm/index.d.ts +7 -0
  15. package/dist/src/evm/index.d.ts.map +1 -1
  16. package/dist/src/evm/index.js +28 -29
  17. package/dist/src/index.d.ts +2 -0
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/index.js +3 -1
  20. package/dist/src/org.d.ts +60 -19
  21. package/dist/src/org.d.ts.map +1 -1
  22. package/dist/src/org.js +82 -25
  23. package/dist/src/policy.d.ts +109 -35
  24. package/dist/src/policy.d.ts.map +1 -1
  25. package/dist/src/policy.js +88 -42
  26. package/dist/src/schema.d.ts +158 -16
  27. package/dist/src/schema.d.ts.map +1 -1
  28. package/dist/src/schema.js +1 -1
  29. package/dist/src/schema_types.d.ts +12 -2
  30. package/dist/src/schema_types.d.ts.map +1 -1
  31. package/dist/src/schema_types.js +1 -1
  32. package/dist/src/scopes.d.ts.map +1 -1
  33. package/dist/src/scopes.js +2 -1
  34. package/package.json +1 -1
  35. package/src/acl.ts +13 -0
  36. package/src/client/api_client.ts +54 -12
  37. package/src/client/base_client.ts +1 -1
  38. package/src/contact.ts +16 -1
  39. package/src/evm/index.ts +4 -4
  40. package/src/index.ts +2 -0
  41. package/src/org.ts +118 -31
  42. package/src/policy.ts +144 -49
  43. package/src/schema.ts +184 -25
  44. package/src/schema_types.ts +14 -3
  45. package/src/scopes.ts +1 -0
package/src/schema.ts CHANGED
@@ -270,9 +270,18 @@ export interface paths {
270
270
  * List all contacts in the org.
271
271
  * Any org member is allowed to list all contacts in the org.
272
272
  *
273
- * If a search condition is provided, the result will contain only the contacts
274
- * who have an address starting with, or equaling, the given search string. The
275
- * search is case-insensitive. If a search term is defined, we do not guarantee
273
+ * ## Search Condition
274
+ * The search condition is optional.
275
+ *
276
+ * - If the search condition starts with "label:...", this list will only hold contacts with
277
+ * the label provided after the ":". For example, "label:cubist:erc20_token" would return contacts that
278
+ * hold the label "cubist:erc20_token".
279
+ *
280
+ * - Otherwise, the result will contain only the contacts who have an address starting with, or
281
+ * equaling, the given search string. For example, "0xee" would return all contacts holding an
282
+ * address starting with "0xee". The search is case-insensitive.
283
+ *
284
+ * If a search term is defined, we do not guarantee
276
285
  * the number of results in a page. The behavior of this parameter may change
277
286
  * in the future (for example, making results more strictly paginated or
278
287
  * performing a fuzzy search rather than a prefix search).
@@ -535,6 +544,13 @@ export interface paths {
535
544
  */
536
545
  get: operations["public_org_info"];
537
546
  };
547
+ "/v0/org/{org_id}/internal/custom_chain_rpc": {
548
+ /**
549
+ * (INTERNAL) Custom chain RPC proxy
550
+ * @description (INTERNAL) Custom chain RPC proxy
551
+ */
552
+ post: operations["customChainRpcCall"];
553
+ };
538
554
  "/v0/org/{org_id}/internal/esplora": {
539
555
  /**
540
556
  * (INTERNAL) Esplora API Proxy
@@ -1753,6 +1769,8 @@ export interface components {
1753
1769
  btc?: components["schemas"]["BitcoinAddressInfo"][];
1754
1770
  /** @description EVM addresses. */
1755
1771
  evm?: components["schemas"]["EvmAddressInfo"][];
1772
+ /** @description Solana addresses. */
1773
+ sol?: components["schemas"]["SolanaAddressInfo"][];
1756
1774
  /** @description SUI addresses. */
1757
1775
  sui?: components["schemas"]["SuiAddressInfo"][];
1758
1776
  };
@@ -2551,6 +2569,8 @@ export interface components {
2551
2569
  };
2552
2570
  /** @enum {string} */
2553
2571
  BadGatewayErrorCode:
2572
+ | "Generic"
2573
+ | "CustomChainRpcError"
2554
2574
  | "EsploraApiError"
2555
2575
  | "SentryApiError"
2556
2576
  | "CallWebhookError"
@@ -2602,6 +2622,7 @@ export interface components {
2602
2622
  | "NameTaken"
2603
2623
  | "ContactNameInvalid"
2604
2624
  | "ContactAddressesInvalid"
2625
+ | "ContactLabelInvalid"
2605
2626
  | "ContactModified"
2606
2627
  | "PolicyNotFound"
2607
2628
  | "PolicyVersionNotFound"
@@ -2749,6 +2770,9 @@ export interface components {
2749
2770
  | "InvalidTendermintRequest"
2750
2771
  | "PolicyVersionMaxReached"
2751
2772
  | "PolicyVersionInvalid"
2773
+ | "PolicySecretLimitReached"
2774
+ | "PolicySecretTooLarge"
2775
+ | "InvalidImportKey"
2752
2776
  | "AlienOwnerInvalid"
2753
2777
  | "EmptyUpdateRequest"
2754
2778
  | "InvalidPolicyReference"
@@ -2934,6 +2958,7 @@ export interface components {
2934
2958
  | "IdpAuthenticate"
2935
2959
  | "IdpPasswordResetRequest"
2936
2960
  | "IdpPasswordResetConfirm"
2961
+ | "CustomChainRpcCall"
2937
2962
  | "EsploraApiCall"
2938
2963
  | "ExecutePolicy"
2939
2964
  | "SentryApiCall"
@@ -3305,6 +3330,13 @@ export interface components {
3305
3330
  ConflictErrorCode: "ConcurrentRequestDisallowed" | "ConcurrentLockCreation";
3306
3331
  /** @description A contact in the org. */
3307
3332
  Contact: components["schemas"]["CommonFields"] & {
3333
+ /**
3334
+ * @description Labels to categorize this contact.
3335
+ * @example [
3336
+ * "cubist:erc20_token"
3337
+ * ]
3338
+ */
3339
+ labels?: components["schemas"]["ContactLabel"][];
3308
3340
  /**
3309
3341
  * @description The name for the contact. Must be a unique name among contacts in the
3310
3342
  * org. The name must consist of alphanumeric characters, spaces, `.` and `-`,
@@ -3327,12 +3359,21 @@ export interface components {
3327
3359
  | (components["schemas"]["SuiAddressInfo"] & {
3328
3360
  /** @enum {string} */
3329
3361
  network: "Sui";
3362
+ })
3363
+ | (components["schemas"]["SolanaAddressInfo"] & {
3364
+ /** @enum {string} */
3365
+ network: "Solana";
3330
3366
  });
3331
3367
  /** @description Information about a Contact. */
3332
3368
  ContactInfoResponse: components["schemas"]["Contact"] & {
3333
3369
  addresses: components["schemas"]["AddressMap"];
3334
3370
  id: components["schemas"]["Id"];
3335
3371
  };
3372
+ /**
3373
+ * @description Labels that can be applied to a contact.
3374
+ * @enum {string}
3375
+ */
3376
+ ContactLabel: "cubist:erc20_token" | "cubist:spl_token";
3336
3377
  CreateAndUpdateKeyProperties: {
3337
3378
  edit_policy?: components["schemas"]["EditPolicy"] | null;
3338
3379
  /**
@@ -3363,6 +3404,13 @@ export interface components {
3363
3404
  CreateContactRequest: {
3364
3405
  addresses?: components["schemas"]["AddressMap"];
3365
3406
  edit_policy?: components["schemas"]["EditPolicy"] | null;
3407
+ /**
3408
+ * @description Optional labels to associate with the contact.
3409
+ * @example [
3410
+ * "cubist:erc20_token"
3411
+ * ]
3412
+ */
3413
+ labels?: components["schemas"]["ContactLabel"][];
3366
3414
  /** @description Optional user-defined metadata about the contact. */
3367
3415
  metadata?: unknown;
3368
3416
  /**
@@ -3552,6 +3600,23 @@ export interface components {
3552
3600
  /** @description CubeSigner's user identifier */
3553
3601
  user_id: string;
3554
3602
  };
3603
+ /** @description Custom chain RPC request */
3604
+ CustomChainRpcRequest: {
3605
+ /** @description HTTP body */
3606
+ body?: string | null;
3607
+ chain: components["schemas"]["CustomChainSelector"];
3608
+ /** @description HTTP relative path */
3609
+ path: string;
3610
+ };
3611
+ CustomChainRpcResponse: unknown;
3612
+ /** @description Custom chain selector */
3613
+ CustomChainSelector: {
3614
+ /** @description EVM chain */
3615
+ Evm: {
3616
+ /** @example 0x01 */
3617
+ chain_id: string;
3618
+ };
3619
+ };
3555
3620
  /** @description Information about an org's custom chains. */
3556
3621
  CustomChainsData: {
3557
3622
  /** @description Custom EVM chains. */
@@ -4224,7 +4289,7 @@ export interface components {
4224
4289
  native_currency: components["schemas"]["EvmCurrencyInfo"];
4225
4290
  /**
4226
4291
  * @description The URL of the RPC provider for this chain.
4227
- * @example https://ethereum-rpc.publicnode.com/
4292
+ * @example https://ethereum-rpc.publicnode.com
4228
4293
  */
4229
4294
  rpc_url: string;
4230
4295
  };
@@ -4388,6 +4453,7 @@ export interface components {
4388
4453
  | "manage:contact:update:name"
4389
4454
  | "manage:contact:update:addresses"
4390
4455
  | "manage:contact:update:owner"
4456
+ | "manage:contact:update:labels"
4391
4457
  | "manage:contact:update:metadata"
4392
4458
  | "manage:contact:update:editPolicy"
4393
4459
  | "manage:contact:lookup:*"
@@ -5556,7 +5622,8 @@ export interface components {
5556
5622
  | "OrgExportCiphertextNotFound"
5557
5623
  | "UploadObjectNotFound"
5558
5624
  | "PolicySecretNotFound"
5559
- | "TimestreamDisabled";
5625
+ | "TimestreamDisabled"
5626
+ | "CustomChainNotFound";
5560
5627
  /** @description The configuration and status of a notification endpoint */
5561
5628
  NotificationEndpoint: components["schemas"]["NotificationEndpointSubscription"] & {
5562
5629
  status: components["schemas"]["SubscriptionStatus"];
@@ -6474,24 +6541,26 @@ export interface components {
6474
6541
  }) &
6475
6542
  Record<string, never>;
6476
6543
  /**
6477
- * @description The possible actions that can be performed on a [NamedPolicy] that are restricted by ACL.
6544
+ * PolicyAction
6545
+ * @description The access-controlled actions that can be performed on a named policy.
6546
+ * @example read:policy
6478
6547
  * @enum {string}
6479
6548
  */
6480
6549
  PolicyAction:
6481
- | "ReadAll"
6482
- | "ReadPolicy"
6483
- | "ReadLogs"
6484
- | "UpdateAll"
6485
- | "UpdateName"
6486
- | "UpdateRules"
6487
- | "UpdateMetadata"
6488
- | "UpdateEditPolicy"
6489
- | "UpdateOwner"
6490
- | "UpdateAcl"
6491
- | "Delete"
6492
- | "Attach"
6493
- | "Sign"
6494
- | "Invoke";
6550
+ | "read:*"
6551
+ | "read:policy"
6552
+ | "read:logs"
6553
+ | "update:*"
6554
+ | "update:name"
6555
+ | "update:rules"
6556
+ | "update:metadata"
6557
+ | "update:editPolicy"
6558
+ | "update:owner"
6559
+ | "update:acl"
6560
+ | "delete"
6561
+ | "attach"
6562
+ | "sign"
6563
+ | "invoke";
6495
6564
  /** @description The id for attaching a named policy to a key, role, or key in role. */
6496
6565
  PolicyAttachedToId: OneOf<
6497
6566
  [
@@ -6532,6 +6601,8 @@ export interface components {
6532
6601
  * ]
6533
6602
  */
6534
6603
  allowed_http_authorities: string[];
6604
+ /** @description The maximum number of policy secrets for the Org. */
6605
+ org_secrets_limit?: number | null;
6535
6606
  };
6536
6607
  PolicyErrorCode:
6537
6608
  | components["schemas"]["PolicyErrorOwnCodes"]
@@ -7348,6 +7419,20 @@ export interface components {
7348
7419
  * A wrapper type for serialization that encodes a `Duration` as a `u64` representing the number of seconds.
7349
7420
  */
7350
7421
  Seconds: number;
7422
+ /**
7423
+ * SecretAction
7424
+ * @description The access-controlled actions that can be performed on an individual policy secret.
7425
+ * @example read:secret
7426
+ * @enum {string}
7427
+ */
7428
+ SecretAction:
7429
+ | "read:*"
7430
+ | "read:info"
7431
+ | "read:secret"
7432
+ | "update:*"
7433
+ | "update:secret"
7434
+ | "update:acl"
7435
+ | "delete";
7351
7436
  /** @description Information about a specific secret. */
7352
7437
  SecretInfo: {
7353
7438
  /** @description The access-control entries for this secret. */
@@ -7548,6 +7633,20 @@ export interface components {
7548
7633
  /** @description The message to sign following the EIP-191 standard. */
7549
7634
  message: string;
7550
7635
  };
7636
+ /** @description A Solana address and the cluster it is on. */
7637
+ SolanaAddressInfo: {
7638
+ /**
7639
+ * @description The Solana address.
7640
+ * @example EPw4LsNwCYCYXace1BKvwLcd7oeZzRiYGuGE5zfPvoPy
7641
+ */
7642
+ address: string;
7643
+ cluster: components["schemas"]["SolanaCluster"];
7644
+ };
7645
+ /**
7646
+ * @description Supported Solana clusters.
7647
+ * @enum {string}
7648
+ */
7649
+ SolanaCluster: "mainnet" | "devnet" | "testnet";
7551
7650
  /**
7552
7651
  * @description Solana signing request
7553
7652
  * @example {
@@ -8082,6 +8181,13 @@ export interface components {
8082
8181
  UpdateContactRequest: {
8083
8182
  addresses?: components["schemas"]["AddressMap"] | null;
8084
8183
  edit_policy?: components["schemas"]["EditPolicy"] | null;
8184
+ /**
8185
+ * @description A new set of labels for the contact.
8186
+ * @example [
8187
+ * "cubist:erc20_token"
8188
+ * ]
8189
+ */
8190
+ labels?: components["schemas"]["ContactLabel"][] | null;
8085
8191
  /** @description A new value for the optional user-defined metadata about the contact. */
8086
8192
  metadata?: unknown;
8087
8193
  /**
@@ -8112,6 +8218,16 @@ export interface components {
8112
8218
  */
8113
8219
  version?: number | null;
8114
8220
  };
8221
+ /** @description Policy Engine configurations. */
8222
+ UpdateOrgPolicyEngineConfigs: {
8223
+ /**
8224
+ * @description Allowed domains for HTTP requests
8225
+ * @example [
8226
+ * "cubist.dev:443"
8227
+ * ]
8228
+ */
8229
+ allowed_http_authorities: string[];
8230
+ };
8115
8231
  UpdateOrgRequest: {
8116
8232
  alien_login_requirement?: components["schemas"]["SecondFactorRequirement"] | null;
8117
8233
  /**
@@ -8198,7 +8314,7 @@ export interface components {
8198
8314
  * ]
8199
8315
  */
8200
8316
  policy?: Record<string, never>[] | null;
8201
- policy_engine_configuration?: components["schemas"]["PolicyEngineConfiguration"] | null;
8317
+ policy_engine_configuration?: components["schemas"]["UpdateOrgPolicyEngineConfigs"] | null;
8202
8318
  /**
8203
8319
  * @description If set, all user logins will require the claim `cubesigner_scope_ceiling` to be present in
8204
8320
  * the user's token. This claim is an array of scopes (e.g. `[ "manage:keys:list", "sign:evm:tx" ]`),
@@ -8920,6 +9036,12 @@ export interface components {
8920
9036
  };
8921
9037
  };
8922
9038
  };
9039
+ /** @description Response to [CustomChainRpcRequest] */
9040
+ CustomChainRpcResponse: {
9041
+ content: {
9042
+ "application/json": unknown;
9043
+ };
9044
+ };
8923
9045
  /** @description The result of a Diffie Hellman key exchange */
8924
9046
  DiffieHellmanResponse: {
8925
9047
  content: {
@@ -11066,9 +11188,18 @@ export interface operations {
11066
11188
  * List all contacts in the org.
11067
11189
  * Any org member is allowed to list all contacts in the org.
11068
11190
  *
11069
- * If a search condition is provided, the result will contain only the contacts
11070
- * who have an address starting with, or equaling, the given search string. The
11071
- * search is case-insensitive. If a search term is defined, we do not guarantee
11191
+ * ## Search Condition
11192
+ * The search condition is optional.
11193
+ *
11194
+ * - If the search condition starts with "label:...", this list will only hold contacts with
11195
+ * the label provided after the ":". For example, "label:cubist:erc20_token" would return contacts that
11196
+ * hold the label "cubist:erc20_token".
11197
+ *
11198
+ * - Otherwise, the result will contain only the contacts who have an address starting with, or
11199
+ * equaling, the given search string. For example, "0xee" would return all contacts holding an
11200
+ * address starting with "0xee". The search is case-insensitive.
11201
+ *
11202
+ * If a search term is defined, we do not guarantee
11072
11203
  * the number of results in a page. The behavior of this parameter may change
11073
11204
  * in the future (for example, making results more strictly paginated or
11074
11205
  * performing a fuzzy search rather than a prefix search).
@@ -11089,7 +11220,7 @@ export interface operations {
11089
11220
  * the exact value previously returned as 'last_evaluated_key' from the same endpoint.
11090
11221
  */
11091
11222
  "page.start"?: string | null;
11092
- /** @description An entire address, or prefix of an address, that returned contacts must have. Must be at least 3 characters. */
11223
+ /** @description Either 'label:...', which lists contacts with the label provided after the ':'. Or, an entire address, or prefix of an address, that returned contacts must have. When searching by address, it must be at least 3 characters. */
11093
11224
  search?: string | null;
11094
11225
  };
11095
11226
  path: {
@@ -11922,6 +12053,34 @@ export interface operations {
11922
12053
  };
11923
12054
  };
11924
12055
  };
12056
+ /**
12057
+ * (INTERNAL) Custom chain RPC proxy
12058
+ * @description (INTERNAL) Custom chain RPC proxy
12059
+ */
12060
+ customChainRpcCall: {
12061
+ parameters: {
12062
+ path: {
12063
+ /**
12064
+ * @description Name or ID of the desired Org
12065
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
12066
+ */
12067
+ org_id: string;
12068
+ };
12069
+ };
12070
+ requestBody: {
12071
+ content: {
12072
+ "application/json": components["schemas"]["CustomChainRpcRequest"];
12073
+ };
12074
+ };
12075
+ responses: {
12076
+ 200: components["responses"]["CustomChainRpcResponse"];
12077
+ default: {
12078
+ content: {
12079
+ "application/json": components["schemas"]["ErrorResponse"];
12080
+ };
12081
+ };
12082
+ };
12083
+ };
11925
12084
  /**
11926
12085
  * (INTERNAL) Esplora API Proxy
11927
12086
  * @description (INTERNAL) Esplora API Proxy
@@ -111,6 +111,8 @@ export type SuiChain = schemas["SuiChain"];
111
111
  export type CreateContactRequest = schemas["CreateContactRequest"];
112
112
  export type UpdateContactRequest = schemas["UpdateContactRequest"];
113
113
  export type ListContactsResponse = schemas["PaginatedListContactsResponse"];
114
+ export type ContactLabel = schemas["ContactLabel"];
115
+ export type ContactAddressData = schemas["ContactAddressData"];
114
116
 
115
117
  export type CreateSignerSessionRequest = schemas["CreateTokenRequest"];
116
118
  export type RefreshSignerSessionRequest = schemas["AuthData"];
@@ -276,9 +278,12 @@ export type InvitationAcceptRequest = schemas["InvitationAcceptRequest"];
276
278
 
277
279
  export type KeyTypeAndDerivationPath = schemas["KeyTypeAndDerivationPath"];
278
280
 
279
- export type PolicyInfo = schemas["PolicyInfo"];
281
+ export type PolicyInfo = schemas["PolicyInfo"] & {
282
+ acl?: JsonValue[];
283
+ };
280
284
  export type UpdatePolicyRequest = schemas["UpdatePolicyRequest"] & {
281
285
  rules?: JsonValue[];
286
+ acl?: JsonValue[];
282
287
  };
283
288
  export type ListPoliciesResponse = schemas["PaginatedListPoliciesResponse"];
284
289
  export type PolicyType = schemas["PolicyType"];
@@ -287,8 +292,14 @@ export type PolicyAttachedToId = schemas["PolicyAttachedToId"];
287
292
  export type UploadWasmPolicyRequest = schemas["UploadWasmPolicyRequest"];
288
293
  export type UploadWasmPolicyResponse = schemas["UploadWasmPolicyResponse"];
289
294
  export type InvokePolicyRequest = schemas["InvokePolicyRequest"];
295
+
296
+ export type WasmRule = schemas["WasmRule"];
297
+ export type InvokeC2FResponse = InvokePolicyResponse;
290
298
  export type InvokePolicyResponse = schemas["InvokePolicyResponse"];
299
+ export type C2FResponse = WasmPolicyResponse;
291
300
  export type WasmPolicyResponse = schemas["WasmPolicyResponse"];
292
- export type WasmRule = schemas["WasmRule"];
293
-
301
+ export type C2FConfiguration = PolicyEngineConfiguration;
294
302
  export type PolicyEngineConfiguration = schemas["PolicyEngineConfiguration"];
303
+
304
+ export type PolicyAction = schemas["PolicyAction"];
305
+ export type SecretAction = schemas["SecretAction"];
package/src/scopes.ts CHANGED
@@ -120,6 +120,7 @@ export const AllScopes: Record<ExplicitScope, string> =
120
120
  "manage:contact:update:addresses" : "Allows access only to the contact 'update' endpoint, but restricts updates to the contact's 'addresses' field.",
121
121
  "manage:contact:update:owner" : "Allows access only to the contact 'update' endpoint, but restricts updates to the contact's 'owner' field.",
122
122
  "manage:contact:update:metadata" : "Allows access only to the contact 'update' endpoint, but restricts updates to the contact's 'metadata' field.",
123
+ "manage:contact:update:labels" : "Allows access only to the contact 'update' endpoint, but restricts updates to the contact's 'labels' field.",
123
124
  "manage:contact:update:editPolicy" : "Allows access only to the contact 'update' endpoint, but restricts updates to the contact's 'edit_policy' field.",
124
125
  "manage:contact:lookup:*" : "Allows access to the contact `lookup` endpoints",
125
126
  "manage:contact:lookup:address" : "Allows access only to the contact 'lookup by address' endpoint",