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