@sodax/wallet-sdk-react 2.0.0-rc.11 → 2.0.0-rc.12
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.
|
@@ -10,7 +10,7 @@ import { SolanaXService } from './chunk-VPNYFVP6.mjs';
|
|
|
10
10
|
import { isNativeToken, getEntryDefaults, getRpcUrl } from './chunk-7V7O3Q7Y.mjs';
|
|
11
11
|
import { StacksXConnector, STACKS_PROVIDERS, StacksXService } from './chunk-OPYSVPRW.mjs';
|
|
12
12
|
import { XConnector, XService } from './chunk-IFXZQW4C.mjs';
|
|
13
|
-
import { ChainTypeArr, baseChainInfo, ChainKeys, detectBitcoinAddressType, CHAIN_KEYS } from '@sodax/types';
|
|
13
|
+
import { ChainTypeArr, baseChainInfo, ChainKeys, usesBip322MessageSigning, detectBitcoinAddressType, CHAIN_KEYS } from '@sodax/types';
|
|
14
14
|
import { AddressPurpose, MessageSigningProtocols } from 'sats-connect';
|
|
15
15
|
import { createContext, useMemo, useSyncExternalStore, useCallback, useState, useRef, useContext, useEffect } from 'react';
|
|
16
16
|
import { create } from 'zustand';
|
|
@@ -262,7 +262,7 @@ var XverseWalletProvider = class {
|
|
|
262
262
|
var XVERSE_ADDRESS_TYPE_KEY = "xverse-address-type";
|
|
263
263
|
var XverseXConnector = class _XverseXConnector extends BitcoinXConnector {
|
|
264
264
|
walletProvider;
|
|
265
|
-
/** Address purpose used when connecting. Taproot (Ordinals) by default to match
|
|
265
|
+
/** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
|
|
266
266
|
addressPurpose;
|
|
267
267
|
constructor(defaults) {
|
|
268
268
|
super("Xverse", "xverse", defaults);
|
|
@@ -510,27 +510,16 @@ var chainRegistry = {
|
|
|
510
510
|
}
|
|
511
511
|
const address = connection?.xAccount.address;
|
|
512
512
|
if (!address) throw new Error("Bitcoin address not found");
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
case "P2TR": {
|
|
517
|
-
if (!hasSignBip322(connector)) {
|
|
518
|
-
throw new Error(`${connector.id} does not support BIP-322 signing`);
|
|
519
|
-
}
|
|
520
|
-
return connector.signBip322Message(message);
|
|
521
|
-
}
|
|
522
|
-
case "P2SH":
|
|
523
|
-
case "P2PKH": {
|
|
524
|
-
if (!hasSignEcdsa(connector)) {
|
|
525
|
-
throw new Error(`${connector.id} does not support ECDSA signing`);
|
|
526
|
-
}
|
|
527
|
-
return connector.signEcdsaMessage(message);
|
|
528
|
-
}
|
|
529
|
-
default: {
|
|
530
|
-
const _exhaustiveCheck = addressType;
|
|
531
|
-
throw new Error(`Unhandled Bitcoin address type: ${_exhaustiveCheck}`);
|
|
513
|
+
if (usesBip322MessageSigning(detectBitcoinAddressType(address))) {
|
|
514
|
+
if (!hasSignBip322(connector)) {
|
|
515
|
+
throw new Error(`${connector.id} does not support BIP-322 signing`);
|
|
532
516
|
}
|
|
517
|
+
return connector.signBip322Message(message);
|
|
518
|
+
}
|
|
519
|
+
if (!hasSignEcdsa(connector)) {
|
|
520
|
+
throw new Error(`${connector.id} does not support ECDSA signing`);
|
|
533
521
|
}
|
|
522
|
+
return connector.signEcdsaMessage(message);
|
|
534
523
|
}
|
|
535
524
|
}),
|
|
536
525
|
createWalletProvider: (service, getStore) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WalletConfigProvider, useXWalletStore, whenPersistReady, chainRegistry, useWalletConfig, usePersistHydrated } from './chunk-
|
|
2
|
-
export { WalletConfigProvider, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage } from './chunk-
|
|
1
|
+
import { WalletConfigProvider, useXWalletStore, whenPersistReady, chainRegistry, useWalletConfig, usePersistHydrated } from './chunk-5XBNBT3J.mjs';
|
|
2
|
+
export { WalletConfigProvider, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage } from './chunk-5XBNBT3J.mjs';
|
|
3
3
|
import { StellarXService } from './chunk-X7BHR7WS.mjs';
|
|
4
4
|
import { SuiXService, SuiXConnector } from './chunk-JQ4H4GJ5.mjs';
|
|
5
5
|
import { createWagmiConfig, EvmXService, EvmXConnector } from './chunk-Z5GXDHGL.mjs';
|
|
@@ -69,7 +69,7 @@ declare class UnisatXConnector extends BitcoinXConnector {
|
|
|
69
69
|
|
|
70
70
|
declare class XverseXConnector extends BitcoinXConnector {
|
|
71
71
|
private walletProvider;
|
|
72
|
-
/** Address purpose used when connecting. Taproot (Ordinals) by default to match
|
|
72
|
+
/** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
|
|
73
73
|
addressPurpose: AddressPurpose;
|
|
74
74
|
constructor(defaults?: BitcoinWalletDefaults);
|
|
75
75
|
/** Set address purpose and persist to localStorage. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-
|
|
1
|
+
export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-5XBNBT3J.mjs';
|
|
2
2
|
import '../../chunk-X7BHR7WS.mjs';
|
|
3
3
|
import '../../chunk-JQ4H4GJ5.mjs';
|
|
4
4
|
import '../../chunk-Z5GXDHGL.mjs';
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "2.0.0-rc.
|
|
8
|
+
"version": "2.0.0-rc.12",
|
|
9
9
|
"description": "Wallet SDK of Sodax",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"sodax",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"viem": "2.29.2",
|
|
76
76
|
"wagmi": "2.16.9",
|
|
77
77
|
"zustand": "4.5.2",
|
|
78
|
-
"@sodax/libs": "2.0.0-rc.
|
|
79
|
-
"@sodax/wallet-sdk-core": "2.0.0-rc.
|
|
80
|
-
"@sodax/types": "2.0.0-rc.
|
|
78
|
+
"@sodax/libs": "2.0.0-rc.12",
|
|
79
|
+
"@sodax/wallet-sdk-core": "2.0.0-rc.12",
|
|
80
|
+
"@sodax/types": "2.0.0-rc.12"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@arethetypeswrong/cli": "0.17.4",
|