@cubist-labs/cubesigner-sdk 0.4.263 → 0.4.265

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 (106) hide show
  1. package/dist/package.json +12 -4
  2. package/dist/src/acl.js +1 -2
  3. package/dist/src/audit_log.d.ts +2 -2
  4. package/dist/src/audit_log.js +116 -119
  5. package/dist/src/bucket.d.ts +2 -2
  6. package/dist/src/bucket.d.ts.map +1 -1
  7. package/dist/src/bucket.js +2 -5
  8. package/dist/src/client/api_client.d.ts +16 -12
  9. package/dist/src/client/api_client.d.ts.map +1 -1
  10. package/dist/src/client/api_client.js +288 -292
  11. package/dist/src/client/base_client.d.ts +6 -6
  12. package/dist/src/client/base_client.d.ts.map +1 -1
  13. package/dist/src/client/base_client.js +27 -38
  14. package/dist/src/client/session.d.ts +2 -2
  15. package/dist/src/client/session.d.ts.map +1 -1
  16. package/dist/src/client/session.js +20 -35
  17. package/dist/src/client.d.ts +18 -18
  18. package/dist/src/client.d.ts.map +1 -1
  19. package/dist/src/client.js +14 -18
  20. package/dist/src/contact.d.ts +3 -3
  21. package/dist/src/contact.d.ts.map +1 -1
  22. package/dist/src/contact.js +4 -8
  23. package/dist/src/diffie_hellman.d.ts +1 -1
  24. package/dist/src/diffie_hellman.d.ts.map +1 -1
  25. package/dist/src/diffie_hellman.js +9 -12
  26. package/dist/src/env.js +13 -20
  27. package/dist/src/error.d.ts +2 -2
  28. package/dist/src/error.d.ts.map +1 -1
  29. package/dist/src/error.js +3 -8
  30. package/dist/src/events.js +2 -6
  31. package/dist/src/evm/index.d.ts +1 -1
  32. package/dist/src/evm/index.d.ts.map +1 -1
  33. package/dist/src/evm/index.js +5 -9
  34. package/dist/src/fetch.d.ts +1 -1
  35. package/dist/src/fetch.d.ts.map +1 -1
  36. package/dist/src/fetch.js +10 -15
  37. package/dist/src/index.d.ts +24 -24
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/dist/src/index.js +25 -48
  40. package/dist/src/key.d.ts +5 -5
  41. package/dist/src/key.d.ts.map +1 -1
  42. package/dist/src/key.js +28 -33
  43. package/dist/src/mfa.d.ts +2 -2
  44. package/dist/src/mfa.d.ts.map +1 -1
  45. package/dist/src/mfa.js +14 -25
  46. package/dist/src/org.d.ts +197 -197
  47. package/dist/src/org.d.ts.map +1 -1
  48. package/dist/src/org.js +28 -32
  49. package/dist/src/paginator.js +3 -8
  50. package/dist/src/passkey.d.ts +1 -1
  51. package/dist/src/passkey.d.ts.map +1 -1
  52. package/dist/src/passkey.js +16 -23
  53. package/dist/src/policy.d.ts +1 -1
  54. package/dist/src/policy.d.ts.map +1 -1
  55. package/dist/src/policy.js +17 -27
  56. package/dist/src/response.d.ts +16 -7
  57. package/dist/src/response.d.ts.map +1 -1
  58. package/dist/src/response.js +42 -21
  59. package/dist/src/retry.d.ts.map +1 -1
  60. package/dist/src/retry.js +5 -11
  61. package/dist/src/role.d.ts +3 -3
  62. package/dist/src/role.d.ts.map +1 -1
  63. package/dist/src/role.js +13 -18
  64. package/dist/src/schema.d.ts +115 -38
  65. package/dist/src/schema.d.ts.map +1 -1
  66. package/dist/src/schema.js +2 -3
  67. package/dist/src/schema_types.d.ts +6 -3
  68. package/dist/src/schema_types.d.ts.map +1 -1
  69. package/dist/src/schema_types.js +11 -7
  70. package/dist/src/scopes.d.ts +1 -1
  71. package/dist/src/scopes.d.ts.map +1 -1
  72. package/dist/src/scopes.js +19 -21
  73. package/dist/src/signer_session.d.ts +1 -1
  74. package/dist/src/signer_session.d.ts.map +1 -1
  75. package/dist/src/signer_session.js +2 -6
  76. package/dist/src/user_export.d.ts +1 -1
  77. package/dist/src/user_export.d.ts.map +1 -1
  78. package/dist/src/user_export.js +10 -18
  79. package/dist/src/util.js +9 -19
  80. package/package.json +12 -4
  81. package/src/audit_log.ts +1 -1
  82. package/src/bucket.ts +2 -2
  83. package/src/client/api_client.ts +25 -19
  84. package/src/client/base_client.ts +10 -10
  85. package/src/client/session.ts +4 -4
  86. package/src/client.ts +12 -6
  87. package/src/contact.ts +3 -3
  88. package/src/diffie_hellman.ts +3 -3
  89. package/src/env.ts +3 -3
  90. package/src/error.ts +2 -2
  91. package/src/evm/index.ts +1 -1
  92. package/src/fetch.ts +3 -3
  93. package/src/index.ts +29 -24
  94. package/src/key.ts +8 -8
  95. package/src/mfa.ts +3 -3
  96. package/src/org.ts +4 -4
  97. package/src/passkey.ts +1 -1
  98. package/src/policy.ts +2 -2
  99. package/src/response.ts +57 -12
  100. package/src/role.ts +3 -3
  101. package/src/schema.ts +107 -21
  102. package/src/schema_types.ts +14 -3
  103. package/src/scopes.ts +2 -1
  104. package/src/signer_session.ts +1 -1
  105. package/src/user_export.ts +2 -2
  106. package/tsconfig.json +12 -0
