@sodax/dapp-kit 1.2.7-beta → 1.3.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 +6 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/hooks/mm/useMMApprove.ts +0 -7
- package/src/hooks/provider/useSpokeProvider.ts +10 -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.3.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.3.0-beta",
|
|
20
|
+
"@sodax/types": "1.3.0-beta"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "19.0.8",
|
|
@@ -47,13 +47,6 @@ export function useMMApprove(): UseMutationResult<string, Error, UseMMApprovePar
|
|
|
47
47
|
return allowance.value;
|
|
48
48
|
},
|
|
49
49
|
onSuccess: (_, { params, spokeProvider }: UseMMApproveParams) => {
|
|
50
|
-
console.log('onSuccess invoked with queryKey:', [
|
|
51
|
-
'mm',
|
|
52
|
-
'allowance',
|
|
53
|
-
spokeProvider?.chainConfig.chain.id,
|
|
54
|
-
params.token,
|
|
55
|
-
params.action,
|
|
56
|
-
]);
|
|
57
50
|
// Invalidate allowance query to refetch updated approval status
|
|
58
51
|
queryClient.invalidateQueries({
|
|
59
52
|
queryKey: ['mm', 'allowance', spokeProvider?.chainConfig.chain.id, params.token, params.action],
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
SONIC_MAINNET_CHAIN_ID,
|
|
19
19
|
SonicSpokeProvider,
|
|
20
20
|
type SonicSpokeChainConfig,
|
|
21
|
+
NearSpokeProvider,
|
|
22
|
+
type NearSpokeChainConfig,
|
|
21
23
|
} from '@sodax/sdk';
|
|
22
24
|
import type {
|
|
23
25
|
IEvmWalletProvider,
|
|
@@ -27,6 +29,7 @@ import type {
|
|
|
27
29
|
IInjectiveWalletProvider,
|
|
28
30
|
IStellarWalletProvider,
|
|
29
31
|
ISolanaWalletProvider,
|
|
32
|
+
INearWalletProvider,
|
|
30
33
|
} from '@sodax/types';
|
|
31
34
|
import { useMemo } from 'react';
|
|
32
35
|
|
|
@@ -117,6 +120,13 @@ export function useSpokeProvider(
|
|
|
117
120
|
);
|
|
118
121
|
}
|
|
119
122
|
|
|
123
|
+
if (xChainType === 'NEAR') {
|
|
124
|
+
return new NearSpokeProvider(
|
|
125
|
+
walletProvider as INearWalletProvider,
|
|
126
|
+
spokeChainConfig[spokeChainId] as NearSpokeChainConfig,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
120
130
|
return undefined;
|
|
121
131
|
}, [spokeChainId, xChainType, walletProvider, rpcConfig]);
|
|
122
132
|
|