thirdweb 5.106.1 → 5.107.1-nightly-d53f8a25b4978a9f92f494f50955765817e31bad-20250920000329
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/cjs/bridge/Token.js +4 -1
- package/dist/cjs/bridge/Token.js.map +1 -1
- package/dist/cjs/exports/x402.js +8 -0
- package/dist/cjs/exports/x402.js.map +1 -0
- package/dist/cjs/react/core/design-system/index.js +1 -0
- package/dist/cjs/react/core/design-system/index.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SearchInput.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SearchInput.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js +44 -28
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-chain.js +9 -7
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-chain.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-token-ui.js +82 -46
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-token-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js +215 -80
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/utils.js +6 -0
- package/dist/cjs/react/web/ui/Bridge/swap-widget/utils.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/ArrowUpDownIcon.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/ArrowUpDownIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +5 -2
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/react/web/ui/components/formElements.js +4 -1
- package/dist/cjs/react/web/ui/components/formElements.js.map +1 -1
- package/dist/cjs/react/web/ui/hooks/useisMobile.js +19 -0
- package/dist/cjs/react/web/ui/hooks/useisMobile.js.map +1 -0
- package/dist/cjs/stories/Bridge/Swap/SelectChain.stories.js +16 -6
- package/dist/cjs/stories/Bridge/Swap/SelectChain.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/Swap/SwapWidget.stories.js +6 -11
- package/dist/cjs/stories/Bridge/Swap/SwapWidget.stories.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/x402/facilitator.js +76 -0
- package/dist/cjs/x402/facilitator.js.map +1 -0
- package/dist/cjs/x402/fetchWithPayment.js +121 -0
- package/dist/cjs/x402/fetchWithPayment.js.map +1 -0
- package/dist/esm/bridge/Token.js +4 -1
- package/dist/esm/bridge/Token.js.map +1 -1
- package/dist/esm/exports/x402.js +3 -0
- package/dist/esm/exports/x402.js.map +1 -0
- package/dist/esm/react/core/design-system/index.js +1 -0
- package/dist/esm/react/core/design-system/index.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SearchInput.js +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SearchInput.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js +44 -28
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-chain.js +11 -9
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-chain.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-token-ui.js +83 -47
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-token-ui.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js +218 -83
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/utils.js +5 -0
- package/dist/esm/react/web/ui/Bridge/swap-widget/utils.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/ArrowUpDownIcon.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/icons/ArrowUpDownIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +5 -2
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/react/web/ui/components/formElements.js +5 -2
- package/dist/esm/react/web/ui/components/formElements.js.map +1 -1
- package/dist/esm/react/web/ui/hooks/useisMobile.js +16 -0
- package/dist/esm/react/web/ui/hooks/useisMobile.js.map +1 -0
- package/dist/esm/stories/Bridge/Swap/SelectChain.stories.js +12 -4
- package/dist/esm/stories/Bridge/Swap/SelectChain.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/Swap/SwapWidget.stories.js +7 -12
- package/dist/esm/stories/Bridge/Swap/SwapWidget.stories.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/x402/facilitator.js +73 -0
- package/dist/esm/x402/facilitator.js.map +1 -0
- package/dist/esm/x402/fetchWithPayment.js +118 -0
- package/dist/esm/x402/fetchWithPayment.js.map +1 -0
- package/dist/types/bridge/Token.d.ts +2 -0
- package/dist/types/bridge/Token.d.ts.map +1 -1
- package/dist/types/bridge/types/Token.d.ts +2 -0
- package/dist/types/bridge/types/Token.d.ts.map +1 -1
- package/dist/types/exports/x402.d.ts +3 -0
- package/dist/types/exports/x402.d.ts.map +1 -0
- package/dist/types/react/core/design-system/index.d.ts +1 -0
- package/dist/types/react/core/design-system/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/SearchInput.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/SwapWidget.d.ts +5 -0
- package/dist/types/react/web/ui/Bridge/swap-widget/SwapWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/select-chain.d.ts +1 -0
- package/dist/types/react/web/ui/Bridge/swap-widget/select-chain.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/select-token-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts +2 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/utils.d.ts +1 -0
- package/dist/types/react/web/ui/Bridge/swap-widget/utils.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/basic.d.ts +1 -1
- package/dist/types/react/web/ui/components/basic.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts +1 -0
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/formElements.d.ts.map +1 -1
- package/dist/types/react/web/ui/hooks/useisMobile.d.ts +2 -0
- package/dist/types/react/web/ui/hooks/useisMobile.d.ts.map +1 -0
- package/dist/types/stories/Bridge/Swap/SelectChain.stories.d.ts +4 -2
- package/dist/types/stories/Bridge/Swap/SelectChain.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/Swap/SwapWidget.stories.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/x402/facilitator.d.ts +48 -0
- package/dist/types/x402/facilitator.d.ts.map +1 -0
- package/dist/types/x402/fetchWithPayment.d.ts +43 -0
- package/dist/types/x402/fetchWithPayment.d.ts.map +1 -0
- package/package.json +10 -1
- package/src/bridge/Token.ts +6 -0
- package/src/bridge/types/Token.ts +2 -0
- package/src/exports/x402.ts +5 -0
- package/src/react/core/design-system/index.ts +1 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +1 -1
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +1 -1
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +1 -1
- package/src/react/web/ui/Bridge/swap-widget/SearchInput.tsx +1 -0
- package/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +62 -45
- package/src/react/web/ui/Bridge/swap-widget/select-chain.tsx +25 -12
- package/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx +302 -197
- package/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx +496 -233
- package/src/react/web/ui/Bridge/swap-widget/utils.ts +6 -0
- package/src/react/web/ui/ConnectWallet/icons/ArrowUpDownIcon.tsx +10 -10
- package/src/react/web/ui/components/basic.tsx +1 -1
- package/src/react/web/ui/components/buttons.tsx +6 -2
- package/src/react/web/ui/components/formElements.tsx +5 -1
- package/src/react/web/ui/hooks/useisMobile.ts +21 -0
- package/src/stories/Bridge/Swap/SelectChain.stories.tsx +40 -2
- package/src/stories/Bridge/Swap/SwapWidget.stories.tsx +18 -13
- package/src/version.ts +1 -1
- package/src/x402/facilitator.ts +87 -0
- package/src/x402/fetchWithPayment.ts +173 -0
- package/dist/cjs/react/web/ui/Bridge/swap-widget/common.js +0 -17
- package/dist/cjs/react/web/ui/Bridge/swap-widget/common.js.map +0 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/common.js +0 -14
- package/dist/esm/react/web/ui/Bridge/swap-widget/common.js.map +0 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/common.d.ts +0 -9
- package/dist/types/react/web/ui/Bridge/swap-widget/common.d.ts.map +0 -1
- package/src/react/web/ui/Bridge/swap-widget/common.tsx +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/swap-widget/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/swap-widget/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C;AAED,eAAO,MAAM,oBAAoB,mBAI/B,CAAC"}
|
|
@@ -35,7 +35,7 @@ export declare function Container(props: {
|
|
|
35
35
|
expand?: boolean;
|
|
36
36
|
center?: "x" | "y" | "both";
|
|
37
37
|
gap?: keyof typeof spacing;
|
|
38
|
-
children
|
|
38
|
+
children?: React.ReactNode;
|
|
39
39
|
style?: React.CSSProperties;
|
|
40
40
|
p?: keyof typeof spacing;
|
|
41
41
|
px?: keyof typeof spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/basic.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAU3E,eAAO,MAAM,qBAAqB;;;yGAShC,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;CAMH,CAAC;AAEtB;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA2BA;AAED,eAAO,MAAM,IAAI;;;;aAAgD,OAAO;yGAKtE,CAAC;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/basic.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAU3E,eAAO,MAAM,qBAAqB;;;yGAShC,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;CAMH,CAAC;AAEtB;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA2BA;AAED,eAAO,MAAM,IAAI;;;;aAAgD,OAAO;yGAKtE,CAAC;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,CAAC,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA4FA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/buttons.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,OAAO,EACP,KAAK,KAAK,EACX,MAAM,sCAAsC,CAAC;AAG9C,KAAK,WAAW,GAAG;IACjB,OAAO,EACH,SAAS,GACT,WAAW,GACX,MAAM,GACN,QAAQ,GACR,SAAS,GACT,OAAO,GACP,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/buttons.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,OAAO,EACP,KAAK,KAAK,EACX,MAAM,sCAAsC,CAAC;AAG9C,KAAK,WAAW,GAAG;IACjB,OAAO,EACH,SAAS,GACT,WAAW,GACX,MAAM,GACN,QAAQ,GACR,SAAS,GACT,OAAO,GACP,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,MAAM;;;mIAsIjB,CAAC;AAEH,eAAO,MAAM,UAAU;;;mIAAsD,CAAC;AAE9E,eAAO,MAAM,UAAU;;;qHAqBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formElements.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/formElements.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"formElements.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/components/formElements.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,KAAK,EACX,MAAM,sCAAsC,CAAC;AAO9C,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,KAAK;;;+HAQhB,CAAC;AAEH,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,SAAS,GAAG,aAAa,CAAC;IACnC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,KAAK;;;+HAyEhB,CAAC;AAGH,eAAO,MAAM,cAAc;;;yGAiBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useisMobile.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/hooks/useisMobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAgB1B"}
|
|
@@ -5,6 +5,8 @@ declare const meta: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
};
|
|
7
7
|
export default meta;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
8
|
+
export declare function WithDataDesktop(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function LoadingDesktop(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function WithDataMobile(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function LoadingMobile(): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=SelectChain.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectChain.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Bridge/Swap/SelectChain.stories.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,IAAI;;;;;CAKgC,CAAC;AAC3C,eAAe,IAAI,CAAC;AAEpB,wBAAgB,
|
|
1
|
+
{"version":3,"file":"SelectChain.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Bridge/Swap/SelectChain.stories.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,IAAI;;;;;CAKgC,CAAC;AAC3C,eAAe,IAAI,CAAC;AAEpB,wBAAgB,eAAe,4CAe9B;AAED,wBAAgB,cAAc,4CAiB7B;AAED,wBAAgB,cAAc,4CAe7B;AAED,wBAAgB,aAAa,4CAiB5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapWidget.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Bridge/Swap/SwapWidget.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"SwapWidget.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Bridge/Swap/SwapWidget.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;AAGpF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAcjC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,wBAAgB,UAAU,4CAEzB;AAED,wBAAgB,WAAW,4CAQ1B;AAED,wBAAgB,SAAS,4CASxB;AAED,wBAAgB,kBAAkB,4CASjC;AAED,wBAAgB,WAAW,4CAiB1B"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.107.1-nightly-d53f8a25b4978a9f92f494f50955765817e31bad-20250920000329";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,4EAA4E,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FacilitatorConfig } from "x402/types";
|
|
2
|
+
import type { ThirdwebClient } from "../client/client.js";
|
|
3
|
+
export type ThirdwebX402FacilitatorConfig = {
|
|
4
|
+
client: ThirdwebClient;
|
|
5
|
+
serverWalletAddress: string;
|
|
6
|
+
vaultAccessToken?: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a facilitator for the x402 payment protocol.
|
|
11
|
+
* Use this with any x402 middleware to enable settling transactions with your thirdweb server wallet.
|
|
12
|
+
*
|
|
13
|
+
* @param config - The configuration for the facilitator
|
|
14
|
+
* @returns a x402 compatible FacilitatorConfig
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { facilitator } from "thirdweb/x402";
|
|
19
|
+
* import { createThirdwebClient } from "thirdweb";
|
|
20
|
+
*
|
|
21
|
+
* const client = createThirdwebClient({
|
|
22
|
+
* secretKey: "your-secret-key",
|
|
23
|
+
* });
|
|
24
|
+
* const thirdwebX402Facilitator = facilitator({
|
|
25
|
+
* client: client,
|
|
26
|
+
* serverWalletAddress: "0x1234567890123456789012345678901234567890",
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // add the facilitator to any x402 payment middleware
|
|
30
|
+
* const middleware = paymentMiddleware(
|
|
31
|
+
* "0x1234567890123456789012345678901234567890",
|
|
32
|
+
* {
|
|
33
|
+
* "/api/paywall": {
|
|
34
|
+
* price: "$0.01",
|
|
35
|
+
* network: "base-sepolia",
|
|
36
|
+
* config: {
|
|
37
|
+
* description: "Access to paid content",
|
|
38
|
+
* },
|
|
39
|
+
* },
|
|
40
|
+
* },
|
|
41
|
+
* thirdwebX402Facilitator,
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @bridge x402
|
|
46
|
+
*/
|
|
47
|
+
export declare function facilitator(config: ThirdwebX402FacilitatorConfig): FacilitatorConfig;
|
|
48
|
+
//# sourceMappingURL=facilitator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facilitator.d.ts","sourceRoot":"","sources":["../../../src/x402/facilitator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,6BAA6B,GACpC,iBAAiB,CAkCnB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ThirdwebClient } from "../client/client.js";
|
|
2
|
+
import type { Wallet } from "../wallets/interfaces/wallet.js";
|
|
3
|
+
/**
|
|
4
|
+
* Enables the payment of APIs using the x402 payment protocol.
|
|
5
|
+
*
|
|
6
|
+
* This function wraps the native fetch API to automatically handle 402 Payment Required responses
|
|
7
|
+
* by creating and sending a payment header. It will:
|
|
8
|
+
* 1. Make the initial request
|
|
9
|
+
* 2. If a 402 response is received, parse the payment requirements
|
|
10
|
+
* 3. Verify the payment amount is within the allowed maximum
|
|
11
|
+
* 4. Create a payment header using the provided wallet client
|
|
12
|
+
* 5. Retry the request with the payment header
|
|
13
|
+
*
|
|
14
|
+
* @param fetch - The fetch function to wrap (typically globalThis.fetch)
|
|
15
|
+
* @param client - The thirdweb client used to access RPC infrastructure
|
|
16
|
+
* @param wallet - The wallet used to sign payment messages
|
|
17
|
+
* @param maxValue - The maximum allowed payment amount in base units (defaults to 1 USDC)
|
|
18
|
+
* @returns A wrapped fetch function that handles 402 responses automatically
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { wrapFetchWithPayment } from "thirdweb/x402";
|
|
23
|
+
* import { createThirdwebClient } from "thirdweb";
|
|
24
|
+
* import { createWallet } from "thirdweb/wallets";
|
|
25
|
+
*
|
|
26
|
+
* const client = createThirdwebClient({ clientId: "your-client-id" });
|
|
27
|
+
* const wallet = createWallet("io.metamask");
|
|
28
|
+
* await wallet.connect({ client })
|
|
29
|
+
*
|
|
30
|
+
* const fetchWithPay = wrapFetchWithPayment(fetch, client, wallet);
|
|
31
|
+
*
|
|
32
|
+
* // Make a request that may require payment
|
|
33
|
+
* const response = await fetchWithPay('https://api.example.com/paid-endpoint');
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @throws {Error} If the payment amount exceeds the maximum allowed value
|
|
37
|
+
* @throws {Error} If a payment has already been attempted for this request
|
|
38
|
+
* @throws {Error} If there's an error creating the payment header
|
|
39
|
+
*
|
|
40
|
+
* @bridge x402
|
|
41
|
+
*/
|
|
42
|
+
export declare function wrapFetchWithPayment(fetch: typeof globalThis.fetch, client: ThirdwebClient, wallet: Wallet, maxValue?: bigint): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
43
|
+
//# sourceMappingURL=fetchWithPayment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchWithPayment.d.ts","sourceRoot":"","sources":["../../../src/x402/fetchWithPayment.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,EAC9B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAA4B,IAExB,OAAO,WAAW,EAAE,OAAO,WAAW,uBAmFrD"}
|
package/package.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"toml": "3.0.0",
|
|
39
39
|
"uqr": "0.1.2",
|
|
40
40
|
"viem": "2.33.2",
|
|
41
|
+
"x402": "0.6.1",
|
|
41
42
|
"zod": "3.25.75",
|
|
42
43
|
"@thirdweb-dev/engine": "3.2.1",
|
|
43
44
|
"@thirdweb-dev/insight": "1.1.1"
|
|
@@ -226,6 +227,11 @@
|
|
|
226
227
|
"react-native": "./dist/esm/exports/wallets/in-app.native.js",
|
|
227
228
|
"import": "./dist/esm/exports/wallets/in-app.js",
|
|
228
229
|
"default": "./dist/cjs/exports/wallets/in-app.js"
|
|
230
|
+
},
|
|
231
|
+
"./x402": {
|
|
232
|
+
"types": "./dist/types/exports/x402.d.ts",
|
|
233
|
+
"import": "./dist/esm/exports/x402.js",
|
|
234
|
+
"default": "./dist/cjs/exports/x402.js"
|
|
229
235
|
}
|
|
230
236
|
},
|
|
231
237
|
"files": [
|
|
@@ -384,11 +390,14 @@
|
|
|
384
390
|
],
|
|
385
391
|
"insight": [
|
|
386
392
|
"./dist/types/exports/insight.d.ts"
|
|
393
|
+
],
|
|
394
|
+
"x402": [
|
|
395
|
+
"./dist/types/exports/x402.d.ts"
|
|
387
396
|
]
|
|
388
397
|
}
|
|
389
398
|
},
|
|
390
399
|
"typings": "./dist/types/exports/thirdweb.d.ts",
|
|
391
|
-
"version": "5.
|
|
400
|
+
"version": "5.107.1-nightly-d53f8a25b4978a9f92f494f50955765817e31bad-20250920000329",
|
|
392
401
|
"scripts": {
|
|
393
402
|
"bench": "vitest -c ./test/vitest.config.ts bench",
|
|
394
403
|
"bench:compare": "bun run ./benchmarks/run.ts",
|
package/src/bridge/Token.ts
CHANGED
|
@@ -141,6 +141,7 @@ export async function tokens<
|
|
|
141
141
|
limit,
|
|
142
142
|
offset,
|
|
143
143
|
includePrices,
|
|
144
|
+
sortBy,
|
|
144
145
|
} = options;
|
|
145
146
|
|
|
146
147
|
const clientFetch = getClientFetch(client);
|
|
@@ -167,6 +168,9 @@ export async function tokens<
|
|
|
167
168
|
if (includePrices !== undefined) {
|
|
168
169
|
url.searchParams.set("includePrices", includePrices.toString());
|
|
169
170
|
}
|
|
171
|
+
if (sortBy !== undefined) {
|
|
172
|
+
url.searchParams.set("sortBy", sortBy);
|
|
173
|
+
}
|
|
170
174
|
|
|
171
175
|
const response = await clientFetch(url.toString());
|
|
172
176
|
if (!response.ok) {
|
|
@@ -204,6 +208,8 @@ export declare namespace tokens {
|
|
|
204
208
|
offset?: number | null;
|
|
205
209
|
/** Whether or not to include prices for the tokens. Setting this to false will speed up the request. */
|
|
206
210
|
includePrices?: IncludePrices;
|
|
211
|
+
/** Sort by a specific field. */
|
|
212
|
+
sortBy?: "newest" | "oldest" | "volume" | "market_cap";
|
|
207
213
|
};
|
|
208
214
|
|
|
209
215
|
/**
|
|
@@ -322,7 +322,7 @@ type UIOptionsResult =
|
|
|
322
322
|
*
|
|
323
323
|
* Refer to the [`BuyWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetConnectOptions) type for more details.
|
|
324
324
|
*
|
|
325
|
-
* @bridge
|
|
325
|
+
* @bridge
|
|
326
326
|
*/
|
|
327
327
|
export function BuyWidget(props: BuyWidgetProps) {
|
|
328
328
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
|
@@ -318,7 +318,7 @@ type UIOptionsResult =
|
|
|
318
318
|
*
|
|
319
319
|
* Refer to the [`CheckoutWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetConnectOptions) type for more details.
|
|
320
320
|
*
|
|
321
|
-
* @bridge
|
|
321
|
+
* @bridge
|
|
322
322
|
*/
|
|
323
323
|
export function CheckoutWidget(props: CheckoutWidgetProps) {
|
|
324
324
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
|
@@ -326,7 +326,7 @@ type UIOptionsResult =
|
|
|
326
326
|
*
|
|
327
327
|
* Refer to the [`TransactionWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/TransactionWidgetConnectOptions) type for more details.
|
|
328
328
|
*
|
|
329
|
-
* @bridge
|
|
329
|
+
* @bridge
|
|
330
330
|
*/
|
|
331
331
|
export function TransactionWidget(props: TransactionWidgetProps) {
|
|
332
332
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
|
@@ -162,6 +162,10 @@ export type SwapWidgetProps = {
|
|
|
162
162
|
* @default true
|
|
163
163
|
*/
|
|
164
164
|
persistTokenSelections?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Called when the user disconnects the active wallet
|
|
167
|
+
*/
|
|
168
|
+
onDisconnect?: () => void;
|
|
165
169
|
};
|
|
166
170
|
|
|
167
171
|
/**
|
|
@@ -234,6 +238,7 @@ export type SwapWidgetProps = {
|
|
|
234
238
|
* }} />
|
|
235
239
|
* ```
|
|
236
240
|
*
|
|
241
|
+
* @bridge
|
|
237
242
|
*/
|
|
238
243
|
export function SwapWidget(props: SwapWidgetProps) {
|
|
239
244
|
return (
|
|
@@ -324,46 +329,11 @@ function SwapWidgetContent(props: SwapWidgetProps) {
|
|
|
324
329
|
});
|
|
325
330
|
|
|
326
331
|
const [buyToken, setBuyToken] = useState<TokenSelection | undefined>(() => {
|
|
327
|
-
|
|
328
|
-
return {
|
|
329
|
-
tokenAddress:
|
|
330
|
-
props.prefill.buyToken.tokenAddress ||
|
|
331
|
-
getAddress(NATIVE_TOKEN_ADDRESS),
|
|
332
|
-
chainId: props.prefill.buyToken.chainId,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (!isPersistEnabled) {
|
|
337
|
-
return undefined;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const lastUsedBuyToken = getLastUsedTokens()?.buyToken;
|
|
341
|
-
|
|
342
|
-
// the token that will be set as initial value of sell token
|
|
343
|
-
const sellToken = getInitialSellToken(
|
|
344
|
-
props.prefill,
|
|
345
|
-
getLastUsedTokens()?.sellToken,
|
|
346
|
-
);
|
|
347
|
-
|
|
348
|
-
// if both tokens are same, ignore "buyToken", keep "sellToken"
|
|
349
|
-
if (
|
|
350
|
-
lastUsedBuyToken &&
|
|
351
|
-
sellToken &&
|
|
352
|
-
lastUsedBuyToken.tokenAddress.toLowerCase() ===
|
|
353
|
-
sellToken.tokenAddress.toLowerCase() &&
|
|
354
|
-
lastUsedBuyToken.chainId === sellToken.chainId
|
|
355
|
-
) {
|
|
356
|
-
return undefined;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
return lastUsedBuyToken;
|
|
332
|
+
return getInitialTokens(props.prefill, isPersistEnabled).buyToken;
|
|
360
333
|
});
|
|
361
334
|
|
|
362
335
|
const [sellToken, setSellToken] = useState<TokenSelection | undefined>(() => {
|
|
363
|
-
return
|
|
364
|
-
props.prefill,
|
|
365
|
-
isPersistEnabled ? getLastUsedTokens()?.sellToken : undefined,
|
|
366
|
-
);
|
|
336
|
+
return getInitialTokens(props.prefill, isPersistEnabled).sellToken;
|
|
367
337
|
});
|
|
368
338
|
|
|
369
339
|
// persist selections to localStorage whenever they change
|
|
@@ -393,6 +363,7 @@ function SwapWidgetContent(props: SwapWidgetProps) {
|
|
|
393
363
|
if (screen.id === "1:swap-ui" || !activeWalletInfo) {
|
|
394
364
|
return (
|
|
395
365
|
<SwapUI
|
|
366
|
+
onDisconnect={props.onDisconnect}
|
|
396
367
|
showThirdwebBranding={
|
|
397
368
|
props.showThirdwebBranding === undefined
|
|
398
369
|
? true
|
|
@@ -532,17 +503,63 @@ function SwapWidgetContent(props: SwapWidgetProps) {
|
|
|
532
503
|
return null;
|
|
533
504
|
}
|
|
534
505
|
|
|
535
|
-
function
|
|
506
|
+
function getInitialTokens(
|
|
536
507
|
prefill: SwapWidgetProps["prefill"],
|
|
537
|
-
|
|
538
|
-
) {
|
|
539
|
-
|
|
508
|
+
isPersistEnabled: boolean,
|
|
509
|
+
): {
|
|
510
|
+
buyToken: TokenSelection | undefined;
|
|
511
|
+
sellToken: TokenSelection | undefined;
|
|
512
|
+
} {
|
|
513
|
+
const lastUsedTokens = isPersistEnabled ? getLastUsedTokens() : undefined;
|
|
514
|
+
const buyToken = prefill?.buyToken
|
|
515
|
+
? {
|
|
516
|
+
tokenAddress:
|
|
517
|
+
prefill.buyToken.tokenAddress || getAddress(NATIVE_TOKEN_ADDRESS),
|
|
518
|
+
chainId: prefill.buyToken.chainId,
|
|
519
|
+
}
|
|
520
|
+
: lastUsedTokens?.buyToken;
|
|
521
|
+
|
|
522
|
+
const sellToken = prefill?.sellToken
|
|
523
|
+
? {
|
|
524
|
+
tokenAddress:
|
|
525
|
+
prefill.sellToken.tokenAddress || getAddress(NATIVE_TOKEN_ADDRESS),
|
|
526
|
+
chainId: prefill.sellToken.chainId,
|
|
527
|
+
}
|
|
528
|
+
: lastUsedTokens?.sellToken;
|
|
529
|
+
|
|
530
|
+
// if both tokens are same
|
|
531
|
+
if (
|
|
532
|
+
buyToken &&
|
|
533
|
+
sellToken &&
|
|
534
|
+
buyToken.tokenAddress?.toLowerCase() ===
|
|
535
|
+
sellToken.tokenAddress?.toLowerCase() &&
|
|
536
|
+
buyToken.chainId === sellToken.chainId
|
|
537
|
+
) {
|
|
538
|
+
// if sell token prefill is specified, ignore buy token
|
|
539
|
+
if (prefill?.sellToken) {
|
|
540
|
+
return {
|
|
541
|
+
buyToken: undefined,
|
|
542
|
+
sellToken: sellToken,
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// if buy token prefill is specified, ignore sell token
|
|
547
|
+
if (prefill?.buyToken) {
|
|
548
|
+
return {
|
|
549
|
+
buyToken: buyToken,
|
|
550
|
+
sellToken: undefined,
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// if none of the two are specified via prefill, keep buy token
|
|
540
555
|
return {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
chainId: prefill.sellToken.chainId,
|
|
556
|
+
buyToken: buyToken,
|
|
557
|
+
sellToken: undefined,
|
|
544
558
|
};
|
|
545
559
|
}
|
|
546
560
|
|
|
547
|
-
return
|
|
561
|
+
return {
|
|
562
|
+
buyToken: buyToken,
|
|
563
|
+
sellToken: sellToken,
|
|
564
|
+
};
|
|
548
565
|
}
|
|
@@ -4,6 +4,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
|
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
iconSize,
|
|
7
|
+
radius,
|
|
7
8
|
spacing,
|
|
8
9
|
} from "../../../../core/design-system/index.js";
|
|
9
10
|
import { Container, Line, ModalHeader } from "../../components/basic.js";
|
|
@@ -21,6 +22,7 @@ type SelectBuyTokenProps = {
|
|
|
21
22
|
client: ThirdwebClient;
|
|
22
23
|
onSelectChain: (chain: BridgeChain) => void;
|
|
23
24
|
selectedChain: BridgeChain | undefined;
|
|
25
|
+
isMobile: boolean;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
/**
|
|
@@ -56,11 +58,15 @@ export function SelectBridgeChainUI(
|
|
|
56
58
|
});
|
|
57
59
|
|
|
58
60
|
return (
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
<Container fullHeight flex="column">
|
|
62
|
+
{props.isMobile && (
|
|
63
|
+
<>
|
|
64
|
+
<Container px="md" py="md+">
|
|
65
|
+
<ModalHeader onBack={props.onBack} title="Select Chain" />
|
|
66
|
+
</Container>
|
|
67
|
+
<Line />
|
|
68
|
+
</>
|
|
69
|
+
)}
|
|
64
70
|
|
|
65
71
|
<Spacer y="md" />
|
|
66
72
|
|
|
@@ -79,10 +85,12 @@ export function SelectBridgeChainUI(
|
|
|
79
85
|
<Spacer y="sm" />
|
|
80
86
|
|
|
81
87
|
<Container
|
|
88
|
+
expand
|
|
82
89
|
px="md"
|
|
90
|
+
gap={props.isMobile ? undefined : "xxs"}
|
|
83
91
|
flex="column"
|
|
84
92
|
style={{
|
|
85
|
-
|
|
93
|
+
maxHeight: props.isMobile ? "400px" : "none",
|
|
86
94
|
overflowY: "auto",
|
|
87
95
|
scrollbarWidth: "none",
|
|
88
96
|
paddingBottom: spacing.md,
|
|
@@ -95,6 +103,7 @@ export function SelectBridgeChainUI(
|
|
|
95
103
|
client={props.client}
|
|
96
104
|
onClick={() => props.onSelectChain(chain)}
|
|
97
105
|
isSelected={chain.chainId === props.selectedChain?.chainId}
|
|
106
|
+
isMobile={props.isMobile}
|
|
98
107
|
/>
|
|
99
108
|
))}
|
|
100
109
|
|
|
@@ -119,7 +128,7 @@ export function SelectBridgeChainUI(
|
|
|
119
128
|
</div>
|
|
120
129
|
)}
|
|
121
130
|
</Container>
|
|
122
|
-
</
|
|
131
|
+
</Container>
|
|
123
132
|
);
|
|
124
133
|
}
|
|
125
134
|
|
|
@@ -144,6 +153,7 @@ function ChainButton(props: {
|
|
|
144
153
|
client: ThirdwebClient;
|
|
145
154
|
onClick: () => void;
|
|
146
155
|
isSelected: boolean;
|
|
156
|
+
isMobile: boolean;
|
|
147
157
|
}) {
|
|
148
158
|
return (
|
|
149
159
|
<Button
|
|
@@ -152,18 +162,21 @@ function ChainButton(props: {
|
|
|
152
162
|
style={{
|
|
153
163
|
justifyContent: "flex-start",
|
|
154
164
|
fontWeight: 500,
|
|
155
|
-
fontSize: fontSize.md,
|
|
165
|
+
fontSize: props.isMobile ? fontSize.md : fontSize.sm,
|
|
156
166
|
border: "1px solid transparent",
|
|
157
|
-
padding: `${spacing.
|
|
167
|
+
padding: !props.isMobile ? `${spacing.xs} ${spacing.xs}` : undefined,
|
|
158
168
|
}}
|
|
159
|
-
gap="sm"
|
|
160
169
|
onClick={props.onClick}
|
|
170
|
+
gap="sm"
|
|
161
171
|
>
|
|
162
172
|
<Img
|
|
163
173
|
src={props.chain.icon}
|
|
164
174
|
client={props.client}
|
|
165
|
-
width={iconSize.lg}
|
|
166
|
-
height={iconSize.lg}
|
|
175
|
+
width={props.isMobile ? iconSize.lg : iconSize.md}
|
|
176
|
+
height={props.isMobile ? iconSize.lg : iconSize.md}
|
|
177
|
+
style={{
|
|
178
|
+
borderRadius: radius.full,
|
|
179
|
+
}}
|
|
167
180
|
/>
|
|
168
181
|
{cleanedChainName(props.chain.name)}
|
|
169
182
|
</Button>
|