@naculus/connect-appkit-react 0.1.9 → 0.2.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.
- package/README.md +4 -4
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +144 -0
- package/dist/client.d.ts +144 -0
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2270 -0
- package/dist/index.d.ts +2270 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +30 -12
- package/api-extractor.json +0 -21
- package/src/chain-abstraction/index.ts +0 -8
- package/src/chain-abstraction/useCompareCosts.ts +0 -137
- package/src/chain-abstraction/useExecuteRoute.ts +0 -129
- package/src/chain-abstraction/useRouteQuote.ts +0 -168
- package/src/client.test.ts +0 -242
- package/src/client.ts +0 -265
- package/src/hooks/useAccount.test.ts +0 -67
- package/src/hooks/useAccount.ts +0 -37
- package/src/hooks/useBalance.test.ts +0 -459
- package/src/hooks/useBalance.ts +0 -170
- package/src/hooks/useChain.test.ts +0 -160
- package/src/hooks/useChain.ts +0 -53
- package/src/hooks/useConnect.test.ts +0 -112
- package/src/hooks/useConnect.ts +0 -29
- package/src/hooks/useDisconnect.test.ts +0 -75
- package/src/hooks/useDisconnect.ts +0 -32
- package/src/hooks/useERC20Allowance.ts +0 -93
- package/src/hooks/useERC20Approve.ts +0 -220
- package/src/hooks/useERC20Transfer.ts +0 -134
- package/src/hooks/useERC20TransferSimulation.ts +0 -147
- package/src/hooks/useEmbeddedWallet.test.ts +0 -266
- package/src/hooks/useEmbeddedWallet.ts +0 -181
- package/src/hooks/useLastTx.test.ts +0 -117
- package/src/hooks/useLastTx.ts +0 -73
- package/src/hooks/useLookupAddress.ts +0 -131
- package/src/hooks/useNotification.ts +0 -308
- package/src/hooks/useResolveName.ts +0 -128
- package/src/hooks/useSIWxLogin.test.ts +0 -307
- package/src/hooks/useSIWxLogin.ts +0 -163
- package/src/hooks/useSIWxSession.test.ts +0 -481
- package/src/hooks/useSIWxSession.ts +0 -290
- package/src/hooks/useSendCalls.ts +0 -103
- package/src/hooks/useSendTransaction.test.ts +0 -175
- package/src/hooks/useSendTransaction.ts +0 -80
- package/src/hooks/useSendUserOperation.ts +0 -313
- package/src/hooks/useSession.ts +0 -96
- package/src/hooks/useSessionKeys.ts +0 -356
- package/src/hooks/useSignInWithEthereum.test.ts +0 -224
- package/src/hooks/useSignInWithEthereum.ts +0 -46
- package/src/hooks/useSignInWithX.test.ts +0 -210
- package/src/hooks/useSignInWithX.ts +0 -141
- package/src/hooks/useSignMessage.test.ts +0 -151
- package/src/hooks/useSignMessage.ts +0 -65
- package/src/hooks/useSimulateTransfer.ts +0 -165
- package/src/hooks/useSiwxAuthSession.test.ts +0 -456
- package/src/hooks/useSiwxAuthSession.ts +0 -163
- package/src/hooks/useSmartAccount.ts +0 -194
- package/src/hooks/useSwitchChain.ts +0 -68
- package/src/hooks/useTokenBalance.test.ts +0 -337
- package/src/hooks/useTokenBalance.ts +0 -210
- package/src/hooks/useTransactionSimulation.ts +0 -401
- package/src/hooks/useTxHistory.test.ts +0 -108
- package/src/hooks/useTxHistory.ts +0 -83
- package/src/hooks/useTxMonitor.test.ts +0 -127
- package/src/hooks/useTxMonitor.ts +0 -178
- package/src/hooks/useUserOpStatus.ts +0 -245
- package/src/hooks/useValidateDestination.test.ts +0 -96
- package/src/hooks/useValidateDestination.ts +0 -72
- package/src/hooks/useViemClient.test.ts +0 -155
- package/src/hooks/useViemClient.ts +0 -65
- package/src/hooks/useWallet.test.ts +0 -133
- package/src/hooks/useWallet.ts +0 -39
- package/src/hooks/useWeb3ErrorHandler.ts +0 -102
- package/src/index.ts +0 -186
- package/src/provider/Web3ConnectProvider.test.tsx +0 -178
- package/src/provider/Web3ConnectProvider.tsx +0 -530
- package/src/token-list/TokenSelector.tsx +0 -351
- package/src/token-list/defaults.ts +0 -39
- package/src/token-list/index.ts +0 -14
- package/src/token-list/useTokenList.ts +0 -119
- package/src/token-list/useTokenSearch.ts +0 -99
- package/src/types/index.ts +0 -99
- package/src/utils/chains.ts +0 -115
- package/src/utils/errorMessages.ts +0 -142
- package/src/utils/i18n.ts +0 -90
- package/src/wc-generated/components.ts +0 -377
- package/test/setup.ts +0 -17
- package/test/test-utils.tsx +0 -78
- package/tsup.config.ts +0 -18
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This file was automatically generated by the Stencil React Output Target.
|
|
5
|
-
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/* eslint-disable */
|
|
9
|
-
|
|
10
|
-
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
11
|
-
import { createComponent } from '@stencil/react-output-target/runtime';
|
|
12
|
-
import React from 'react';
|
|
13
|
-
|
|
14
|
-
import { type AppkitAccordionCustomEvent, type AppkitAlertDialogCustomEvent, type AppkitCheckboxCustomEvent, type AppkitCollapsibleCustomEvent, type AppkitConnectButtonCustomEvent, type AppkitDialogCustomEvent, type AppkitDropdownMenuCustomEvent, type AppkitInputCustomEvent, type AppkitPopoverCustomEvent, type AppkitSelectCustomEvent, type AppkitSwitchCustomEvent, type AppkitTabsCustomEvent, type AppkitToggleGroupCustomEvent } from "@naculus/connect-appkit-wc";
|
|
15
|
-
import type { Components } from "@naculus/connect-appkit-wc/dist/components";
|
|
16
|
-
import { AppkitAccordion as AppkitAccordionElement, defineCustomElement as defineAppkitAccordion } from "@naculus/connect-appkit-wc/dist/components/appkit-accordion.js";
|
|
17
|
-
import { AppkitAccountButton as AppkitAccountButtonElement, defineCustomElement as defineAppkitAccountButton } from "@naculus/connect-appkit-wc/dist/components/appkit-account-button.js";
|
|
18
|
-
import { AppkitAlertDialog as AppkitAlertDialogElement, defineCustomElement as defineAppkitAlertDialog } from "@naculus/connect-appkit-wc/dist/components/appkit-alert-dialog.js";
|
|
19
|
-
import { AppkitAvatar as AppkitAvatarElement, defineCustomElement as defineAppkitAvatar } from "@naculus/connect-appkit-wc/dist/components/appkit-avatar.js";
|
|
20
|
-
import { AppkitBadge as AppkitBadgeElement, defineCustomElement as defineAppkitBadge } from "@naculus/connect-appkit-wc/dist/components/appkit-badge.js";
|
|
21
|
-
import { AppkitButton as AppkitButtonElement, defineCustomElement as defineAppkitButton } from "@naculus/connect-appkit-wc/dist/components/appkit-button.js";
|
|
22
|
-
import { AppkitCardContent as AppkitCardContentElement, defineCustomElement as defineAppkitCardContent } from "@naculus/connect-appkit-wc/dist/components/appkit-card-content.js";
|
|
23
|
-
import { AppkitCardDescription as AppkitCardDescriptionElement, defineCustomElement as defineAppkitCardDescription } from "@naculus/connect-appkit-wc/dist/components/appkit-card-description.js";
|
|
24
|
-
import { AppkitCardFooter as AppkitCardFooterElement, defineCustomElement as defineAppkitCardFooter } from "@naculus/connect-appkit-wc/dist/components/appkit-card-footer.js";
|
|
25
|
-
import { AppkitCardHeader as AppkitCardHeaderElement, defineCustomElement as defineAppkitCardHeader } from "@naculus/connect-appkit-wc/dist/components/appkit-card-header.js";
|
|
26
|
-
import { AppkitCardTitle as AppkitCardTitleElement, defineCustomElement as defineAppkitCardTitle } from "@naculus/connect-appkit-wc/dist/components/appkit-card-title.js";
|
|
27
|
-
import { AppkitCard as AppkitCardElement, defineCustomElement as defineAppkitCard } from "@naculus/connect-appkit-wc/dist/components/appkit-card.js";
|
|
28
|
-
import { AppkitCheckbox as AppkitCheckboxElement, defineCustomElement as defineAppkitCheckbox } from "@naculus/connect-appkit-wc/dist/components/appkit-checkbox.js";
|
|
29
|
-
import { AppkitCollapsible as AppkitCollapsibleElement, defineCustomElement as defineAppkitCollapsible } from "@naculus/connect-appkit-wc/dist/components/appkit-collapsible.js";
|
|
30
|
-
import { AppkitConnectButton as AppkitConnectButtonElement, defineCustomElement as defineAppkitConnectButton } from "@naculus/connect-appkit-wc/dist/components/appkit-connect-button.js";
|
|
31
|
-
import { AppkitDialog as AppkitDialogElement, defineCustomElement as defineAppkitDialog } from "@naculus/connect-appkit-wc/dist/components/appkit-dialog.js";
|
|
32
|
-
import { AppkitDropdownMenu as AppkitDropdownMenuElement, defineCustomElement as defineAppkitDropdownMenu } from "@naculus/connect-appkit-wc/dist/components/appkit-dropdown-menu.js";
|
|
33
|
-
import { AppkitInput as AppkitInputElement, defineCustomElement as defineAppkitInput } from "@naculus/connect-appkit-wc/dist/components/appkit-input.js";
|
|
34
|
-
import { AppkitPopover as AppkitPopoverElement, defineCustomElement as defineAppkitPopover } from "@naculus/connect-appkit-wc/dist/components/appkit-popover.js";
|
|
35
|
-
import { AppkitProgress as AppkitProgressElement, defineCustomElement as defineAppkitProgress } from "@naculus/connect-appkit-wc/dist/components/appkit-progress.js";
|
|
36
|
-
import { AppkitScrollArea as AppkitScrollAreaElement, defineCustomElement as defineAppkitScrollArea } from "@naculus/connect-appkit-wc/dist/components/appkit-scroll-area.js";
|
|
37
|
-
import { AppkitSelect as AppkitSelectElement, defineCustomElement as defineAppkitSelect } from "@naculus/connect-appkit-wc/dist/components/appkit-select.js";
|
|
38
|
-
import { AppkitSeparator as AppkitSeparatorElement, defineCustomElement as defineAppkitSeparator } from "@naculus/connect-appkit-wc/dist/components/appkit-separator.js";
|
|
39
|
-
import { AppkitSkeleton as AppkitSkeletonElement, defineCustomElement as defineAppkitSkeleton } from "@naculus/connect-appkit-wc/dist/components/appkit-skeleton.js";
|
|
40
|
-
import { AppkitSwitch as AppkitSwitchElement, defineCustomElement as defineAppkitSwitch } from "@naculus/connect-appkit-wc/dist/components/appkit-switch.js";
|
|
41
|
-
import { AppkitTabs as AppkitTabsElement, defineCustomElement as defineAppkitTabs } from "@naculus/connect-appkit-wc/dist/components/appkit-tabs.js";
|
|
42
|
-
import { AppkitToggleGroup as AppkitToggleGroupElement, defineCustomElement as defineAppkitToggleGroup } from "@naculus/connect-appkit-wc/dist/components/appkit-toggle-group.js";
|
|
43
|
-
import { AppkitTooltip as AppkitTooltipElement, defineCustomElement as defineAppkitTooltip } from "@naculus/connect-appkit-wc/dist/components/appkit-tooltip.js";
|
|
44
|
-
|
|
45
|
-
export type AppkitAccordionEvents = { onAppkitToggle: EventName<AppkitAccordionCustomEvent<boolean>> };
|
|
46
|
-
|
|
47
|
-
export const AppkitAccordion: StencilReactComponent<AppkitAccordionElement, AppkitAccordionEvents, Components.AppkitAccordion> = /*@__PURE__*/ createComponent<AppkitAccordionElement, AppkitAccordionEvents, Components.AppkitAccordion>({
|
|
48
|
-
tagName: 'appkit-accordion',
|
|
49
|
-
elementClass: AppkitAccordionElement,
|
|
50
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
51
|
-
react: React,
|
|
52
|
-
events: { onAppkitToggle: 'appkitToggle' } as AppkitAccordionEvents,
|
|
53
|
-
defineCustomElement: defineAppkitAccordion
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export type AppkitAccountButtonEvents = NonNullable<unknown>;
|
|
57
|
-
|
|
58
|
-
export const AppkitAccountButton: StencilReactComponent<AppkitAccountButtonElement, AppkitAccountButtonEvents, Components.AppkitAccountButton> = /*@__PURE__*/ createComponent<AppkitAccountButtonElement, AppkitAccountButtonEvents, Components.AppkitAccountButton>({
|
|
59
|
-
tagName: 'appkit-account-button',
|
|
60
|
-
elementClass: AppkitAccountButtonElement,
|
|
61
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
62
|
-
react: React,
|
|
63
|
-
events: {} as AppkitAccountButtonEvents,
|
|
64
|
-
defineCustomElement: defineAppkitAccountButton
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export type AppkitAlertDialogEvents = {
|
|
68
|
-
onAppkitClose: EventName<AppkitAlertDialogCustomEvent<void>>,
|
|
69
|
-
onAppkitOpenChange: EventName<AppkitAlertDialogCustomEvent<boolean>>
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const AppkitAlertDialog: StencilReactComponent<AppkitAlertDialogElement, AppkitAlertDialogEvents, Components.AppkitAlertDialog> = /*@__PURE__*/ createComponent<AppkitAlertDialogElement, AppkitAlertDialogEvents, Components.AppkitAlertDialog>({
|
|
73
|
-
tagName: 'appkit-alert-dialog',
|
|
74
|
-
elementClass: AppkitAlertDialogElement,
|
|
75
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
76
|
-
react: React,
|
|
77
|
-
events: {
|
|
78
|
-
onAppkitClose: 'appkitClose',
|
|
79
|
-
onAppkitOpenChange: 'appkitOpenChange'
|
|
80
|
-
} as AppkitAlertDialogEvents,
|
|
81
|
-
defineCustomElement: defineAppkitAlertDialog
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
export type AppkitAvatarEvents = NonNullable<unknown>;
|
|
85
|
-
|
|
86
|
-
export const AppkitAvatar: StencilReactComponent<AppkitAvatarElement, AppkitAvatarEvents, Components.AppkitAvatar> = /*@__PURE__*/ createComponent<AppkitAvatarElement, AppkitAvatarEvents, Components.AppkitAvatar>({
|
|
87
|
-
tagName: 'appkit-avatar',
|
|
88
|
-
elementClass: AppkitAvatarElement,
|
|
89
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
90
|
-
react: React,
|
|
91
|
-
events: {} as AppkitAvatarEvents,
|
|
92
|
-
defineCustomElement: defineAppkitAvatar
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export type AppkitBadgeEvents = NonNullable<unknown>;
|
|
96
|
-
|
|
97
|
-
export const AppkitBadge: StencilReactComponent<AppkitBadgeElement, AppkitBadgeEvents, Components.AppkitBadge> = /*@__PURE__*/ createComponent<AppkitBadgeElement, AppkitBadgeEvents, Components.AppkitBadge>({
|
|
98
|
-
tagName: 'appkit-badge',
|
|
99
|
-
elementClass: AppkitBadgeElement,
|
|
100
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
101
|
-
react: React,
|
|
102
|
-
events: {} as AppkitBadgeEvents,
|
|
103
|
-
defineCustomElement: defineAppkitBadge
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
export type AppkitButtonEvents = NonNullable<unknown>;
|
|
107
|
-
|
|
108
|
-
export const AppkitButton: StencilReactComponent<AppkitButtonElement, AppkitButtonEvents, Components.AppkitButton> = /*@__PURE__*/ createComponent<AppkitButtonElement, AppkitButtonEvents, Components.AppkitButton>({
|
|
109
|
-
tagName: 'appkit-button',
|
|
110
|
-
elementClass: AppkitButtonElement,
|
|
111
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
112
|
-
react: React,
|
|
113
|
-
events: {} as AppkitButtonEvents,
|
|
114
|
-
defineCustomElement: defineAppkitButton
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export type AppkitCardEvents = NonNullable<unknown>;
|
|
118
|
-
|
|
119
|
-
export const AppkitCard: StencilReactComponent<AppkitCardElement, AppkitCardEvents, Components.AppkitCard> = /*@__PURE__*/ createComponent<AppkitCardElement, AppkitCardEvents, Components.AppkitCard>({
|
|
120
|
-
tagName: 'appkit-card',
|
|
121
|
-
elementClass: AppkitCardElement,
|
|
122
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
123
|
-
react: React,
|
|
124
|
-
events: {} as AppkitCardEvents,
|
|
125
|
-
defineCustomElement: defineAppkitCard
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export type AppkitCardContentEvents = NonNullable<unknown>;
|
|
129
|
-
|
|
130
|
-
export const AppkitCardContent: StencilReactComponent<AppkitCardContentElement, AppkitCardContentEvents, Components.AppkitCardContent> = /*@__PURE__*/ createComponent<AppkitCardContentElement, AppkitCardContentEvents, Components.AppkitCardContent>({
|
|
131
|
-
tagName: 'appkit-card-content',
|
|
132
|
-
elementClass: AppkitCardContentElement,
|
|
133
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
134
|
-
react: React,
|
|
135
|
-
events: {} as AppkitCardContentEvents,
|
|
136
|
-
defineCustomElement: defineAppkitCardContent
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
export type AppkitCardDescriptionEvents = NonNullable<unknown>;
|
|
140
|
-
|
|
141
|
-
export const AppkitCardDescription: StencilReactComponent<AppkitCardDescriptionElement, AppkitCardDescriptionEvents, Components.AppkitCardDescription> = /*@__PURE__*/ createComponent<AppkitCardDescriptionElement, AppkitCardDescriptionEvents, Components.AppkitCardDescription>({
|
|
142
|
-
tagName: 'appkit-card-description',
|
|
143
|
-
elementClass: AppkitCardDescriptionElement,
|
|
144
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
145
|
-
react: React,
|
|
146
|
-
events: {} as AppkitCardDescriptionEvents,
|
|
147
|
-
defineCustomElement: defineAppkitCardDescription
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
export type AppkitCardFooterEvents = NonNullable<unknown>;
|
|
151
|
-
|
|
152
|
-
export const AppkitCardFooter: StencilReactComponent<AppkitCardFooterElement, AppkitCardFooterEvents, Components.AppkitCardFooter> = /*@__PURE__*/ createComponent<AppkitCardFooterElement, AppkitCardFooterEvents, Components.AppkitCardFooter>({
|
|
153
|
-
tagName: 'appkit-card-footer',
|
|
154
|
-
elementClass: AppkitCardFooterElement,
|
|
155
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
156
|
-
react: React,
|
|
157
|
-
events: {} as AppkitCardFooterEvents,
|
|
158
|
-
defineCustomElement: defineAppkitCardFooter
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
export type AppkitCardHeaderEvents = NonNullable<unknown>;
|
|
162
|
-
|
|
163
|
-
export const AppkitCardHeader: StencilReactComponent<AppkitCardHeaderElement, AppkitCardHeaderEvents, Components.AppkitCardHeader> = /*@__PURE__*/ createComponent<AppkitCardHeaderElement, AppkitCardHeaderEvents, Components.AppkitCardHeader>({
|
|
164
|
-
tagName: 'appkit-card-header',
|
|
165
|
-
elementClass: AppkitCardHeaderElement,
|
|
166
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
167
|
-
react: React,
|
|
168
|
-
events: {} as AppkitCardHeaderEvents,
|
|
169
|
-
defineCustomElement: defineAppkitCardHeader
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
export type AppkitCardTitleEvents = NonNullable<unknown>;
|
|
173
|
-
|
|
174
|
-
export const AppkitCardTitle: StencilReactComponent<AppkitCardTitleElement, AppkitCardTitleEvents, Components.AppkitCardTitle> = /*@__PURE__*/ createComponent<AppkitCardTitleElement, AppkitCardTitleEvents, Components.AppkitCardTitle>({
|
|
175
|
-
tagName: 'appkit-card-title',
|
|
176
|
-
elementClass: AppkitCardTitleElement,
|
|
177
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
178
|
-
react: React,
|
|
179
|
-
events: {} as AppkitCardTitleEvents,
|
|
180
|
-
defineCustomElement: defineAppkitCardTitle
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
export type AppkitCheckboxEvents = { onAppkitChange: EventName<AppkitCheckboxCustomEvent<boolean>> };
|
|
184
|
-
|
|
185
|
-
export const AppkitCheckbox: StencilReactComponent<AppkitCheckboxElement, AppkitCheckboxEvents, Components.AppkitCheckbox> = /*@__PURE__*/ createComponent<AppkitCheckboxElement, AppkitCheckboxEvents, Components.AppkitCheckbox>({
|
|
186
|
-
tagName: 'appkit-checkbox',
|
|
187
|
-
elementClass: AppkitCheckboxElement,
|
|
188
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
189
|
-
react: React,
|
|
190
|
-
events: { onAppkitChange: 'appkitChange' } as AppkitCheckboxEvents,
|
|
191
|
-
defineCustomElement: defineAppkitCheckbox
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
export type AppkitCollapsibleEvents = { onAppkitToggle: EventName<AppkitCollapsibleCustomEvent<boolean>> };
|
|
195
|
-
|
|
196
|
-
export const AppkitCollapsible: StencilReactComponent<AppkitCollapsibleElement, AppkitCollapsibleEvents, Components.AppkitCollapsible> = /*@__PURE__*/ createComponent<AppkitCollapsibleElement, AppkitCollapsibleEvents, Components.AppkitCollapsible>({
|
|
197
|
-
tagName: 'appkit-collapsible',
|
|
198
|
-
elementClass: AppkitCollapsibleElement,
|
|
199
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
200
|
-
react: React,
|
|
201
|
-
events: { onAppkitToggle: 'appkitToggle' } as AppkitCollapsibleEvents,
|
|
202
|
-
defineCustomElement: defineAppkitCollapsible
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
export type AppkitConnectButtonEvents = {
|
|
206
|
-
onAppkitConnect: EventName<AppkitConnectButtonCustomEvent<{ kind: string; walletId?: string }>>,
|
|
207
|
-
onAppkitDisconnect: EventName<AppkitConnectButtonCustomEvent<void>>,
|
|
208
|
-
onAppkitStartPairing: EventName<AppkitConnectButtonCustomEvent<void>>,
|
|
209
|
-
onAppkitRetry: EventName<AppkitConnectButtonCustomEvent<void>>,
|
|
210
|
-
onAppkitMobileDeepLink: EventName<AppkitConnectButtonCustomEvent<void>>,
|
|
211
|
-
onAppkitCopyAddress: EventName<AppkitConnectButtonCustomEvent<string>>
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export const AppkitConnectButton: StencilReactComponent<AppkitConnectButtonElement, AppkitConnectButtonEvents, Components.AppkitConnectButton> = /*@__PURE__*/ createComponent<AppkitConnectButtonElement, AppkitConnectButtonEvents, Components.AppkitConnectButton>({
|
|
215
|
-
tagName: 'appkit-connect-button',
|
|
216
|
-
elementClass: AppkitConnectButtonElement,
|
|
217
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
218
|
-
react: React,
|
|
219
|
-
events: {
|
|
220
|
-
onAppkitConnect: 'appkitConnect',
|
|
221
|
-
onAppkitDisconnect: 'appkitDisconnect',
|
|
222
|
-
onAppkitStartPairing: 'appkitStartPairing',
|
|
223
|
-
onAppkitRetry: 'appkitRetry',
|
|
224
|
-
onAppkitMobileDeepLink: 'appkitMobileDeepLink',
|
|
225
|
-
onAppkitCopyAddress: 'appkitCopyAddress'
|
|
226
|
-
} as AppkitConnectButtonEvents,
|
|
227
|
-
defineCustomElement: defineAppkitConnectButton
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
export type AppkitDialogEvents = {
|
|
231
|
-
onAppkitClose: EventName<AppkitDialogCustomEvent<void>>,
|
|
232
|
-
onAppkitOpenChange: EventName<AppkitDialogCustomEvent<boolean>>
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
export const AppkitDialog: StencilReactComponent<AppkitDialogElement, AppkitDialogEvents, Components.AppkitDialog> = /*@__PURE__*/ createComponent<AppkitDialogElement, AppkitDialogEvents, Components.AppkitDialog>({
|
|
236
|
-
tagName: 'appkit-dialog',
|
|
237
|
-
elementClass: AppkitDialogElement,
|
|
238
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
239
|
-
react: React,
|
|
240
|
-
events: {
|
|
241
|
-
onAppkitClose: 'appkitClose',
|
|
242
|
-
onAppkitOpenChange: 'appkitOpenChange'
|
|
243
|
-
} as AppkitDialogEvents,
|
|
244
|
-
defineCustomElement: defineAppkitDialog
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
export type AppkitDropdownMenuEvents = { onAppkitSelect: EventName<AppkitDropdownMenuCustomEvent<string>> };
|
|
248
|
-
|
|
249
|
-
export const AppkitDropdownMenu: StencilReactComponent<AppkitDropdownMenuElement, AppkitDropdownMenuEvents, Components.AppkitDropdownMenu> = /*@__PURE__*/ createComponent<AppkitDropdownMenuElement, AppkitDropdownMenuEvents, Components.AppkitDropdownMenu>({
|
|
250
|
-
tagName: 'appkit-dropdown-menu',
|
|
251
|
-
elementClass: AppkitDropdownMenuElement,
|
|
252
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
253
|
-
react: React,
|
|
254
|
-
events: { onAppkitSelect: 'appkitSelect' } as AppkitDropdownMenuEvents,
|
|
255
|
-
defineCustomElement: defineAppkitDropdownMenu
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
export type AppkitInputEvents = { onAppkitChange: EventName<AppkitInputCustomEvent<string>> };
|
|
259
|
-
|
|
260
|
-
export const AppkitInput: StencilReactComponent<AppkitInputElement, AppkitInputEvents, Components.AppkitInput> = /*@__PURE__*/ createComponent<AppkitInputElement, AppkitInputEvents, Components.AppkitInput>({
|
|
261
|
-
tagName: 'appkit-input',
|
|
262
|
-
elementClass: AppkitInputElement,
|
|
263
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
264
|
-
react: React,
|
|
265
|
-
events: { onAppkitChange: 'appkitChange' } as AppkitInputEvents,
|
|
266
|
-
defineCustomElement: defineAppkitInput
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
export type AppkitPopoverEvents = { onAppkitOpenChange: EventName<AppkitPopoverCustomEvent<boolean>> };
|
|
270
|
-
|
|
271
|
-
export const AppkitPopover: StencilReactComponent<AppkitPopoverElement, AppkitPopoverEvents, Components.AppkitPopover> = /*@__PURE__*/ createComponent<AppkitPopoverElement, AppkitPopoverEvents, Components.AppkitPopover>({
|
|
272
|
-
tagName: 'appkit-popover',
|
|
273
|
-
elementClass: AppkitPopoverElement,
|
|
274
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
275
|
-
react: React,
|
|
276
|
-
events: { onAppkitOpenChange: 'appkitOpenChange' } as AppkitPopoverEvents,
|
|
277
|
-
defineCustomElement: defineAppkitPopover
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
export type AppkitProgressEvents = NonNullable<unknown>;
|
|
281
|
-
|
|
282
|
-
export const AppkitProgress: StencilReactComponent<AppkitProgressElement, AppkitProgressEvents, Components.AppkitProgress> = /*@__PURE__*/ createComponent<AppkitProgressElement, AppkitProgressEvents, Components.AppkitProgress>({
|
|
283
|
-
tagName: 'appkit-progress',
|
|
284
|
-
elementClass: AppkitProgressElement,
|
|
285
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
286
|
-
react: React,
|
|
287
|
-
events: {} as AppkitProgressEvents,
|
|
288
|
-
defineCustomElement: defineAppkitProgress
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
export type AppkitScrollAreaEvents = NonNullable<unknown>;
|
|
292
|
-
|
|
293
|
-
export const AppkitScrollArea: StencilReactComponent<AppkitScrollAreaElement, AppkitScrollAreaEvents, Components.AppkitScrollArea> = /*@__PURE__*/ createComponent<AppkitScrollAreaElement, AppkitScrollAreaEvents, Components.AppkitScrollArea>({
|
|
294
|
-
tagName: 'appkit-scroll-area',
|
|
295
|
-
elementClass: AppkitScrollAreaElement,
|
|
296
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
297
|
-
react: React,
|
|
298
|
-
events: {} as AppkitScrollAreaEvents,
|
|
299
|
-
defineCustomElement: defineAppkitScrollArea
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
export type AppkitSelectEvents = { onAppkitChange: EventName<AppkitSelectCustomEvent<string>> };
|
|
303
|
-
|
|
304
|
-
export const AppkitSelect: StencilReactComponent<AppkitSelectElement, AppkitSelectEvents, Components.AppkitSelect> = /*@__PURE__*/ createComponent<AppkitSelectElement, AppkitSelectEvents, Components.AppkitSelect>({
|
|
305
|
-
tagName: 'appkit-select',
|
|
306
|
-
elementClass: AppkitSelectElement,
|
|
307
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
308
|
-
react: React,
|
|
309
|
-
events: { onAppkitChange: 'appkitChange' } as AppkitSelectEvents,
|
|
310
|
-
defineCustomElement: defineAppkitSelect
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
export type AppkitSeparatorEvents = NonNullable<unknown>;
|
|
314
|
-
|
|
315
|
-
export const AppkitSeparator: StencilReactComponent<AppkitSeparatorElement, AppkitSeparatorEvents, Components.AppkitSeparator> = /*@__PURE__*/ createComponent<AppkitSeparatorElement, AppkitSeparatorEvents, Components.AppkitSeparator>({
|
|
316
|
-
tagName: 'appkit-separator',
|
|
317
|
-
elementClass: AppkitSeparatorElement,
|
|
318
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
319
|
-
react: React,
|
|
320
|
-
events: {} as AppkitSeparatorEvents,
|
|
321
|
-
defineCustomElement: defineAppkitSeparator
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
export type AppkitSkeletonEvents = NonNullable<unknown>;
|
|
325
|
-
|
|
326
|
-
export const AppkitSkeleton: StencilReactComponent<AppkitSkeletonElement, AppkitSkeletonEvents, Components.AppkitSkeleton> = /*@__PURE__*/ createComponent<AppkitSkeletonElement, AppkitSkeletonEvents, Components.AppkitSkeleton>({
|
|
327
|
-
tagName: 'appkit-skeleton',
|
|
328
|
-
elementClass: AppkitSkeletonElement,
|
|
329
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
330
|
-
react: React,
|
|
331
|
-
events: {} as AppkitSkeletonEvents,
|
|
332
|
-
defineCustomElement: defineAppkitSkeleton
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
export type AppkitSwitchEvents = { onAppkitChange: EventName<AppkitSwitchCustomEvent<boolean>> };
|
|
336
|
-
|
|
337
|
-
export const AppkitSwitch: StencilReactComponent<AppkitSwitchElement, AppkitSwitchEvents, Components.AppkitSwitch> = /*@__PURE__*/ createComponent<AppkitSwitchElement, AppkitSwitchEvents, Components.AppkitSwitch>({
|
|
338
|
-
tagName: 'appkit-switch',
|
|
339
|
-
elementClass: AppkitSwitchElement,
|
|
340
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
341
|
-
react: React,
|
|
342
|
-
events: { onAppkitChange: 'appkitChange' } as AppkitSwitchEvents,
|
|
343
|
-
defineCustomElement: defineAppkitSwitch
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
export type AppkitTabsEvents = { onAppkitTabChange: EventName<AppkitTabsCustomEvent<string>> };
|
|
347
|
-
|
|
348
|
-
export const AppkitTabs: StencilReactComponent<AppkitTabsElement, AppkitTabsEvents, Components.AppkitTabs> = /*@__PURE__*/ createComponent<AppkitTabsElement, AppkitTabsEvents, Components.AppkitTabs>({
|
|
349
|
-
tagName: 'appkit-tabs',
|
|
350
|
-
elementClass: AppkitTabsElement,
|
|
351
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
352
|
-
react: React,
|
|
353
|
-
events: { onAppkitTabChange: 'appkitTabChange' } as AppkitTabsEvents,
|
|
354
|
-
defineCustomElement: defineAppkitTabs
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
export type AppkitToggleGroupEvents = { onAppkitChange: EventName<AppkitToggleGroupCustomEvent<string[]>> };
|
|
358
|
-
|
|
359
|
-
export const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroupElement, AppkitToggleGroupEvents, Components.AppkitToggleGroup> = /*@__PURE__*/ createComponent<AppkitToggleGroupElement, AppkitToggleGroupEvents, Components.AppkitToggleGroup>({
|
|
360
|
-
tagName: 'appkit-toggle-group',
|
|
361
|
-
elementClass: AppkitToggleGroupElement,
|
|
362
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
363
|
-
react: React,
|
|
364
|
-
events: { onAppkitChange: 'appkitChange' } as AppkitToggleGroupEvents,
|
|
365
|
-
defineCustomElement: defineAppkitToggleGroup
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
export type AppkitTooltipEvents = NonNullable<unknown>;
|
|
369
|
-
|
|
370
|
-
export const AppkitTooltip: StencilReactComponent<AppkitTooltipElement, AppkitTooltipEvents, Components.AppkitTooltip> = /*@__PURE__*/ createComponent<AppkitTooltipElement, AppkitTooltipEvents, Components.AppkitTooltip>({
|
|
371
|
-
tagName: 'appkit-tooltip',
|
|
372
|
-
elementClass: AppkitTooltipElement,
|
|
373
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
374
|
-
react: React,
|
|
375
|
-
events: {} as AppkitTooltipEvents,
|
|
376
|
-
defineCustomElement: defineAppkitTooltip
|
|
377
|
-
});
|
package/test/setup.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
2
|
-
|
|
3
|
-
// Mock localStorage for jsdom
|
|
4
|
-
const localStorageMock = (() => {
|
|
5
|
-
let store: Record<string, string> = {};
|
|
6
|
-
return {
|
|
7
|
-
getItem: (key: string) => store[key] ?? null,
|
|
8
|
-
setItem: (key: string, value: string) => { store[key] = value; },
|
|
9
|
-
removeItem: (key: string) => { delete store[key]; },
|
|
10
|
-
clear: () => { store = {}; },
|
|
11
|
-
get length() { return Object.keys(store).length; },
|
|
12
|
-
key: (index: number) => Object.keys(store)[index] ?? null,
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
|
|
16
|
-
Object.defineProperty(window, "localStorage", { value: localStorageMock });
|
|
17
|
-
Object.defineProperty(globalThis, "localStorage", { value: localStorageMock });
|
package/test/test-utils.tsx
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { renderHook } from "@testing-library/react";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
4
|
-
import type { UniversalWalletSession } from "@naculus/connect-core";
|
|
5
|
-
import type { Web3ContextValue } from "../src/provider/Web3ConnectProvider";
|
|
6
|
-
|
|
7
|
-
// Default mock session
|
|
8
|
-
export const defaultSession: UniversalWalletSession = {
|
|
9
|
-
topic: "test-topic",
|
|
10
|
-
relay: { protocol: "irn" },
|
|
11
|
-
namespaces: {
|
|
12
|
-
eip155: {
|
|
13
|
-
accounts: ["eip155:1:0x1234567890123456789012345678901234567890"],
|
|
14
|
-
chains: ["eip155:1"],
|
|
15
|
-
methods: ["eth_sendTransaction", "personal_sign"],
|
|
16
|
-
events: ["chainChanged", "accountsChanged"],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
expiry: Date.now() + 86400000,
|
|
20
|
-
acknowledged: true,
|
|
21
|
-
pairingTopic: "test-pairing",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// Create a default mock context value
|
|
25
|
-
export function createMockContextValue(
|
|
26
|
-
overrides: Partial<Web3ContextValue> = {}
|
|
27
|
-
): Web3ContextValue {
|
|
28
|
-
return {
|
|
29
|
-
status: "disconnected" as const,
|
|
30
|
-
session: null,
|
|
31
|
-
accounts: [],
|
|
32
|
-
chainId: null,
|
|
33
|
-
error: null,
|
|
34
|
-
isConnected: false,
|
|
35
|
-
chains: [
|
|
36
|
-
{
|
|
37
|
-
id: 1,
|
|
38
|
-
namespace: "eip155",
|
|
39
|
-
name: "Ethereum Mainnet",
|
|
40
|
-
rpcUrl: "https://rpc.ankr.com/eth",
|
|
41
|
-
token: "ETH",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: 137,
|
|
45
|
-
namespace: "eip155",
|
|
46
|
-
name: "Polygon",
|
|
47
|
-
rpcUrl: "https://rpc.ankr.com/polygon",
|
|
48
|
-
token: "MATIC",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
connect: vi.fn().mockResolvedValue(undefined),
|
|
52
|
-
disconnect: vi.fn().mockResolvedValue(undefined),
|
|
53
|
-
reconnect: vi.fn().mockResolvedValue(undefined),
|
|
54
|
-
switchChain: vi.fn().mockResolvedValue(undefined),
|
|
55
|
-
startPairing: vi.fn().mockResolvedValue("pairing-uri"),
|
|
56
|
-
completePairing: vi.fn().mockResolvedValue(defaultSession),
|
|
57
|
-
connectInjected: vi.fn().mockResolvedValue(undefined),
|
|
58
|
-
...overrides,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Render hook with mocked useWeb3
|
|
63
|
-
export function renderHookWithMockWeb3<Result, Props>(
|
|
64
|
-
hook: (props: Props) => Result,
|
|
65
|
-
options?: {
|
|
66
|
-
initialProps?: Props;
|
|
67
|
-
contextValue?: Partial<Web3ContextValue>;
|
|
68
|
-
}
|
|
69
|
-
) {
|
|
70
|
-
const mockValue = createMockContextValue(options?.contextValue);
|
|
71
|
-
|
|
72
|
-
// We mock at import time — caller must vi.mock("../src/provider/Web3ConnectProvider")
|
|
73
|
-
// This utility just provides the mock values
|
|
74
|
-
|
|
75
|
-
return renderHook(hook, {
|
|
76
|
-
initialProps: options?.initialProps,
|
|
77
|
-
});
|
|
78
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: {
|
|
5
|
-
index: "src/index.ts",
|
|
6
|
-
client: "src/client.ts"
|
|
7
|
-
},
|
|
8
|
-
format: ["esm", "cjs"],
|
|
9
|
-
dts: false,
|
|
10
|
-
splitting: false,
|
|
11
|
-
sourcemap: true,
|
|
12
|
-
clean: true,
|
|
13
|
-
minify: true,
|
|
14
|
-
external: ["react", "viem", "@walletconnect/sign-client", "@noble/hashes", "@noble/curves", /^@naculus\//, "@stencil/react-output-target"],
|
|
15
|
-
onSuccess: () => {
|
|
16
|
-
console.log("React SDK built successfully");
|
|
17
|
-
}
|
|
18
|
-
});
|