package/src/response.ts CHANGED
@@ -1,7 +1,21 @@
1
- import type { MfaVote, EnvInterface, MfaReceipts, MfaRequired } from ".";
2
- import { CubeSignerClient, MultiRegionEnv, isManyMfaReceipts } from ".";
3
- import { encodeToBase64Url } from "./util";
4
- import type { AcceptedResponse, AcceptedValue, BinanceDryRun, SignDryRun } from "./schema_types";
1
+ import type { MfaVote, EnvInterface, MfaReceipts, MfaRequired } from "./index.ts";
2
+ import {
3
+ ALL_ACCEPTED_CODES,
4
+ CubeSignerClient,
5
+ ErrResponse,
6
+ MultiRegionEnv,
7
+ isManyMfaReceipts,
8
+ } from "./index.ts";
9
+ import { encodeToBase64Url } from "./util.ts";
10
+ import type {
11
+ AcceptedResponse,
12
+ AcceptedValue,
13
+ SignDryRun,
14
+ JsonRpcResponse,
15
+ JsonRpcResult,
16
+ ErrorResponse,
17
+ AcceptedValueCode,
18
+ } from "./schema_types.ts";
5
19
 
6
20
  /**
7
21
  * Response type, which can be either a value of type {@link U}
@@ -42,7 +56,7 @@ export function mapResponse<U, V>(resp: Response<U>, mapFn: MapFn<U, V>): Respon
42
56
  */
43
57
  function asAccepted<U>(resp: Response<U>): AcceptedValue | undefined {
44
58
  const acceptedResp = resp as AcceptedResponse;
45
- return acceptedResp.error_code === "SignDryRun" || acceptedResp.error_code === "MfaRequired"
59
+ return ALL_ACCEPTED_CODES.includes(acceptedResp.error_code as AcceptedValueCode)
46
60
  ? (acceptedResp.accepted ?? undefined)
47
61
  : undefined;
48
62
  }
@@ -76,13 +90,6 @@ export class CubeSignerResponse<U> {
76
90
  return this.asAccepted()?.SignDryRun ?? undefined;
77
91
  }
78
92
 
79
- /**
80
- * @returns The associated {@link BinanceDryRun} value, if the response status code is 202 and the response is a dry run of a sign operation.
81
- */
82
- asBinanceDryRun(): BinanceDryRun | undefined {
83
- return this.asAccepted()?.BinanceDryRun ?? undefined;
84
- }
85
-
86
93
  /**
87
94
  * @returns Whether this response is a "200 Success" (in which case it is safe to call {@link data})
88
95
  */
@@ -285,6 +292,44 @@ export class CubeSignerResponse<U> {
285
292
  return new CubeSignerResponse(MultiRegionEnv.create(env), requestFn, seed);
286
293
  }
