@lifi/widget 4.0.0-alpha.5 → 4.0.0-alpha.6
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/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/types/widget.d.ts +1 -1
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/package.json +3 -3
- package/src/config/version.ts +1 -1
- package/src/types/widget.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../../src/config/version.ts"],"sourcesContent":["export const name = '@lifi/widget'\nexport const version = '4.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../../src/config/version.ts"],"sourcesContent":["export const name = '@lifi/widget'\nexport const version = '4.0.0-alpha.6'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
|
@@ -119,7 +119,7 @@ interface WidgetWalletConfig {
|
|
|
119
119
|
*/
|
|
120
120
|
forceInternalWalletManagement?: boolean;
|
|
121
121
|
}
|
|
122
|
-
interface WidgetSDKConfig extends Omit<SDKConfig, "apiKey" | "disableVersionCheck" | "integrator" | "routeOptions" | "widgetVersion"> {
|
|
122
|
+
interface WidgetSDKConfig extends Omit<SDKConfig, "apiKey" | "disableVersionCheck" | "integrator" | "providers" | "routeOptions" | "widgetVersion"> {
|
|
123
123
|
routeOptions?: Omit<RouteOptions, "bridges" | "exchanges">;
|
|
124
124
|
executionOptions?: Pick<ExecutionOptions, "updateTransactionRequestHook">;
|
|
125
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","names":[],"sources":["../../../src/types/widget.ts"],"mappings":";;;;;;;;;;KAqCY,aAAA;AAAA,KACA,gBAAA;AAAA,KACA,eAAA;AAAA,KACA,sBAAA;EACV,UAAA,EAAY,e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AAA;AAAA,UAGO,wBAAA;EACf,MAAA,GAAS,OAAA,CAAQ,YAAA;AAAA;AAAA,KAGP,WAAA,GAAc,iBAAA,GACxB,YAAA,GACA,wBAAA,GACA,YAAA;AAAA,UAEe,iBAAA,SAA0B,wBAAA;EACzC,UAAA,GAAa,SAAA,CAAU,cAAA;EACvB,IAAA;;;;EAIA,OAAA;AAAA;AAAA,aAGU,aAAA;EACV,MAAA;EACA,SAAA;EACA,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","names":[],"sources":["../../../src/types/widget.ts"],"sourcesContent":["import type {\n BaseToken,\n ChainType,\n ContractCall,\n ExecutionOptions,\n ExtendedChain,\n Order,\n RouteExtended,\n RouteOptions,\n SDKConfig,\n StaticToken,\n Token,\n} from '@lifi/sdk'\nimport type { WalletMenuOpenArgs } from '@lifi/wallet-management'\nimport type { WidgetProviderProps } from '@lifi/widget-provider'\nimport type {\n Components,\n PaletteMode,\n PaletteOptions,\n Shape,\n SxProps,\n Theme,\n} from '@mui/material'\nimport type { TypographyVariantsOptions } from '@mui/material/styles'\nimport type {\n CSSProperties,\n FC,\n PropsWithChildren,\n ReactNode,\n RefObject,\n} from 'react'\nimport type {\n LanguageKey,\n LanguageResources,\n} from '../providers/I18nProvider/types.js'\nimport type { DefaultFieldValues } from '../stores/form/types.js'\n\nexport type WidgetVariant = 'compact' | 'wide' | 'drawer'\nexport type WidgetSubvariant = 'default' | 'split' | 'custom' | 'refuel'\nexport type SplitSubvariant = 'bridge' | 'swap'\nexport type SplitSubvariantOptions = {\n defaultTab: SplitSubvariant\n}\nexport type CustomSubvariant = 'checkout' | 'deposit'\nexport type WideSubvariant = {\n disableChainSidebar?: boolean\n}\nexport interface SubvariantOptions {\n /**\n * Configure split subvariant behavior:\n * - 'bridge' | 'swap': Single mode without tabs\n * - { defaultTab: 'bridge' | 'swap' }: Tabs mode with configurable default tab\n */\n split?: SplitSubvariant | SplitSubvariantOptions\n custom?: CustomSubvariant\n wide?: WideSubvariant\n}\n\nexport type Appearance = PaletteMode | 'system'\nexport interface NavigationProps {\n /**\n * If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.\n * @default true\n */\n edge?: boolean\n}\nexport type WidgetThemeComponents = Partial<\n Pick<\n Components<Theme>,\n | 'MuiAppBar'\n | 'MuiAvatar'\n | 'MuiButton'\n | 'MuiCard'\n | 'MuiIconButton'\n | 'MuiInputCard'\n | 'MuiNavigationTabs'\n | 'MuiNavigationTab'\n | 'MuiTabs'\n | 'MuiCheckbox'\n >\n>\n\nexport type WidgetTheme = {\n /**\n * @deprecated Use `colorScheme` instead.\n */\n palette?: PaletteOptions\n colorSchemes?: {\n light?: {\n palette: PaletteOptions\n }\n dark?: {\n palette: PaletteOptions\n }\n }\n shape?: Partial<Shape>\n typography?: TypographyVariantsOptions\n components?: WidgetThemeComponents\n container?: CSSProperties\n routesContainer?: CSSProperties\n chainSidebarContainer?: CSSProperties\n header?: CSSProperties\n navigation?: NavigationProps\n}\n\nexport enum DisabledUI {\n FromAmount = 'fromAmount',\n FromToken = 'fromToken',\n ToAddress = 'toAddress',\n ToToken = 'toToken',\n}\nexport type DisabledUIType = `${DisabledUI}`\n\nexport enum HiddenUI {\n Appearance = 'appearance',\n DrawerCloseButton = 'drawerCloseButton',\n History = 'history',\n Language = 'language',\n PoweredBy = 'poweredBy',\n ToAddress = 'toAddress',\n FromToken = 'fromToken',\n ToToken = 'toToken',\n WalletMenu = 'walletMenu',\n IntegratorStepDetails = 'integratorStepDetails',\n ReverseTokensButton = 'reverseTokensButton',\n RouteTokenDescription = 'routeTokenDescription',\n RouteCardPriceImpact = 'routeCardPriceImpact',\n ChainSelect = 'chainSelect',\n BridgesSettings = 'bridgesSettings',\n AddressBookConnectedWallets = 'addressBookConnectedWallets',\n LowAddressActivityConfirmation = 'lowAddressActivityConfirmation',\n GasRefuelMessage = 'gasRefuelMessage',\n SearchTokenInput = 'searchTokenInput',\n InsufficientGasMessage = 'insufficientGasMessage',\n ContactSupport = 'contactSupport',\n HideSmallBalances = 'hideSmallBalances',\n AllNetworks = 'allNetworks',\n}\nexport type HiddenUIType = `${HiddenUI}`\n\nexport enum RequiredUI {\n ToAddress = 'toAddress',\n AccountDeployedMessage = 'accountDeployedMessage',\n}\nexport type RequiredUIType = `${RequiredUI}`\n\nexport type DefaultUI = {\n transactionDetailsExpanded?: boolean\n navigationHeaderTitleNoWrap?: boolean\n}\n\nexport interface WidgetWalletConfig {\n walletEcosystemsOrder?: Record<string, ChainType[]>\n onConnect?(args?: WalletMenuOpenArgs): void\n /**\n * Determines whether the widget should provide partial wallet management functionality.\n *\n * In partial mode, external wallet management will be used for \"opt-out\" providers,\n * while the internal management is applied for any remaining providers that do not opt out.\n * This allows a flexible balance between the integrator's custom wallet menu and the widget's native wallet menu.\n * @default false\n */\n usePartialWalletManagement?: boolean\n /**\n * This option forces the widget to always use internal wallet management ignoring external wallet management contexts\n * @default false\n */\n forceInternalWalletManagement?: boolean\n}\n\nexport interface WidgetSDKConfig\n extends Omit<\n SDKConfig,\n | 'apiKey'\n | 'disableVersionCheck'\n | 'integrator'\n | 'routeOptions'\n | 'widgetVersion'\n > {\n routeOptions?: Omit<RouteOptions, 'bridges' | 'exchanges'>\n executionOptions?: Pick<ExecutionOptions, 'updateTransactionRequestHook'>\n}\n\nexport interface WidgetContractTool {\n name: string\n logoURI: string\n}\n\nexport interface CalculateFeeParams {\n fromChain: ExtendedChain\n toChain: ExtendedChain\n fromToken: Token\n toToken: Token\n fromAddress?: string\n toAddress?: string\n fromAmount?: bigint\n toAmount?: bigint\n slippage?: number\n}\n\nexport interface WidgetFeeConfig {\n name?: string\n logoURI?: string\n fee?: number\n /**\n * Whether to show the fee percentage in the fee details.\n * @default false\n */\n showFeePercentage?: boolean\n /**\n * Whether to show a tooltip with the fee details. Requires `name` or `feeTooltipComponent` to be set.\n * @default false\n */\n showFeeTooltip?: boolean\n /**\n * Custom tooltip component to show with the fee details.\n */\n feeTooltipComponent?: ReactNode\n /**\n * Function to calculate fees before fetching quotes.\n * If provided, this function will be used instead of the `fee` parameter.\n * Only one of `fee` or `calculateFee` should be used.\n *\n * @param params Object containing the fee calculation parameters\n * @returns A promise that resolves to the calculated fee as a number (e.g., 0.03 represents a 3% fee)\n */\n calculateFee?(params: CalculateFeeParams): Promise<number | undefined>\n /**\n * @internal\n */\n _vcComponent?: FC<{ route: RouteExtended }>\n}\n\nexport interface ToAddress {\n name?: string\n address: string\n chainType: ChainType\n logoURI?: string\n}\n\nexport interface AllowDeny<T> {\n allow?: T[]\n deny?: T[]\n}\n\nexport type AllowDenySetItem = string | number\nexport interface AllowDenySet {\n allow?: Set<AllowDenySetItem>\n deny?: Set<AllowDenySetItem>\n}\n\nexport type AllowDenySets = {\n from?: AllowDenySet\n to?: AllowDenySet\n} & AllowDenySet\n\nexport type AllowDenyItems<T> = {\n from?: AllowDeny<T>\n to?: AllowDeny<T>\n} & AllowDeny<T>\n\nexport type WidgetChains = {\n types?: AllowDeny<ChainType>\n} & AllowDenyItems<number>\n\nexport type WidgetTokens = {\n featured?: StaticToken[]\n include?: Token[]\n popular?: StaticToken[]\n} & AllowDenyItems<BaseToken>\n\nexport type WidgetLanguages = {\n default?: LanguageKey\n} & AllowDeny<LanguageKey>\n\nexport type PoweredByType = 'default' | 'jumper'\n\nexport interface RouteLabel {\n text: string\n sx?: SxProps<Theme>\n}\n\nexport interface RouteLabelRule {\n label: RouteLabel\n // Matching criteria\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n fromChainId?: number[]\n toChainId?: number[]\n fromTokenAddress?: string[]\n toTokenAddress?: string[]\n}\n\nexport type ExplorerUrl =\n | string\n | {\n url: string\n txPath?: string\n addressPath?: string\n }\n\nexport type WidgetProvider = (\n props: PropsWithChildren<WidgetProviderProps>\n) => ReactNode\n\nexport interface WidgetConfig {\n fromChain?: number\n toChain?: number\n fromToken?: string\n toToken?: string\n toAddress?: ToAddress\n toAddresses?: ToAddress[]\n fromAmount?: number | string\n minFromAmountUSD?: number\n toAmount?: number | string\n formUpdateKey?: string\n\n providers?: WidgetProvider[]\n\n contractCalls?: ContractCall[]\n contractComponent?: ReactNode\n contractSecondaryComponent?: ReactNode\n contractCompactComponent?: ReactNode\n contractTool?: WidgetContractTool\n integrator: string\n apiKey?: string\n fee?: number\n feeConfig?: WidgetFeeConfig\n referrer?: string\n\n routePriority?: Order\n slippage?: number\n\n variant?: WidgetVariant\n subvariant?: WidgetSubvariant\n subvariantOptions?: SubvariantOptions\n\n appearance?: Appearance\n theme?: WidgetTheme\n\n disabledUI?: DisabledUIType[]\n hiddenUI?: HiddenUIType[]\n requiredUI?: RequiredUIType[]\n defaultUI?: DefaultUI\n useRecommendedRoute?: boolean\n useRelayerRoutes?: boolean\n\n walletConfig?: WidgetWalletConfig\n sdkConfig?: WidgetSDKConfig\n\n buildUrl?: boolean\n keyPrefix?: string\n\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n chains?: WidgetChains\n tokens?: WidgetTokens\n languages?: WidgetLanguages\n languageResources?: LanguageResources\n explorerUrls?: Record<number, ExplorerUrl[]> &\n Partial<Record<'internal', ExplorerUrl[]>>\n poweredBy?: PoweredByType\n\n /**\n * Custom labels/badges to show on routes based on specified rules\n */\n routeLabels?: RouteLabelRule[]\n}\n\nexport interface FormFieldOptions {\n setUrlSearchParam: boolean\n}\n\nexport interface FieldValues\n extends Omit<DefaultFieldValues, 'fromAmount' | 'toAmount' | 'toAddress'> {\n fromAmount?: number | string\n toAmount?: number | string\n toAddress?: ToAddress | string\n}\n\nexport type FieldNames = keyof FieldValues\n\nexport type SetFieldValueFunction = <K extends FieldNames>(\n key: K,\n value: FieldValues[K],\n options?: FormFieldOptions\n) => void\n\nexport type FormState = {\n setFieldValue: SetFieldValueFunction\n}\n\nexport type FormRef = RefObject<FormState | null>\n\nexport interface FormRefProps {\n formRef?: FormRef\n}\n\nexport interface WidgetConfigProps extends FormRefProps {\n config: WidgetConfig\n}\n\nexport interface WidgetConfigPartialProps {\n config?: Partial<WidgetConfig>\n}\n\nexport type WidgetProps = WidgetDrawerProps &\n WidgetConfig &\n WidgetConfigPartialProps &\n FormRefProps\n\nexport interface WidgetDrawerProps extends WidgetConfigPartialProps {\n elementRef?: RefObject<HTMLDivElement>\n open?: boolean\n /**\n * Make sure to make the onClose callback stable (e.g. using useCallback) to avoid causing re-renders of the entire widget\n */\n onClose?(): void\n}\n\nexport enum ExpansionType {\n Routes = 'routes',\n FromChain = 'fromChain',\n ToChain = 'toChain',\n}\n"],"mappings":";AAyGA,IAAY,aAAL,yBAAA,YAAA;AACL,YAAA,gBAAA;AACA,YAAA,eAAA;AACA,YAAA,eAAA;AACA,YAAA,aAAA;;KACD;AAGD,IAAY,WAAL,yBAAA,UAAA;AACL,UAAA,gBAAA;AACA,UAAA,uBAAA;AACA,UAAA,aAAA;AACA,UAAA,cAAA;AACA,UAAA,eAAA;AACA,UAAA,eAAA;AACA,UAAA,eAAA;AACA,UAAA,aAAA;AACA,UAAA,gBAAA;AACA,UAAA,2BAAA;AACA,UAAA,yBAAA;AACA,UAAA,2BAAA;AACA,UAAA,0BAAA;AACA,UAAA,iBAAA;AACA,UAAA,qBAAA;AACA,UAAA,iCAAA;AACA,UAAA,oCAAA;AACA,UAAA,sBAAA;AACA,UAAA,sBAAA;AACA,UAAA,4BAAA;AACA,UAAA,oBAAA;AACA,UAAA,uBAAA;AACA,UAAA,iBAAA;;KACD;AAGD,IAAY,aAAL,yBAAA,YAAA;AACL,YAAA,eAAA;AACA,YAAA,4BAAA;;KACD;AAqRD,IAAY,gBAAL,yBAAA,eAAA;AACL,eAAA,YAAA;AACA,eAAA,eAAA;AACA,eAAA,aAAA;;KACD"}
|
|
1
|
+
{"version":3,"file":"widget.js","names":[],"sources":["../../../src/types/widget.ts"],"sourcesContent":["import type {\n BaseToken,\n ChainType,\n ContractCall,\n ExecutionOptions,\n ExtendedChain,\n Order,\n RouteExtended,\n RouteOptions,\n SDKConfig,\n StaticToken,\n Token,\n} from '@lifi/sdk'\nimport type { WalletMenuOpenArgs } from '@lifi/wallet-management'\nimport type { WidgetProviderProps } from '@lifi/widget-provider'\nimport type {\n Components,\n PaletteMode,\n PaletteOptions,\n Shape,\n SxProps,\n Theme,\n} from '@mui/material'\nimport type { TypographyVariantsOptions } from '@mui/material/styles'\nimport type {\n CSSProperties,\n FC,\n PropsWithChildren,\n ReactNode,\n RefObject,\n} from 'react'\nimport type {\n LanguageKey,\n LanguageResources,\n} from '../providers/I18nProvider/types.js'\nimport type { DefaultFieldValues } from '../stores/form/types.js'\n\nexport type WidgetVariant = 'compact' | 'wide' | 'drawer'\nexport type WidgetSubvariant = 'default' | 'split' | 'custom' | 'refuel'\nexport type SplitSubvariant = 'bridge' | 'swap'\nexport type SplitSubvariantOptions = {\n defaultTab: SplitSubvariant\n}\nexport type CustomSubvariant = 'checkout' | 'deposit'\nexport type WideSubvariant = {\n disableChainSidebar?: boolean\n}\nexport interface SubvariantOptions {\n /**\n * Configure split subvariant behavior:\n * - 'bridge' | 'swap': Single mode without tabs\n * - { defaultTab: 'bridge' | 'swap' }: Tabs mode with configurable default tab\n */\n split?: SplitSubvariant | SplitSubvariantOptions\n custom?: CustomSubvariant\n wide?: WideSubvariant\n}\n\nexport type Appearance = PaletteMode | 'system'\nexport interface NavigationProps {\n /**\n * If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.\n * @default true\n */\n edge?: boolean\n}\nexport type WidgetThemeComponents = Partial<\n Pick<\n Components<Theme>,\n | 'MuiAppBar'\n | 'MuiAvatar'\n | 'MuiButton'\n | 'MuiCard'\n | 'MuiIconButton'\n | 'MuiInputCard'\n | 'MuiNavigationTabs'\n | 'MuiNavigationTab'\n | 'MuiTabs'\n | 'MuiCheckbox'\n >\n>\n\nexport type WidgetTheme = {\n /**\n * @deprecated Use `colorScheme` instead.\n */\n palette?: PaletteOptions\n colorSchemes?: {\n light?: {\n palette: PaletteOptions\n }\n dark?: {\n palette: PaletteOptions\n }\n }\n shape?: Partial<Shape>\n typography?: TypographyVariantsOptions\n components?: WidgetThemeComponents\n container?: CSSProperties\n routesContainer?: CSSProperties\n chainSidebarContainer?: CSSProperties\n header?: CSSProperties\n navigation?: NavigationProps\n}\n\nexport enum DisabledUI {\n FromAmount = 'fromAmount',\n FromToken = 'fromToken',\n ToAddress = 'toAddress',\n ToToken = 'toToken',\n}\nexport type DisabledUIType = `${DisabledUI}`\n\nexport enum HiddenUI {\n Appearance = 'appearance',\n DrawerCloseButton = 'drawerCloseButton',\n History = 'history',\n Language = 'language',\n PoweredBy = 'poweredBy',\n ToAddress = 'toAddress',\n FromToken = 'fromToken',\n ToToken = 'toToken',\n WalletMenu = 'walletMenu',\n IntegratorStepDetails = 'integratorStepDetails',\n ReverseTokensButton = 'reverseTokensButton',\n RouteTokenDescription = 'routeTokenDescription',\n RouteCardPriceImpact = 'routeCardPriceImpact',\n ChainSelect = 'chainSelect',\n BridgesSettings = 'bridgesSettings',\n AddressBookConnectedWallets = 'addressBookConnectedWallets',\n LowAddressActivityConfirmation = 'lowAddressActivityConfirmation',\n GasRefuelMessage = 'gasRefuelMessage',\n SearchTokenInput = 'searchTokenInput',\n InsufficientGasMessage = 'insufficientGasMessage',\n ContactSupport = 'contactSupport',\n HideSmallBalances = 'hideSmallBalances',\n AllNetworks = 'allNetworks',\n}\nexport type HiddenUIType = `${HiddenUI}`\n\nexport enum RequiredUI {\n ToAddress = 'toAddress',\n AccountDeployedMessage = 'accountDeployedMessage',\n}\nexport type RequiredUIType = `${RequiredUI}`\n\nexport type DefaultUI = {\n transactionDetailsExpanded?: boolean\n navigationHeaderTitleNoWrap?: boolean\n}\n\nexport interface WidgetWalletConfig {\n walletEcosystemsOrder?: Record<string, ChainType[]>\n onConnect?(args?: WalletMenuOpenArgs): void\n /**\n * Determines whether the widget should provide partial wallet management functionality.\n *\n * In partial mode, external wallet management will be used for \"opt-out\" providers,\n * while the internal management is applied for any remaining providers that do not opt out.\n * This allows a flexible balance between the integrator's custom wallet menu and the widget's native wallet menu.\n * @default false\n */\n usePartialWalletManagement?: boolean\n /**\n * This option forces the widget to always use internal wallet management ignoring external wallet management contexts\n * @default false\n */\n forceInternalWalletManagement?: boolean\n}\n\nexport interface WidgetSDKConfig\n extends Omit<\n SDKConfig,\n | 'apiKey'\n | 'disableVersionCheck'\n | 'integrator'\n | 'providers'\n | 'routeOptions'\n | 'widgetVersion'\n > {\n routeOptions?: Omit<RouteOptions, 'bridges' | 'exchanges'>\n executionOptions?: Pick<ExecutionOptions, 'updateTransactionRequestHook'>\n}\n\nexport interface WidgetContractTool {\n name: string\n logoURI: string\n}\n\nexport interface CalculateFeeParams {\n fromChain: ExtendedChain\n toChain: ExtendedChain\n fromToken: Token\n toToken: Token\n fromAddress?: string\n toAddress?: string\n fromAmount?: bigint\n toAmount?: bigint\n slippage?: number\n}\n\nexport interface WidgetFeeConfig {\n name?: string\n logoURI?: string\n fee?: number\n /**\n * Whether to show the fee percentage in the fee details.\n * @default false\n */\n showFeePercentage?: boolean\n /**\n * Whether to show a tooltip with the fee details. Requires `name` or `feeTooltipComponent` to be set.\n * @default false\n */\n showFeeTooltip?: boolean\n /**\n * Custom tooltip component to show with the fee details.\n */\n feeTooltipComponent?: ReactNode\n /**\n * Function to calculate fees before fetching quotes.\n * If provided, this function will be used instead of the `fee` parameter.\n * Only one of `fee` or `calculateFee` should be used.\n *\n * @param params Object containing the fee calculation parameters\n * @returns A promise that resolves to the calculated fee as a number (e.g., 0.03 represents a 3% fee)\n */\n calculateFee?(params: CalculateFeeParams): Promise<number | undefined>\n /**\n * @internal\n */\n _vcComponent?: FC<{ route: RouteExtended }>\n}\n\nexport interface ToAddress {\n name?: string\n address: string\n chainType: ChainType\n logoURI?: string\n}\n\nexport interface AllowDeny<T> {\n allow?: T[]\n deny?: T[]\n}\n\nexport type AllowDenySetItem = string | number\nexport interface AllowDenySet {\n allow?: Set<AllowDenySetItem>\n deny?: Set<AllowDenySetItem>\n}\n\nexport type AllowDenySets = {\n from?: AllowDenySet\n to?: AllowDenySet\n} & AllowDenySet\n\nexport type AllowDenyItems<T> = {\n from?: AllowDeny<T>\n to?: AllowDeny<T>\n} & AllowDeny<T>\n\nexport type WidgetChains = {\n types?: AllowDeny<ChainType>\n} & AllowDenyItems<number>\n\nexport type WidgetTokens = {\n featured?: StaticToken[]\n include?: Token[]\n popular?: StaticToken[]\n} & AllowDenyItems<BaseToken>\n\nexport type WidgetLanguages = {\n default?: LanguageKey\n} & AllowDeny<LanguageKey>\n\nexport type PoweredByType = 'default' | 'jumper'\n\nexport interface RouteLabel {\n text: string\n sx?: SxProps<Theme>\n}\n\nexport interface RouteLabelRule {\n label: RouteLabel\n // Matching criteria\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n fromChainId?: number[]\n toChainId?: number[]\n fromTokenAddress?: string[]\n toTokenAddress?: string[]\n}\n\nexport type ExplorerUrl =\n | string\n | {\n url: string\n txPath?: string\n addressPath?: string\n }\n\nexport type WidgetProvider = (\n props: PropsWithChildren<WidgetProviderProps>\n) => ReactNode\n\nexport interface WidgetConfig {\n fromChain?: number\n toChain?: number\n fromToken?: string\n toToken?: string\n toAddress?: ToAddress\n toAddresses?: ToAddress[]\n fromAmount?: number | string\n minFromAmountUSD?: number\n toAmount?: number | string\n formUpdateKey?: string\n\n providers?: WidgetProvider[]\n\n contractCalls?: ContractCall[]\n contractComponent?: ReactNode\n contractSecondaryComponent?: ReactNode\n contractCompactComponent?: ReactNode\n contractTool?: WidgetContractTool\n integrator: string\n apiKey?: string\n fee?: number\n feeConfig?: WidgetFeeConfig\n referrer?: string\n\n routePriority?: Order\n slippage?: number\n\n variant?: WidgetVariant\n subvariant?: WidgetSubvariant\n subvariantOptions?: SubvariantOptions\n\n appearance?: Appearance\n theme?: WidgetTheme\n\n disabledUI?: DisabledUIType[]\n hiddenUI?: HiddenUIType[]\n requiredUI?: RequiredUIType[]\n defaultUI?: DefaultUI\n useRecommendedRoute?: boolean\n useRelayerRoutes?: boolean\n\n walletConfig?: WidgetWalletConfig\n sdkConfig?: WidgetSDKConfig\n\n buildUrl?: boolean\n keyPrefix?: string\n\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n chains?: WidgetChains\n tokens?: WidgetTokens\n languages?: WidgetLanguages\n languageResources?: LanguageResources\n explorerUrls?: Record<number, ExplorerUrl[]> &\n Partial<Record<'internal', ExplorerUrl[]>>\n poweredBy?: PoweredByType\n\n /**\n * Custom labels/badges to show on routes based on specified rules\n */\n routeLabels?: RouteLabelRule[]\n}\n\nexport interface FormFieldOptions {\n setUrlSearchParam: boolean\n}\n\nexport interface FieldValues\n extends Omit<DefaultFieldValues, 'fromAmount' | 'toAmount' | 'toAddress'> {\n fromAmount?: number | string\n toAmount?: number | string\n toAddress?: ToAddress | string\n}\n\nexport type FieldNames = keyof FieldValues\n\nexport type SetFieldValueFunction = <K extends FieldNames>(\n key: K,\n value: FieldValues[K],\n options?: FormFieldOptions\n) => void\n\nexport type FormState = {\n setFieldValue: SetFieldValueFunction\n}\n\nexport type FormRef = RefObject<FormState | null>\n\nexport interface FormRefProps {\n formRef?: FormRef\n}\n\nexport interface WidgetConfigProps extends FormRefProps {\n config: WidgetConfig\n}\n\nexport interface WidgetConfigPartialProps {\n config?: Partial<WidgetConfig>\n}\n\nexport type WidgetProps = WidgetDrawerProps &\n WidgetConfig &\n WidgetConfigPartialProps &\n FormRefProps\n\nexport interface WidgetDrawerProps extends WidgetConfigPartialProps {\n elementRef?: RefObject<HTMLDivElement>\n open?: boolean\n /**\n * Make sure to make the onClose callback stable (e.g. using useCallback) to avoid causing re-renders of the entire widget\n */\n onClose?(): void\n}\n\nexport enum ExpansionType {\n Routes = 'routes',\n FromChain = 'fromChain',\n ToChain = 'toChain',\n}\n"],"mappings":";AAyGA,IAAY,aAAL,yBAAA,YAAA;AACL,YAAA,gBAAA;AACA,YAAA,eAAA;AACA,YAAA,eAAA;AACA,YAAA,aAAA;;KACD;AAGD,IAAY,WAAL,yBAAA,UAAA;AACL,UAAA,gBAAA;AACA,UAAA,uBAAA;AACA,UAAA,aAAA;AACA,UAAA,cAAA;AACA,UAAA,eAAA;AACA,UAAA,eAAA;AACA,UAAA,eAAA;AACA,UAAA,aAAA;AACA,UAAA,gBAAA;AACA,UAAA,2BAAA;AACA,UAAA,yBAAA;AACA,UAAA,2BAAA;AACA,UAAA,0BAAA;AACA,UAAA,iBAAA;AACA,UAAA,qBAAA;AACA,UAAA,iCAAA;AACA,UAAA,oCAAA;AACA,UAAA,sBAAA;AACA,UAAA,sBAAA;AACA,UAAA,4BAAA;AACA,UAAA,oBAAA;AACA,UAAA,uBAAA;AACA,UAAA,iBAAA;;KACD;AAGD,IAAY,aAAL,yBAAA,YAAA;AACL,YAAA,eAAA;AACA,YAAA,4BAAA;;KACD;AAsRD,IAAY,gBAAL,yBAAA,eAAA;AACL,eAAA,YAAA;AACA,eAAA,eAAA;AACA,eAAA,aAAA;;KACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.6",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"react-intersection-observer": "^10.0.3",
|
|
48
48
|
"react-transition-group": "^4.4.5",
|
|
49
49
|
"zustand": "^5.0.12",
|
|
50
|
-
"@lifi/
|
|
51
|
-
"@lifi/
|
|
50
|
+
"@lifi/wallet-management": "4.0.0-alpha.6",
|
|
51
|
+
"@lifi/widget-provider": "4.0.0-alpha.6"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@tanstack/react-query": ">=5.90.0",
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '4.0.0-alpha.
|
|
2
|
+
export const version = '4.0.0-alpha.6'
|