@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/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext, useState, useCallback, useMemo, useRef, useEffect } from 'react';
|
|
2
|
-
import { SpokeService, deriveUserWalletAddress, STELLAR_MAINNET_CHAIN_ID, StellarSpokeProvider, StellarSpokeService, HubService, spokeChainConfig, SONIC_MAINNET_CHAIN_ID, SonicSpokeProvider, EvmSpokeProvider, SuiSpokeProvider, IconSpokeProvider, InjectiveSpokeProvider, SolanaSpokeProvider, isLegacybnUSDToken, Sodax } from '@sodax/sdk';
|
|
2
|
+
import { SpokeService, deriveUserWalletAddress, STELLAR_MAINNET_CHAIN_ID, StellarSpokeProvider, StellarSpokeService, HubService, spokeChainConfig, SONIC_MAINNET_CHAIN_ID, SonicSpokeProvider, EvmSpokeProvider, SuiSpokeProvider, IconSpokeProvider, InjectiveSpokeProvider, SolanaSpokeProvider, NearSpokeProvider, isLegacybnUSDToken, Sodax } from '@sodax/sdk';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import { isAddress, parseUnits } from 'viem';
|
|
5
5
|
import { ICON_MAINNET_CHAIN_ID } from '@sodax/types';
|
|
@@ -187,6 +187,12 @@ function useSpokeProvider(spokeChainId, walletProvider) {
|
|
|
187
187
|
} : spokeChainConfig[spokeChainId]
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
|
+
if (xChainType === "NEAR") {
|
|
191
|
+
return new NearSpokeProvider(
|
|
192
|
+
walletProvider,
|
|
193
|
+
spokeChainConfig[spokeChainId]
|
|
194
|
+
);
|
|
195
|
+
}
|
|
190
196
|
return void 0;
|
|
191
197
|
}, [spokeChainId, xChainType, walletProvider, rpcConfig]);
|
|
192
198
|
return spokeProvider;
|
|
@@ -348,13 +354,6 @@ function useMMApprove() {
|
|
|
348
354
|
return allowance.value;
|
|
349
355
|
},
|
|
350
356
|
onSuccess: (_, { params, spokeProvider }) => {
|
|
351
|
-
console.log("onSuccess invoked with queryKey:", [
|
|
352
|
-
"mm",
|
|
353
|
-
"allowance",
|
|
354
|
-
spokeProvider?.chainConfig.chain.id,
|
|
355
|
-
params.token,
|
|
356
|
-
params.action
|
|
357
|
-
]);
|
|
358
357
|
queryClient.invalidateQueries({
|
|
359
358
|
queryKey: ["mm", "allowance", spokeProvider?.chainConfig.chain.id, params.token, params.action]
|
|
360
359
|
});
|