@sodax/wallet-sdk-react 2.0.0-rc.19 → 2.0.0-rc.20
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/README.md +2 -2
- package/dist/{chunk-AU24YNOI.mjs → chunk-JTQGKX65.mjs} +196 -7
- package/dist/{chunk-Z5GXDHGL.mjs → chunk-LM7R5APS.mjs} +11 -4
- package/dist/index.mjs +7 -7
- package/dist/xchains/bitcoin/index.d.ts +18 -1
- package/dist/xchains/bitcoin/index.mjs +6 -6
- package/dist/xchains/evm/index.mjs +1 -1
- package/dist/xchains/icon/index.mjs +2 -2
- package/package.json +4 -4
- package/dist/{chunk-WPZOLGVB.mjs → chunk-WX23SYR6.mjs} +1 -1
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ React layer over [`@sodax/wallet-sdk-core`](https://github.com/icon-project/soda
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Unified wallet connectivity** for 9 chain families across
|
|
8
|
-
- EVM (Sonic hub, Ethereum, Arbitrum, Base, BSC, Optimism, Polygon, Avalanche, HyperEVM, Lightlink, Redbelly, Kaia) — EIP-6963 + WalletConnect
|
|
7
|
+
- **Unified wallet connectivity** for 9 chain families across 21 chains
|
|
8
|
+
- EVM (Sonic hub, Ethereum, Arbitrum, Base, BSC, Optimism, Polygon, Avalanche, HyperEVM, Lightlink, Redbelly, Kaia, Hedera) — EIP-6963 + WalletConnect
|
|
9
9
|
- Solana, Sui, Stellar, ICON, Injective, Bitcoin, NEAR, Stacks
|
|
10
10
|
- **Single-store state** — `useXAccount`, `useXConnection`, `useXAccounts` all read the same Zustand slice; persisted to `localStorage`
|
|
11
11
|
- **Bridge to `@sodax/sdk`** — `useWalletProvider` returns a typed `IXxxWalletProvider` ready to plug into any SDK call
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { StellarWalletsKitXConnector, StellarXService } from './chunk-X7BHR7WS.mjs';
|
|
2
1
|
import { SuiXService } from './chunk-JQ4H4GJ5.mjs';
|
|
3
|
-
import {
|
|
2
|
+
import { NearXConnector, NearXService } from './chunk-C6M34IVL.mjs';
|
|
3
|
+
import { EvmXService } from './chunk-LM7R5APS.mjs';
|
|
4
|
+
import { IconHanaXConnector, CHAIN_INFO, IconXService } from './chunk-WX23SYR6.mjs';
|
|
4
5
|
import { assert, isRecord, hasFunctionProperty } from './chunk-TACW7Z4D.mjs';
|
|
5
6
|
import { InjectiveXConnector, InjectiveXService } from './chunk-MWWVB7TD.mjs';
|
|
6
|
-
import { EvmXService } from './chunk-Z5GXDHGL.mjs';
|
|
7
|
-
import { NearXConnector, NearXService } from './chunk-C6M34IVL.mjs';
|
|
8
|
-
import { BITCOIN_DEFAULT_RPC_URL, WALLET_METADATA } from './chunk-NAKCAL2M.mjs';
|
|
9
7
|
import { SolanaXService } from './chunk-VPNYFVP6.mjs';
|
|
10
8
|
import { isNativeToken, getEntryDefaults, getRpcUrl } from './chunk-7V7O3Q7Y.mjs';
|
|
11
9
|
import { StacksXConnector, STACKS_PROVIDERS, StacksXService } from './chunk-OPX55MQO.mjs';
|
|
10
|
+
import { StellarWalletsKitXConnector, StellarXService } from './chunk-X7BHR7WS.mjs';
|
|
11
|
+
import { BITCOIN_DEFAULT_RPC_URL, WALLET_METADATA } from './chunk-NAKCAL2M.mjs';
|
|
12
12
|
import { XConnector, XService } from './chunk-IFXZQW4C.mjs';
|
|
13
13
|
import { ChainTypeArr, baseChainInfo, ChainKeys, usesBip322MessageSigning, detectBitcoinAddressType, CHAIN_KEYS } from '@sodax/types';
|
|
14
14
|
import { AddressPurpose, MessageSigningProtocols } from 'sats-connect';
|
|
@@ -416,6 +416,190 @@ var OKXXConnector = class _OKXXConnector extends BitcoinXConnector {
|
|
|
416
416
|
return new OKXWalletProvider(xAccount.address, this.defaults);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
+
var HANA_PROVIDER_ID = "hanaWallet.bitcoin";
|
|
420
|
+
var BitcoinHanaWalletProvider = class {
|
|
421
|
+
chainType = "BITCOIN";
|
|
422
|
+
address;
|
|
423
|
+
publicKey;
|
|
424
|
+
defaults;
|
|
425
|
+
constructor(address, publicKey, defaults) {
|
|
426
|
+
this.address = address;
|
|
427
|
+
this.publicKey = publicKey;
|
|
428
|
+
this.defaults = defaults;
|
|
429
|
+
}
|
|
430
|
+
async getWalletAddress() {
|
|
431
|
+
return this.address;
|
|
432
|
+
}
|
|
433
|
+
async getPublicKey() {
|
|
434
|
+
return this.publicKey;
|
|
435
|
+
}
|
|
436
|
+
async getAddressType(_address) {
|
|
437
|
+
return detectBitcoinAddressType(this.address);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Parse a base64-encoded PSBT to count the number of inputs.
|
|
441
|
+
* Reads the unsigned transaction from the PSBT global section.
|
|
442
|
+
*/
|
|
443
|
+
countPsbtInputs(psbtBase64) {
|
|
444
|
+
const data = Buffer.from(psbtBase64, "base64");
|
|
445
|
+
let offset = 5;
|
|
446
|
+
const keyLen = data[offset++] ?? 0;
|
|
447
|
+
if (keyLen !== 1 || data[offset++] !== 0) {
|
|
448
|
+
return 1;
|
|
449
|
+
}
|
|
450
|
+
const firstByte = data[offset++] ?? 0;
|
|
451
|
+
if (firstByte === 253) offset += 2;
|
|
452
|
+
else if (firstByte === 254) offset += 4;
|
|
453
|
+
else if (firstByte === 255) offset += 8;
|
|
454
|
+
offset += 4;
|
|
455
|
+
const inputByte = data[offset] ?? 0;
|
|
456
|
+
if (inputByte < 253) return inputByte;
|
|
457
|
+
return 1;
|
|
458
|
+
}
|
|
459
|
+
async signTransaction(psbtBase64, finalize) {
|
|
460
|
+
const effectiveFinalize = finalize ?? this.defaults?.defaultFinalize ?? false;
|
|
461
|
+
const { request } = await import('sats-connect');
|
|
462
|
+
const inputCount = this.countPsbtInputs(psbtBase64);
|
|
463
|
+
const signingIndexes = Array.from({ length: inputCount }, (_, i) => i);
|
|
464
|
+
const response = await request(
|
|
465
|
+
"signPsbt",
|
|
466
|
+
{
|
|
467
|
+
psbt: psbtBase64,
|
|
468
|
+
broadcast: false,
|
|
469
|
+
signInputs: {
|
|
470
|
+
[this.address]: signingIndexes
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
HANA_PROVIDER_ID
|
|
474
|
+
);
|
|
475
|
+
if (response.status === "error") {
|
|
476
|
+
throw new Error(response.error?.message || "Hana PSBT signing failed");
|
|
477
|
+
}
|
|
478
|
+
const result = response.result;
|
|
479
|
+
if (effectiveFinalize) {
|
|
480
|
+
return Buffer.from(result.psbt, "base64").toString("hex");
|
|
481
|
+
}
|
|
482
|
+
return result.psbt;
|
|
483
|
+
}
|
|
484
|
+
async signEcdsaMessage(message) {
|
|
485
|
+
const { request } = await import('sats-connect');
|
|
486
|
+
const response = await request(
|
|
487
|
+
"signMessage",
|
|
488
|
+
{
|
|
489
|
+
address: this.address,
|
|
490
|
+
message,
|
|
491
|
+
protocol: MessageSigningProtocols.ECDSA
|
|
492
|
+
},
|
|
493
|
+
HANA_PROVIDER_ID
|
|
494
|
+
);
|
|
495
|
+
if (response.status === "error") {
|
|
496
|
+
throw new Error(response.error?.message || "Hana ECDSA signing failed");
|
|
497
|
+
}
|
|
498
|
+
return response.result.signature;
|
|
499
|
+
}
|
|
500
|
+
async signBip322Message(message) {
|
|
501
|
+
const { request } = await import('sats-connect');
|
|
502
|
+
const response = await request(
|
|
503
|
+
"signMessage",
|
|
504
|
+
{
|
|
505
|
+
address: this.address,
|
|
506
|
+
message,
|
|
507
|
+
protocol: MessageSigningProtocols.BIP322
|
|
508
|
+
},
|
|
509
|
+
HANA_PROVIDER_ID
|
|
510
|
+
);
|
|
511
|
+
if (response.status === "error") {
|
|
512
|
+
throw new Error(response.error?.message || "Hana BIP322 signing failed");
|
|
513
|
+
}
|
|
514
|
+
return response.result.signature;
|
|
515
|
+
}
|
|
516
|
+
async sendBitcoin(toAddress, satoshis) {
|
|
517
|
+
const { request } = await import('sats-connect');
|
|
518
|
+
const response = await request(
|
|
519
|
+
"sendTransfer",
|
|
520
|
+
{
|
|
521
|
+
recipients: [
|
|
522
|
+
{
|
|
523
|
+
address: toAddress,
|
|
524
|
+
amount: Number(satoshis)
|
|
525
|
+
}
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
HANA_PROVIDER_ID
|
|
529
|
+
);
|
|
530
|
+
if (response.status === "error") {
|
|
531
|
+
throw new Error(response.error?.message || "Hana sendTransfer failed");
|
|
532
|
+
}
|
|
533
|
+
return response.result.txid;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
var HANA_ADDRESS_TYPE_KEY = "hana-address-type";
|
|
537
|
+
var BitcoinHanaXConnector = class _BitcoinHanaXConnector extends BitcoinXConnector {
|
|
538
|
+
walletProvider;
|
|
539
|
+
/** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
|
|
540
|
+
addressPurpose;
|
|
541
|
+
constructor(defaults) {
|
|
542
|
+
super("Hana Wallet", "hana-bitcoin", defaults);
|
|
543
|
+
const saved = typeof window !== "undefined" ? localStorage.getItem(HANA_ADDRESS_TYPE_KEY) : null;
|
|
544
|
+
this.addressPurpose = saved === "segwit" ? AddressPurpose.Payment : AddressPurpose.Ordinals;
|
|
545
|
+
}
|
|
546
|
+
/** Set address purpose and persist to localStorage. */
|
|
547
|
+
setAddressPurpose(type) {
|
|
548
|
+
this.addressPurpose = type === "taproot" ? AddressPurpose.Ordinals : AddressPurpose.Payment;
|
|
549
|
+
if (typeof window !== "undefined") {
|
|
550
|
+
localStorage.setItem(HANA_ADDRESS_TYPE_KEY, type);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
static isAvailable() {
|
|
554
|
+
if (typeof window === "undefined") return false;
|
|
555
|
+
return !!window.hanaWallet?.bitcoin;
|
|
556
|
+
}
|
|
557
|
+
get isInstalled() {
|
|
558
|
+
return _BitcoinHanaXConnector.isAvailable();
|
|
559
|
+
}
|
|
560
|
+
get installUrl() {
|
|
561
|
+
return WALLET_METADATA.hana.installUrl;
|
|
562
|
+
}
|
|
563
|
+
get icon() {
|
|
564
|
+
return WALLET_METADATA.hana.icon;
|
|
565
|
+
}
|
|
566
|
+
async connect() {
|
|
567
|
+
if (!_BitcoinHanaXConnector.isAvailable()) {
|
|
568
|
+
throw new Error("Hana wallet is not installed");
|
|
569
|
+
}
|
|
570
|
+
const { request } = await import('sats-connect');
|
|
571
|
+
const response = await request(
|
|
572
|
+
"getAccounts",
|
|
573
|
+
{
|
|
574
|
+
purposes: [this.addressPurpose],
|
|
575
|
+
message: "Connect to Sodax"
|
|
576
|
+
},
|
|
577
|
+
HANA_PROVIDER_ID
|
|
578
|
+
);
|
|
579
|
+
if (response.status === "error") {
|
|
580
|
+
throw new Error(response.error?.message || "Hana connection failed");
|
|
581
|
+
}
|
|
582
|
+
const accounts = response.result;
|
|
583
|
+
const paymentAccount = accounts.find((a) => a.purpose === this.addressPurpose) || accounts[0];
|
|
584
|
+
if (!paymentAccount) return void 0;
|
|
585
|
+
this.walletProvider = new BitcoinHanaWalletProvider(paymentAccount.address, paymentAccount.publicKey, this.defaults);
|
|
586
|
+
return {
|
|
587
|
+
address: paymentAccount.address,
|
|
588
|
+
publicKey: paymentAccount.publicKey,
|
|
589
|
+
xChainType: "BITCOIN"
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
async disconnect() {
|
|
593
|
+
this.walletProvider = void 0;
|
|
594
|
+
}
|
|
595
|
+
getWalletProvider() {
|
|
596
|
+
return this.walletProvider;
|
|
597
|
+
}
|
|
598
|
+
recreateWalletProvider(xAccount) {
|
|
599
|
+
if (!xAccount.address || !xAccount.publicKey) return void 0;
|
|
600
|
+
return new BitcoinHanaWalletProvider(xAccount.address, xAccount.publicKey, this.defaults);
|
|
601
|
+
}
|
|
602
|
+
};
|
|
419
603
|
function getXChainType(xChainId) {
|
|
420
604
|
if (!xChainId) {
|
|
421
605
|
return void 0;
|
|
@@ -496,7 +680,12 @@ var chainRegistry = {
|
|
|
496
680
|
const defaults = getEntryDefaults(
|
|
497
681
|
walletConfig?.BITCOIN?.chains?.[ChainKeys.BITCOIN_MAINNET]
|
|
498
682
|
);
|
|
499
|
-
return [
|
|
683
|
+
return [
|
|
684
|
+
new UnisatXConnector(defaults),
|
|
685
|
+
new XverseXConnector(defaults),
|
|
686
|
+
new OKXXConnector(defaults),
|
|
687
|
+
new BitcoinHanaXConnector(defaults)
|
|
688
|
+
];
|
|
500
689
|
},
|
|
501
690
|
providerManaged: false,
|
|
502
691
|
createActions: (service, getStore) => ({
|
|
@@ -1595,4 +1784,4 @@ function useBitcoinXConnectors() {
|
|
|
1595
1784
|
}, [xService]);
|
|
1596
1785
|
}
|
|
1597
1786
|
|
|
1598
|
-
export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, WalletConfigProvider, XverseXConnector, chainRegistry, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useBitcoinXConnectors, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, usePersistHydrated, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage, useXWalletStore, whenPersistReady };
|
|
1787
|
+
export { BitcoinHanaXConnector, BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, WalletConfigProvider, XverseXConnector, chainRegistry, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useBitcoinXConnectors, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, usePersistHydrated, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage, useXWalletStore, whenPersistReady };
|
|
@@ -4,8 +4,9 @@ import { ChainKeys } from '@sodax/types';
|
|
|
4
4
|
import { erc20Abi, defineChain } from 'viem';
|
|
5
5
|
import { getPublicClient } from 'wagmi/actions';
|
|
6
6
|
import { createConfig, createStorage, cookieStorage, http } from 'wagmi';
|
|
7
|
-
import { mainnet, avalanche, arbitrum, base, bsc, sonic, optimism, polygon, lightlinkPhoenix, kaia, redbellyMainnet } from 'wagmi/chains';
|
|
7
|
+
import { mainnet, avalanche, arbitrum, base, bsc, sonic, optimism, polygon, lightlinkPhoenix, kaia, redbellyMainnet, hedera } from 'wagmi/chains';
|
|
8
8
|
|
|
9
|
+
var HEDERA_NATIVE_BALANCE_SCALE = 10n ** 10n;
|
|
9
10
|
var hyper = /* @__PURE__ */ defineChain({
|
|
10
11
|
id: 999,
|
|
11
12
|
name: "HyperEVM",
|
|
@@ -44,7 +45,8 @@ var createWagmiConfig = (evmChains, options) => {
|
|
|
44
45
|
hyper,
|
|
45
46
|
lightlinkPhoenix,
|
|
46
47
|
kaia,
|
|
47
|
-
redbellyMainnet
|
|
48
|
+
redbellyMainnet,
|
|
49
|
+
hedera
|
|
48
50
|
],
|
|
49
51
|
connectors: options?.connectors ?? [],
|
|
50
52
|
// NOTE: wagmi's `ssr` is a hydration-timing flag, not an "is host app SSR"
|
|
@@ -66,7 +68,8 @@ var createWagmiConfig = (evmChains, options) => {
|
|
|
66
68
|
[hyper.id]: http(getRpcUrl(evmChains?.[ChainKeys.HYPEREVM_MAINNET])),
|
|
67
69
|
[lightlinkPhoenix.id]: http(getRpcUrl(evmChains?.[ChainKeys.LIGHTLINK_MAINNET])),
|
|
68
70
|
[redbellyMainnet.id]: http(getRpcUrl(evmChains?.[ChainKeys.REDBELLY_MAINNET])),
|
|
69
|
-
[kaia.id]: http(getRpcUrl(evmChains?.[ChainKeys.KAIA_MAINNET]))
|
|
71
|
+
[kaia.id]: http(getRpcUrl(evmChains?.[ChainKeys.KAIA_MAINNET])),
|
|
72
|
+
[hedera.id]: http(getRpcUrl(evmChains?.[ChainKeys.HEDERA_MAINNET]))
|
|
70
73
|
},
|
|
71
74
|
storage: createStorage({
|
|
72
75
|
storage: cookieStorage,
|
|
@@ -110,7 +113,11 @@ var EvmXService = class _EvmXService extends XService {
|
|
|
110
113
|
if (!this.wagmiConfig) return 0n;
|
|
111
114
|
const chainId = getWagmiChainId(xToken.chainKey);
|
|
112
115
|
if (isNativeToken(xToken)) {
|
|
113
|
-
|
|
116
|
+
const balance = await this._getChainBalance(address, chainId);
|
|
117
|
+
if (xToken.chainKey === ChainKeys.HEDERA_MAINNET) {
|
|
118
|
+
return balance / HEDERA_NATIVE_BALANCE_SCALE;
|
|
119
|
+
}
|
|
120
|
+
return balance;
|
|
114
121
|
}
|
|
115
122
|
throw new Error(`Unsupported token: ${xToken.symbol}`);
|
|
116
123
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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-
|
|
3
|
-
import { StellarXService } from './chunk-X7BHR7WS.mjs';
|
|
1
|
+
import { WalletConfigProvider, useXWalletStore, whenPersistReady, chainRegistry, useWalletConfig, usePersistHydrated } from './chunk-JTQGKX65.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-JTQGKX65.mjs';
|
|
4
3
|
import { SuiXService, SuiXConnector } from './chunk-JQ4H4GJ5.mjs';
|
|
5
|
-
import
|
|
4
|
+
import './chunk-C6M34IVL.mjs';
|
|
5
|
+
import { createWagmiConfig, EvmXService, EvmXConnector } from './chunk-LM7R5APS.mjs';
|
|
6
|
+
import { request } from './chunk-WX23SYR6.mjs';
|
|
6
7
|
import { assertSuiProviderShape } from './chunk-TACW7Z4D.mjs';
|
|
7
8
|
import { InjectiveXService } from './chunk-MWWVB7TD.mjs';
|
|
8
|
-
import { createWagmiConfig, EvmXService, EvmXConnector } from './chunk-Z5GXDHGL.mjs';
|
|
9
|
-
import './chunk-C6M34IVL.mjs';
|
|
10
|
-
import { SOLANA_DEFAULT_AUTO_CONNECT, SOLANA_DEFAULT_RPC_URL, SUI_DEFAULT_AUTO_CONNECT, SUI_DEFAULT_NETWORK, EVM_DEFAULT_RECONNECT_ON_MOUNT, EVM_DEFAULT_SSR, SOLANA_METAMASK_CONNECT_TIMEOUT_MS } from './chunk-NAKCAL2M.mjs';
|
|
11
9
|
import { SolanaXConnector } from './chunk-XJA2MJMG.mjs';
|
|
12
10
|
import { SolanaXService } from './chunk-VPNYFVP6.mjs';
|
|
13
11
|
import { getEntryDefaults, resolveEvmDefaults } from './chunk-7V7O3Q7Y.mjs';
|
|
14
12
|
export { getEntryDefaults, getRpcUrl, getWagmiChainId, isNativeToken, resolveEvmDefaults, sortConnectors } from './chunk-7V7O3Q7Y.mjs';
|
|
15
13
|
import './chunk-OPX55MQO.mjs';
|
|
14
|
+
import { StellarXService } from './chunk-X7BHR7WS.mjs';
|
|
15
|
+
import { SOLANA_DEFAULT_AUTO_CONNECT, SOLANA_DEFAULT_RPC_URL, SUI_DEFAULT_AUTO_CONNECT, SUI_DEFAULT_NETWORK, EVM_DEFAULT_RECONNECT_ON_MOUNT, EVM_DEFAULT_SSR, SOLANA_METAMASK_CONNECT_TIMEOUT_MS } from './chunk-NAKCAL2M.mjs';
|
|
16
16
|
import './chunk-QMXBY3UI.mjs';
|
|
17
17
|
export { XConnector, XService } from './chunk-IFXZQW4C.mjs';
|
|
18
18
|
import { useRef, useEffect, useMemo } from 'react';
|
|
@@ -117,9 +117,26 @@ declare class OKXXConnector extends BitcoinXConnector {
|
|
|
117
117
|
recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
declare class BitcoinHanaXConnector extends BitcoinXConnector {
|
|
121
|
+
private walletProvider;
|
|
122
|
+
/** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
|
|
123
|
+
addressPurpose: AddressPurpose;
|
|
124
|
+
constructor(defaults?: BitcoinWalletDefaults);
|
|
125
|
+
/** Set address purpose and persist to localStorage. */
|
|
126
|
+
setAddressPurpose(type: BtcWalletAddressType): void;
|
|
127
|
+
static isAvailable(): boolean;
|
|
128
|
+
get isInstalled(): boolean;
|
|
129
|
+
get installUrl(): string;
|
|
130
|
+
get icon(): string;
|
|
131
|
+
connect(): Promise<XAccount | undefined>;
|
|
132
|
+
disconnect(): Promise<void>;
|
|
133
|
+
getWalletProvider(): IBitcoinWalletProvider | undefined;
|
|
134
|
+
recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
|
|
135
|
+
}
|
|
136
|
+
|
|
120
137
|
/**
|
|
121
138
|
* Hook to return available Bitcoin wallet connectors from the globally registered xService.
|
|
122
139
|
*/
|
|
123
140
|
declare function useBitcoinXConnectors(): BitcoinXConnector[];
|
|
124
141
|
|
|
125
|
-
export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors };
|
|
142
|
+
export { BitcoinHanaXConnector, BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-
|
|
2
|
-
import '../../chunk-X7BHR7WS.mjs';
|
|
1
|
+
export { BitcoinHanaXConnector, BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-JTQGKX65.mjs';
|
|
3
2
|
import '../../chunk-JQ4H4GJ5.mjs';
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-C6M34IVL.mjs';
|
|
4
|
+
import '../../chunk-LM7R5APS.mjs';
|
|
5
|
+
import '../../chunk-WX23SYR6.mjs';
|
|
5
6
|
import '../../chunk-TACW7Z4D.mjs';
|
|
6
7
|
import '../../chunk-MWWVB7TD.mjs';
|
|
7
|
-
import '../../chunk-Z5GXDHGL.mjs';
|
|
8
|
-
import '../../chunk-C6M34IVL.mjs';
|
|
9
|
-
import '../../chunk-NAKCAL2M.mjs';
|
|
10
8
|
import '../../chunk-VPNYFVP6.mjs';
|
|
11
9
|
import '../../chunk-7V7O3Q7Y.mjs';
|
|
12
10
|
import '../../chunk-OPX55MQO.mjs';
|
|
11
|
+
import '../../chunk-X7BHR7WS.mjs';
|
|
12
|
+
import '../../chunk-NAKCAL2M.mjs';
|
|
13
13
|
import '../../chunk-QMXBY3UI.mjs';
|
|
14
14
|
import '../../chunk-IFXZQW4C.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig } from '../../chunk-
|
|
1
|
+
export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig } from '../../chunk-LM7R5APS.mjs';
|
|
2
2
|
import '../../chunk-7V7O3Q7Y.mjs';
|
|
3
3
|
import '../../chunk-IFXZQW4C.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId } from '../../chunk-
|
|
1
|
+
export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId } from '../../chunk-WX23SYR6.mjs';
|
|
2
2
|
import '../../chunk-TACW7Z4D.mjs';
|
|
3
|
-
import '../../chunk-NAKCAL2M.mjs';
|
|
4
3
|
import '../../chunk-7V7O3Q7Y.mjs';
|
|
4
|
+
import '../../chunk-NAKCAL2M.mjs';
|
|
5
5
|
import '../../chunk-IFXZQW4C.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.20",
|
|
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/
|
|
79
|
-
"@sodax/
|
|
80
|
-
"@sodax/wallet-sdk-core": "2.0.0-rc.
|
|
78
|
+
"@sodax/libs": "2.0.0-rc.20",
|
|
79
|
+
"@sodax/types": "2.0.0-rc.20",
|
|
80
|
+
"@sodax/wallet-sdk-core": "2.0.0-rc.20"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@arethetypeswrong/cli": "0.17.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert, isRecord, hasBooleanProperty } from './chunk-TACW7Z4D.mjs';
|
|
2
|
-
import { WALLET_METADATA } from './chunk-NAKCAL2M.mjs';
|
|
3
2
|
import { isNativeToken } from './chunk-7V7O3Q7Y.mjs';
|
|
3
|
+
import { WALLET_METADATA } from './chunk-NAKCAL2M.mjs';
|
|
4
4
|
import { XService, XConnector } from './chunk-IFXZQW4C.mjs';
|
|
5
5
|
import * as IconSdkRaw from 'icon-sdk-js';
|
|
6
6
|
|