@skip-go/widget 2.3.7 → 2.4.0

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.
Files changed (33) hide show
  1. package/README.md +30 -3
  2. package/build/hooks/use-assets.d.ts +2 -2
  3. package/build/hooks/use-auto-set-address.d.ts +1 -1
  4. package/build/hooks/use-balances-by-chain.d.ts +1 -1
  5. package/build/hooks/use-bridges.d.ts +1 -1
  6. package/build/hooks/use-broadcasted-txs.d.ts +1 -1
  7. package/build/hooks/use-chains.d.ts +1 -1
  8. package/build/hooks/use-finality-time-estimate.d.ts +1 -1
  9. package/build/hooks/use-route.d.ts +2 -2
  10. package/build/hooks/use-skip-client.d.ts +2 -2
  11. package/build/hooks/use-swap-widget.d.ts +2 -2
  12. package/build/index.es.js +96 -12
  13. package/build/index.es.js.map +1 -1
  14. package/build/provider/assets.d.ts +1 -1
  15. package/build/provider/index.d.ts +2 -1
  16. package/build/provider/skip-provider.d.ts +5 -8
  17. package/build/store/callbacks.d.ts +31 -0
  18. package/build/store/tx-history.d.ts +1 -1
  19. package/build/ui/AssetInput.d.ts +1 -1
  20. package/build/ui/AssetSelect/AssetSelectContent.d.ts +1 -1
  21. package/build/ui/AssetSelect/index.d.ts +1 -1
  22. package/build/ui/ConversionRate.d.ts +1 -1
  23. package/build/ui/PreviewRoute/ChainStep.d.ts +1 -1
  24. package/build/ui/PreviewRoute/SetAddressDialog.d.ts +1 -1
  25. package/build/ui/PreviewRoute/index.d.ts +1 -1
  26. package/build/ui/PreviewRoute/make-actions.d.ts +1 -1
  27. package/build/ui/PreviewRoute/make-chain-ids-with-actions.d.ts +1 -1
  28. package/build/ui/PreviewRoute/make-step-state.d.ts +1 -1
  29. package/build/ui/SwapDetails.d.ts +1 -1
  30. package/build/ui/TransactionDialog.d.ts +1 -1
  31. package/build/ui/index.d.ts +2 -1
  32. package/build/utils/ledger-warning.d.ts +1 -1
  33. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { Asset } from '@skip-go/core';
1
+ import { Asset } from '@skip-go/client';
2
2
  import { ReactNode } from 'react';
3
3
  interface AssetsContext {
4
4
  assets: Record<string, Asset[]>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SkipRouterOptions } from '@skip-go/core';
2
+ import { ChainAffiliates, SkipRouterOptions } from '@skip-go/client';
3
3
  import { DefaultRouteConfig } from '../hooks/use-swap-widget';
4
4
  import { RouteConfig } from '../hooks/use-route';
5
5
  import { MinimalWallet } from '../hooks/use-make-wallets';
@@ -18,6 +18,7 @@ export interface SkipAPIProviderProps {
18
18
  endpointOptions?: SkipRouterOptions['endpointOptions'];
19
19
  apiURL?: string;
20
20
  makeDestinationWallets?: (chainID: string) => MinimalWallet[];
21
+ chainIDsToAffiliates?: Record<string, ChainAffiliates>;
21
22
  }
22
23
  export declare const WalletProvider: React.FC<WalletProviderProps>;
23
24
  export declare const SkipAPIProvider: React.FC<SkipAPIProviderProps>;
@@ -1,15 +1,12 @@
1
- import { SkipRouter, SkipRouterOptions } from '@skip-go/core';
2
- import { ReactNode } from 'react';
1
+ /// <reference types="react" />
2
+ import { ChainAffiliates, SkipRouter, SkipRouterOptions } from '@skip-go/client';
3
3
  import { MinimalWallet } from '../hooks/use-make-wallets';
4
+ import { SkipAPIProviderProps } from './index';
4
5
  export declare const SkipContext: import("react").Context<{
5
6
  skipClient: SkipRouter;
6
7
  apiURL?: string | undefined;
7
8
  endpointOptions?: SkipRouterOptions['endpointOptions'];
8
9
  makeDestinationWallets?: ((chainID: string) => MinimalWallet[]) | undefined;
10
+ chainIDsToAffiliates?: Record<string, ChainAffiliates> | undefined;
9
11
  } | undefined>;
