@sats-connect/core 0.7.1-3ab7f7d → 0.7.1-77a9de6

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
@@ -156,14 +156,22 @@ declare enum AddressType {
156
156
  starknet = "starknet",
157
157
  spark = "spark"
158
158
  }
159
+ type AddressWithPublicKey = AddressPurpose.Payment | AddressPurpose.Ordinals | AddressPurpose.Stacks;
160
+ type AddressWithoutPublicKey = Exclude<AddressPurpose, AddressWithPublicKey>;
159
161
  declare const addressSchema: v.ObjectSchema<{
160
162
  readonly address: v.StringSchema<undefined>;
161
- readonly publicKey: v.StringSchema<undefined>;
163
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
162
164
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
163
165
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
164
166
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
165
167
  }, undefined>;
166
- type Address = v.InferOutput<typeof addressSchema>;
168
+ type Address = v.InferOutput<typeof addressSchema> & ({
169
+ purpose: AddressWithPublicKey;
170
+ publicKey: string;
171
+ } | {
172
+ purpose: AddressWithoutPublicKey;
173
+ publicKey?: undefined;
174
+ });
167
175
  interface GetAddressResponse {
168
176
  addresses: Address[];
169
177
  }
@@ -273,7 +281,7 @@ declare const accountChangeSchema: v.ObjectSchema<{
273
281
  readonly type: v.LiteralSchema<"accountChange", undefined>;
274
282
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
275
283
  readonly address: v.StringSchema<undefined>;
276
- readonly publicKey: v.StringSchema<undefined>;
284
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
277
285
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
278
286
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
279
287
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -291,7 +299,7 @@ declare const networkChangeSchema: v.ObjectSchema<{
291
299
  }, undefined>;
292
300
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
293
301
  readonly address: v.StringSchema<undefined>;
294
- readonly publicKey: v.StringSchema<undefined>;
302
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
295
303
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
296
304
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
297
305
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -307,7 +315,7 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
307
315
  readonly type: v.LiteralSchema<"accountChange", undefined>;
308
316
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
309
317
  readonly address: v.StringSchema<undefined>;
310
- readonly publicKey: v.StringSchema<undefined>;
318
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
311
319
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
312
320
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
313
321
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -322,7 +330,7 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
322
330
  }, undefined>;
323
331
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
324
332
  readonly address: v.StringSchema<undefined>;
325
- readonly publicKey: v.StringSchema<undefined>;
333
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
326
334
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
327
335
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
328
336
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -439,7 +447,7 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
439
447
  */
440
448
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
441
449
  readonly address: v.StringSchema<undefined>;
442
- readonly publicKey: v.StringSchema<undefined>;
450
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
443
451
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
444
452
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
445
453
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -638,7 +646,7 @@ type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
638
646
  declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
639
647
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
640
648
  readonly address: v.StringSchema<undefined>;
641
- readonly publicKey: v.StringSchema<undefined>;
649
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
642
650
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
643
651
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
644
652
  }, undefined>, undefined>;
