@sats-connect/core 0.5.3-a7c5453 → 0.5.3-b107fb6
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 +47 -28
- package/dist/index.d.ts +47 -28
- package/dist/index.js +126 -114
- package/dist/index.mjs +126 -114
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -102,6 +102,12 @@ type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;
|
|
|
102
102
|
declare const networkChangeEventName = "networkChange";
|
|
103
103
|
declare const networkChangeSchema: v.ObjectSchema<{
|
|
104
104
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
105
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
106
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
107
|
+
}, undefined>;
|
|
108
|
+
readonly stacks: v.ObjectSchema<{
|
|
109
|
+
readonly name: v.StringSchema<undefined>;
|
|
110
|
+
}, undefined>;
|
|
105
111
|
}, undefined>;
|
|
106
112
|
type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
|
|
107
113
|
declare const disconnectEventName = "disconnect";
|
|
@@ -113,6 +119,12 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
|
113
119
|
readonly type: v.LiteralSchema<"accountChange", undefined>;
|
|
114
120
|
}, undefined>, v.ObjectSchema<{
|
|
115
121
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
122
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
123
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
124
|
+
}, undefined>;
|
|
125
|
+
readonly stacks: v.ObjectSchema<{
|
|
126
|
+
readonly name: v.StringSchema<undefined>;
|
|
127
|
+
}, undefined>;
|
|
116
128
|
}, undefined>, v.ObjectSchema<{
|
|
117
129
|
readonly type: v.LiteralSchema<"disconnect", undefined>;
|
|
118
130
|
}, undefined>], undefined>;
|
|
@@ -314,7 +326,6 @@ declare const addressSchema: v.ObjectSchema<{
|
|
|
314
326
|
readonly publicKey: v.StringSchema<undefined>;
|
|
315
327
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
316
328
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
317
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
318
329
|
}, undefined>;
|
|
319
330
|
type Address = v.InferOutput<typeof addressSchema>;
|
|
320
331
|
interface GetAddressResponse {
|
|
@@ -373,9 +384,10 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
|
|
|
373
384
|
readonly addresses: v.ArraySchema<v.ObjectSchema<{
|
|
374
385
|
readonly address: v.StringSchema<undefined>;
|
|
375
386
|
readonly publicKey: v.StringSchema<undefined>;
|
|
376
|
-
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
387
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
|
|
388
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
389
|
+
*/
|
|
377
390
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
378
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
379
391
|
}, undefined>, undefined>;
|
|
380
392
|
}, undefined>;
|
|
381
393
|
type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;
|
|
@@ -558,11 +570,13 @@ declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
|
558
570
|
}, undefined>;
|
|
559
571
|
type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
|
|
560
572
|
declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
|
|
573
|
+
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
561
574
|
readonly address: v.StringSchema<undefined>;
|
|
562
575
|
readonly publicKey: v.StringSchema<undefined>;
|
|
563
|
-
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
576
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
|
|
577
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
578
|
+
*/
|
|
564
579
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
565
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
566
580
|
}, undefined>, undefined>;
|
|
567
581
|
type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
|
|
568
582
|
declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
|
|
@@ -1101,7 +1115,6 @@ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
|
|
|
1101
1115
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1102
1116
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1103
1117
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1104
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1105
1118
|
}, undefined>, undefined>;
|
|
1106
1119
|
}, undefined>;
|
|
1107
1120
|
type StxGetAddressesResult = v.InferOutput<typeof stxGetAddressesResultSchema>;
|
|
@@ -1601,7 +1614,6 @@ declare const getAccountResultSchema: v.ObjectSchema<{
|
|
|
1601
1614
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1602
1615
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1603
1616
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1604
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1605
1617
|
}, undefined>, undefined>;
|
|
1606
1618
|
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1607
1619
|
}, undefined>;
|
|
@@ -1614,6 +1626,26 @@ declare const getAccountRequestMessageSchema: v.ObjectSchema<{
|
|
|
1614
1626
|
}, undefined>;
|
|
1615
1627
|
type GetAccountRequestMessage = v.InferOutput<typeof getAccountRequestMessageSchema>;
|
|
1616
1628
|
type GetAccount = MethodParamsAndResult<GetAccountParams, GetAccountResult>;
|
|
1629
|
+
declare const getNetworkMethodName = "wallet_getNetwork";
|
|
1630
|
+
declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1631
|
+
type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
|
|
1632
|
+
declare const getNetworkResultSchema: v.ObjectSchema<{
|
|
1633
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
1634
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1635
|
+
}, undefined>;
|
|
1636
|
+
readonly stacks: v.ObjectSchema<{
|
|
1637
|
+
readonly name: v.StringSchema<undefined>;
|
|
1638
|
+
}, undefined>;
|
|
1639
|
+
}, undefined>;
|
|
1640
|
+
type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
|
|
1641
|
+
declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
|
|
1642
|
+
readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
|
|
1643
|
+
readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1644
|
+
readonly id: v.StringSchema<undefined>;
|
|
1645
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1646
|
+
}, undefined>;
|
|
1647
|
+
type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
|
|
1648
|
+
type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
|
|
1617
1649
|
declare const connectMethodName = "wallet_connect";
|
|
1618
1650
|
declare const connectParamsSchema: v.NullishSchema<v.ObjectSchema<{
|
|
1619
1651
|
readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
@@ -1640,9 +1672,16 @@ declare const connectResultSchema: v.ObjectSchema<{
|
|
|
1640
1672
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1641
1673
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1642
1674
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1643
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1644
1675
|
}, undefined>, undefined>;
|
|
1645
1676
|
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1677
|
+
readonly network: v.ObjectSchema<{
|
|
1678
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
1679
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1680
|
+
}, undefined>;
|
|
1681
|
+
readonly stacks: v.ObjectSchema<{
|
|
1682
|
+
readonly name: v.StringSchema<undefined>;
|
|
1683
|
+
}, undefined>;
|
|
1684
|
+
}, undefined>;
|
|
1646
1685
|
}, undefined>;
|
|
1647
1686
|
type ConnectResult = v.InferOutput<typeof connectResultSchema>;
|
|
1648
1687
|
declare const connectRequestMessageSchema: v.ObjectSchema<{
|
|
@@ -1669,26 +1708,6 @@ declare const connectRequestMessageSchema: v.ObjectSchema<{
|
|
|
1669
1708
|
}, undefined>;
|
|
1670
1709
|
type ConnectRequestMessage = v.InferOutput<typeof connectRequestMessageSchema>;
|
|
1671
1710
|
type Connect = MethodParamsAndResult<ConnectParams, ConnectResult>;
|
|
1672
|
-
declare const getNetworkMethodName = "wallet_getNetwork";
|
|
1673
|
-
declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1674
|
-
type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
|
|
1675
|
-
declare const getNetworkResultSchema: v.ObjectSchema<{
|
|
1676
|
-
readonly bitcoin: v.ObjectSchema<{
|
|
1677
|
-
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1678
|
-
}, undefined>;
|
|
1679
|
-
readonly stacks: v.ObjectSchema<{
|
|
1680
|
-
readonly name: v.StringSchema<undefined>;
|
|
1681
|
-
}, undefined>;
|
|
1682
|
-
}, undefined>;
|
|
1683
|
-
type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
|
|
1684
|
-
declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
|
|
1685
|
-
readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
|
|
1686
|
-
readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1687
|
-
readonly id: v.StringSchema<undefined>;
|
|
1688
|
-
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1689
|
-
}, undefined>;
|
|
1690
|
-
type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
|
|
1691
|
-
type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
|
|
1692
1711
|
|
|
1693
1712
|
declare const walletTypes: readonly ["software", "ledger", "keystone"];
|
|
1694
1713
|
declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,12 @@ type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;
|
|
|
102
102
|
declare const networkChangeEventName = "networkChange";
|
|
103
103
|
declare const networkChangeSchema: v.ObjectSchema<{
|
|
104
104
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
105
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
106
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
107
|
+
}, undefined>;
|
|
108
|
+
readonly stacks: v.ObjectSchema<{
|
|
109
|
+
readonly name: v.StringSchema<undefined>;
|
|
110
|
+
}, undefined>;
|
|
105
111
|
}, undefined>;
|
|
106
112
|
type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
|
|
107
113
|
declare const disconnectEventName = "disconnect";
|
|
@@ -113,6 +119,12 @@ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
|
113
119
|
readonly type: v.LiteralSchema<"accountChange", undefined>;
|
|
114
120
|
}, undefined>, v.ObjectSchema<{
|
|
115
121
|
readonly type: v.LiteralSchema<"networkChange", undefined>;
|
|
122
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
123
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
124
|
+
}, undefined>;
|
|
125
|
+
readonly stacks: v.ObjectSchema<{
|
|
126
|
+
readonly name: v.StringSchema<undefined>;
|
|
127
|
+
}, undefined>;
|
|
116
128
|
}, undefined>, v.ObjectSchema<{
|
|
117
129
|
readonly type: v.LiteralSchema<"disconnect", undefined>;
|
|
118
130
|
}, undefined>], undefined>;
|
|
@@ -314,7 +326,6 @@ declare const addressSchema: v.ObjectSchema<{
|
|
|
314
326
|
readonly publicKey: v.StringSchema<undefined>;
|
|
315
327
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
316
328
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
317
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
318
329
|
}, undefined>;
|
|
319
330
|
type Address = v.InferOutput<typeof addressSchema>;
|
|
320
331
|
interface GetAddressResponse {
|
|
@@ -373,9 +384,10 @@ declare const getAddressesResultSchema: v.ObjectSchema<{
|
|
|
373
384
|
readonly addresses: v.ArraySchema<v.ObjectSchema<{
|
|
374
385
|
readonly address: v.StringSchema<undefined>;
|
|
375
386
|
readonly publicKey: v.StringSchema<undefined>;
|
|
376
|
-
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
387
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
|
|
388
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
389
|
+
*/
|
|
377
390
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
378
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
379
391
|
}, undefined>, undefined>;
|
|
380
392
|
}, undefined>;
|
|
381
393
|
type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;
|
|
@@ -558,11 +570,13 @@ declare const getAccountsParamsSchema: v.ObjectSchema<{
|
|
|
558
570
|
}, undefined>;
|
|
559
571
|
type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
|
|
560
572
|
declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
|
|
573
|
+
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
561
574
|
readonly address: v.StringSchema<undefined>;
|
|
562
575
|
readonly publicKey: v.StringSchema<undefined>;
|
|
563
|
-
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
576
|
+
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>; /**
|
|
577
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
578
|
+
*/
|
|
564
579
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
565
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
566
580
|
}, undefined>, undefined>;
|
|
567
581
|
type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
|
|
568
582
|
declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
|
|
@@ -1101,7 +1115,6 @@ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
|
|
|
1101
1115
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1102
1116
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1103
1117
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1104
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1105
1118
|
}, undefined>, undefined>;
|
|
1106
1119
|
}, undefined>;
|
|
1107
1120
|
type StxGetAddressesResult = v.InferOutput<typeof stxGetAddressesResultSchema>;
|
|
@@ -1601,7 +1614,6 @@ declare const getAccountResultSchema: v.ObjectSchema<{
|
|
|
1601
1614
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1602
1615
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1603
1616
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1604
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1605
1617
|
}, undefined>, undefined>;
|
|
1606
1618
|
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1607
1619
|
}, undefined>;
|
|
@@ -1614,6 +1626,26 @@ declare const getAccountRequestMessageSchema: v.ObjectSchema<{
|
|
|
1614
1626
|
}, undefined>;
|
|
1615
1627
|
type GetAccountRequestMessage = v.InferOutput<typeof getAccountRequestMessageSchema>;
|
|
1616
1628
|
type GetAccount = MethodParamsAndResult<GetAccountParams, GetAccountResult>;
|
|
1629
|
+
declare const getNetworkMethodName = "wallet_getNetwork";
|
|
1630
|
+
declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1631
|
+
type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
|
|
1632
|
+
declare const getNetworkResultSchema: v.ObjectSchema<{
|
|
1633
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
1634
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1635
|
+
}, undefined>;
|
|
1636
|
+
readonly stacks: v.ObjectSchema<{
|
|
1637
|
+
readonly name: v.StringSchema<undefined>;
|
|
1638
|
+
}, undefined>;
|
|
1639
|
+
}, undefined>;
|
|
1640
|
+
type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
|
|
1641
|
+
declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
|
|
1642
|
+
readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
|
|
1643
|
+
readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1644
|
+
readonly id: v.StringSchema<undefined>;
|
|
1645
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1646
|
+
}, undefined>;
|
|
1647
|
+
type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
|
|
1648
|
+
type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
|
|
1617
1649
|
declare const connectMethodName = "wallet_connect";
|
|
1618
1650
|
declare const connectParamsSchema: v.NullishSchema<v.ObjectSchema<{
|
|
1619
1651
|
readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
@@ -1640,9 +1672,16 @@ declare const connectResultSchema: v.ObjectSchema<{
|
|
|
1640
1672
|
readonly publicKey: v.StringSchema<undefined>;
|
|
1641
1673
|
readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
|
|
1642
1674
|
readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
|
|
1643
|
-
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1644
1675
|
}, undefined>, undefined>;
|
|
1645
1676
|
readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
|
1677
|
+
readonly network: v.ObjectSchema<{
|
|
1678
|
+
readonly bitcoin: v.ObjectSchema<{
|
|
1679
|
+
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1680
|
+
}, undefined>;
|
|
1681
|
+
readonly stacks: v.ObjectSchema<{
|
|
1682
|
+
readonly name: v.StringSchema<undefined>;
|
|
1683
|
+
}, undefined>;
|
|
1684
|
+
}, undefined>;
|
|
1646
1685
|
}, undefined>;
|
|
1647
1686
|
type ConnectResult = v.InferOutput<typeof connectResultSchema>;
|
|
1648
1687
|
declare const connectRequestMessageSchema: v.ObjectSchema<{
|
|
@@ -1669,26 +1708,6 @@ declare const connectRequestMessageSchema: v.ObjectSchema<{
|
|
|
1669
1708
|
}, undefined>;
|
|
1670
1709
|
type ConnectRequestMessage = v.InferOutput<typeof connectRequestMessageSchema>;
|
|
1671
1710
|
type Connect = MethodParamsAndResult<ConnectParams, ConnectResult>;
|
|
1672
|
-
declare const getNetworkMethodName = "wallet_getNetwork";
|
|
1673
|
-
declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1674
|
-
type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
|
|
1675
|
-
declare const getNetworkResultSchema: v.ObjectSchema<{
|
|
1676
|
-
readonly bitcoin: v.ObjectSchema<{
|
|
1677
|
-
readonly name: v.PicklistSchema<readonly ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"], undefined>;
|
|
1678
|
-
}, undefined>;
|
|
1679
|
-
readonly stacks: v.ObjectSchema<{
|
|
1680
|
-
readonly name: v.StringSchema<undefined>;
|
|
1681
|
-
}, undefined>;
|
|
1682
|
-
}, undefined>;
|
|
1683
|
-
type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
|
|
1684
|
-
declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
|
|
1685
|
-
readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
|
|
1686
|
-
readonly params: v.NullishSchema<v.NullSchema<undefined>, never>;
|
|
1687
|
-
readonly id: v.StringSchema<undefined>;
|
|
1688
|
-
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1689
|
-
}, undefined>;
|
|
1690
|
-
type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
|
|
1691
|
-
type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
|
|
1692
1711
|
|
|
1693
1712
|
declare const walletTypes: readonly ["software", "ledger", "keystone"];
|
|
1694
1713
|
declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
|
package/dist/index.js
CHANGED
|
@@ -208,8 +208,15 @@ var accountChangeSchema = v.object({
|
|
|
208
208
|
type: v.literal(accountChangeEventName)
|
|
209
209
|
});
|
|
210
210
|
var networkChangeEventName = "networkChange";
|
|
211
|
+
var networkType = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
211
212
|
var networkChangeSchema = v.object({
|
|
212
|
-
type: v.literal(networkChangeEventName)
|
|
213
|
+
type: v.literal(networkChangeEventName),
|
|
214
|
+
bitcoin: v.object({
|
|
215
|
+
name: v.picklist(networkType)
|
|
216
|
+
}),
|
|
217
|
+
stacks: v.object({
|
|
218
|
+
name: v.string()
|
|
219
|
+
})
|
|
213
220
|
});
|
|
214
221
|
var disconnectEventName = "disconnect";
|
|
215
222
|
var disconnectSchema = v.object({
|
|
@@ -262,13 +269,13 @@ function getSupportedWallets() {
|
|
|
262
269
|
|
|
263
270
|
// src/types.ts
|
|
264
271
|
var v2 = __toESM(require("valibot"));
|
|
265
|
-
var BitcoinNetworkType = /* @__PURE__ */ ((
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return
|
|
272
|
+
var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
|
|
273
|
+
BitcoinNetworkType2["Mainnet"] = "Mainnet";
|
|
274
|
+
BitcoinNetworkType2["Testnet"] = "Testnet";
|
|
275
|
+
BitcoinNetworkType2["Testnet4"] = "Testnet4";
|
|
276
|
+
BitcoinNetworkType2["Signet"] = "Signet";
|
|
277
|
+
BitcoinNetworkType2["Regtest"] = "Regtest";
|
|
278
|
+
return BitcoinNetworkType2;
|
|
272
279
|
})(BitcoinNetworkType || {});
|
|
273
280
|
var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
|
|
274
281
|
var rpcRequestMessageSchema = v2.object({
|
|
@@ -454,8 +461,7 @@ var addressSchema = v6.object({
|
|
|
454
461
|
address: v6.string(),
|
|
455
462
|
publicKey: v6.string(),
|
|
456
463
|
purpose: v6.enum(AddressPurpose),
|
|
457
|
-
addressType: v6.enum(AddressType)
|
|
458
|
-
walletType: walletTypeSchema
|
|
464
|
+
addressType: v6.enum(AddressType)
|
|
459
465
|
});
|
|
460
466
|
|
|
461
467
|
// src/addresses/index.ts
|
|
@@ -722,55 +728,62 @@ var stxTransferStxRequestMessageSchema = v12.object({
|
|
|
722
728
|
});
|
|
723
729
|
|
|
724
730
|
// src/request/types/btcMethods.ts
|
|
731
|
+
var v14 = __toESM(require("valibot"));
|
|
732
|
+
|
|
733
|
+
// src/request/types/common.ts
|
|
725
734
|
var v13 = __toESM(require("valibot"));
|
|
735
|
+
var walletTypes = ["software", "ledger", "keystone"];
|
|
736
|
+
var walletTypeSchema = v13.picklist(walletTypes);
|
|
737
|
+
|
|
738
|
+
// src/request/types/btcMethods.ts
|
|
726
739
|
var getInfoMethodName = "getInfo";
|
|
727
|
-
var getInfoParamsSchema =
|
|
728
|
-
var getInfoResultSchema =
|
|
740
|
+
var getInfoParamsSchema = v14.nullish(v14.null());
|
|
741
|
+
var getInfoResultSchema = v14.object({
|
|
729
742
|
/**
|
|
730
743
|
* Version of the wallet.
|
|
731
744
|
*/
|
|
732
|
-
version:
|
|
745
|
+
version: v14.string(),
|
|
733
746
|
/**
|
|
734
747
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
735
748
|
*/
|
|
736
|
-
methods:
|
|
749
|
+
methods: v14.optional(v14.array(v14.string())),
|
|
737
750
|
/**
|
|
738
751
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
739
752
|
*/
|
|
740
|
-
supports:
|
|
753
|
+
supports: v14.array(v14.string())
|
|
741
754
|
});
|
|
742
|
-
var getInfoRequestMessageSchema =
|
|
755
|
+
var getInfoRequestMessageSchema = v14.object({
|
|
743
756
|
...rpcRequestMessageSchema.entries,
|
|
744
|
-
...
|
|
745
|
-
method:
|
|
757
|
+
...v14.object({
|
|
758
|
+
method: v14.literal(getInfoMethodName),
|
|
746
759
|
params: getInfoParamsSchema,
|
|
747
|
-
id:
|
|
760
|
+
id: v14.string()
|
|
748
761
|
}).entries
|
|
749
762
|
});
|
|
750
763
|
var getAddressesMethodName = "getAddresses";
|
|
751
|
-
var getAddressesParamsSchema =
|
|
764
|
+
var getAddressesParamsSchema = v14.object({
|
|
752
765
|
/**
|
|
753
766
|
* The purposes for which to generate addresses. See
|
|
754
767
|
* {@linkcode AddressPurpose} for available purposes.
|
|
755
768
|
*/
|
|
756
|
-
purposes:
|
|
769
|
+
purposes: v14.array(v14.enum(AddressPurpose)),
|
|
757
770
|
/**
|
|
758
771
|
* A message to be displayed to the user in the request prompt.
|
|
759
772
|
*/
|
|
760
|
-
message:
|
|
773
|
+
message: v14.optional(v14.string())
|
|
761
774
|
});
|
|
762
|
-
var getAddressesResultSchema =
|
|
775
|
+
var getAddressesResultSchema = v14.object({
|
|
763
776
|
/**
|
|
764
777
|
* The addresses generated for the given purposes.
|
|
765
778
|
*/
|
|
766
|
-
addresses:
|
|
779
|
+
addresses: v14.array(addressSchema)
|
|
767
780
|
});
|
|
768
|
-
var getAddressesRequestMessageSchema =
|
|
781
|
+
var getAddressesRequestMessageSchema = v14.object({
|
|
769
782
|
...rpcRequestMessageSchema.entries,
|
|
770
|
-
...
|
|
771
|
-
method:
|
|
783
|
+
...v14.object({
|
|
784
|
+
method: v14.literal(getAddressesMethodName),
|
|
772
785
|
params: getAddressesParamsSchema,
|
|
773
|
-
id:
|
|
786
|
+
id: v14.string()
|
|
774
787
|
}).entries
|
|
775
788
|
});
|
|
776
789
|
var signMessageMethodName = "signMessage";
|
|
@@ -779,172 +792,168 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
|
779
792
|
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
780
793
|
return MessageSigningProtocols2;
|
|
781
794
|
})(MessageSigningProtocols || {});
|
|
782
|
-
var signMessageParamsSchema =
|
|
795
|
+
var signMessageParamsSchema = v14.object({
|
|
783
796
|
/**
|
|
784
797
|
* The address used for signing.
|
|
785
798
|
**/
|
|
786
|
-
address:
|
|
799
|
+
address: v14.string(),
|
|
787
800
|
/**
|
|
788
801
|
* The message to sign.
|
|
789
802
|
**/
|
|
790
|
-
message:
|
|
803
|
+
message: v14.string(),
|
|
791
804
|
/**
|
|
792
805
|
* The protocol to use for signing the message.
|
|
793
806
|
*/
|
|
794
|
-
protocol:
|
|
807
|
+
protocol: v14.optional(v14.enum(MessageSigningProtocols))
|
|
795
808
|
});
|
|
796
|
-
var signMessageResultSchema =
|
|
809
|
+
var signMessageResultSchema = v14.object({
|
|
797
810
|
/**
|
|
798
811
|
* The signature of the message.
|
|
799
812
|
*/
|
|
800
|
-
signature:
|
|
813
|
+
signature: v14.string(),
|
|
801
814
|
/**
|
|
802
815
|
* hash of the message.
|
|
803
816
|
*/
|
|
804
|
-
messageHash:
|
|
817
|
+
messageHash: v14.string(),
|
|
805
818
|
/**
|
|
806
819
|
* The address used for signing.
|
|
807
820
|
*/
|
|
808
|
-
address:
|
|
821
|
+
address: v14.string(),
|
|
809
822
|
/**
|
|
810
823
|
* The protocol to use for signing the message.
|
|
811
824
|
*/
|
|
812
|
-
protocol:
|
|
825
|
+
protocol: v14.enum(MessageSigningProtocols)
|
|
813
826
|
});
|
|
814
|
-
var signMessageRequestMessageSchema =
|
|
827
|
+
var signMessageRequestMessageSchema = v14.object({
|
|
815
828
|
...rpcRequestMessageSchema.entries,
|
|
816
|
-
...
|
|
817
|
-
method:
|
|
829
|
+
...v14.object({
|
|
830
|
+
method: v14.literal(signMessageMethodName),
|
|
818
831
|
params: signMessageParamsSchema,
|
|
819
|
-
id:
|
|
832
|
+
id: v14.string()
|
|
820
833
|
}).entries
|
|
821
834
|
});
|
|
822
835
|
var sendTransferMethodName = "sendTransfer";
|
|
823
|
-
var sendTransferParamsSchema =
|
|
836
|
+
var sendTransferParamsSchema = v14.object({
|
|
824
837
|
/**
|
|
825
838
|
* Array of recipients to send to.
|
|
826
839
|
* The amount to send to each recipient is in satoshis.
|
|
827
840
|
*/
|
|
828
|
-
recipients:
|
|
829
|
-
|
|
830
|
-
address:
|
|
831
|
-
amount:
|
|
841
|
+
recipients: v14.array(
|
|
842
|
+
v14.object({
|
|
843
|
+
address: v14.string(),
|
|
844
|
+
amount: v14.number()
|
|
832
845
|
})
|
|
833
846
|
)
|
|
834
847
|
});
|
|
835
|
-
var sendTransferResultSchema =
|
|
848
|
+
var sendTransferResultSchema = v14.object({
|
|
836
849
|
/**
|
|
837
850
|
* The transaction id as a hex-encoded string.
|
|
838
851
|
*/
|
|
839
|
-
txid:
|
|
852
|
+
txid: v14.string()
|
|
840
853
|
});
|
|
841
|
-
var sendTransferRequestMessageSchema =
|
|
854
|
+
var sendTransferRequestMessageSchema = v14.object({
|
|
842
855
|
...rpcRequestMessageSchema.entries,
|
|
843
|
-
...
|
|
844
|
-
method:
|
|
856
|
+
...v14.object({
|
|
857
|
+
method: v14.literal(sendTransferMethodName),
|
|
845
858
|
params: sendTransferParamsSchema,
|
|
846
|
-
id:
|
|
859
|
+
id: v14.string()
|
|
847
860
|
}).entries
|
|
848
861
|
});
|
|
849
862
|
var signPsbtMethodName = "signPsbt";
|
|
850
|
-
var signPsbtParamsSchema =
|
|
863
|
+
var signPsbtParamsSchema = v14.object({
|
|
851
864
|
/**
|
|
852
865
|
* The base64 encoded PSBT to sign.
|
|
853
866
|
*/
|
|
854
|
-
psbt:
|
|
867
|
+
psbt: v14.string(),
|
|
855
868
|
/**
|
|
856
869
|
* The inputs to sign.
|
|
857
870
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
858
871
|
*/
|
|
859
|
-
signInputs:
|
|
872
|
+
signInputs: v14.record(v14.string(), v14.array(v14.number())),
|
|
860
873
|
/**
|
|
861
874
|
* Whether to broadcast the transaction after signing.
|
|
862
875
|
**/
|
|
863
|
-
broadcast:
|
|
876
|
+
broadcast: v14.optional(v14.boolean())
|
|
864
877
|
});
|
|
865
|
-
var signPsbtResultSchema =
|
|
878
|
+
var signPsbtResultSchema = v14.object({
|
|
866
879
|
/**
|
|
867
880
|
* The base64 encoded PSBT after signing.
|
|
868
881
|
*/
|
|
869
|
-
psbt:
|
|
882
|
+
psbt: v14.string(),
|
|
870
883
|
/**
|
|
871
884
|
* The transaction id as a hex-encoded string.
|
|
872
885
|
* This is only returned if the transaction was broadcast.
|
|
873
886
|
**/
|
|
874
|
-
txid:
|
|
887
|
+
txid: v14.optional(v14.string())
|
|
875
888
|
});
|
|
876
|
-
var signPsbtRequestMessageSchema =
|
|
889
|
+
var signPsbtRequestMessageSchema = v14.object({
|
|
877
890
|
...rpcRequestMessageSchema.entries,
|
|
878
|
-
...
|
|
879
|
-
method:
|
|
891
|
+
...v14.object({
|
|
892
|
+
method: v14.literal(signPsbtMethodName),
|
|
880
893
|
params: signPsbtParamsSchema,
|
|
881
|
-
id:
|
|
894
|
+
id: v14.string()
|
|
882
895
|
}).entries
|
|
883
896
|
});
|
|
884
897
|
var getAccountsMethodName = "getAccounts";
|
|
885
|
-
var getAccountsParamsSchema =
|
|
898
|
+
var getAccountsParamsSchema = v14.object({
|
|
886
899
|
/**
|
|
887
900
|
* The purposes for which to generate addresses. See
|
|
888
901
|
* {@linkcode AddressPurpose} for available purposes.
|
|
889
902
|
*/
|
|
890
|
-
purposes:
|
|
903
|
+
purposes: v14.array(v14.enum(AddressPurpose)),
|
|
891
904
|
/**
|
|
892
905
|
* A message to be displayed to the user in the request prompt.
|
|
893
906
|
*/
|
|
894
|
-
message:
|
|
895
|
-
});
|
|
896
|
-
var getAccountsResultSchema =
|
|
897
|
-
|
|
898
|
-
...addressSchema.entries
|
|
907
|
+
message: v14.optional(v14.string())
|
|
908
|
+
});
|
|
909
|
+
var getAccountsResultSchema = v14.array(
|
|
910
|
+
v14.object({
|
|
911
|
+
...addressSchema.entries,
|
|
912
|
+
...v14.object({
|
|
913
|
+
walletType: walletTypeSchema
|
|
914
|
+
}).entries
|
|
899
915
|
})
|
|
900
916
|
);
|
|
901
|
-
var getAccountsRequestMessageSchema =
|
|
917
|
+
var getAccountsRequestMessageSchema = v14.object({
|
|
902
918
|
...rpcRequestMessageSchema.entries,
|
|
903
|
-
...
|
|
904
|
-
method:
|
|
919
|
+
...v14.object({
|
|
920
|
+
method: v14.literal(getAccountsMethodName),
|
|
905
921
|
params: getAccountsParamsSchema,
|
|
906
|
-
id:
|
|
922
|
+
id: v14.string()
|
|
907
923
|
}).entries
|
|
908
924
|
});
|
|
909
925
|
var getBalanceMethodName = "getBalance";
|
|
910
|
-
var getBalanceParamsSchema =
|
|
911
|
-
var getBalanceResultSchema =
|
|
926
|
+
var getBalanceParamsSchema = v14.nullish(v14.null());
|
|
927
|
+
var getBalanceResultSchema = v14.object({
|
|
912
928
|
/**
|
|
913
929
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
914
930
|
* messages not supporting bigint
|
|
915
931
|
* (https://issues.chromium.org/issues/40116184).
|
|
916
932
|
*/
|
|
917
|
-
confirmed:
|
|
933
|
+
confirmed: v14.string(),
|
|
918
934
|
/**
|
|
919
935
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
920
936
|
* messages not supporting bigint
|
|
921
937
|
* (https://issues.chromium.org/issues/40116184).
|
|
922
938
|
*/
|
|
923
|
-
unconfirmed:
|
|
939
|
+
unconfirmed: v14.string(),
|
|
924
940
|
/**
|
|
925
941
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
926
942
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
927
943
|
* (https://issues.chromium.org/issues/40116184).
|
|
928
944
|
*/
|
|
929
|
-
total:
|
|
945
|
+
total: v14.string()
|
|
930
946
|
});
|
|
931
|
-
var getBalanceRequestMessageSchema =
|
|
947
|
+
var getBalanceRequestMessageSchema = v14.object({
|
|
932
948
|
...rpcRequestMessageSchema.entries,
|
|
933
|
-
...
|
|
934
|
-
method:
|
|
935
|
-
id:
|
|
949
|
+
...v14.object({
|
|
950
|
+
method: v14.literal(getBalanceMethodName),
|
|
951
|
+
id: v14.string()
|
|
936
952
|
}).entries
|
|
937
953
|
});
|
|
938
954
|
|
|
939
955
|
// src/request/types/walletMethods.ts
|
|
940
956
|
var v15 = __toESM(require("valibot"));
|
|
941
|
-
|
|
942
|
-
// src/request/types/common.ts
|
|
943
|
-
var v14 = __toESM(require("valibot"));
|
|
944
|
-
var walletTypes = ["software", "ledger", "keystone"];
|
|
945
|
-
var walletTypeSchema = v14.picklist(walletTypes);
|
|
946
|
-
|
|
947
|
-
// src/request/types/walletMethods.ts
|
|
948
957
|
var accountActionsSchema = v15.object({
|
|
949
958
|
read: v15.optional(v15.boolean())
|
|
950
959
|
});
|
|
@@ -1042,6 +1051,25 @@ var getAccountRequestMessageSchema = v15.object({
|
|
|
1042
1051
|
id: v15.string()
|
|
1043
1052
|
}).entries
|
|
1044
1053
|
});
|
|
1054
|
+
var getNetworkMethodName = "wallet_getNetwork";
|
|
1055
|
+
var getNetworkParamsSchema = v15.nullish(v15.null());
|
|
1056
|
+
var networkType2 = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
1057
|
+
var getNetworkResultSchema = v15.object({
|
|
1058
|
+
bitcoin: v15.object({
|
|
1059
|
+
name: v15.picklist(networkType2)
|
|
1060
|
+
}),
|
|
1061
|
+
stacks: v15.object({
|
|
1062
|
+
name: v15.string()
|
|
1063
|
+
})
|
|
1064
|
+
});
|
|
1065
|
+
var getNetworkRequestMessageSchema = v15.object({
|
|
1066
|
+
...rpcRequestMessageSchema.entries,
|
|
1067
|
+
...v15.object({
|
|
1068
|
+
method: v15.literal(getNetworkMethodName),
|
|
1069
|
+
params: getNetworkParamsSchema,
|
|
1070
|
+
id: v15.string()
|
|
1071
|
+
}).entries
|
|
1072
|
+
});
|
|
1045
1073
|
var connectMethodName = "wallet_connect";
|
|
1046
1074
|
var connectParamsSchema = v15.nullish(
|
|
1047
1075
|
v15.object({
|
|
@@ -1052,7 +1080,12 @@ var connectParamsSchema = v15.nullish(
|
|
|
1052
1080
|
)
|
|
1053
1081
|
})
|
|
1054
1082
|
);
|
|
1055
|
-
var connectResultSchema =
|
|
1083
|
+
var connectResultSchema = v15.object({
|
|
1084
|
+
id: v15.string(),
|
|
1085
|
+
addresses: v15.array(addressSchema),
|
|
1086
|
+
walletType: walletTypeSchema,
|
|
1087
|
+
network: getNetworkResultSchema
|
|
1088
|
+
});
|
|
1056
1089
|
var connectRequestMessageSchema = v15.object({
|
|
1057
1090
|
...rpcRequestMessageSchema.entries,
|
|
1058
1091
|
...v15.object({
|
|
@@ -1061,25 +1094,6 @@ var connectRequestMessageSchema = v15.object({
|
|
|
1061
1094
|
id: v15.string()
|
|
1062
1095
|
}).entries
|
|
1063
1096
|
});
|
|
1064
|
-
var getNetworkMethodName = "wallet_getNetwork";
|
|
1065
|
-
var getNetworkParamsSchema = v15.nullish(v15.null());
|
|
1066
|
-
var networkType = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
1067
|
-
var getNetworkResultSchema = v15.object({
|
|
1068
|
-
bitcoin: v15.object({
|
|
1069
|
-
name: v15.picklist(networkType)
|
|
1070
|
-
}),
|
|
1071
|
-
stacks: v15.object({
|
|
1072
|
-
name: v15.string()
|
|
1073
|
-
})
|
|
1074
|
-
});
|
|
1075
|
-
var getNetworkRequestMessageSchema = v15.object({
|
|
1076
|
-
...rpcRequestMessageSchema.entries,
|
|
1077
|
-
...v15.object({
|
|
1078
|
-
method: v15.literal(getNetworkMethodName),
|
|
1079
|
-
params: getNetworkParamsSchema,
|
|
1080
|
-
id: v15.string()
|
|
1081
|
-
}).entries
|
|
1082
|
-
});
|
|
1083
1097
|
|
|
1084
1098
|
// src/request/types/runesMethods/etch.ts
|
|
1085
1099
|
var v16 = __toESM(require("valibot"));
|
|
@@ -1823,15 +1837,13 @@ var UnisatAdapter = class extends SatsConnectAdapter {
|
|
|
1823
1837
|
address,
|
|
1824
1838
|
publicKey: pk,
|
|
1825
1839
|
addressType,
|
|
1826
|
-
purpose: "payment" /* Payment
|
|
1827
|
-
walletType: "software"
|
|
1840
|
+
purpose: "payment" /* Payment */
|
|
1828
1841
|
};
|
|
1829
1842
|
const ordinalsAddress = {
|
|
1830
1843
|
address,
|
|
1831
1844
|
publicKey: pk,
|
|
1832
1845
|
addressType,
|
|
1833
|
-
purpose: "ordinals" /* Ordinals
|
|
1834
|
-
walletType: "software"
|
|
1846
|
+
purpose: "ordinals" /* Ordinals */
|
|
1835
1847
|
};
|
|
1836
1848
|
const response = [];
|
|
1837
1849
|
if (purposes.includes("payment" /* Payment */)) {
|
package/dist/index.mjs
CHANGED
|
@@ -5,8 +5,15 @@ var accountChangeSchema = v.object({
|
|
|
5
5
|
type: v.literal(accountChangeEventName)
|
|
6
6
|
});
|
|
7
7
|
var networkChangeEventName = "networkChange";
|
|
8
|
+
var networkType = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
8
9
|
var networkChangeSchema = v.object({
|
|
9
|
-
type: v.literal(networkChangeEventName)
|
|
10
|
+
type: v.literal(networkChangeEventName),
|
|
11
|
+
bitcoin: v.object({
|
|
12
|
+
name: v.picklist(networkType)
|
|
13
|
+
}),
|
|
14
|
+
stacks: v.object({
|
|
15
|
+
name: v.string()
|
|
16
|
+
})
|
|
10
17
|
});
|
|
11
18
|
var disconnectEventName = "disconnect";
|
|
12
19
|
var disconnectSchema = v.object({
|
|
@@ -59,13 +66,13 @@ function getSupportedWallets() {
|
|
|
59
66
|
|
|
60
67
|
// src/types.ts
|
|
61
68
|
import * as v2 from "valibot";
|
|
62
|
-
var BitcoinNetworkType = /* @__PURE__ */ ((
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return
|
|
69
|
+
var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
|
|
70
|
+
BitcoinNetworkType2["Mainnet"] = "Mainnet";
|
|
71
|
+
BitcoinNetworkType2["Testnet"] = "Testnet";
|
|
72
|
+
BitcoinNetworkType2["Testnet4"] = "Testnet4";
|
|
73
|
+
BitcoinNetworkType2["Signet"] = "Signet";
|
|
74
|
+
BitcoinNetworkType2["Regtest"] = "Regtest";
|
|
75
|
+
return BitcoinNetworkType2;
|
|
69
76
|
})(BitcoinNetworkType || {});
|
|
70
77
|
var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
|
|
71
78
|
var rpcRequestMessageSchema = v2.object({
|
|
@@ -251,8 +258,7 @@ var addressSchema = v6.object({
|
|
|
251
258
|
address: v6.string(),
|
|
252
259
|
publicKey: v6.string(),
|
|
253
260
|
purpose: v6.enum(AddressPurpose),
|
|
254
|
-
addressType: v6.enum(AddressType)
|
|
255
|
-
walletType: walletTypeSchema
|
|
261
|
+
addressType: v6.enum(AddressType)
|
|
256
262
|
});
|
|
257
263
|
|
|
258
264
|
// src/addresses/index.ts
|
|
@@ -519,55 +525,62 @@ var stxTransferStxRequestMessageSchema = v12.object({
|
|
|
519
525
|
});
|
|
520
526
|
|
|
521
527
|
// src/request/types/btcMethods.ts
|
|
528
|
+
import * as v14 from "valibot";
|
|
529
|
+
|
|
530
|
+
// src/request/types/common.ts
|
|
522
531
|
import * as v13 from "valibot";
|
|
532
|
+
var walletTypes = ["software", "ledger", "keystone"];
|
|
533
|
+
var walletTypeSchema = v13.picklist(walletTypes);
|
|
534
|
+
|
|
535
|
+
// src/request/types/btcMethods.ts
|
|
523
536
|
var getInfoMethodName = "getInfo";
|
|
524
|
-
var getInfoParamsSchema =
|
|
525
|
-
var getInfoResultSchema =
|
|
537
|
+
var getInfoParamsSchema = v14.nullish(v14.null());
|
|
538
|
+
var getInfoResultSchema = v14.object({
|
|
526
539
|
/**
|
|
527
540
|
* Version of the wallet.
|
|
528
541
|
*/
|
|
529
|
-
version:
|
|
542
|
+
version: v14.string(),
|
|
530
543
|
/**
|
|
531
544
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
532
545
|
*/
|
|
533
|
-
methods:
|
|
546
|
+
methods: v14.optional(v14.array(v14.string())),
|
|
534
547
|
/**
|
|
535
548
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
536
549
|
*/
|
|
537
|
-
supports:
|
|
550
|
+
supports: v14.array(v14.string())
|
|
538
551
|
});
|
|
539
|
-
var getInfoRequestMessageSchema =
|
|
552
|
+
var getInfoRequestMessageSchema = v14.object({
|
|
540
553
|
...rpcRequestMessageSchema.entries,
|
|
541
|
-
...
|
|
542
|
-
method:
|
|
554
|
+
...v14.object({
|
|
555
|
+
method: v14.literal(getInfoMethodName),
|
|
543
556
|
params: getInfoParamsSchema,
|
|
544
|
-
id:
|
|
557
|
+
id: v14.string()
|
|
545
558
|
}).entries
|
|
546
559
|
});
|
|
547
560
|
var getAddressesMethodName = "getAddresses";
|
|
548
|
-
var getAddressesParamsSchema =
|
|
561
|
+
var getAddressesParamsSchema = v14.object({
|
|
549
562
|
/**
|
|
550
563
|
* The purposes for which to generate addresses. See
|
|
551
564
|
* {@linkcode AddressPurpose} for available purposes.
|
|
552
565
|
*/
|
|
553
|
-
purposes:
|
|
566
|
+
purposes: v14.array(v14.enum(AddressPurpose)),
|
|
554
567
|
/**
|
|
555
568
|
* A message to be displayed to the user in the request prompt.
|
|
556
569
|
*/
|
|
557
|
-
message:
|
|
570
|
+
message: v14.optional(v14.string())
|
|
558
571
|
});
|
|
559
|
-
var getAddressesResultSchema =
|
|
572
|
+
var getAddressesResultSchema = v14.object({
|
|
560
573
|
/**
|
|
561
574
|
* The addresses generated for the given purposes.
|
|
562
575
|
*/
|
|
563
|
-
addresses:
|
|
576
|
+
addresses: v14.array(addressSchema)
|
|
564
577
|
});
|
|
565
|
-
var getAddressesRequestMessageSchema =
|
|
578
|
+
var getAddressesRequestMessageSchema = v14.object({
|
|
566
579
|
...rpcRequestMessageSchema.entries,
|
|
567
|
-
...
|
|
568
|
-
method:
|
|
580
|
+
...v14.object({
|
|
581
|
+
method: v14.literal(getAddressesMethodName),
|
|
569
582
|
params: getAddressesParamsSchema,
|
|
570
|
-
id:
|
|
583
|
+
id: v14.string()
|
|
571
584
|
}).entries
|
|
572
585
|
});
|
|
573
586
|
var signMessageMethodName = "signMessage";
|
|
@@ -576,172 +589,168 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
|
576
589
|
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
577
590
|
return MessageSigningProtocols2;
|
|
578
591
|
})(MessageSigningProtocols || {});
|
|
579
|
-
var signMessageParamsSchema =
|
|
592
|
+
var signMessageParamsSchema = v14.object({
|
|
580
593
|
/**
|
|
581
594
|
* The address used for signing.
|
|
582
595
|
**/
|
|
583
|
-
address:
|
|
596
|
+
address: v14.string(),
|
|
584
597
|
/**
|
|
585
598
|
* The message to sign.
|
|
586
599
|
**/
|
|
587
|
-
message:
|
|
600
|
+
message: v14.string(),
|
|
588
601
|
/**
|
|
589
602
|
* The protocol to use for signing the message.
|
|
590
603
|
*/
|
|
591
|
-
protocol:
|
|
604
|
+
protocol: v14.optional(v14.enum(MessageSigningProtocols))
|
|
592
605
|
});
|
|
593
|
-
var signMessageResultSchema =
|
|
606
|
+
var signMessageResultSchema = v14.object({
|
|
594
607
|
/**
|
|
595
608
|
* The signature of the message.
|
|
596
609
|
*/
|
|
597
|
-
signature:
|
|
610
|
+
signature: v14.string(),
|
|
598
611
|
/**
|
|
599
612
|
* hash of the message.
|
|
600
613
|
*/
|
|
601
|
-
messageHash:
|
|
614
|
+
messageHash: v14.string(),
|
|
602
615
|
/**
|
|
603
616
|
* The address used for signing.
|
|
604
617
|
*/
|
|
605
|
-
address:
|
|
618
|
+
address: v14.string(),
|
|
606
619
|
/**
|
|
607
620
|
* The protocol to use for signing the message.
|
|
608
621
|
*/
|
|
609
|
-
protocol:
|
|
622
|
+
protocol: v14.enum(MessageSigningProtocols)
|
|
610
623
|
});
|
|
611
|
-
var signMessageRequestMessageSchema =
|
|
624
|
+
var signMessageRequestMessageSchema = v14.object({
|
|
612
625
|
...rpcRequestMessageSchema.entries,
|
|
613
|
-
...
|
|
614
|
-
method:
|
|
626
|
+
...v14.object({
|
|
627
|
+
method: v14.literal(signMessageMethodName),
|
|
615
628
|
params: signMessageParamsSchema,
|
|
616
|
-
id:
|
|
629
|
+
id: v14.string()
|
|
617
630
|
}).entries
|
|
618
631
|
});
|
|
619
632
|
var sendTransferMethodName = "sendTransfer";
|
|
620
|
-
var sendTransferParamsSchema =
|
|
633
|
+
var sendTransferParamsSchema = v14.object({
|
|
621
634
|
/**
|
|
622
635
|
* Array of recipients to send to.
|
|
623
636
|
* The amount to send to each recipient is in satoshis.
|
|
624
637
|
*/
|
|
625
|
-
recipients:
|
|
626
|
-
|
|
627
|
-
address:
|
|
628
|
-
amount:
|
|
638
|
+
recipients: v14.array(
|
|
639
|
+
v14.object({
|
|
640
|
+
address: v14.string(),
|
|
641
|
+
amount: v14.number()
|
|
629
642
|
})
|
|
630
643
|
)
|
|
631
644
|
});
|
|
632
|
-
var sendTransferResultSchema =
|
|
645
|
+
var sendTransferResultSchema = v14.object({
|
|
633
646
|
/**
|
|
634
647
|
* The transaction id as a hex-encoded string.
|
|
635
648
|
*/
|
|
636
|
-
txid:
|
|
649
|
+
txid: v14.string()
|
|
637
650
|
});
|
|
638
|
-
var sendTransferRequestMessageSchema =
|
|
651
|
+
var sendTransferRequestMessageSchema = v14.object({
|
|
639
652
|
...rpcRequestMessageSchema.entries,
|
|
640
|
-
...
|
|
641
|
-
method:
|
|
653
|
+
...v14.object({
|
|
654
|
+
method: v14.literal(sendTransferMethodName),
|
|
642
655
|
params: sendTransferParamsSchema,
|
|
643
|
-
id:
|
|
656
|
+
id: v14.string()
|
|
644
657
|
}).entries
|
|
645
658
|
});
|
|
646
659
|
var signPsbtMethodName = "signPsbt";
|
|
647
|
-
var signPsbtParamsSchema =
|
|
660
|
+
var signPsbtParamsSchema = v14.object({
|
|
648
661
|
/**
|
|
649
662
|
* The base64 encoded PSBT to sign.
|
|
650
663
|
*/
|
|
651
|
-
psbt:
|
|
664
|
+
psbt: v14.string(),
|
|
652
665
|
/**
|
|
653
666
|
* The inputs to sign.
|
|
654
667
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
655
668
|
*/
|
|
656
|
-
signInputs:
|
|
669
|
+
signInputs: v14.record(v14.string(), v14.array(v14.number())),
|
|
657
670
|
/**
|
|
658
671
|
* Whether to broadcast the transaction after signing.
|
|
659
672
|
**/
|
|
660
|
-
broadcast:
|
|
673
|
+
broadcast: v14.optional(v14.boolean())
|
|
661
674
|
});
|
|
662
|
-
var signPsbtResultSchema =
|
|
675
|
+
var signPsbtResultSchema = v14.object({
|
|
663
676
|
/**
|
|
664
677
|
* The base64 encoded PSBT after signing.
|
|
665
678
|
*/
|
|
666
|
-
psbt:
|
|
679
|
+
psbt: v14.string(),
|
|
667
680
|
/**
|
|
668
681
|
* The transaction id as a hex-encoded string.
|
|
669
682
|
* This is only returned if the transaction was broadcast.
|
|
670
683
|
**/
|
|
671
|
-
txid:
|
|
684
|
+
txid: v14.optional(v14.string())
|
|
672
685
|
});
|
|
673
|
-
var signPsbtRequestMessageSchema =
|
|
686
|
+
var signPsbtRequestMessageSchema = v14.object({
|
|
674
687
|
...rpcRequestMessageSchema.entries,
|
|
675
|
-
...
|
|
676
|
-
method:
|
|
688
|
+
...v14.object({
|
|
689
|
+
method: v14.literal(signPsbtMethodName),
|
|
677
690
|
params: signPsbtParamsSchema,
|
|
678
|
-
id:
|
|
691
|
+
id: v14.string()
|
|
679
692
|
}).entries
|
|
680
693
|
});
|
|
681
694
|
var getAccountsMethodName = "getAccounts";
|
|
682
|
-
var getAccountsParamsSchema =
|
|
695
|
+
var getAccountsParamsSchema = v14.object({
|
|
683
696
|
/**
|
|
684
697
|
* The purposes for which to generate addresses. See
|
|
685
698
|
* {@linkcode AddressPurpose} for available purposes.
|
|
686
699
|
*/
|
|
687
|
-
purposes:
|
|
700
|
+
purposes: v14.array(v14.enum(AddressPurpose)),
|
|
688
701
|
/**
|
|
689
702
|
* A message to be displayed to the user in the request prompt.
|
|
690
703
|
*/
|
|
691
|
-
message:
|
|
692
|
-
});
|
|
693
|
-
var getAccountsResultSchema =
|
|
694
|
-
|
|
695
|
-
...addressSchema.entries
|
|
704
|
+
message: v14.optional(v14.string())
|
|
705
|
+
});
|
|
706
|
+
var getAccountsResultSchema = v14.array(
|
|
707
|
+
v14.object({
|
|
708
|
+
...addressSchema.entries,
|
|
709
|
+
...v14.object({
|
|
710
|
+
walletType: walletTypeSchema
|
|
711
|
+
}).entries
|
|
696
712
|
})
|
|
697
713
|
);
|
|
698
|
-
var getAccountsRequestMessageSchema =
|
|
714
|
+
var getAccountsRequestMessageSchema = v14.object({
|
|
699
715
|
...rpcRequestMessageSchema.entries,
|
|
700
|
-
...
|
|
701
|
-
method:
|
|
716
|
+
...v14.object({
|
|
717
|
+
method: v14.literal(getAccountsMethodName),
|
|
702
718
|
params: getAccountsParamsSchema,
|
|
703
|
-
id:
|
|
719
|
+
id: v14.string()
|
|
704
720
|
}).entries
|
|
705
721
|
});
|
|
706
722
|
var getBalanceMethodName = "getBalance";
|
|
707
|
-
var getBalanceParamsSchema =
|
|
708
|
-
var getBalanceResultSchema =
|
|
723
|
+
var getBalanceParamsSchema = v14.nullish(v14.null());
|
|
724
|
+
var getBalanceResultSchema = v14.object({
|
|
709
725
|
/**
|
|
710
726
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
711
727
|
* messages not supporting bigint
|
|
712
728
|
* (https://issues.chromium.org/issues/40116184).
|
|
713
729
|
*/
|
|
714
|
-
confirmed:
|
|
730
|
+
confirmed: v14.string(),
|
|
715
731
|
/**
|
|
716
732
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
717
733
|
* messages not supporting bigint
|
|
718
734
|
* (https://issues.chromium.org/issues/40116184).
|
|
719
735
|
*/
|
|
720
|
-
unconfirmed:
|
|
736
|
+
unconfirmed: v14.string(),
|
|
721
737
|
/**
|
|
722
738
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
723
739
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
724
740
|
* (https://issues.chromium.org/issues/40116184).
|
|
725
741
|
*/
|
|
726
|
-
total:
|
|
742
|
+
total: v14.string()
|
|
727
743
|
});
|
|
728
|
-
var getBalanceRequestMessageSchema =
|
|
744
|
+
var getBalanceRequestMessageSchema = v14.object({
|
|
729
745
|
...rpcRequestMessageSchema.entries,
|
|
730
|
-
...
|
|
731
|
-
method:
|
|
732
|
-
id:
|
|
746
|
+
...v14.object({
|
|
747
|
+
method: v14.literal(getBalanceMethodName),
|
|
748
|
+
id: v14.string()
|
|
733
749
|
}).entries
|
|
734
750
|
});
|
|
735
751
|
|
|
736
752
|
// src/request/types/walletMethods.ts
|
|
737
753
|
import * as v15 from "valibot";
|
|
738
|
-
|
|
739
|
-
// src/request/types/common.ts
|
|
740
|
-
import * as v14 from "valibot";
|
|
741
|
-
var walletTypes = ["software", "ledger", "keystone"];
|
|
742
|
-
var walletTypeSchema = v14.picklist(walletTypes);
|
|
743
|
-
|
|
744
|
-
// src/request/types/walletMethods.ts
|
|
745
754
|
var accountActionsSchema = v15.object({
|
|
746
755
|
read: v15.optional(v15.boolean())
|
|
747
756
|
});
|
|
@@ -839,6 +848,25 @@ var getAccountRequestMessageSchema = v15.object({
|
|
|
839
848
|
id: v15.string()
|
|
840
849
|
}).entries
|
|
841
850
|
});
|
|
851
|
+
var getNetworkMethodName = "wallet_getNetwork";
|
|
852
|
+
var getNetworkParamsSchema = v15.nullish(v15.null());
|
|
853
|
+
var networkType2 = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
854
|
+
var getNetworkResultSchema = v15.object({
|
|
855
|
+
bitcoin: v15.object({
|
|
856
|
+
name: v15.picklist(networkType2)
|
|
857
|
+
}),
|
|
858
|
+
stacks: v15.object({
|
|
859
|
+
name: v15.string()
|
|
860
|
+
})
|
|
861
|
+
});
|
|
862
|
+
var getNetworkRequestMessageSchema = v15.object({
|
|
863
|
+
...rpcRequestMessageSchema.entries,
|
|
864
|
+
...v15.object({
|
|
865
|
+
method: v15.literal(getNetworkMethodName),
|
|
866
|
+
params: getNetworkParamsSchema,
|
|
867
|
+
id: v15.string()
|
|
868
|
+
}).entries
|
|
869
|
+
});
|
|
842
870
|
var connectMethodName = "wallet_connect";
|
|
843
871
|
var connectParamsSchema = v15.nullish(
|
|
844
872
|
v15.object({
|
|
@@ -849,7 +877,12 @@ var connectParamsSchema = v15.nullish(
|
|
|
849
877
|
)
|
|
850
878
|
})
|
|
851
879
|
);
|
|
852
|
-
var connectResultSchema =
|
|
880
|
+
var connectResultSchema = v15.object({
|
|
881
|
+
id: v15.string(),
|
|
882
|
+
addresses: v15.array(addressSchema),
|
|
883
|
+
walletType: walletTypeSchema,
|
|
884
|
+
network: getNetworkResultSchema
|
|
885
|
+
});
|
|
853
886
|
var connectRequestMessageSchema = v15.object({
|
|
854
887
|
...rpcRequestMessageSchema.entries,
|
|
855
888
|
...v15.object({
|
|
@@ -858,25 +891,6 @@ var connectRequestMessageSchema = v15.object({
|
|
|
858
891
|
id: v15.string()
|
|
859
892
|
}).entries
|
|
860
893
|
});
|
|
861
|
-
var getNetworkMethodName = "wallet_getNetwork";
|
|
862
|
-
var getNetworkParamsSchema = v15.nullish(v15.null());
|
|
863
|
-
var networkType = ["Mainnet", "Testnet", "Testnet4", "Signet", "Regtest"];
|
|
864
|
-
var getNetworkResultSchema = v15.object({
|
|
865
|
-
bitcoin: v15.object({
|
|
866
|
-
name: v15.picklist(networkType)
|
|
867
|
-
}),
|
|
868
|
-
stacks: v15.object({
|
|
869
|
-
name: v15.string()
|
|
870
|
-
})
|
|
871
|
-
});
|
|
872
|
-
var getNetworkRequestMessageSchema = v15.object({
|
|
873
|
-
...rpcRequestMessageSchema.entries,
|
|
874
|
-
...v15.object({
|
|
875
|
-
method: v15.literal(getNetworkMethodName),
|
|
876
|
-
params: getNetworkParamsSchema,
|
|
877
|
-
id: v15.string()
|
|
878
|
-
}).entries
|
|
879
|
-
});
|
|
880
894
|
|
|
881
895
|
// src/request/types/runesMethods/etch.ts
|
|
882
896
|
import * as v16 from "valibot";
|
|
@@ -1620,15 +1634,13 @@ var UnisatAdapter = class extends SatsConnectAdapter {
|
|
|
1620
1634
|
address,
|
|
1621
1635
|
publicKey: pk,
|
|
1622
1636
|
addressType,
|
|
1623
|
-
purpose: "payment" /* Payment
|
|
1624
|
-
walletType: "software"
|
|
1637
|
+
purpose: "payment" /* Payment */
|
|
1625
1638
|
};
|
|
1626
1639
|
const ordinalsAddress = {
|
|
1627
1640
|
address,
|
|
1628
1641
|
publicKey: pk,
|
|
1629
1642
|
addressType,
|
|
1630
|
-
purpose: "ordinals" /* Ordinals
|
|
1631
|
-
walletType: "software"
|
|
1643
|
+
purpose: "ordinals" /* Ordinals */
|
|
1632
1644
|
};
|
|
1633
1645
|
const response = [];
|
|
1634
1646
|
if (purposes.includes("payment" /* Payment */)) {
|