@sats-connect/core 0.6.4 → 0.6.5-e7f85ed

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/dist/index.d.mts CHANGED
@@ -150,6 +150,13 @@ declare const networkChangeSchema: v.ObjectSchema<{
150
150
  readonly stacks: v.ObjectSchema<{
151
151
  readonly name: v.StringSchema<undefined>;
152
152
  }, undefined>;
153
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
154
+ readonly address: v.StringSchema<undefined>;
155
+ readonly publicKey: v.StringSchema<undefined>;
156
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
157
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
158
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
159
+ }, undefined>, undefined>, never>;
153
160
  }, undefined>;
154
161
  type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
155
162
  declare const disconnectEventName = "disconnect";
@@ -174,6 +181,13 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
174
181
  readonly stacks: v.ObjectSchema<{
175
182
  readonly name: v.StringSchema<undefined>;
176
183
  }, undefined>;
184
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
185
+ readonly address: v.StringSchema<undefined>;
186
+ readonly publicKey: v.StringSchema<undefined>;
187
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
188
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
189
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
190
+ }, undefined>, undefined>, never>;
177
191
  }, undefined>, v.ObjectSchema<{
178
192
  readonly type: v.LiteralSchema<"disconnect", undefined>;
179
193
  }, undefined>], undefined>;
@@ -399,7 +413,9 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
399
413
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
400
414
  readonly address: v.StringSchema<undefined>;
401
415
  readonly publicKey: v.StringSchema<undefined>;
402
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
416
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
417
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
418
+ */
403
419
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
404
420
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
405
421
  }, undefined>, undefined>;
@@ -595,7 +611,9 @@ declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
595
611
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
596
612
  readonly address: v.StringSchema<undefined>;
597
613
  readonly publicKey: v.StringSchema<undefined>;
598
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
614
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
615
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
616
+ */
599
617
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
600
618
  }, undefined>, undefined>;
601
619
  type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
package/dist/index.d.ts CHANGED
@@ -150,6 +150,13 @@ declare const networkChangeSchema: v.ObjectSchema<{
150
150
  readonly stacks: v.ObjectSchema<{
151
151
  readonly name: v.StringSchema<undefined>;
152
152
  }, undefined>;
153
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
154
+ readonly address: v.StringSchema<undefined>;
155
+ readonly publicKey: v.StringSchema<undefined>;
156
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
157
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
158
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
159
+ }, undefined>, undefined>, never>;
153
160
  }, undefined>;
154
161
  type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
155
162
  declare const disconnectEventName = "disconnect";
@@ -174,6 +181,13 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
174
181
  readonly stacks: v.ObjectSchema<{
175
182
  readonly name: v.StringSchema<undefined>;
176
183
  }, undefined>;
184
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
185
+ readonly address: v.StringSchema<undefined>;
186
+ readonly publicKey: v.StringSchema<undefined>;
187
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
188
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
189
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
190
+ }, undefined>, undefined>, never>;
177
191
  }, undefined>, v.ObjectSchema<{
178
192
  readonly type: v.LiteralSchema<"disconnect", undefined>;
179
193
  }, undefined>], undefined>;
@@ -399,7 +413,9 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
399
413
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
400
414
  readonly address: v.StringSchema<undefined>;
401
415
  readonly publicKey: v.StringSchema<undefined>;
402
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
416
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
417
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
418
+ */
403
419
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
404
420
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
405
421
  }, undefined>, undefined>;
@@ -595,7 +611,9 @@ declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
595
611
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
596
612
  readonly address: v.StringSchema<undefined>;
597
613
  readonly publicKey: v.StringSchema<undefined>;
598
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
614
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
615
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
616
+ */
599
617
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
600
618
  }, undefined>, undefined>;
601
619
  type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
package/dist/index.js CHANGED
@@ -205,11 +205,21 @@ __export(src_exports, {
205
205
  });
206
206
  module.exports = __toCommonJS(src_exports);
207
207
 
208
+ // src/provider/types.ts
209
+ var v4 = __toESM(require("valibot"));
210
+
208
211
  // src/addresses/index.ts
