@sodax/dapp-kit 1.3.1-beta → 1.4.0-beta
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.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/hooks/provider/useSpokeProvider.ts +15 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sodax/dapp-kit",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0-beta",
|
|
5
5
|
"description": "dapp-kit of New World",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"viem": "2.29.2",
|
|
19
|
-
"@sodax/sdk": "1.
|
|
20
|
-
"@sodax/types": "1.
|
|
19
|
+
"@sodax/sdk": "1.4.0-beta",
|
|
20
|
+
"@sodax/types": "1.4.0-beta"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "19.0.8",
|
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
type SonicSpokeChainConfig,
|
|
22
22
|
NearSpokeProvider,
|
|
23
23
|
type NearSpokeChainConfig,
|
|
24
|
+
StacksSpokeProvider,
|
|
25
|
+
type StacksSpokeChainConfig,
|
|
24
26
|
} from '@sodax/sdk';
|
|
25
27
|
import type {
|
|
26
28
|
BitcoinSpokeChainConfig,
|
|
@@ -34,6 +36,7 @@ import type {
|
|
|
34
36
|
IStellarWalletProvider,
|
|
35
37
|
ISolanaWalletProvider,
|
|
36
38
|
INearWalletProvider,
|
|
39
|
+
IStacksWalletProvider,
|
|
37
40
|
} from '@sodax/types';
|
|
38
41
|
import { useMemo } from 'react';
|
|
39
42
|
|
|
@@ -150,6 +153,18 @@ export function useSpokeProvider(
|
|
|
150
153
|
);
|
|
151
154
|
}
|
|
152
155
|
|
|
156
|
+
if (xChainType === 'STACKS') {
|
|
157
|
+
return new StacksSpokeProvider(
|
|
158
|
+
rpcConfig[spokeChainId]
|
|
159
|
+
? ({
|
|
160
|
+
...spokeChainConfig[spokeChainId],
|
|
161
|
+
rpcUrl: rpcConfig[spokeChainId],
|
|
162
|
+
} as StacksSpokeChainConfig)
|
|
163
|
+
: (spokeChainConfig[spokeChainId] as StacksSpokeChainConfig),
|
|
164
|
+
walletProvider as IStacksWalletProvider,
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
153
168
|
return undefined;
|
|
154
169
|
}, [spokeChainId, xChainType, walletProvider, rpcConfig]);
|
|
155
170
|
|