@sodax/wallet-sdk-react 0.0.1-rc.5 → 0.0.1-rc.6
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 +21 -35
- package/dist/index.cjs +260 -397
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -15540
- package/dist/index.d.ts +37 -15540
- package/dist/index.mjs +255 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/Hydrate.ts +62 -0
- package/src/SodaxWalletProvider.tsx +18 -20
- package/src/actions/getXChainType.ts +2 -4
- package/src/core/XService.ts +4 -10
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useEvmSwitchChain.ts +2 -3
- package/src/hooks/useWalletProvider.ts +23 -18
- package/src/hooks/useXBalances.ts +1 -1
- package/src/hooks/useXConnect.ts +1 -2
- package/src/hooks/useXSignMessage.ts +82 -0
- package/src/index.ts +0 -1
- package/src/types/index.ts +0 -23
- package/src/useXWagmiStore.ts +91 -0
- package/src/utils/index.ts +2 -16
- package/src/xchains/evm/EvmXConnector.ts +1 -1
- package/src/xchains/evm/EvmXService.ts +32 -75
- package/src/xchains/icon/IconXService.ts +2 -2
- package/src/xchains/icon/actions.ts +28 -0
- package/src/xchains/injective/InjectiveKelprXConnector.ts +1 -1
- package/src/xchains/injective/InjectiveMetamaskXConnector.ts +1 -1
- package/src/xchains/injective/actions.ts +25 -0
- package/src/xchains/stellar/StellarXService.ts +1 -2
- package/src/xchains/stellar/actions.ts +24 -0
- package/src/constants/index.ts +0 -1
- package/src/constants/xChains.ts +0 -164
- package/src/hooks/useWalletProviderOptions.ts +0 -51
- package/src/useXWagmiStore.tsx +0 -164
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ A comprehensive React Wallet SDK tailored for the Sodax ecosystem that provides
|
|
|
12
12
|
- ICON Wallets: ✅ (Hana Wallet and other ICON-compatible extensions)
|
|
13
13
|
|
|
14
14
|
- Address and connection state management
|
|
15
|
-
- EVM (Arbitrum, Avalanche, Base, BSC, Optimism, Polygon) ✅
|
|
15
|
+
- EVM (Arbitrum, Avalanche, Base, BSC, Optimism, Polygon, Sonic, HyperEVM, Lightlink) ✅
|
|
16
16
|
- Sui ✅
|
|
17
17
|
- Solana ✅
|
|
18
18
|
- Stellar ✅
|
|
@@ -49,48 +49,34 @@ This package requires the following peer dependencies:
|
|
|
49
49
|
```typescript
|
|
50
50
|
import { SodaxWalletProvider, useXConnectors, useXConnect, useXAccount } from '@sodax/wallet-sdk-react';
|
|
51
51
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
52
|
-
import {
|
|
53
|
-
ARBITRUM_MAINNET_CHAIN_ID,
|
|
54
|
-
AVALANCHE_MAINNET_CHAIN_ID,
|
|
55
|
-
BASE_MAINNET_CHAIN_ID,
|
|
56
|
-
BSC_MAINNET_CHAIN_ID,
|
|
57
|
-
OPTIMISM_MAINNET_CHAIN_ID,
|
|
58
|
-
POLYGON_MAINNET_CHAIN_ID,
|
|
59
|
-
SONIC_MAINNET_CHAIN_ID,
|
|
60
|
-
} from '@sodax/types';
|
|
52
|
+
import type { RpcConfig } from '@sodax/types';
|
|
61
53
|
|
|
62
54
|
// Create a QueryClient instance
|
|
63
55
|
const queryClient = new QueryClient();
|
|
64
56
|
|
|
57
|
+
const rpcConfig: RpcConfig = {
|
|
58
|
+
// EVM chains
|
|
59
|
+
sonic: 'https://rpc.soniclabs.com',
|
|
60
|
+
'0xa86a.avax': 'https://api.avax.network/ext/bc/C/rpc',
|
|
61
|
+
'0xa4b1.arbitrum': 'https://arb1.arbitrum.io/rpc',
|
|
62
|
+
'0x2105.base': 'https://mainnet.base.org',
|
|
63
|
+
'0x38.bsc': 'https://bsc-dataseed1.binance.org',
|
|
64
|
+
'0xa.optimism': 'https://mainnet.optimism.io',
|
|
65
|
+
'0x89.polygon': 'https://polygon-rpc.com',
|
|
66
|
+
|
|
67
|
+
// Other chains
|
|
68
|
+
'0x1.icon': 'https://ctz.solidwallet.io/api/v3',
|
|
69
|
+
solana: 'https://solana-mainnet.g.alchemy.com/v2/your-api-key',
|
|
70
|
+
sui: 'https://fullnode.mainnet.sui.io',
|
|
71
|
+
'injective-1': 'https://sentry.tm.injective.network:26657',
|
|
72
|
+
};
|
|
73
|
+
|
|
65
74
|
function App() {
|
|
66
75
|
return (
|
|
67
76
|
<QueryClientProvider client={queryClient}>
|
|
68
|
-
<SodaxWalletProvider
|
|
69
|
-
config={{
|
|
70
|
-
EVM: {
|
|
71
|
-
chains: [
|
|
72
|
-
ARBITRUM_MAINNET_CHAIN_ID,
|
|
73
|
-
AVALANCHE_MAINNET_CHAIN_ID,
|
|
74
|
-
BASE_MAINNET_CHAIN_ID,
|
|
75
|
-
BSC_MAINNET_CHAIN_ID,
|
|
76
|
-
OPTIMISM_MAINNET_CHAIN_ID,
|
|
77
|
-
POLYGON_MAINNET_CHAIN_ID,
|
|
78
|
-
SONIC_MAINNET_CHAIN_ID,
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
SUI: {
|
|
82
|
-
isMainnet: true,
|
|
83
|
-
},
|
|
84
|
-
SOLANA: {
|
|
85
|
-
endpoint: 'https://your-rpc-endpoint',
|
|
86
|
-
},
|
|
87
|
-
ICON: {},
|
|
88
|
-
INJECTIVE: {},
|
|
89
|
-
STELLAR: {},
|
|
90
|
-
}}
|
|
91
|
-
>
|
|
77
|
+
<SodaxWalletProvider rpcConfig={rpcConfig}>
|
|
92
78
|
<WalletConnect />
|
|
93
|
-
|
|
79
|
+
</SodaxWalletProvider>
|
|
94
80
|
</QueryClientProvider>
|
|
95
81
|
);
|
|
96
82
|
}
|