@sodax/dapp-kit 2.0.0-rc.1 → 2.0.0-rc.3
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/ai-exported/AGENTS.md +1 -1
- package/ai-exported/integration/ai-rules.md +1 -0
- package/ai-exported/integration/architecture.md +9 -7
- package/ai-exported/integration/features/README.md +10 -10
- package/ai-exported/integration/features/auxiliary-services.md +3 -3
- package/ai-exported/integration/features/money-market.md +30 -2
- package/ai-exported/integration/recipes/money-market.md +5 -4
- package/ai-exported/integration/recipes/setup.md +24 -0
- package/ai-exported/integration/recipes/wallet-connectivity.md +27 -0
- package/ai-exported/integration/reference/README.md +1 -1
- package/ai-exported/integration/reference/glossary.md +2 -0
- package/ai-exported/integration/reference/hooks-index.md +12 -16
- package/ai-exported/integration/reference/public-api.md +2 -2
- package/ai-exported/migration/breaking-changes/sdk-leakage.md +2 -0
- package/ai-exported/migration/features/auxiliary-services.md +3 -3
- package/ai-exported/migration/features/bridge.md +50 -13
- package/ai-exported/migration/features/money-market.md +45 -3
- package/ai-exported/migration/features/swap.md +17 -2
- package/ai-exported/migration/recipes.md +11 -14
- package/ai-exported/migration/reference/renamed-hooks.md +2 -0
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.mjs +3 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/providers/SodaxProvider.tsx +15 -11
package/dist/index.d.cts
CHANGED
|
@@ -1478,13 +1478,20 @@ declare function useClaimRewards<K extends SpokeChainKey = SpokeChainKey>({ muta
|
|
|
1478
1478
|
interface SodaxProviderProps {
|
|
1479
1479
|
children: ReactNode;
|
|
1480
1480
|
/**
|
|
1481
|
-
* Sodax config
|
|
1482
|
-
*
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1481
|
+
* Sodax SDK config. Tracked by **reference** - a new identity re-instantiates the
|
|
1482
|
+
* SDK. Hoist to a module constant or wrap in `useMemo`; include any value the SDK
|
|
1483
|
+
* should react to (e.g. solver env) in the deps. Inline `{...}` re-creates the SDK
|
|
1484
|
+
* every parent render and resets every `useSodaxContext` consumer.
|
|
1485
|
+
*
|
|
1486
|
+
* @example
|
|
1487
|
+
* ```tsx
|
|
1488
|
+
* const config = useMemo(() => ({ solver: solverMap[env] }), [env]);
|
|
1489
|
+
* <SodaxProvider config={config}>...</SodaxProvider>
|
|
1490
|
+
* ```
|
|
1485
1491
|
*/
|
|
1486
1492
|
config?: DeepPartial<SodaxConfig>;
|
|
1487
1493
|
}
|
|
1494
|
+
/** Root provider for `@sodax/dapp-kit`. Must be paired with `QueryClientProvider`. */
|
|
1488
1495
|
declare const SodaxProvider: ({ children, config }: SodaxProviderProps) => ReactElement;
|
|
1489
1496
|
|
|
1490
1497
|
type CreateSodaxQueryClientOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1478,13 +1478,20 @@ declare function useClaimRewards<K extends SpokeChainKey = SpokeChainKey>({ muta
|
|
|
1478
1478
|
interface SodaxProviderProps {
|
|
1479
1479
|
children: ReactNode;
|
|
1480
1480
|
/**
|
|
1481
|
-
* Sodax config
|
|
1482
|
-
*
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1481
|
+
* Sodax SDK config. Tracked by **reference** - a new identity re-instantiates the
|
|
1482
|
+
* SDK. Hoist to a module constant or wrap in `useMemo`; include any value the SDK
|
|
1483
|
+
* should react to (e.g. solver env) in the deps. Inline `{...}` re-creates the SDK
|
|
1484
|
+
* every parent render and resets every `useSodaxContext` consumer.
|
|
1485
|
+
*
|
|
1486
|
+
* @example
|
|
1487
|
+
* ```tsx
|
|
1488
|
+
* const config = useMemo(() => ({ solver: solverMap[env] }), [env]);
|
|
1489
|
+
* <SodaxProvider config={config}>...</SodaxProvider>
|
|
1490
|
+
* ```
|
|
1485
1491
|
*/
|
|
1486
1492
|
config?: DeepPartial<SodaxConfig>;
|
|
1487
1493
|
}
|
|
1494
|
+
/** Root provider for `@sodax/dapp-kit`. Must be paired with `QueryClientProvider`. */
|
|
1488
1495
|
declare const SodaxProvider: ({ children, config }: SodaxProviderProps) => ReactElement;
|
|
1489
1496
|
|
|
1490
1497
|
type CreateSodaxQueryClientOptions = {
|
package/dist/index.mjs
CHANGED
|
@@ -2483,10 +2483,9 @@ function useClaimRewards({
|
|
|
2483
2483
|
});
|
|
2484
2484
|
}
|
|
2485
2485
|
var SodaxProvider = ({ children, config }) => {
|
|
2486
|
-
const
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2489
|
-
return /* @__PURE__ */ jsx(SodaxContext.Provider, { value: { sodax }, children });
|
|
2486
|
+
const sodax = useMemo(() => new Sodax(config), [config]);
|
|
2487
|
+
const contextValue = useMemo(() => ({ sodax }), [sodax]);
|
|
2488
|
+
return /* @__PURE__ */ jsx(SodaxContext.Provider, { value: contextValue, children });
|
|
2490
2489
|
};
|
|
2491
2490
|
var defaultOnMutationError = (error) => {
|
|
2492
2491
|
console.error("[sodax] Mutation error:", error);
|