10
- export declare function SkipProvider({ children, apiURL, endpointOptions, makeDestinationWallets, }: {
11
- children: ReactNode;
12
- apiURL?: string;
13
- endpointOptions?: SkipRouterOptions['endpointOptions'];
14
- makeDestinationWallets?: (chainID: string) => MinimalWallet[];
15
- }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function SkipProvider({ children, apiURL, endpointOptions, makeDestinationWallets, chainIDsToAffiliates, }: SkipAPIProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ type OnWalletConnected = {
2
+ walletName: string;
3
+ chainId: string;
4
+ address?: string;
5
+ };
6
+ type OnWalletDisconnected = {
7
+ chainType?: string;
8
+ };
9
+ type OnTransactionBroadcasted = {
10
+ txHash: string;
11
+ chainId: string;
12
+ explorerLink: string;
13
+ };
14
+ type OnTransactionComplete = {
15
+ txHash: string;
16
+ chainId: string;
17
+ explorerLink: string;
18
+ };
19
+ type OnTransactionFailed = {
20
+ error: string;
21
+ };
22
+ export type CallbackStore = {
23
+ onWalletConnected?: (props: OnWalletConnected) => void;
24
+ onWalletDisconnected?: (props: OnWalletDisconnected) => void;
25
+ onTransactionBroadcasted?: (props: OnTransactionBroadcasted) => void;
26
+ onTransactionComplete?: (props: OnTransactionComplete) => void;
27
+ onTransactionFailed?: (props: OnTransactionFailed) => void;
28
+ };
29
+ export declare const defaultValues: CallbackStore;
30
+ export declare const useCallbackStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CallbackStore>>;
31
+ export {};
@@ -1,4 +1,4 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  export interface TxStatus {
3
3
  chainId: string;
4
4
  txHash: string;
@@ -1,4 +1,4 @@
1
- import { Asset } from '@skip-go/core';
1
+ import { Asset } from '@skip-go/client';
2
2
  import { MouseEventHandler } from 'react';
3
3
  import { Chain } from '../hooks/use-chains';
4
4
  interface Props {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as ScrollArea from '@radix-ui/react-scroll-area';
3
- import { Asset } from '@skip-go/core';
3
+ import { Asset } from '@skip-go/client';
4
4
  interface Props {
5
5
  assets?: Asset[];
6
6
  balances: Record<string, string>;
@@ -1,4 +1,4 @@
1
- import { Asset } from '@skip-go/core';
1
+ import { Asset } from '@skip-go/client';
2
2
  interface Props {
3
3
  asset?: Asset;
4
4
  assets?: Asset[];
@@ -1,4 +1,4 @@
1
- import { Asset } from '@skip-go/core';
1
+ import { Asset } from '@skip-go/client';
2
2
  import { ReactNode } from 'react';
3
3
  export interface Props {
4
4
  srcAsset: Asset;
@@ -1,4 +1,4 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  import { Dispatch, SetStateAction } from 'react';
3
3
  import { SwapAction, TransferAction } from './make-actions';
4
4
  import { ChainIDWithAction } from './make-chain-ids-with-actions';
@@ -1,4 +1,4 @@
1
- import { Chain } from '@skip-go/core';
1
+ import { Chain } from '@skip-go/client';
2
2
  import { ChainAddresses, SetChainAddressesParam } from './types';
3
3
  export declare const SetAddressDialog: ({ open, onOpen, chain, index, signRequired, isDestination, chainAddresses, setChainAddresses, }: {
4
4
  open: boolean;
@@ -1,4 +1,4 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  import { useDisclosureKey } from '../../store/disclosures';
3
3
  export interface Wallet {
4
4
  walletName: string;
@@ -1,4 +1,4 @@
1
- import { BridgeType, RouteResponse } from '@skip-go/core';
1
+ import { BridgeType, RouteResponse } from '@skip-go/client';
2
2
  export interface TransferAction {
3
3
  type: 'TRANSFER';
4
4
  denomIn: string;
@@ -1,4 +1,4 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  import { Action, SwapAction, TransferAction } from './make-actions';
3
3
  export interface ChainIDWithAction {
4
4
  chainID: string;
@@ -8,7 +8,7 @@ export declare const makeStepState: (props: Props) => {
8
8
  isSuccess: boolean;
9
9
  isLoading: boolean;
10
10
  isError: boolean;
11
- state: import("@skip-go/core/dist/types").TransferState | undefined;
11
+ state: import("@skip-go/client/dist/types").TransferState | undefined;
12
12
  explorerLink: {
13
13
  link: string;
14
14
  shorthand: string;
@@ -1,4 +1,4 @@
1
- import { BridgeType, RouteResponse } from '@skip-go/core';
1
+ import { BridgeType, RouteResponse } from '@skip-go/client';
2
2
  import { SwapWidgetStore } from '../hooks/use-swap-widget';
3
3
  type Props = SwapWidgetStore & {
4
4
  amountOut: string;
@@ -1,4 +1,4 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  export type ActionType = 'NONE' | 'TRANSFER' | 'SWAP';
3
3
  interface Props {
4
4
  isLoading?: boolean;
@@ -3,7 +3,8 @@ import { SwapWidgetProviderProps } from '../provider';
3
3
  import { ConfigureSwapWidgetArgs } from '../store/swap-widget';
4
4
  import { SwapWidgetUIProps } from './Widget';
5
5
  import { PartialTheme } from './theme';
6
- export type SwapWidgetWithoutProvidersProps = SwapWidgetUIProps & ConfigureSwapWidgetArgs & {
6
+ import { CallbackStore } from '../store/callbacks';
7
+ export type SwapWidgetWithoutProvidersProps = SwapWidgetUIProps & ConfigureSwapWidgetArgs & CallbackStore & {
7
8
  theme?: PartialTheme;
8
9
  };
9
10
  export type SwapWidgetProps = SwapWidgetWithoutProvidersProps & Partial<SwapWidgetProviderProps>;
@@ -1,3 +1,3 @@
1
- import { RouteResponse } from '@skip-go/core';
1
+ import { RouteResponse } from '@skip-go/client';
2
2
  export declare const isCCTPLedgerBrokenInOperation: (route: RouteResponse) => boolean;
3
3
  export declare const isEthermintLedgerInOperation: (route: RouteResponse) => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skip-go/widget",
3
3
  "description": "Swap widget",
4
- "version": "2.3.7",
4
+ "version": "2.4.0",
5
5
  "repository": "https://github.com/skip-mev/widget",
6
6
  "type": "module",
7
7
  "exports": {
@@ -62,7 +62,7 @@
62
62
  "@radix-ui/react-scroll-area": "^1.0.5",
63
63
  "@radix-ui/react-switch": "^1.0.3",
64
64
  "@radix-ui/react-tooltip": "^1.0.7",
65
- "@skip-go/core": "0.4.4",
65
+ "@skip-go/client": "0.6.0",
66
66
  "@solana/spl-token": "^0.4.6",
67
67
  "@solana/wallet-adapter-react": "^0.15.35",
68
68
  "@solana/wallet-adapter-wallets": "^0.19.32",