209
212
  var import_jsontokens = require("jsontokens");
210
213
 
211
214
  // src/addresses/types.ts
215
+ var v2 = __toESM(require("valibot"));
216
+
217
+ // src/request/types/common.ts
212
218
  var v = __toESM(require("valibot"));
219
+ var walletTypes = ["software", "ledger", "keystone"];
220
+ var walletTypeSchema = v.picklist(walletTypes);
221
+
222
+ // src/addresses/types.ts
213
223
  var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
214
224
  AddressPurpose2["Ordinals"] = "ordinals";
215
225
  AddressPurpose2["Payment"] = "payment";
@@ -225,11 +235,11 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
225
235
  AddressType3["stacks"] = "stacks";
226
236
  return AddressType3;
227
237
  })(AddressType || {});
228
- var addressSchema = v.object({
229
- address: v.string(),
230
- publicKey: v.string(),
231
- purpose: v.enum(AddressPurpose),
232
- addressType: v.enum(AddressType),
238
+ var addressSchema = v2.object({
239
+ address: v2.string(),
240
+ publicKey: v2.string(),
241
+ purpose: v2.enum(AddressPurpose),
242
+ addressType: v2.enum(AddressType),
233
243
  walletType: walletTypeSchema
234
244
  });
235
245
 
@@ -251,7 +261,7 @@ var getAddress = async (options) => {
251
261
  };
252
262
 
253
263
  // src/types.ts
254
- var v2 = __toESM(require("valibot"));
264
+ var v3 = __toESM(require("valibot"));
255
265
  var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
256
266
  BitcoinNetworkType2["Mainnet"] = "Mainnet";
257
267
  BitcoinNetworkType2["Testnet"] = "Testnet";
@@ -260,22 +270,22 @@ var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
260
270
  BitcoinNetworkType2["Regtest"] = "Regtest";
261
271
  return BitcoinNetworkType2;
262
272
  })(BitcoinNetworkType || {});