287
294
 
295
+ /**
296
+ * Similar to {@link create} except that unwraps the {@link JsonRpcResponse}
297
+ * to throw an {@link ErrResponse} on error
298
+ *
299
+ * @param env The environment where the response comes from
300
+ * @param reqFn
301
+ * The request function that this response is from.
302
+ * This argument is used to resend requests with different headers if needed.
303
+ * @param mfaReceipt Optional MFA receipt(s)
304
+ * @returns New instance of this class.
305
+ * @internal
306
+ */
307
+ static async createForJsonRpc(
308
+ env: EnvInterface | MultiRegionEnv,
309
+ reqFn: RequestFn<JsonRpcResponse>,
310
+ mfaReceipt?: MfaReceipts,
311
+ ): Promise<CubeSignerResponse<JsonRpcResult>> {
312
+ const requestFn: RequestFn<JsonRpcResult> = async (headers) => {
313
+ const resp = await reqFn(headers);
314
+ if (resp.result) return resp.result;
315
+ const errResp = resp.error?.data as ErrorResponse | undefined;
316
+
317
+ // return AcceptedResponse if accepted
318
+ if (errResp?.accepted) {
319
+ return errResp;
320
+ }
321
+
322
+ // otherwise it's an error
323
+ throw new ErrResponse({
324
+ message: errResp?.message ?? resp.error?.message ?? "JSON-RPC error",
325
+ errorCode: errResp?.error_code,
326
+ requestId: errResp?.request_id,
327
+ });
328
+ };
329
+ const seed = await requestFn(this.getMfaHeaders(mfaReceipt));
330
+ return new CubeSignerResponse(MultiRegionEnv.create(env), requestFn, seed);
331
+ }
332
+
288
333
  /**
289
334
  * Return HTTP headers containing a given MFA receipt.
290
335
  *
package/src/role.ts CHANGED
@@ -20,12 +20,12 @@ import type {
20
20
  EditPolicy,
21
21
  MfaPolicy,
22
22
  RoleInfoJwt,
23
- } from ".";
24
- import { Key, SignerSessionInfo } from ".";
23
+ } from "./index.ts";
24
+ import { Key, SignerSessionInfo } from "./index.ts";
25
25
 
26
26
  // these types are used in doc comments only
27
27
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- import type { RoleAttestationClaims, RoleAttestationQuery } from "./schema_types";
28
+ import type { RoleAttestationClaims, RoleAttestationQuery } from "./schema_types.ts";
29
29
 
30
30
  type NameOrAddressOrNull = string | null;
31
31
 
package/src/schema.ts CHANGED
@@ -1320,6 +1320,12 @@ export interface paths {
1320
1320
  *
1321
1321
  * If a `role` query parameter is provided, all active sessions for the selected role are returned
1322
1322
  * (asserting first that the current user has permissions to read sessions for that role).
1323
+ *
1324
+ * If a `role_created_by` query parameter is provided, all active **role** sessions created by that
1325
+ * user are returned (gated by the same permissions as listing that user's own sessions: the
1326
+ * current user must be that user or an org owner). When combined with `role`, the result is
1327
+ * further restricted to the sessions created by that user for the given role; the permission model
1328
+ * is unchanged. The `user` selector cannot be combined with `role` or `role_created_by`.
1323
1329
  */
1324
1330
  get: operations["listSessions"];
1325
1331
  /**
@@ -1350,6 +1356,14 @@ export interface paths {
1350
1356
  * user is an org owner, only sessions for roles the current user is **still a member of** are
1351
1357
  * revoked (so a user cannot revoke sessions for a role they have since been removed from); org
1352
1358
  * owners revoke across all roles.
1359
+ *
1360
+ * If **both** a `role` and a `role_created_by` query parameter are provided, the selection above
1361
+ * is narrowed to only the sessions created by **THAT USER** for **THAT ROLE**. The permission
1362
+ * model is unchanged from the `role_created_by`-only case (the current user must be that user or
1363
+ * an org owner, and non-owners are still limited to roles they are a member of); `role` is purely
1364
+ * an additional filter.
1365
+ *
1366
+ * The `user` selector cannot be combined with `role` or `role_created_by`.
1353
1367
  */