@@ -1023,7 +1031,7 @@ declare const sparkGetAddressesResultSchema: v.ObjectSchema<{
1023
1031
  */
1024
1032
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1025
1033
  readonly address: v.StringSchema<undefined>;
1026
- readonly publicKey: v.StringSchema<undefined>;
1034
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1027
1035
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1028
1036
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1029
1037
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1385,7 +1393,7 @@ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
1385
1393
  */
1386
1394
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1387
1395
  readonly address: v.StringSchema<undefined>;
1388
- readonly publicKey: v.StringSchema<undefined>;
1396
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1389
1397
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1390
1398
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1391
1399
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1929,7 +1937,7 @@ declare const getAccountResultSchema: v.ObjectSchema<{
1929
1937
  readonly id: v.StringSchema<undefined>;
1930
1938
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1931
1939
  readonly address: v.StringSchema<undefined>;
1932
- readonly publicKey: v.StringSchema<undefined>;
1940
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1933
1941
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1934
1942
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1935
1943
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1980,7 +1988,7 @@ declare const connectResultSchema: v.ObjectSchema<{
1980
1988
  readonly id: v.StringSchema<undefined>;
1981
1989
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1982
1990
  readonly address: v.StringSchema<undefined>;
1983
- readonly publicKey: v.StringSchema<undefined>;
1991
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1984
1992
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1985
1993
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1986
1994
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
package/dist/index.d.ts CHANGED
@@ -156,14 +156,22 @@ declare enum AddressType {
156
156
  starknet = "starknet",
157
157
  spark = "spark"
158
158
  }
159
+ type AddressWithPublicKey = AddressPurpose.Payment | AddressPurpose.Ordinals | AddressPurpose.Stacks;
160
+ type AddressWithoutPublicKey = Exclude<AddressPurpose, AddressWithPublicKey>;
159
161
  declare const addressSchema: v.ObjectSchema<{
160
162
  readonly address: v.StringSchema<undefined>;
161
- readonly publicKey: v.StringSchema<undefined>;
163
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
162
164
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
163
165
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
164
166
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
165
167
  }, undefined>;
166
- type Address = v.InferOutput<typeof addressSchema>;
168
+ type Address = v.InferOutput<typeof addressSchema> & ({
169
+ purpose: AddressWithPublicKey;
170
+ publicKey: string;
171
+ } | {
172
+ purpose: AddressWithoutPublicKey;
173
+ publicKey?: undefined;
174
+ });
167
175
  interface GetAddressResponse {
168
176
  addresses: Address[];
169
177
  }
@@ -273,7 +281,7 @@ declare const accountChangeSchema: v.ObjectSchema<{
273
281
  readonly type: v.LiteralSchema<"accountChange", undefined>;
274
282
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
275
283
  readonly address: v.StringSchema<undefined>;
276
- readonly publicKey: v.StringSchema<undefined>;
284
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
277
285
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
278
286
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
279
287
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -291,7 +299,7 @@ declare const networkChangeSchema: v.ObjectSchema<{
291
299
  }, undefined>;
292
300
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
293
301
  readonly address: v.StringSchema<undefined>;
294
- readonly publicKey: v.StringSchema<undefined>;
302
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
295
303
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
296
304
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
297
305
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -307,7 +315,7 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
307
315
  readonly type: v.LiteralSchema<"accountChange", undefined>;
308
316
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
309
317
  readonly address: v.StringSchema<undefined>;
310
- readonly publicKey: v.StringSchema<undefined>;
318
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
311
319
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
312
320
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
313
321
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -322,7 +330,7 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
322
330
  }, undefined>;
323
331
  readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
324
332
  readonly address: v.StringSchema<undefined>;
325
- readonly publicKey: v.StringSchema<undefined>;
333
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
326
334
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
327
335
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
328
336
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -439,7 +447,7 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
439
447
  */
440
448
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
441
449
  readonly address: v.StringSchema<undefined>;
442
- readonly publicKey: v.StringSchema<undefined>;
450
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
443
451
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
444
452
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
445
453
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -638,7 +646,7 @@ type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
638
646
  declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
639
647
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
640
648
  readonly address: v.StringSchema<undefined>;
641
- readonly publicKey: v.StringSchema<undefined>;
649
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
642
650
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
643
651
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
644
652
  }, undefined>, undefined>;
@@ -1023,7 +1031,7 @@ declare const sparkGetAddressesResultSchema: v.ObjectSchema<{
1023
1031
  */
1024
1032
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1025
1033
  readonly address: v.StringSchema<undefined>;
1026
- readonly publicKey: v.StringSchema<undefined>;
1034
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1027
1035
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1028
1036
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1029
1037
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1385,7 +1393,7 @@ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
1385
1393
  */
1386
1394
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1387
1395
  readonly address: v.StringSchema<undefined>;
1388
- readonly publicKey: v.StringSchema<undefined>;
1396
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1389
1397
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1390
1398
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1391
1399
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1929,7 +1937,7 @@ declare const getAccountResultSchema: v.ObjectSchema<{
1929
1937
  readonly id: v.StringSchema<undefined>;
1930
1938
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1931
1939
  readonly address: v.StringSchema<undefined>;
1932
- readonly publicKey: v.StringSchema<undefined>;
1940
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1933
1941
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1934
1942
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1935
1943
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
@@ -1980,7 +1988,7 @@ declare const connectResultSchema: v.ObjectSchema<{
1980
1988
  readonly id: v.StringSchema<undefined>;
1981
1989
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1982
1990
  readonly address: v.StringSchema<undefined>;
1983
- readonly publicKey: v.StringSchema<undefined>;
1991
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1984
1992
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1985
1993
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1986
1994
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
package/dist/index.js CHANGED
@@ -268,7 +268,7 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
268
268
  })(AddressType || {});
269
269
  var addressSchema = v2.object({
270
270
  address: v2.string(),
271
- publicKey: v2.string(),
271
+ publicKey: v2.optional(v2.string()),
272
272
  purpose: v2.enum(AddressPurpose),
273
273
  addressType: v2.enum(AddressType),
274
274
  walletType: walletTypeSchema
package/dist/index.mjs CHANGED
@@ -34,7 +34,7 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
34
34
  })(AddressType || {});
35
35
  var addressSchema = v2.object({
36
36
  address: v2.string(),
37
- publicKey: v2.string(),
37
+ publicKey: v2.optional(v2.string()),
38
38
  purpose: v2.enum(AddressPurpose),
39
39
  addressType: v2.enum(AddressType),
40
40
  walletType: walletTypeSchema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sats-connect/core",
3
- "version": "0.7.1-3ab7f7d",
3
+ "version": "0.7.1-77a9de6",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",