263
- var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
264
- var rpcRequestMessageSchema = v2.object({
265
- jsonrpc: v2.literal("2.0"),
266
- method: v2.string(),
267
- params: v2.optional(
268
- v2.union([
269
- v2.array(v2.unknown()),
270
- v2.looseObject({}),
273
+ var RpcIdSchema = v3.optional(v3.union([v3.string(), v3.number(), v3.null()]));
274
+ var rpcRequestMessageSchema = v3.object({
275
+ jsonrpc: v3.literal("2.0"),
276
+ method: v3.string(),
277
+ params: v3.optional(
278
+ v3.union([
279
+ v3.array(v3.unknown()),
280
+ v3.looseObject({}),
271
281
  // Note: This is to support current incorrect usage of RPC 2.0. Params need
272
282
  // to be either an array or an object when provided. Changing this now would
273
283
  // be a breaking change, so accepting null values for now. Tracking in
274
284
  // https://linear.app/xverseapp/issue/ENG-4538.
275
- v2.null()
285
+ v3.null()
276
286
  ])
277
287
  ),
278
- id: v2.unwrap(RpcIdSchema)
288
+ id: v3.unwrap(RpcIdSchema)
279
289
  });
280
290
  var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
281
291
  RpcErrorCode2[RpcErrorCode2["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
@@ -288,43 +298,43 @@ var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
288
298
  RpcErrorCode2[RpcErrorCode2["ACCESS_DENIED"] = -32002] = "ACCESS_DENIED";
289
299
  return RpcErrorCode2;
290
300
  })(RpcErrorCode || {});
291
- var rpcSuccessResponseMessageSchema = v2.object({
292
- jsonrpc: v2.literal("2.0"),
293
- result: v2.nonOptional(v2.unknown()),
301
+ var rpcSuccessResponseMessageSchema = v3.object({
302
+ jsonrpc: v3.literal("2.0"),
303
+ result: v3.nonOptional(v3.unknown()),
294
304
  id: RpcIdSchema
295
305
  });
296
- var rpcErrorResponseMessageSchema = v2.object({
297
- jsonrpc: v2.literal("2.0"),
298
- error: v2.nonOptional(v2.unknown()),
306
+ var rpcErrorResponseMessageSchema = v3.object({
307
+ jsonrpc: v3.literal("2.0"),
308
+ error: v3.nonOptional(v3.unknown()),
299
309
  id: RpcIdSchema
300
310
  });
301
- var rpcResponseMessageSchema = v2.union([
311
+ var rpcResponseMessageSchema = v3.union([
302
312
  rpcSuccessResponseMessageSchema,
303
313
  rpcErrorResponseMessageSchema
304
314
  ]);
305
315
 
306
316
  // src/provider/types.ts
307
- var v3 = __toESM(require("valibot"));
308
317
  var accountChangeEventName = "accountChange";
309
- var accountChangeSchema = v3.object({
310
- type: v3.literal(accountChangeEventName),
311
- addresses: v3.optional(v3.array(addressSchema))
318
+ var accountChangeSchema = v4.object({
319
+ type: v4.literal(accountChangeEventName),
320
+ addresses: v4.optional(v4.array(addressSchema))
312
321
  });
313
322
  var networkChangeEventName = "networkChange";
314
- var networkChangeSchema = v3.object({
315
- type: v3.literal(networkChangeEventName),
316
- bitcoin: v3.object({
317
- name: v3.enum(BitcoinNetworkType)
323
+ var networkChangeSchema = v4.object({
324
+ type: v4.literal(networkChangeEventName),
325
+ bitcoin: v4.object({
326
+ name: v4.enum(BitcoinNetworkType)
318
327
  }),
319
- stacks: v3.object({
320
- name: v3.string()
321
- })
328
+ stacks: v4.object({
329
+ name: v4.string()
330
+ }),
331
+ addresses: v4.optional(v4.array(addressSchema))
322
332
  });
323
333
  var disconnectEventName = "disconnect";
324
- var disconnectSchema = v3.object({
325
- type: v3.literal(disconnectEventName)
334
+ var disconnectSchema = v4.object({
335
+ type: v4.literal(disconnectEventName)
326
336
  });
327
- var walletEventSchema = v3.variant("type", [
337
+ var walletEventSchema = v4.variant("type", [
328
338
  accountChangeSchema,
329
339
  networkChangeSchema,
330
340
  disconnectSchema
@@ -373,26 +383,26 @@ function getSupportedWallets() {
373
383
  var v21 = __toESM(require("valibot"));
374
384
 
375
385
  // src/request/types/stxMethods/callContract.ts
376
- var v4 = __toESM(require("valibot"));
386
+ var v5 = __toESM(require("valibot"));
377
387
  var stxCallContractMethodName = "stx_callContract";
378
- var stxCallContractParamsSchema = v4.object({
388
+ var stxCallContractParamsSchema = v5.object({
379
389
  /**
380
390
  * The contract principal.
381
391
  *
382
392
  * E.g. `"SPKE...GD5C.my-contract"`
383
393
  */
384
- contract: v4.string(),
394
+ contract: v5.string(),
385
395
  /**
386
396
  * The name of the function to call.
387
397
  *
388
398
  * Note: spec changes ongoing,
389
399
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
390
400
  */
391
- functionName: v4.string(),
401
+ functionName: v5.string(),
392
402
  /**
393
403
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
394
404
  */
395
- arguments: v4.optional(v4.array(v4.string())),
405
+ arguments: v5.optional(v5.array(v5.string())),
396
406
  /**
397
407
  * The function's arguments. The arguments are expected to be hex-encoded
398
408
  * strings of Clarity values.
@@ -407,76 +417,76 @@ var stxCallContractParamsSchema = v4.object({
407
417
  * const hexArgs = functionArgs.map(cvToHex);
408
418
  * ```
409
419
  */
410
- functionArgs: v4.optional(v4.array(v4.string())),
420
+ functionArgs: v5.optional(v5.array(v5.string())),
411
421
  /**
412
422
  * The post conditions to apply to the contract call.
413
423
  */
414
- postConditions: v4.optional(v4.array(v4.string())),
424
+ postConditions: v5.optional(v5.array(v5.string())),
415
425
  /**
416
426
  * The mode to apply to the post conditions.
417
427
  */
418
- postConditionMode: v4.optional(v4.union([v4.literal("allow"), v4.literal("deny")]))
428
+ postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
419
429
  });
420
- var stxCallContractResultSchema = v4.object({
430
+ var stxCallContractResultSchema = v5.object({
421
431
  /**
422
432
  * The ID of the transaction.
423
433
  */
424
- txid: v4.string(),
434
+ txid: v5.string(),
425
435
  /**
426
436
  * A Stacks transaction as a hex-encoded string.
427
437
  */
428
- transaction: v4.string()
438
+ transaction: v5.string()
429
439
  });
430
- var stxCallContractRequestMessageSchema = v4.object({
440
+ var stxCallContractRequestMessageSchema = v5.object({
431
441
  ...rpcRequestMessageSchema.entries,
432
- ...v4.object({
433
- method: v4.literal(stxCallContractMethodName),
442
+ ...v5.object({
443
+ method: v5.literal(stxCallContractMethodName),
434
444
  params: stxCallContractParamsSchema,
435
- id: v4.string()
445
+ id: v5.string()
436
446
  }).entries
437
447
  });
438
448
 
439
449
  // src/request/types/stxMethods/deployContract.ts
440
- var v5 = __toESM(require("valibot"));
450
+ var v6 = __toESM(require("valibot"));
441
451
  var stxDeployContractMethodName = "stx_deployContract";
442
- var stxDeployContractParamsSchema = v5.object({
452
+ var stxDeployContractParamsSchema = v6.object({
443
453
  /**
444
454
  * Name of the contract.
445
455
  */
446
- name: v5.string(),
456
+ name: v6.string(),
447
457
  /**
448
458
  * The source code of the Clarity contract.
449
459
  */
450
- clarityCode: v5.string(),
460
+ clarityCode: v6.string(),
451
461
  /**
452
462
  * The version of the Clarity contract.
453
463
  */
454
- clarityVersion: v5.optional(v5.string()),
464
+ clarityVersion: v6.optional(v6.string()),
455
465
  /**
456
466
  * The post conditions to apply to the contract call.
457
467
  */
458
- postConditions: v5.optional(v5.array(v5.string())),
468
+ postConditions: v6.optional(v6.array(v6.string())),
459
469
  /**
460
470
  * The mode to apply to the post conditions.
461
471
  */
462
- postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
472
+ postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
463
473
  });
464
- var stxDeployContractResultSchema = v5.object({
474
+ var stxDeployContractResultSchema = v6.object({
465
475
  /**
466
476
  * The ID of the transaction.
467
477
  */
468
- txid: v5.string(),
478
+ txid: v6.string(),
469
479
  /**
470
480
  * A Stacks transaction as a hex-encoded string.
471
481
  */
472
- transaction: v5.string()
482
+ transaction: v6.string()
473
483
  });
474
- var stxDeployContractRequestMessageSchema = v5.object({
484
+ var stxDeployContractRequestMessageSchema = v6.object({
475
485
  ...rpcRequestMessageSchema.entries,
476
- ...v5.object({
477
- method: v5.literal(stxDeployContractMethodName),
486
+ ...v6.object({
487
+ method: v6.literal(stxDeployContractMethodName),
478
488
  params: stxDeployContractParamsSchema,
479
- id: v5.string()
489
+ id: v6.string()
480
490
  }).entries
481
491
  });
482
492
 
@@ -485,13 +495,6 @@ var v8 = __toESM(require("valibot"));
485
495
 
486
496
  // src/request/types/walletMethods.ts
487
497
  var v7 = __toESM(require("valibot"));
488
-
489
- // src/request/types/common.ts
490
- var v6 = __toESM(require("valibot"));
491
- var walletTypes = ["software", "ledger", "keystone"];
492
- var walletTypeSchema = v6.picklist(walletTypes);
493
-
494
- // src/request/types/walletMethods.ts
495
498
  var accountActionsSchema = v7.object({
496
499
  read: v7.optional(v7.boolean())
497
500
  });
package/dist/index.mjs CHANGED
@@ -1,8 +1,18 @@
1
+ // src/provider/types.ts
2
+ import * as v4 from "valibot";
3
+
1
4
  // src/addresses/index.ts
2
5
  import { createUnsecuredToken } from "jsontokens";
3
6
 
4
7
  // src/addresses/types.ts
8
+ import * as v2 from "valibot";
9
+
10
+ // src/request/types/common.ts
5
11
  import * as v from "valibot";
12
+ var walletTypes = ["software", "ledger", "keystone"];
13
+ var walletTypeSchema = v.picklist(walletTypes);
14
+
15
+ // src/addresses/types.ts
6
16
  var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
7
17
  AddressPurpose2["Ordinals"] = "ordinals";
8
18
  AddressPurpose2["Payment"] = "payment";
@@ -18,11 +28,11 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
18
28
  AddressType3["stacks"] = "stacks";
19
29
  return AddressType3;
20
30
  })(AddressType || {});
21
- var addressSchema = v.object({
22
- address: v.string(),
23
- publicKey: v.string(),
24
- purpose: v.enum(AddressPurpose),
25
- addressType: v.enum(AddressType),
31
+ var addressSchema = v2.object({
32
+ address: v2.string(),
33
+ publicKey: v2.string(),
34
+ purpose: v2.enum(AddressPurpose),
35
+ addressType: v2.enum(AddressType),
26
36
  walletType: walletTypeSchema
27
37
  });
28
38
 
@@ -44,7 +54,7 @@ var getAddress = async (options) => {
44
54
  };
45
55
 
46
56
  // src/types.ts
47
- import * as v2 from "valibot";
57
+ import * as v3 from "valibot";
48
58
  var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
49
59
  BitcoinNetworkType2["Mainnet"] = "Mainnet";
50
60
  BitcoinNetworkType2["Testnet"] = "Testnet";
@@ -53,22 +63,22 @@ var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
53
63
  BitcoinNetworkType2["Regtest"] = "Regtest";
54
64
  return BitcoinNetworkType2;
55
65
  })(BitcoinNetworkType || {});
56
- var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
57
- var rpcRequestMessageSchema = v2.object({
58
- jsonrpc: v2.literal("2.0"),
59
- method: v2.string(),
60
- params: v2.optional(
61
- v2.union([
62
- v2.array(v2.unknown()),
63
- v2.looseObject({}),
66
+ var RpcIdSchema = v3.optional(v3.union([v3.string(), v3.number(), v3.null()]));
67
+ var rpcRequestMessageSchema = v3.object({
68
+ jsonrpc: v3.literal("2.0"),
69
+ method: v3.string(),
70
+ params: v3.optional(
71
+ v3.union([
72
+ v3.array(v3.unknown()),
73
+ v3.looseObject({}),
64
74
  // Note: This is to support current incorrect usage of RPC 2.0. Params need
65
75
  // to be either an array or an object when provided. Changing this now would
66
76
  // be a breaking change, so accepting null values for now. Tracking in
67
77
  // https://linear.app/xverseapp/issue/ENG-4538.
68
- v2.null()
78
+ v3.null()
69
79
  ])
70
80
  ),
71
- id: v2.unwrap(RpcIdSchema)
81
+ id: v3.unwrap(RpcIdSchema)
72
82
  });
73
83
  var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
74
84
  RpcErrorCode2[RpcErrorCode2["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
@@ -81,43 +91,43 @@ var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
81
91
  RpcErrorCode2[RpcErrorCode2["ACCESS_DENIED"] = -32002] = "ACCESS_DENIED";
82
92
  return RpcErrorCode2;
83
93
  })(RpcErrorCode || {});
84
- var rpcSuccessResponseMessageSchema = v2.object({
85
- jsonrpc: v2.literal("2.0"),
86
- result: v2.nonOptional(v2.unknown()),
94
+ var rpcSuccessResponseMessageSchema = v3.object({
95
+ jsonrpc: v3.literal("2.0"),
96
+ result: v3.nonOptional(v3.unknown()),
87
97
  id: RpcIdSchema
88
98
  });
89
- var rpcErrorResponseMessageSchema = v2.object({
90
- jsonrpc: v2.literal("2.0"),
91
- error: v2.nonOptional(v2.unknown()),
99
+ var rpcErrorResponseMessageSchema = v3.object({
100
+ jsonrpc: v3.literal("2.0"),
101
+ error: v3.nonOptional(v3.unknown()),
92
102
  id: RpcIdSchema
93
103
  });
94
- var rpcResponseMessageSchema = v2.union([
104
+ var rpcResponseMessageSchema = v3.union([
95
105
  rpcSuccessResponseMessageSchema,
96
106
  rpcErrorResponseMessageSchema
97
107
  ]);
98
108
 
99
109
  // src/provider/types.ts
100
- import * as v3 from "valibot";
101
110
  var accountChangeEventName = "accountChange";
102
- var accountChangeSchema = v3.object({
103
- type: v3.literal(accountChangeEventName),
104
- addresses: v3.optional(v3.array(addressSchema))
111
+ var accountChangeSchema = v4.object({
112
+ type: v4.literal(accountChangeEventName),
113
+ addresses: v4.optional(v4.array(addressSchema))
105
114
  });
106
115
  var networkChangeEventName = "networkChange";
107
- var networkChangeSchema = v3.object({
108
- type: v3.literal(networkChangeEventName),
109
- bitcoin: v3.object({
110
- name: v3.enum(BitcoinNetworkType)
116
+ var networkChangeSchema = v4.object({
117
+ type: v4.literal(networkChangeEventName),
118
+ bitcoin: v4.object({
119
+ name: v4.enum(BitcoinNetworkType)
111
120
  }),
112
- stacks: v3.object({
113
- name: v3.string()
114
- })
121
+ stacks: v4.object({
122
+ name: v4.string()
123
+ }),
124
+ addresses: v4.optional(v4.array(addressSchema))
115
125
  });
116
126
  var disconnectEventName = "disconnect";
117
- var disconnectSchema = v3.object({
118
- type: v3.literal(disconnectEventName)
127
+ var disconnectSchema = v4.object({
128
+ type: v4.literal(disconnectEventName)
119
129
  });
120
- var walletEventSchema = v3.variant("type", [
130
+ var walletEventSchema = v4.variant("type", [
121
131
  accountChangeSchema,
122
132
  networkChangeSchema,
123
133
  disconnectSchema
@@ -166,26 +176,26 @@ function getSupportedWallets() {
166
176
  import * as v21 from "valibot";
167
177
 
168
178
  // src/request/types/stxMethods/callContract.ts
169
- import * as v4 from "valibot";
179
+ import * as v5 from "valibot";
170
180
  var stxCallContractMethodName = "stx_callContract";
171
- var stxCallContractParamsSchema = v4.object({
181
+ var stxCallContractParamsSchema = v5.object({
172
182
  /**
173
183
  * The contract principal.
174
184
  *
175
185
  * E.g. `"SPKE...GD5C.my-contract"`
176
186
  */
177
- contract: v4.string(),
187
+ contract: v5.string(),
178
188
  /**
179
189
  * The name of the function to call.
180
190
  *
181
191
  * Note: spec changes ongoing,
182
192
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
183
193
  */
184
- functionName: v4.string(),
194
+ functionName: v5.string(),
185
195
  /**
186
196
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
187
197
  */
188
- arguments: v4.optional(v4.array(v4.string())),
198
+ arguments: v5.optional(v5.array(v5.string())),
189
199
  /**
190
200
  * The function's arguments. The arguments are expected to be hex-encoded
191
201
  * strings of Clarity values.
@@ -200,76 +210,76 @@ var stxCallContractParamsSchema = v4.object({
200
210
  * const hexArgs = functionArgs.map(cvToHex);
201
211
  * ```
202
212
  */
203
- functionArgs: v4.optional(v4.array(v4.string())),
213
+ functionArgs: v5.optional(v5.array(v5.string())),
204
214
  /**
205
215
  * The post conditions to apply to the contract call.
206
216
  */
207
- postConditions: v4.optional(v4.array(v4.string())),
217
+ postConditions: v5.optional(v5.array(v5.string())),
208
218
  /**
209
219
  * The mode to apply to the post conditions.
210
220
  */
211
- postConditionMode: v4.optional(v4.union([v4.literal("allow"), v4.literal("deny")]))
221
+ postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
212
222
  });
213
- var stxCallContractResultSchema = v4.object({
223
+ var stxCallContractResultSchema = v5.object({
214
224
  /**
215
225
  * The ID of the transaction.
216
226
  */
217
- txid: v4.string(),
227
+ txid: v5.string(),
218
228
  /**
219
229
  * A Stacks transaction as a hex-encoded string.
220
230
  */
221
- transaction: v4.string()
231
+ transaction: v5.string()
222
232
  });
223
- var stxCallContractRequestMessageSchema = v4.object({
233
+ var stxCallContractRequestMessageSchema = v5.object({
224
234
  ...rpcRequestMessageSchema.entries,
225
- ...v4.object({
226
- method: v4.literal(stxCallContractMethodName),
235
+ ...v5.object({
236
+ method: v5.literal(stxCallContractMethodName),
227
237
  params: stxCallContractParamsSchema,
228
- id: v4.string()
238
+ id: v5.string()
229
239
  }).entries
230
240
  });
231
241
 
232
242
  // src/request/types/stxMethods/deployContract.ts
233
- import * as v5 from "valibot";
243
+ import * as v6 from "valibot";
234
244
  var stxDeployContractMethodName = "stx_deployContract";
235
- var stxDeployContractParamsSchema = v5.object({
245
+ var stxDeployContractParamsSchema = v6.object({
236
246
  /**
237
247
  * Name of the contract.
238
248
  */
239
- name: v5.string(),
249
+ name: v6.string(),
240
250
  /**
241
251
  * The source code of the Clarity contract.
242
252
  */
243
- clarityCode: v5.string(),
253
+ clarityCode: v6.string(),
244
254
  /**
245
255
  * The version of the Clarity contract.
246
256
  */
247
- clarityVersion: v5.optional(v5.string()),
257
+ clarityVersion: v6.optional(v6.string()),
248
258
  /**
249
259
  * The post conditions to apply to the contract call.
250
260
  */
251
- postConditions: v5.optional(v5.array(v5.string())),
261
+ postConditions: v6.optional(v6.array(v6.string())),
252
262
  /**
253
263
  * The mode to apply to the post conditions.
254
264
  */
255
- postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
265
+ postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
256
266
  });
257
- var stxDeployContractResultSchema = v5.object({
267
+ var stxDeployContractResultSchema = v6.object({
258
268
  /**
259
269
  * The ID of the transaction.
260
270
  */
261
- txid: v5.string(),
271
+ txid: v6.string(),
262
272
  /**
263
273
  * A Stacks transaction as a hex-encoded string.
264
274
  */
265
- transaction: v5.string()
275
+ transaction: v6.string()
266
276
  });
267
- var stxDeployContractRequestMessageSchema = v5.object({
277
+ var stxDeployContractRequestMessageSchema = v6.object({
268
278
  ...rpcRequestMessageSchema.entries,
269
- ...v5.object({
270
- method: v5.literal(stxDeployContractMethodName),
279
+ ...v6.object({
280
+ method: v6.literal(stxDeployContractMethodName),
271
281
  params: stxDeployContractParamsSchema,
272
- id: v5.string()
282
+ id: v6.string()
273
283
  }).entries
274
284
  });
275
285
 
@@ -278,13 +288,6 @@ import * as v8 from "valibot";
278
288
 
279
289
  // src/request/types/walletMethods.ts
280
290
  import * as v7 from "valibot";
281
-
282
- // src/request/types/common.ts
283
- import * as v6 from "valibot";
284
- var walletTypes = ["software", "ledger", "keystone"];
285
- var walletTypeSchema = v6.picklist(walletTypes);
286
-
287
- // src/request/types/walletMethods.ts
288
291
  var accountActionsSchema = v7.object({
289
292
  read: v7.optional(v7.boolean())
290
293
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.6.4",
3
+ "version": "0.6.5-e7f85ed",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",