@use-glyph/sdk-react 1.2.13 → 2.0.0-rc.5
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/EIP1193Strategy.js +96 -87
- package/dist/EIP1193Strategy.js.map +1 -1
- package/dist/PrivyStrategy.js +85 -67
- package/dist/PrivyStrategy.js.map +1 -1
- package/dist/assets/sdk-react.css +1 -1
- package/dist/glyph-widget.es.js +23 -21
- package/dist/glyph-widget.umd.js +89 -37
- package/dist/glyph-widget.umd.js.map +1 -1
- package/dist/index.js +30233 -10328
- package/dist/index.js.map +1 -1
- package/dist/types/assets/svg/TxSwapIcon.d.ts +1 -0
- package/dist/types/components/shared/ActivityRow.d.ts +1 -0
- package/dist/types/components/shared/{ChainIcon.d.ts → NativeTokenIcon.d.ts} +1 -1
- package/dist/types/components/shared/WalletViewTemplate.d.ts +2 -0
- package/dist/types/components/ui/button.d.ts +1 -1
- package/dist/types/components/ui/dialog.d.ts +21 -0
- package/dist/types/components/ui/drawer.d.ts +18 -0
- package/dist/types/components/widget/WalletHomeTab.d.ts +3 -4
- package/dist/types/components/widget/WalletMainView.d.ts +3 -6
- package/dist/types/components/widget/WalletSendFundView.d.ts +2 -2
- package/dist/types/components/widget/WalletTradeView.d.ts +8 -0
- package/dist/types/components/widget/internal/SendFundChainAndTokenSelector.d.ts +6 -0
- package/dist/types/components/widget/internal/SwapChainAndTokenSelector.d.ts +7 -0
- package/dist/types/components/widget/internal/TokenAndChainIcon.d.ts +13 -0
- package/dist/types/components/widget/{WalletSendFundEnterAddressView.d.ts → internal/WalletSendFundEnterAddressView.d.ts} +1 -1
- package/dist/types/components/widget/{WalletSendFundPendingView.d.ts → internal/WalletSendFundPendingView.d.ts} +2 -2
- package/dist/types/components/widget/{WalletSendFundSuccessView.d.ts → internal/WalletSendFundSuccessView.d.ts} +1 -1
- package/dist/types/components/widget/internal/WalletSwapTopUpGas.d.ts +13 -0
- package/dist/types/components/widget/internal/WalletTokenVsNftSwitcher.d.ts +5 -0
- package/dist/types/components/widget/internal/WalletTradeFailedView.d.ts +12 -0
- package/dist/types/components/widget/internal/WalletTradePendingView.d.ts +13 -0
- package/dist/types/components/widget/internal/WalletTradeSuccessView.d.ts +13 -0
- package/dist/types/components/widget/{WidgetGradient.d.ts → internal/WidgetGradient.d.ts} +1 -1
- package/dist/types/context/GlyphSwapContext.d.ts +18 -0
- package/dist/types/context/GlyphSwapProvider.d.ts +3 -0
- package/dist/types/context/GlyphUserDataContext.d.ts +3 -0
- package/dist/types/context/GlyphUserDataProvider.d.ts +2 -5
- package/dist/types/context/GlyphViewProvider.d.ts +2 -4
- package/dist/types/context/strategies/EIP1193Strategy.d.ts +2 -2
- package/dist/types/context/strategies/LoadingStrategy.d.ts +2 -3
- package/dist/types/context/strategies/PrivyStrategy.d.ts +2 -1
- package/dist/types/hooks/useActivity.d.ts +1 -0
- package/dist/types/hooks/useBalances.d.ts +3 -0
- package/dist/types/hooks/useGlyph.d.ts +10 -7
- package/dist/types/hooks/useGlyphConfigureDynamicChains.d.ts +12 -0
- package/dist/types/hooks/useGlyphRelayEvmAdapter.d.ts +2 -0
- package/dist/types/hooks/useRelayExecute.d.ts +9 -0
- package/dist/types/hooks/useRelayIntentStatus.d.ts +18 -0
- package/dist/types/hooks/useRelayQuote.d.ts +175 -0
- package/dist/types/hooks/useRelayTokenList.d.ts +25 -0
- package/dist/types/hooks/useTokenBalance.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/constants.d.ts +10 -6
- package/dist/types/lib/eip1193/GlyphWalletProvider.d.ts +2 -8
- package/dist/types/lib/intl.d.ts +1 -1
- package/dist/types/lib/privy/GlyphPrivyProvider.d.ts +8 -9
- package/dist/types/lib/relay.d.ts +4 -0
- package/dist/types/lib/utils.d.ts +15 -2
- package/dist/types/types/GlyphWidgetTypes.d.ts +13 -2
- package/package.json +3 -1
- package/dist/types/assets/svg/APEIcon.d.ts +0 -2
- package/dist/types/assets/svg/APE_ETH.d.ts +0 -1
- package/dist/types/assets/svg/APE_USD.d.ts +0 -1
- package/dist/types/assets/svg/APE_WAPE.d.ts +0 -1
- package/dist/types/assets/svg/ApechainIcon.d.ts +0 -1
- package/dist/types/assets/svg/ApecoinIcon.d.ts +0 -2
- package/dist/types/assets/svg/BaseIcon.d.ts +0 -1
- package/dist/types/assets/svg/ETH.d.ts +0 -1
- package/dist/types/assets/svg/POL.d.ts +0 -1
- package/dist/types/assets/svg/USDCIcon.d.ts +0 -1
- /package/dist/types/components/widget/{WalletFundFailedView.d.ts → internal/WalletFundFailedView.d.ts} +0 -0
- /package/dist/types/components/widget/{WalletFundPendingView.d.ts → internal/WalletFundPendingView.d.ts} +0 -0
- /package/dist/types/components/widget/{WalletFundSuccessView.d.ts → internal/WalletFundSuccessView.d.ts} +0 -0
- /package/dist/types/components/widget/{WalletSendFundFailedView.d.ts → internal/WalletSendFundFailedView.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TxSwapIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,7 @@ export type WalletScreenProps = {
|
|
|
6
6
|
footerCols?: boolean;
|
|
7
7
|
mainFooter?: boolean;
|
|
8
8
|
setView?: (view: SelectedView) => void;
|
|
9
|
+
headerClassName?: string;
|
|
10
|
+
footerClassName?: string;
|
|
9
11
|
};
|
|
10
12
|
export declare function WalletViewTemplate({ mainFooter, ...props }: WalletScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
declare const buttonVariantsClasses: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "tertiary" | "ghost" | "link-inline" | "cube" | null | undefined;
|
|
5
5
|
size?: "default" | "login" | "icon" | "cube" | "xs" | "xs-inline" | "sm" | "lg" | null | undefined;
|
|
6
6
|
shadow?: boolean | null | undefined;
|
|
7
7
|
scale?: boolean | null | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
|
+
container?: HTMLElement | null;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DialogHeader: {
|
|
12
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
declare const DialogFooter: {
|
|
16
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
20
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
21
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as react, ComponentProps, HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
|
+
declare const Drawer: ({ shouldScaleBackground, repositionInputs, ...props }: ComponentProps<typeof DrawerPrimitive.Root>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const DrawerTrigger: react.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DrawerPortal: react.FC<PropsWithChildren>;
|
|
6
|
+
declare const DrawerClose: react.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DrawerHandle: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
|
+
preventCycle?: boolean | undefined;
|
|
9
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const DrawerOverlay: react.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-dialog').DialogOverlayProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DrawerContent: react.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-dialog').DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
childrenWrapperClassName?: string;
|
|
13
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DrawerHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const DrawerFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const DrawerTitle: react.ForwardRefExoticComponent<Omit<import('@radix-ui/react-dialog').DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const DrawerDescription: react.ForwardRefExoticComponent<Omit<import('@radix-ui/react-dialog').DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { WalletView } from '../../lib/constants';
|
|
1
2
|
export type WalletHomeTabProps = {
|
|
2
|
-
|
|
3
|
-
onReceive: () => void;
|
|
4
|
-
onSend: () => void;
|
|
3
|
+
setWalletView: (view: WalletView) => void;
|
|
5
4
|
};
|
|
6
|
-
export declare function WalletHomeTab({
|
|
5
|
+
export declare function WalletHomeTab({ setWalletView }: WalletHomeTabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { INTERNAL_GRADIENT_TYPE, WalletMainViewTab } from '../../lib/constants';
|
|
1
|
+
import { INTERNAL_GRADIENT_TYPE, WalletMainViewTab, WalletView } from '../../lib/constants';
|
|
2
2
|
export type WalletMainProps = {
|
|
3
|
-
|
|
4
|
-
onAddFunds: () => void;
|
|
5
|
-
onSendFunds: () => void;
|
|
6
|
-
onReceive: () => void;
|
|
3
|
+
setWalletView: (view: WalletView) => void;
|
|
7
4
|
activeMainViewScreen: WalletMainViewTab;
|
|
8
5
|
setActiveMainViewScreen: (screen: WalletMainViewTab) => void;
|
|
9
6
|
expandFirstActivityRow?: boolean;
|
|
10
7
|
setGradientType: React.Dispatch<React.SetStateAction<INTERNAL_GRADIENT_TYPE | undefined>>;
|
|
11
8
|
};
|
|
12
|
-
export declare function WalletMainView({
|
|
9
|
+
export declare function WalletMainView({ setWalletView, activeMainViewScreen, setActiveMainViewScreen, expandFirstActivityRow, setGradientType }: WalletMainProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,9 +10,9 @@ export type SendFundQuote = {
|
|
|
10
10
|
tokenAddress: Hex;
|
|
11
11
|
receivable_amount: bigint;
|
|
12
12
|
receivable_amount_in_token: number;
|
|
13
|
-
receivable_amount_in_currency:
|
|
13
|
+
receivable_amount_in_currency: string;
|
|
14
14
|
estimated_fees_amount: string;
|
|
15
|
-
estimated_fees_amount_in_currency:
|
|
15
|
+
estimated_fees_amount_in_currency: string | undefined;
|
|
16
16
|
currency: string;
|
|
17
17
|
in_amount: string;
|
|
18
18
|
receiver_address: Hex;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { INTERNAL_GRADIENT_TYPE } from '../../lib/constants';
|
|
2
|
+
export type WalletTradeProps = {
|
|
3
|
+
onBack: () => void;
|
|
4
|
+
onEnd: () => void;
|
|
5
|
+
onShowActivity: () => void;
|
|
6
|
+
setGradientType: React.Dispatch<React.SetStateAction<INTERNAL_GRADIENT_TYPE | undefined>>;
|
|
7
|
+
};
|
|
8
|
+
export declare function WalletTradeView({ onBack, onEnd, onShowActivity, setGradientType }: WalletTradeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GlyphWidgetTokenBalancesItem } from '../../../types';
|
|
2
|
+
declare const _default: import('react').MemoExoticComponent<({ onTokenSelect, selectedToken }: {
|
|
3
|
+
onTokenSelect: (token: GlyphWidgetTokenBalancesItem | undefined) => void;
|
|
4
|
+
selectedToken: GlyphWidgetTokenBalancesItem | undefined;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RelayAPIToken } from '../../../context/GlyphSwapContext';
|
|
2
|
+
declare const _default: import('react').MemoExoticComponent<({ onTokenSelect, selectedToken, defaultChainId }: {
|
|
3
|
+
onTokenSelect: (token: RelayAPIToken) => void;
|
|
4
|
+
selectedToken: RelayAPIToken | undefined;
|
|
5
|
+
defaultChainId?: number;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const TokenAndChainIcon: ({ token, chain, tokenClassName, chainClassName }: {
|
|
2
|
+
token: {
|
|
3
|
+
logoUrl: string | undefined;
|
|
4
|
+
name: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
tokenClassName?: string;
|
|
7
|
+
chain?: {
|
|
8
|
+
id: number;
|
|
9
|
+
logoUrl: string | undefined | null;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
chainClassName?: string;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SendFundQuote } from '
|
|
1
|
+
import { SendFundQuote } from '../WalletSendFundView';
|
|
2
2
|
interface WalletSendFundPendingViewProps {
|
|
3
3
|
onBack: () => void;
|
|
4
4
|
txHash: string | undefined;
|
|
@@ -6,7 +6,7 @@ interface WalletSendFundPendingViewProps {
|
|
|
6
6
|
txBlockExplorerName: string | undefined;
|
|
7
7
|
quote: SendFundQuote;
|
|
8
8
|
tokenSymbol: string;
|
|
9
|
-
TokenIcon: React.
|
|
9
|
+
TokenIcon: React.JSX.Element;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: import('react').NamedExoticComponent<WalletSendFundPendingViewProps>;
|
|
12
12
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { paths } from '@relayprotocol/relay-sdk';
|
|
2
|
+
import { Hex } from 'viem';
|
|
3
|
+
export type TopUpDetails = NonNullable<paths["/quote"]["post"]["responses"]["200"]["content"]["application/json"]["details"]>["currencyGasTopup"] | undefined;
|
|
4
|
+
type WalletSwapTopUpGasProps = {
|
|
5
|
+
destinationChainId?: number;
|
|
6
|
+
walletAddress?: Hex;
|
|
7
|
+
topUpGas: boolean;
|
|
8
|
+
setTopUpGas: (value: boolean) => void;
|
|
9
|
+
topUpDetails: TopUpDetails;
|
|
10
|
+
quoteReady?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const WalletSwapTopUpGas: ({ destinationChainId, walletAddress, topUpGas, setTopUpGas, topUpDetails, quoteReady }: WalletSwapTopUpGasProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface WalletTradeFailedViewProps {
|
|
2
|
+
onEnd: () => void;
|
|
3
|
+
onShowActivity: () => void;
|
|
4
|
+
txDetails?: {
|
|
5
|
+
hash?: string;
|
|
6
|
+
blockExplorerUrl?: string;
|
|
7
|
+
blockExplorerName?: string;
|
|
8
|
+
};
|
|
9
|
+
reason?: string | null;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('react').NamedExoticComponent<WalletTradeFailedViewProps>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface WalletTradePendingViewProps {
|
|
2
|
+
onBack: () => void;
|
|
3
|
+
txDetails?: {
|
|
4
|
+
hash?: string;
|
|
5
|
+
blockExplorerUrl?: string;
|
|
6
|
+
blockExplorerName?: string;
|
|
7
|
+
estimatedTime?: number;
|
|
8
|
+
};
|
|
9
|
+
sellAmount: number;
|
|
10
|
+
buyAmount: number;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('react').NamedExoticComponent<WalletTradePendingViewProps>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface WalletSendFundSuccessViewProps {
|
|
2
|
+
onEnd: () => void;
|
|
3
|
+
onShowActivity: () => void;
|
|
4
|
+
sellAmount: number;
|
|
5
|
+
buyAmount: number;
|
|
6
|
+
txDetails?: {
|
|
7
|
+
hash?: string;
|
|
8
|
+
blockExplorerUrl?: string;
|
|
9
|
+
blockExplorerName?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('react').NamedExoticComponent<WalletSendFundSuccessViewProps>;
|
|
13
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INTERNAL_GRADIENT_TYPE } from '
|
|
1
|
+
import { INTERNAL_GRADIENT_TYPE } from '../../../lib/constants';
|
|
2
2
|
export declare const WidgetGradient: ({ gradientType }: {
|
|
3
3
|
gradientType: INTERNAL_GRADIENT_TYPE | undefined;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { paths } from '@relayprotocol/relay-sdk';
|
|
2
|
+
export type RelayAPIToken = paths["/currencies/v2"]["post"]["responses"]["200"]["content"]["application/json"][number];
|
|
3
|
+
export type GlyphSwapContextData = {
|
|
4
|
+
fromCurrency: RelayAPIToken | undefined;
|
|
5
|
+
toCurrency: RelayAPIToken | undefined;
|
|
6
|
+
tradeType: "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
7
|
+
amount: string;
|
|
8
|
+
topupGas: boolean;
|
|
9
|
+
topupGasAmount: string;
|
|
10
|
+
};
|
|
11
|
+
type GlyphSwapContextFns = {
|
|
12
|
+
update: (data: Partial<GlyphSwapContext>) => void;
|
|
13
|
+
reportSwapFailed: (id: string) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export type GlyphSwapContext = GlyphSwapContextData & GlyphSwapContextFns;
|
|
16
|
+
export declare const GlyphSwapContext: import('react').Context<GlyphSwapContext | undefined>;
|
|
17
|
+
export declare const useGlyphSwap: () => GlyphSwapContext;
|
|
18
|
+
export {};
|
|
@@ -4,7 +4,10 @@ interface GlyphUserDataContextType {
|
|
|
4
4
|
refreshUser: (force?: boolean) => Promise<void>;
|
|
5
5
|
balances: GlyphWidgetBalances | null;
|
|
6
6
|
hasBalances: boolean;
|
|
7
|
+
isBalancesLoading: boolean;
|
|
7
8
|
refreshBalances: (force?: boolean, cbs?: Record<string, (diffAmount: number) => void>) => Promise<void>;
|
|
9
|
+
setFetchForAllNetworks: (value: boolean) => void;
|
|
10
|
+
fetchForAllNetworks: boolean;
|
|
8
11
|
}
|
|
9
12
|
export declare const GlyphUserDataContext: import('react').Context<GlyphUserDataContextType | undefined>;
|
|
10
13
|
export {};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export declare const GlyphUserDataProvider: ({ children }: GlyphUserDataProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export {};
|
|
1
|
+
import { default as react, PropsWithChildren } from 'react';
|
|
2
|
+
export declare const GlyphUserDataProvider: react.FC<PropsWithChildren>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as react } from 'react';
|
|
2
2
|
import { BaseGlyphProviderOptionsWithSignature } from '../../types';
|
|
3
|
-
declare const EIP1193Strategy: FC<BaseGlyphProviderOptionsWithSignature>;
|
|
3
|
+
declare const EIP1193Strategy: react.FC<BaseGlyphProviderOptionsWithSignature>;
|
|
4
4
|
export default EIP1193Strategy;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { default as react, PropsWithChildren } from 'react';
|
|
2
|
+
declare const LoadingStrategy: react.FC<PropsWithChildren>;
|
|
4
3
|
export default LoadingStrategy;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as react } from 'react';
|
|
1
2
|
import { BaseGlyphProviderOptions } from '../../types';
|
|
2
|
-
declare const _default:
|
|
3
|
+
declare const _default: react.NamedExoticComponent<BaseGlyphProviderOptions>;
|
|
3
4
|
export default _default;
|
|
@@ -2,4 +2,7 @@ export declare function useBalances(): {
|
|
|
2
2
|
balances: import('../types').GlyphWidgetBalances | null;
|
|
3
3
|
hasBalances: boolean;
|
|
4
4
|
refreshBalances: (force?: boolean, cbs?: Record<string, (diffAmount: number) => void>) => Promise<void>;
|
|
5
|
+
fetchForAllNetworks: boolean;
|
|
6
|
+
setFetchForAllNetworks: (value: boolean) => void;
|
|
7
|
+
isBalancesLoading: boolean;
|
|
5
8
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { UnsignedTransactionRequest } from '@privy-io/react-auth';
|
|
2
|
-
import { Hex } from 'viem';
|
|
1
|
+
import { SignTypedDataParams, UnsignedTransactionRequest } from '@privy-io/react-auth';
|
|
3
2
|
import { GlyphWidgetBalances, GlyphWidgetUser } from '../types';
|
|
4
3
|
export interface GlyphInterface {
|
|
5
4
|
/**
|
|
@@ -20,12 +19,13 @@ export interface GlyphInterface {
|
|
|
20
19
|
hideWidget?: boolean;
|
|
21
20
|
signMessage: (params: {
|
|
22
21
|
message: string;
|
|
23
|
-
}) => Promise<
|
|
22
|
+
}) => Promise<string>;
|
|
23
|
+
signTypedData: (params: {
|
|
24
|
+
data: SignTypedDataParams;
|
|
25
|
+
}) => Promise<string>;
|
|
24
26
|
sendTransaction: (params: {
|
|
25
|
-
transaction:
|
|
26
|
-
}) => Promise<string
|
|
27
|
-
hash: Hex;
|
|
28
|
-
}>;
|
|
27
|
+
transaction: UnsignedTransactionRequest;
|
|
28
|
+
}) => Promise<string>;
|
|
29
29
|
login: () => void;
|
|
30
30
|
logout: () => void;
|
|
31
31
|
/**
|
|
@@ -51,6 +51,9 @@ export interface GlyphHook extends GlyphInterface {
|
|
|
51
51
|
* Whether the balances have been loaded (false on first load or when user just switched chains)
|
|
52
52
|
*/
|
|
53
53
|
hasBalances: boolean;
|
|
54
|
+
isBalancesLoading: boolean;
|
|
54
55
|
refreshBalances: (force?: boolean, cbs?: Record<string, (diffAmount: number) => void>) => Promise<void>;
|
|
56
|
+
setFetchForAllNetworks: (value: boolean) => void;
|
|
57
|
+
fetchForAllNetworks: boolean;
|
|
55
58
|
}
|
|
56
59
|
export declare const useGlyph: () => GlyphHook;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Chain } from 'viem';
|
|
2
|
+
interface UseGlyphRequiredChainsResult {
|
|
3
|
+
chainIds: [number, ...number[]] | undefined;
|
|
4
|
+
chains: [Chain, ...Chain[]];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Hook to fetch the list of required Glyph chain IDs (viem chain ids) from an API endpoint. SHOULD ONLY BE USED ONCE AT THE TOP LEVEL.
|
|
8
|
+
*
|
|
9
|
+
* @param glyphUrl - (optional) The URL of the Glyph API endpoint if need to override
|
|
10
|
+
*/
|
|
11
|
+
export declare const useGlyphConfigureDynamicChains: (glyphUrl?: string) => UseGlyphRequiredChainsResult;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Execute } from '@relayprotocol/relay-sdk';
|
|
2
|
+
export declare const useRelayExecute: () => import('@tanstack/react-query').UseMutationResult<{
|
|
3
|
+
requestId: string | undefined;
|
|
4
|
+
txnId: any;
|
|
5
|
+
result: {
|
|
6
|
+
data: Execute;
|
|
7
|
+
abortController: AbortController;
|
|
8
|
+
};
|
|
9
|
+
} | null, Error, Execute, unknown>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { SwapView } from '../lib/constants';
|
|
3
|
+
type TxDetails = {
|
|
4
|
+
hash: string;
|
|
5
|
+
blockExplorerName?: string;
|
|
6
|
+
blockExplorerUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
type UseRelayIntentStatusParams = {
|
|
9
|
+
intentRequestId: string | null;
|
|
10
|
+
setTxStatus: Dispatch<SetStateAction<"SUCCESS" | "FAILED" | "PENDING">>;
|
|
11
|
+
setView: Dispatch<SetStateAction<SwapView>>;
|
|
12
|
+
onError?: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare const useRelayIntentStatus: ({ intentRequestId, setTxStatus, setView, onError }: UseRelayIntentStatusParams) => {
|
|
15
|
+
error: string;
|
|
16
|
+
txDetails: TxDetails | undefined;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export declare const useRelayQuote: (enabled?: boolean) => {
|
|
2
|
+
appFeesWaived: boolean;
|
|
3
|
+
operation: string;
|
|
4
|
+
data: import('@relayprotocol/relay-sdk').Execute;
|
|
5
|
+
error: Error;
|
|
6
|
+
isError: true;
|
|
7
|
+
isPending: false;
|
|
8
|
+
isLoading: false;
|
|
9
|
+
isLoadingError: false;
|
|
10
|
+
isRefetchError: true;
|
|
11
|
+
isSuccess: false;
|
|
12
|
+
isPlaceholderData: false;
|
|
13
|
+
status: "error";
|
|
14
|
+
dataUpdatedAt: number;
|
|
15
|
+
errorUpdatedAt: number;
|
|
16
|
+
failureCount: number;
|
|
17
|
+
failureReason: Error | null;
|
|
18
|
+
errorUpdateCount: number;
|
|
19
|
+
isFetched: boolean;
|
|
20
|
+
isFetchedAfterMount: boolean;
|
|
21
|
+
isFetching: boolean;
|
|
22
|
+
isInitialLoading: boolean;
|
|
23
|
+
isPaused: boolean;
|
|
24
|
+
isRefetching: boolean;
|
|
25
|
+
isStale: boolean;
|
|
26
|
+
isEnabled: boolean;
|
|
27
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
28
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
29
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
30
|
+
} | {
|
|
31
|
+
appFeesWaived: boolean;
|
|
32
|
+
operation: string;
|
|
33
|
+
data: import('@relayprotocol/relay-sdk').Execute;
|
|
34
|
+
error: null;
|
|
35
|
+
isError: false;
|
|
36
|
+
isPending: false;
|
|
37
|
+
isLoading: false;
|
|
38
|
+
isLoadingError: false;
|
|
39
|
+
isRefetchError: false;
|
|
40
|
+
isSuccess: true;
|
|
41
|
+
isPlaceholderData: false;
|
|
42
|
+
status: "success";
|
|
43
|
+
dataUpdatedAt: number;
|
|
44
|
+
errorUpdatedAt: number;
|
|
45
|
+
failureCount: number;
|
|
46
|
+
failureReason: Error | null;
|
|
47
|
+
errorUpdateCount: number;
|
|
48
|
+
isFetched: boolean;
|
|
49
|
+
isFetchedAfterMount: boolean;
|
|
50
|
+
isFetching: boolean;
|
|
51
|
+
isInitialLoading: boolean;
|
|
52
|
+
isPaused: boolean;
|
|
53
|
+
isRefetching: boolean;
|
|
54
|
+
isStale: boolean;
|
|
55
|
+
isEnabled: boolean;
|
|
56
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
57
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
58
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
59
|
+
} | {
|
|
60
|
+
appFeesWaived: boolean;
|
|
61
|
+
operation: string;
|
|
62
|
+
data: undefined;
|
|
63
|
+
error: Error;
|
|
64
|
+
isError: true;
|
|
65
|
+
isPending: false;
|
|
66
|
+
isLoading: false;
|
|
67
|
+
isLoadingError: true;
|
|
68
|
+
isRefetchError: false;
|
|
69
|
+
isSuccess: false;
|
|
70
|
+
isPlaceholderData: false;
|
|
71
|
+
status: "error";
|
|
72
|
+
dataUpdatedAt: number;
|
|
73
|
+
errorUpdatedAt: number;
|
|
74
|
+
failureCount: number;
|
|
75
|
+
failureReason: Error | null;
|
|
76
|
+
errorUpdateCount: number;
|
|
77
|
+
isFetched: boolean;
|
|
78
|
+
isFetchedAfterMount: boolean;
|
|
79
|
+
isFetching: boolean;
|
|
80
|
+
isInitialLoading: boolean;
|
|
81
|
+
isPaused: boolean;
|
|
82
|
+
isRefetching: boolean;
|
|
83
|
+
isStale: boolean;
|
|
84
|
+
isEnabled: boolean;
|
|
85
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
86
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
87
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
88
|
+
} | {
|
|
89
|
+
appFeesWaived: boolean;
|
|
90
|
+
operation: string;
|
|
91
|
+
data: undefined;
|
|
92
|
+
error: null;
|
|
93
|
+
isError: false;
|
|
94
|
+
isPending: true;
|
|
95
|
+
isLoading: true;
|
|
96
|
+
isLoadingError: false;
|
|
97
|
+
isRefetchError: false;
|
|
98
|
+
isSuccess: false;
|
|
99
|
+
isPlaceholderData: false;
|
|
100
|
+
status: "pending";
|
|
101
|
+
dataUpdatedAt: number;
|
|
102
|
+
errorUpdatedAt: number;
|
|
103
|
+
failureCount: number;
|
|
104
|
+
failureReason: Error | null;
|
|
105
|
+
errorUpdateCount: number;
|
|
106
|
+
isFetched: boolean;
|
|
107
|
+
isFetchedAfterMount: boolean;
|
|
108
|
+
isFetching: boolean;
|
|
109
|
+
isInitialLoading: boolean;
|
|
110
|
+
isPaused: boolean;
|
|
111
|
+
isRefetching: boolean;
|
|
112
|
+
isStale: boolean;
|
|
113
|
+
isEnabled: boolean;
|
|
114
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
115
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
116
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
117
|
+
} | {
|
|
118
|
+
appFeesWaived: boolean;
|
|
119
|
+
operation: string;
|
|
120
|
+
data: undefined;
|
|
121
|
+
error: null;
|
|
122
|
+
isError: false;
|
|
123
|
+
isPending: true;
|
|
124
|
+
isLoadingError: false;
|
|
125
|
+
isRefetchError: false;
|
|
126
|
+
isSuccess: false;
|
|
127
|
+
isPlaceholderData: false;
|
|
128
|
+
status: "pending";
|
|
129
|
+
dataUpdatedAt: number;
|
|
130
|
+
errorUpdatedAt: number;
|
|
131
|
+
failureCount: number;
|
|
132
|
+
failureReason: Error | null;
|
|
133
|
+
errorUpdateCount: number;
|
|
134
|
+
isFetched: boolean;
|
|
135
|
+
isFetchedAfterMount: boolean;
|
|
136
|
+
isFetching: boolean;
|
|
137
|
+
isLoading: boolean;
|
|
138
|
+
isInitialLoading: boolean;
|
|
139
|
+
isPaused: boolean;
|
|
140
|
+
isRefetching: boolean;
|
|
141
|
+
isStale: boolean;
|
|
142
|
+
isEnabled: boolean;
|
|
143
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
144
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
145
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
146
|
+
} | {
|
|
147
|
+
appFeesWaived: boolean;
|
|
148
|
+
operation: string;
|
|
149
|
+
data: import('@relayprotocol/relay-sdk').Execute;
|
|
150
|
+
isError: false;
|
|
151
|
+
error: null;
|
|
152
|
+
isPending: false;
|
|
153
|
+
isLoading: false;
|
|
154
|
+
isLoadingError: false;
|
|
155
|
+
isRefetchError: false;
|
|
156
|
+
isSuccess: true;
|
|
157
|
+
isPlaceholderData: true;
|
|
158
|
+
status: "success";
|
|
159
|
+
dataUpdatedAt: number;
|
|
160
|
+
errorUpdatedAt: number;
|
|
161
|
+
failureCount: number;
|
|
162
|
+
failureReason: Error | null;
|
|
163
|
+
errorUpdateCount: number;
|
|
164
|
+
isFetched: boolean;
|
|
165
|
+
isFetchedAfterMount: boolean;
|
|
166
|
+
isFetching: boolean;
|
|
167
|
+
isInitialLoading: boolean;
|
|
168
|
+
isPaused: boolean;
|
|
169
|
+
isRefetching: boolean;
|
|
170
|
+
isStale: boolean;
|
|
171
|
+
isEnabled: boolean;
|
|
172
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import('@relayprotocol/relay-sdk').Execute, Error>>;
|
|
173
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
174
|
+
promise: Promise<import('@relayprotocol/relay-sdk').Execute>;
|
|
175
|
+
};
|