1354
1368
  delete: operations["revokeSessions"];
1355
1369
  };
@@ -2949,6 +2963,7 @@ export interface components {
2949
2963
  | "InvalidSolanaSignRequest"
2950
2964
  | "InvalidEip712SignRequest"
2951
2965
  | "OnlySpecifyOne"
2966
+ | "IncompatibleParams"
2952
2967
  | "NoOidcDataInProof"
2953
2968
  | "InvalidEvmSignRequest"
2954
2969
  | "InvalidEth2SignRequest"
@@ -3257,6 +3272,7 @@ export interface components {
3257
3272
  | "RpcCreateTransaction"
3258
3273
  | "RpcGetTransaction"
3259
3274
  | "RpcListTransactions"
3275
+ | "RpcBtcListUtxos"
3260
3276
  | "RpcRetryTransaction"
3261
3277
  | "RpcCancelTransaction"
3262
3278
  | "RpcBinance"
@@ -3646,6 +3662,27 @@ export interface components {
3646
3662
  /** @description Taproot-tagged hash with tag "TapLeaf". */
3647
3663
  leaf_hash: string;
3648
3664
  };
3665
+ /** @description Parameters for the [`cs_btcListUtxos`](CsRpc::BtcListUtxos) method. */
3666
+ BtcListUtxosRequest: {
3667
+ /** @description The Bitcoin address whose unspent outputs (UTXOs) are being queried. */
3668
+ address: string;
3669
+ /**
3670
+ * Format: int32
3671
+ * @description The maximum number of UTXOs to return (1-250).
3672
+ * @default 100
3673
+ */
3674
+ max_results?: number;
3675
+ network: components["schemas"]["BtcNetwork"];
3676
+ /** @description Pagination token returned by a previous call. */
3677
+ next_token?: string | null;
3678
+ };
3679
+ /** @description The response to [`cs_btcListUtxos`](super::request::CsRpc::BtcListUtxos). */
3680
+ BtcListUtxosResponse: {
3681
+ /** @description Pagination token to pass to the next call, if more results remain. */
3682
+ next_token?: string | null;
3683
+ /** @description The unspent transaction outputs for the queried address. */
3684
+ utxos: components["schemas"]["BtcUtxo"][];
3685
+ };
3649
3686
  /** @description Data to sign */
3650
3687
  BtcMessageSignRequest: {
3651
3688
  /** @description Do not produce a valid signature, just evaluate attached policies. */
@@ -3683,6 +3720,11 @@ export interface components {
3683
3720
  /** @description The base64-encoded signature in BIP137 format. */
3684
3721
  sig: string;
3685
3722
  };
3723
+ /**
3724
+ * @description The Bitcoin network to query for UTXOs.
3725
+ * @enum {string}
3726
+ */
3727
+ BtcNetwork: "mainnet" | "testnet";
3686
3728
  /** @enum {string} */
3687
3729
  BtcSighashType:
3688
3730
  | "All"
@@ -3779,6 +3821,27 @@ export interface components {
3779
3821
  */
3780
3822
  value: number;
3781
3823
  };
3824
+ /** @description A single Bitcoin unspent transaction output (UTXO). */
3825
+ BtcUtxo: {
3826
+ /** @description The address that controls this output. */
3827
+ address?: string | null;
3828
+ /** @description Whether the output has reached finality (is confirmed). */
3829
+ confirmed: boolean;
3830
+ /**
3831
+ * Format: int64
3832
+ * @description The block time of the output, in seconds since the Unix epoch.
3833
+ */
3834
+ time?: number | null;
3835
+ /** @description The hash of the transaction that created this output. */
3836
+ transaction_hash: string;
3837
+ /** @description The output value, in satoshis, as a decimal string. */
3838
+ value?: string | null;
3839
+ /**
3840
+ * Format: int32
3841
+ * @description The index of this output within its transaction.
3842
+ */
3843
+ vout_index?: number | null;
3844
+ };
3782
3845
  /**
3783
3846
  * @description The access-controlled actions that can be performed on a bucket
3784
3847
  * @enum {string}
@@ -5049,35 +5112,37 @@ export interface components {
5049
5112
  options: components["schemas"]["PublicKeyCredentialCreationOptions"];
5050
5113
  };
5051
5114
  /** @description Core RPC methods (transaction CRUD). */
5052
- CsRpc: OneOf<
5053
- [
5054
- {
5115
+ CsRpc:
5116
+ | {
5055
5117
  /** @enum {string} */
5056
5118
  method: "cs_createTransaction";
5057
5119
  params: components["schemas"]["CreateTransactionRequest"];
5058
- },
5059
- {
5120
+ }
5121
+ | {
5060
5122
  /** @enum {string} */
5061
5123
  method: "cs_retryTransaction";
5062
5124
  params: components["schemas"]["RetryTransactionRequest"];
5063
- },
5064
- {
5125
+ }
5126
+ | {
5065
5127
  /** @enum {string} */
5066
5128
  method: "cs_cancelTransaction";
5067
5129
  params: components["schemas"]["CancelTransactionRequest"];
5068
- },
5069
- {
5130
+ }
5131
+ | {
5070
5132
  /** @enum {string} */
5071
5133
  method: "cs_getTransaction";
5072
5134
  params: components["schemas"]["GetTransactionRequest"];
5073
- },
5074
- {
5135
+ }
5136
+ | {
5075
5137
  /** @enum {string} */
5076
5138
  method: "cs_listTransactions";
5077
5139
  params: components["schemas"]["ListTransactionsRequest"];
5078
- },
5079
- ]
5080
- >;
5140
+ }
5141
+ | {
5142
+ /** @enum {string} */
5143
+ method: "cs_btcListUtxos";
5144
+ params: components["schemas"]["BtcListUtxosRequest"];
5145
+ };
5081
5146
  CubeSignerUserInfo: {
5082
5147
  /** @description All multi-factor authentication methods configured for this user */
5083
5148
  configured_mfa: components["schemas"]["ConfiguredMfa"][];
@@ -6356,6 +6421,7 @@ export interface components {
6356
6421
  | "rpc:cancelTransaction"
6357
6422
  | "rpc:getTransaction"
6358
6423
  | "rpc:listTransactions"
6424
+ | "rpc:btcListUtxos"
6359
6425
  | "rpc:binance"
6360
6426
  | "rpc:bybit"
6361
6427
  | "rpc:coinbase";
@@ -6507,6 +6573,7 @@ export interface components {
6507
6573
  | "SiweMessageNotValid"
6508
6574
  | "SiweMessageInvalidSignature"
6509
6575
  | "SiwsChallengeExpired"
6576
+ | "SiwsDomain"
6510
6577
  | "SiwsMessageInvalid"
6511
6578
  | "Acl";
6512
6579
  /**
@@ -7068,7 +7135,8 @@ export interface components {
7068
7135
  | components["schemas"]["BybitWithdrawalsResponse"]
7069
7136
  | components["schemas"]["CoinbaseListAccountsResponse"]
7070
7137
  | components["schemas"]["CoinbaseListPortfoliosResponse"]
7071
- | components["schemas"]["CoinbaseMoveFundsResponse"];
7138
+ | components["schemas"]["CoinbaseMoveFundsResponse"]
7139
+ | components["schemas"]["BtcListUtxosResponse"];
7072
7140
  JwkSetResponse: {
7073
7141
  /** @description The keys included in this set */
7074
7142
  keys: Record<string, never>[];
@@ -7634,7 +7702,7 @@ export interface components {
7634
7702
  * @example 1701879640
7635
7703
  */
7636
7704
  expiration?: number;
7637
- org_id?: components["schemas"]["Id"] | null;
7705
+ org_id: components["schemas"]["Id"];
7638
7706
  /** @description Token that can be used to refresh this session. */
7639
7707
  refresh_token: string;
7640
7708
  session_info: components["schemas"]["ClientSessionInfo"];
@@ -12502,7 +12570,7 @@ export interface components {
12502
12570
  * @example 1701879640
12503
12571
  */
12504
12572
  expiration?: number;
12505
- org_id?: components["schemas"]["Id"] | null;
12573
+ org_id: components["schemas"]["Id"];
12506
12574
  /** @description Token that can be used to refresh this session. */
12507
12575
  refresh_token: string;
12508
12576
  session_info: components["schemas"]["ClientSessionInfo"];
@@ -18053,6 +18121,12 @@ export interface operations {
18053
18121
  *
18054
18122
  * If a `role` query parameter is provided, all active sessions for the selected role are returned
18055
18123
  * (asserting first that the current user has permissions to read sessions for that role).
18124
+ *
18125
+ * If a `role_created_by` query parameter is provided, all active **role** sessions created by that
18126
+ * user are returned (gated by the same permissions as listing that user's own sessions: the
18127
+ * current user must be that user or an org owner). When combined with `role`, the result is
18128
+ * further restricted to the sessions created by that user for the given role; the permission model
18129
+ * is unchanged. The `user` selector cannot be combined with `role` or `role_created_by`.
18056
18130
  */
18057
18131
  listSessions: {
18058
18132
  parameters: {
@@ -18072,7 +18146,8 @@ export interface operations {
18072
18146
  "page.start"?: string | null;
18073
18147
  /**
18074
18148
  * @description If provided, the name or ID of a role to operate on.
18075
- * Cannot be specified together with other selectors.
18149
+ * Cannot be specified together with `user`, but may be combined with `role_created_by`
18150
+ * to operate on the role sessions created by a given user for this specific role.
18076
18151
  * @example my-role
18077
18152
  */
18078
18153
  role?: string | null;
@@ -18085,7 +18160,8 @@ export interface operations {
18085
18160
  /**
18086
18161
  * @description If provided, the ID of the user whose created role sessions to operate on.
18087
18162
  * Selects all *role* sessions created by that user (user sessions are not affected).
18088
- * Cannot be specified together with other selectors.
18163
+ * Cannot be specified together with `user`. When combined with `role`, the selection is
18164
+ * further restricted to the sessions created by that user for the given role.
18089
18165
  * @example User#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
18090
18166
  */
18091
18167
  role_created_by?: string | null;
@@ -18158,13 +18234,22 @@ export interface operations {
18158
18234
  * user is an org owner, only sessions for roles the current user is **still a member of** are
18159
18235
  * revoked (so a user cannot revoke sessions for a role they have since been removed from); org
18160
18236
  * owners revoke across all roles.
18237
+ *
18238
+ * If **both** a `role` and a `role_created_by` query parameter are provided, the selection above
18239
+ * is narrowed to only the sessions created by **THAT USER** for **THAT ROLE**. The permission
18240
+ * model is unchanged from the `role_created_by`-only case (the current user must be that user or
18241
+ * an org owner, and non-owners are still limited to roles they are a member of); `role` is purely
18242
+ * an additional filter.
18243
+ *
18244
+ * The `user` selector cannot be combined with `role` or `role_created_by`.
18161
18245
  */
18162
18246
  revokeSessions: {
18163
18247
  parameters: {
18164
18248
  query?: {
18165
18249
  /**
18166
18250
  * @description If provided, the name or ID of a role to operate on.
18167
- * Cannot be specified together with other selectors.
18251
+ * Cannot be specified together with `user`, but may be combined with `role_created_by`
18252
+ * to operate on the role sessions created by a given user for this specific role.
18168
18253
  * @example my-role
18169
18254
  */
18170
18255
  role?: string | null;
@@ -18177,7 +18262,8 @@ export interface operations {
18177
18262
  /**
18178
18263
  * @description If provided, the ID of the user whose created role sessions to operate on.
18179
18264
  * Selects all *role* sessions created by that user (user sessions are not affected).
18180
- * Cannot be specified together with other selectors.
18265
+ * Cannot be specified together with `user`. When combined with `role`, the selection is
18266
+ * further restricted to the sessions created by that user for the given role.
18181
18267
  * @example User#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
18182
18268
  */
18183
18269
  role_created_by?: string | null;
@@ -1,5 +1,5 @@
1
- import type { components, operations, paths } from "./schema";
2
- import type { JsonMap, JsonValue } from "./util";
1
+ import type { components, operations, paths } from "./schema.ts";
2
+ import type { JsonMap, JsonValue } from "./util.ts";
3
3
 
4
4
  export type schemas = components["schemas"];
5
5
 
@@ -90,6 +90,16 @@ const AllOperationKinds: Record<OperationKind, true> = {
90
90
  };
91
91
  export const ALL_OPERATION_KINDS = Object.keys(AllOperationKinds) as readonly OperationKind[];
92
92
 
93
+ export type AcceptedValueCode = schemas["AcceptedValueCode"];
94
+ const AllAcceptedCodes: Record<AcceptedValueCode, true> = {
95
+ BinanceDryRun: true,
96
+ BybitDryRun: true,
97
+ CoinbaseDryRun: true,
98
+ MfaRequired: true,
99
+ SignDryRun: true,
100
+ };
101
+ export const ALL_ACCEPTED_CODES = Object.keys(AllAcceptedCodes) as readonly AcceptedValueCode[];
102
+
93
103
  export type OrgData = schemas["OrgData"];
94
104
  export type UserOrgsResponse = schemas["UserOrgsResponse"];
95
105
 
@@ -253,7 +263,7 @@ export type QueryMetricsRequest = schemas["QueryMetricsRequest"];
253
263
  export type QueryMetricsResponse = schemas["QueryMetricsResponse"];
254
264
  export type AuditLogRequest = schemas["AuditLogRequest"];
255
265
  export type AuditLogResponse = schemas["PaginatedAuditLogResponse"];
256
- export type { AuditLogEntry } from "./audit_log";
266
+ export type { AuditLogEntry } from "./audit_log.ts";
257
267
 
258
268
  export type DiffieHellmanRequest = schemas["DiffieHellmanRequest"];
259
269
  export type DiffieHellmanResponse = schemas["DiffieHellmanResponse"];
@@ -265,6 +275,7 @@ export type UserExportCompleteResponse = schemas["UserExportCompleteResponse"];
265
275
  export type UserExportListResponse = schemas["PaginatedUserExportListResponse"];
266
276
  export type UserExportKeyMaterial = schemas["JsonKeyPackage"];
267
277
  export type JsonRpcResponse = schemas["JsonRpcResponse"];
278
+ export type JsonRpcResult = NonNullable<schemas["JsonRpcResponse"]["result"]>;
268
279
  export type JsonRpcRequest = schemas["RpcMethod"] & {
269
280
  /** @description Request ID */
270
281
  id?: string;
package/src/scopes.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // eslint-disable spaced-comment
2
2
 
3
- import { type ExplicitScope } from ".";
3
+ import { type ExplicitScope } from "./index.ts";
4
4
 
5
5
  export type ScopesDictionary = Record<string, { label: string; scopes: ScopeItem[] }>;
6
6
 
@@ -273,6 +273,7 @@ export const AllScopes: Record<ExplicitScope, string> =
273
273
  "rpc:createTransaction:*" : "Allows access to the RPC API endpoint, but only for the 'cs_createTransaction' function.",
274
274
  "rpc:createTransaction:evm" : "Allows access to the RPC API endpoint, but only for the 'cs_createTransaction' function with an EVM transaction request.",
275
275
  "rpc:getTransaction" : "Allows access to the RPC API endpoint, but only for the 'cs_getTransaction' function.",
276
+ "rpc:btcListUtxos" : "Allows access to the RPC API endpoint, but only for the 'cs_btcListUtxos' function.",
276
277
  "rpc:listTransactions" : "Allows access to the RPC API endpoint, but only for the 'cs_listTransactions' function.",
277
278
  "rpc:retryTransaction" : "Allows access to the RPC API endpoint, but only for the 'cs_retryTransaction' function",
278
279
  "rpc:binance" : "Allows access to the RPC API endpoint, but only for the 'cs_binance*' functions",
@@ -1,4 +1,4 @@
1
- import type { ApiClient } from ".";
1
+ import type { ApiClient } from "./index.ts";
2
2
 
3
3
  /** Signer session info. Can only be used to revoke a token, but not for authentication. */
4
4
  export class SignerSessionInfo {
@@ -1,5 +1,5 @@
1
- import type { UserExportCompleteResponse, UserExportKeyMaterial } from "./schema_types";
2
- import { decodeBase64 } from "./util";
1
+ import type { UserExportCompleteResponse, UserExportKeyMaterial } from "./schema_types.ts";
2
+ import { decodeBase64 } from "./util.ts";
3
3
  import type { CipherSuite } from "@hpke/core";
4
4
 
5
5
  /**
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist"
5
+ },
6
+ "typedocOptions": {
7
+ "out": "./docs",
8
+ "entryPoints": ["src/index.ts"]
9
+ },
10
+ "exclude": ["spec", "node_modules", "dist"],
11
+ "include": ["src/**/*.ts"]
12
+ }