@orderly.network/wallet-connector-privy 2.12.2 → 2.12.3-alpha.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/dist/index.d.mts +15 -8
- package/dist/index.d.ts +15 -8
- package/dist/index.js +1325 -1086
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1210 -971
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineChain } from 'viem';
|
|
|
3
3
|
import * as WagmiExport from 'wagmi';
|
|
4
4
|
import { createConfig, injected, createStorage, http, WagmiProvider, useConnect, useDisconnect, useAccount as useAccount$1, useSwitchChain } from 'wagmi';
|
|
5
5
|
import * as WagmiConnectorsExport from 'wagmi/connectors';
|
|
6
|
-
import
|
|
6
|
+
import React7, { createContext, useState, useEffect, useMemo, useContext, useRef, useCallback } from 'react';
|
|
7
7
|
import { mainnet, abstract, abstractTestnet } from 'viem/chains';
|
|
8
8
|
import { useWalletConnector, useAccount, useMainnetChainsStore, useTestnetChainsStore, WalletConnectorContext, useEventEmitter, useStorageLedgerAddress, useTrack, useLocalStorage, useStorageChain } from '@orderly.network/hooks';
|
|
9
9
|
import { SOLANA_TESTNET_CHAINID, SOLANA_MAINNET_CHAINID, ChainNamespace, ABSTRACT_CHAIN_ID_MAP, AccountStatusEnum, ABSTRACT_TESTNET_CHAINID, ABSTRACT_MAINNET_CHAINID, SolanaChains as SolanaChains$1, AbstractChains, ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo, EMPTY_OBJECT, defaultMainnetChains, defaultTestnetChains, ConnectorKey, TrackerEventName } from '@orderly.network/types';
|
|
@@ -12,6 +12,7 @@ import { useTranslation, Trans } from '@orderly.network/i18n';
|
|
|
12
12
|
import { AbstractWalletProvider as AbstractWalletProvider$1, useLoginWithAbstract, useAbstractClient, useGlobalWalletSignerAccount } from '@abstract-foundation/agw-react';
|
|
13
13
|
import { windowGuard } from '@orderly.network/utils';
|
|
14
14
|
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
|
|
15
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
15
16
|
import { PrivyProvider, usePrivy, useWallets, useSolanaWallets } from '@privy-io/react-auth';
|
|
16
17
|
import { WalletProvider, useWallet } from '@solana/wallet-adapter-react';
|
|
17
18
|
import { create } from 'zustand';
|
|
@@ -58,8 +59,6 @@ var WalletChainTypeEnum = /* @__PURE__ */ ((WalletChainTypeEnum2) => {
|
|
|
58
59
|
WalletChainTypeEnum2["EVM_SOL"] = "EVM_SOL";
|
|
59
60
|
return WalletChainTypeEnum2;
|
|
60
61
|
})(WalletChainTypeEnum || {});
|
|
61
|
-
|
|
62
|
-
// src/providers/abstractWallet/abstractWalletProvider.tsx
|
|
63
62
|
var AbstractWalletContext = createContext(
|
|
64
63
|
null
|
|
65
64
|
);
|
|
@@ -146,7 +145,7 @@ var AbstractWalletProvider = (props) => {
|
|
|
146
145
|
}
|
|
147
146
|
});
|
|
148
147
|
}, []);
|
|
149
|
-
return /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ jsx(AbstractWalletContext.Provider, { value, children: props.children });
|
|
150
149
|
};
|
|
151
150
|
function useAbstractWallet() {
|
|
152
151
|
const context = useContext(AbstractWalletContext);
|
|
@@ -186,9 +185,9 @@ var PrivyWalletProvider = ({
|
|
|
186
185
|
}) => {
|
|
187
186
|
const { connectorWalletType } = useWalletConnectorPrivy();
|
|
188
187
|
if (connectorWalletType.disablePrivy) {
|
|
189
|
-
return /* @__PURE__ */
|
|
188
|
+
return /* @__PURE__ */ jsx(PrivyWalletContext.Provider, { value: defaultPrivyWalletContextValue, children });
|
|
190
189
|
}
|
|
191
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ jsx(PrivyWalletProviderInner, { children });
|
|
192
191
|
};
|
|
193
192
|
var PrivyWalletProviderInner = ({
|
|
194
193
|
children
|
|
@@ -455,7 +454,7 @@ var PrivyWalletProviderInner = ({
|
|
|
455
454
|
selectWallet
|
|
456
455
|
]
|
|
457
456
|
);
|
|
458
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ jsx(PrivyWalletContext.Provider, { value, children });
|
|
459
458
|
};
|
|
460
459
|
function usePrivyWallet() {
|
|
461
460
|
const context = useContext(PrivyWalletContext);
|
|
@@ -569,8 +568,6 @@ var useSolanaWalletStore = create((set, get) => ({
|
|
|
569
568
|
setWalletMethods: (methods) => set({ walletMethods: methods }),
|
|
570
569
|
setPendingWalletName: (name) => set({ pendingWalletName: name })
|
|
571
570
|
}));
|
|
572
|
-
|
|
573
|
-
// src/providers/solana/solanaWalletProvider.tsx
|
|
574
571
|
var defaultUseSolanaWallet = {
|
|
575
572
|
wallets: [],
|
|
576
573
|
select: () => Promise.resolve(),
|
|
@@ -705,7 +702,7 @@ var SolanaWalletProvider = ({
|
|
|
705
702
|
}),
|
|
706
703
|
[dedupedWallets, publicKey, wallet, network]
|
|
707
704
|
);
|
|
708
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsx(SolanaWalletContext.Provider, { value, children });
|
|
709
706
|
};
|
|
710
707
|
function useSolanaWallet() {
|
|
711
708
|
const context = useContext(SolanaWalletContext);
|
|
@@ -801,7 +798,7 @@ var WagmiWalletProvider = ({
|
|
|
801
798
|
isConnected
|
|
802
799
|
]
|
|
803
800
|
);
|
|
804
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ jsx(WagmiWalletContext.Provider, { value, children });
|
|
805
802
|
};
|
|
806
803
|
function useWagmiWallet() {
|
|
807
804
|
const context = useContext(WagmiWalletContext);
|
|
@@ -810,7 +807,7 @@ function useWagmiWallet() {
|
|
|
810
807
|
}
|
|
811
808
|
return context;
|
|
812
809
|
}
|
|
813
|
-
var MoreIcon = (props) => /* @__PURE__ */
|
|
810
|
+
var MoreIcon = (props) => /* @__PURE__ */ jsxs(
|
|
814
811
|
"svg",
|
|
815
812
|
{
|
|
816
813
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -818,13 +815,15 @@ var MoreIcon = (props) => /* @__PURE__ */ React19.createElement(
|
|
|
818
815
|
height: "16",
|
|
819
816
|
viewBox: "0 0 16 16",
|
|
820
817
|
fill: "currentColor",
|
|
821
|
-
...props
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
818
|
+
...props,
|
|
819
|
+
children: [
|
|
820
|
+
/* @__PURE__ */ jsx("path", { d: "M8.00521 6.66797C8.74161 6.66797 9.33854 7.26464 9.33854 8.0013C9.33854 8.73797 8.74161 9.33464 8.00521 9.33464C7.26881 9.33464 6.67188 8.73797 6.67188 8.0013C6.67188 7.26464 7.26881 6.66797 8.00521 6.66797Z" }),
|
|
821
|
+
/* @__PURE__ */ jsx("path", { d: "M3.33333 6.66797C4.06973 6.66797 4.66667 7.26464 4.66667 8.0013C4.66667 8.73797 4.06973 9.33464 3.33333 9.33464C2.59693 9.33464 2 8.73797 2 8.0013C2 7.26464 2.59693 6.66797 3.33333 6.66797Z" }),
|
|
822
|
+
/* @__PURE__ */ jsx("path", { d: "M12.6666 6.66797C13.403 6.66797 14 7.26464 14 8.0013C14 8.73797 13.403 9.33464 12.6666 9.33464C11.9302 9.33464 11.3333 8.73797 11.3333 8.0013C11.3333 7.26464 11.9302 6.66797 12.6666 6.66797Z" })
|
|
823
|
+
]
|
|
824
|
+
}
|
|
826
825
|
);
|
|
827
|
-
var DisconnectIcon = (props) => /* @__PURE__ */
|
|
826
|
+
var DisconnectIcon = (props) => /* @__PURE__ */ jsx(
|
|
828
827
|
"svg",
|
|
829
828
|
{
|
|
830
829
|
width: "16",
|
|
@@ -832,17 +831,17 @@ var DisconnectIcon = (props) => /* @__PURE__ */ React19.createElement(
|
|
|
832
831
|
viewBox: "0 0 16 16",
|
|
833
832
|
xmlns: "http://www.w3.org/2000/svg",
|
|
834
833
|
fill: "currentColor",
|
|
835
|
-
...props
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
|
|
834
|
+
...props,
|
|
835
|
+
children: /* @__PURE__ */ jsx("g", { id: "box-arrow-right", children: /* @__PURE__ */ jsx(
|
|
836
|
+
"path",
|
|
837
|
+
{
|
|
838
|
+
id: "Vector",
|
|
839
|
+
d: "M1.99365 4.66056C1.99365 3.1879 3.18759 1.9939 4.66032 1.9939H7.32698C8.79965 1.9939 9.99365 3.1879 9.99365 4.66056C9.99365 5.02856 9.69498 5.32723 9.32698 5.32723C8.95898 5.32723 8.66032 5.02856 8.66032 4.66056C8.66032 3.92389 8.06365 3.32723 7.32698 3.32723H4.66032C3.92392 3.32723 3.32699 3.92389 3.32699 4.66056V11.3272C3.32699 12.0639 3.92392 12.6606 4.66032 12.6606H7.32698C8.06365 12.6606 8.66032 12.0639 8.66032 11.3272C8.66032 10.9592 8.95898 10.6606 9.32698 10.6606C9.69498 10.6606 9.99365 10.9592 9.99365 11.3272C9.99365 12.7999 8.79965 13.9939 7.32698 13.9939H4.66032C3.18759 13.9939 1.99365 12.7999 1.99365 11.3272V4.66056ZM6.66032 7.99389C6.66032 7.62589 6.95898 7.32722 7.32698 7.32722H12.369L11.0563 5.99389L11.9937 5.05656L14.473 7.51456C14.733 7.77523 14.733 8.21255 14.473 8.47322L11.9937 10.9312L11.0563 9.99389L12.369 8.66056H7.32698C6.95898 8.66056 6.66032 8.36189 6.66032 7.99389Z"
|
|
840
|
+
}
|
|
841
|
+
) })
|
|
842
|
+
}
|
|
844
843
|
);
|
|
845
|
-
var ArrowRightIcon = ({ size, ...props }) => /* @__PURE__ */
|
|
844
|
+
var ArrowRightIcon = ({ size, ...props }) => /* @__PURE__ */ jsx(
|
|
846
845
|
"svg",
|
|
847
846
|
{
|
|
848
847
|
width: size,
|
|
@@ -850,42 +849,46 @@ var ArrowRightIcon = ({ size, ...props }) => /* @__PURE__ */ React19.createEleme
|
|
|
850
849
|
viewBox: "0 0 14 14",
|
|
851
850
|
fill: "currentColor",
|
|
852
851
|
xmlns: "http://www.w3.org/2000/svg",
|
|
853
|
-
...props
|
|
854
|
-
|
|
855
|
-
|
|
852
|
+
...props,
|
|
853
|
+
children: /* @__PURE__ */ jsx("path", { d: "M3.50696 6.9958C3.50696 6.6738 3.76788 6.41305 4.08971 6.41305C4.36842 6.41305 7.62762 6.41305 8.49679 6.41305L6.76662 4.6648L7.58621 3.84521L10.336 6.57697C10.4504 6.69072 10.507 6.84355 10.507 6.99639C10.507 7.14864 10.4498 7.30089 10.336 7.41464L7.58621 10.1464L6.76662 9.3268L8.49679 7.57854C7.62762 7.57854 4.36842 7.57854 4.08971 7.57854C3.76788 7.57854 3.50696 7.3178 3.50696 6.9958Z" })
|
|
854
|
+
}
|
|
856
855
|
);
|
|
857
856
|
var ArrowRightLinearGradientIcon = ({
|
|
858
857
|
size,
|
|
859
858
|
...props
|
|
860
|
-
}) => /* @__PURE__ */
|
|
859
|
+
}) => /* @__PURE__ */ jsxs(
|
|
861
860
|
"svg",
|
|
862
861
|
{
|
|
863
862
|
xmlns: "http://www.w3.org/2000/svg",
|
|
864
863
|
width: size,
|
|
865
864
|
height: size,
|
|
866
865
|
viewBox: "0 0 20 20",
|
|
867
|
-
fill: "none"
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
866
|
+
fill: "none",
|
|
867
|
+
children: [
|
|
868
|
+
/* @__PURE__ */ jsx(
|
|
869
|
+
"path",
|
|
870
|
+
{
|
|
871
|
+
d: "M5.01001 9.994C5.01001 9.534 5.38276 9.1615 5.84251 9.1615C6.24068 9.1615 10.8967 9.1615 12.1383 9.1615L9.66667 6.664L10.8375 5.49316L14.7658 9.39568C14.9292 9.55818 15.01 9.7765 15.01 9.99484C15.01 10.2123 14.9283 10.4298 14.7658 10.5923L10.8375 14.4948L9.66667 13.324L12.1383 10.8265C10.8967 10.8265 6.24068 10.8265 5.84251 10.8265C5.38276 10.8265 5.01001 10.454 5.01001 9.994Z",
|
|
872
|
+
fill: "url(#paint0_linear_2269_12077)"
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
876
|
+
"linearGradient",
|
|
877
|
+
{
|
|
878
|
+
id: "paint0_linear_2269_12077",
|
|
879
|
+
x1: "15.01",
|
|
880
|
+
y1: "9.994",
|
|
881
|
+
x2: "5.01001",
|
|
882
|
+
y2: "9.994",
|
|
883
|
+
gradientUnits: "userSpaceOnUse",
|
|
884
|
+
children: [
|
|
885
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "rgb(var(--oui-gradient-brand-end))" }),
|
|
886
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "rgb(var(--oui-gradient-brand-start))" })
|
|
887
|
+
]
|
|
888
|
+
}
|
|
889
|
+
) })
|
|
890
|
+
]
|
|
891
|
+
}
|
|
889
892
|
);
|
|
890
893
|
var PwaDialog = modal.create((props) => {
|
|
891
894
|
const { visible, hide, resolve, reject, onOpenChange } = useModal();
|
|
@@ -894,62 +897,77 @@ var PwaDialog = modal.create((props) => {
|
|
|
894
897
|
useEffect(() => {
|
|
895
898
|
setDomain(window.location.hostname);
|
|
896
899
|
}, []);
|
|
897
|
-
return /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
{
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
{
|
|
905
|
-
className: "oui-relative oui-h-[52px] oui-w-full oui-rounded-[44px] oui-bg-base-static-contrast/10 oui-p-2 oui-px-4",
|
|
906
|
-
itemAlign: "center",
|
|
907
|
-
justify: "center"
|
|
908
|
-
},
|
|
909
|
-
/* @__PURE__ */ React19.createElement(Text, { className: "oui-text-base-static-contrast-80 oui-text-[18px] oui-leading-[36px] oui-flex-1 oui-text-center oui-whitespace-nowrap" }, domain),
|
|
910
|
-
/* @__PURE__ */ React19.createElement(ShareIcon, { className: "oui-absolute oui-right-4 oui-top-1/2 oui-translate-y-[-50%]" })
|
|
911
|
-
))
|
|
912
|
-
}
|
|
913
|
-
), /* @__PURE__ */ React19.createElement(
|
|
914
|
-
StepItem,
|
|
915
|
-
{
|
|
916
|
-
index: 2,
|
|
917
|
-
title: t("connector.privy.pwa.step2"),
|
|
918
|
-
classNames: {
|
|
919
|
-
content: "oui-bg-[#e9e9eb]"
|
|
920
|
-
},
|
|
921
|
-
content: /* @__PURE__ */ React19.createElement(
|
|
922
|
-
Flex,
|
|
923
|
-
{
|
|
924
|
-
className: "oui-w-full oui-bg-secondary oui-rounded-[12px]",
|
|
925
|
-
direction: "column"
|
|
926
|
-
},
|
|
927
|
-
/* @__PURE__ */ React19.createElement(
|
|
928
|
-
Flex,
|
|
900
|
+
return /* @__PURE__ */ jsxs(SimpleSheet, { open: visible, onOpenChange, children: [
|
|
901
|
+
/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-80 oui-text ", children: t("connector.privy.pwa.sheetTitle") }) }),
|
|
902
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, className: "oui-w-full", children: [
|
|
903
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-80 oui-text ", children: t("connector.privy.pwa.description") }),
|
|
904
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, className: "oui-w-full", children: [
|
|
905
|
+
/* @__PURE__ */ jsx(
|
|
906
|
+
StepItem,
|
|
929
907
|
{
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
908
|
+
index: 1,
|
|
909
|
+
title: t("connector.privy.pwa.step1"),
|
|
910
|
+
content: /* @__PURE__ */ jsx(Flex, { className: "oui-w-full oui-bg-dark-8", children: /* @__PURE__ */ jsxs(
|
|
911
|
+
Flex,
|
|
912
|
+
{
|
|
913
|
+
className: "oui-relative oui-h-[52px] oui-w-full oui-rounded-[44px] oui-bg-base-static-contrast/10 oui-p-2 oui-px-4",
|
|
914
|
+
itemAlign: "center",
|
|
915
|
+
justify: "center",
|
|
916
|
+
children: [
|
|
917
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-text-base-static-contrast-80 oui-text-[18px] oui-leading-[36px] oui-flex-1 oui-text-center oui-whitespace-nowrap", children: domain }),
|
|
918
|
+
/* @__PURE__ */ jsx(ShareIcon, { className: "oui-absolute oui-right-4 oui-top-1/2 oui-translate-y-[-50%]" })
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
) })
|
|
922
|
+
}
|
|
935
923
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
|
|
938
|
-
Flex,
|
|
924
|
+
/* @__PURE__ */ jsx(
|
|
925
|
+
StepItem,
|
|
939
926
|
{
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
927
|
+
index: 2,
|
|
928
|
+
title: t("connector.privy.pwa.step2"),
|
|
929
|
+
classNames: {
|
|
930
|
+
content: "oui-bg-[#e9e9eb]"
|
|
931
|
+
},
|
|
932
|
+
content: /* @__PURE__ */ jsxs(
|
|
933
|
+
Flex,
|
|
934
|
+
{
|
|
935
|
+
className: "oui-w-full oui-bg-secondary oui-rounded-[12px]",
|
|
936
|
+
direction: "column",
|
|
937
|
+
children: [
|
|
938
|
+
/* @__PURE__ */ jsx(
|
|
939
|
+
Flex,
|
|
940
|
+
{
|
|
941
|
+
className: "oui-w-full oui-px-4 oui-py-3",
|
|
942
|
+
justify: "start",
|
|
943
|
+
itemAlign: "center",
|
|
944
|
+
children: /* @__PURE__ */ jsx(Text, { className: "oui-text-[18px] oui-text-base-static-contrast-20", children: t("connector.privy.pwa.findOnPage") })
|
|
945
|
+
}
|
|
946
|
+
),
|
|
947
|
+
/* @__PURE__ */ jsx(Divider, { className: "oui-border-base-static-contrast-20 oui-w-full" }),
|
|
948
|
+
/* @__PURE__ */ jsxs(
|
|
949
|
+
Flex,
|
|
950
|
+
{
|
|
951
|
+
className: "oui-w-full oui-px-4 oui-py-3",
|
|
952
|
+
justify: "between",
|
|
953
|
+
itemAlign: "center",
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-col-span-2 oui-whitespace-nowrap oui-text-[18px] oui-text-base-static-contrast-80", children: t("connector.privy.pwa.addToHomeScreen") }),
|
|
956
|
+
/* @__PURE__ */ jsx(AddIcon, {})
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
)
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
)
|
|
963
|
+
}
|
|
946
964
|
)
|
|
947
|
-
)
|
|
948
|
-
}
|
|
949
|
-
)
|
|
965
|
+
] })
|
|
966
|
+
] })
|
|
967
|
+
] });
|
|
950
968
|
});
|
|
951
969
|
var ShareIcon = (props) => {
|
|
952
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ jsxs(
|
|
953
971
|
"svg",
|
|
954
972
|
{
|
|
955
973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -957,87 +975,96 @@ var ShareIcon = (props) => {
|
|
|
957
975
|
height: "28",
|
|
958
976
|
viewBox: "0 0 28 28",
|
|
959
977
|
fill: "none",
|
|
960
|
-
className: props.className
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
+
className: props.className,
|
|
979
|
+
children: [
|
|
980
|
+
/* @__PURE__ */ jsx(
|
|
981
|
+
"path",
|
|
982
|
+
{
|
|
983
|
+
d: "M5 23.3333V13.6667C5 12.1939 6.15127 11 7.57143 11H10.6744V12.7778H7.57143C7.09804 12.7778 6.71429 13.1757 6.71429 13.6667V23.3333C6.71429 23.8243 7.09804 24.2222 7.57143 24.2222H20.4286C20.902 24.2222 21.2857 23.8243 21.2857 23.3333V13.6667C21.2857 13.1757 20.902 12.7778 20.4286 12.7778H17.555V11H20.4286C21.8487 11 23 12.1939 23 13.6667V23.3333C23 24.8061 21.8487 26 20.4286 26H7.57143C6.15127 26 5 24.8061 5 23.3333Z",
|
|
984
|
+
fill: "black",
|
|
985
|
+
fillOpacity: "0.48"
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
/* @__PURE__ */ jsx(
|
|
989
|
+
"path",
|
|
990
|
+
{
|
|
991
|
+
d: "M13.3759 2.25933C13.7206 1.91356 14.2794 1.91356 14.6241 2.25933L20.2416 7.89432C20.586 8.24011 20.5862 8.80066 20.2416 9.14634C19.897 9.49203 19.3382 9.49185 18.9935 9.14634L14.8827 5.02278V19H13.1173V5.02278L9.00654 9.14634C8.66182 9.49185 8.10301 9.49203 7.7584 9.14634C7.41378 8.80066 7.41396 8.24011 7.7584 7.89432L13.3759 2.25933Z",
|
|
992
|
+
fill: "black",
|
|
993
|
+
fillOpacity: "0.48"
|
|
994
|
+
}
|
|
995
|
+
)
|
|
996
|
+
]
|
|
997
|
+
}
|
|
978
998
|
);
|
|
979
999
|
};
|
|
980
1000
|
var AddIcon = () => {
|
|
981
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ jsxs(
|
|
982
1002
|
"svg",
|
|
983
1003
|
{
|
|
984
1004
|
xmlns: "http://www.w3.org/2000/svg",
|
|
985
1005
|
width: "24",
|
|
986
1006
|
height: "24",
|
|
987
1007
|
viewBox: "0 0 24 24",
|
|
988
|
-
fill: "none"
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1008
|
+
fill: "none",
|
|
1009
|
+
children: [
|
|
1010
|
+
/* @__PURE__ */ jsx(
|
|
1011
|
+
"path",
|
|
1012
|
+
{
|
|
1013
|
+
d: "M7.00598 3.92969H17.006C18.6627 3.92969 20.006 5.27297 20.006 6.92969V16.9297C20.006 18.5864 18.6627 19.9297 17.006 19.9297H7.00598C5.34927 19.9297 4.00598 18.5864 4.00598 16.9297V6.92969C4.00598 5.27297 5.34927 3.92969 7.00598 3.92969Z",
|
|
1014
|
+
stroke: "black",
|
|
1015
|
+
strokeOpacity: "0.88",
|
|
1016
|
+
strokeWidth: "2"
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
/* @__PURE__ */ jsx(
|
|
1020
|
+
"path",
|
|
1021
|
+
{
|
|
1022
|
+
d: "M8 12L16 12",
|
|
1023
|
+
stroke: "black",
|
|
1024
|
+
strokeOpacity: "0.88",
|
|
1025
|
+
strokeWidth: "2",
|
|
1026
|
+
strokeLinecap: "round"
|
|
1027
|
+
}
|
|
1028
|
+
),
|
|
1029
|
+
/* @__PURE__ */ jsx(
|
|
1030
|
+
"path",
|
|
1031
|
+
{
|
|
1032
|
+
d: "M12 8L12 16",
|
|
1033
|
+
stroke: "black",
|
|
1034
|
+
strokeOpacity: "0.88",
|
|
1035
|
+
strokeWidth: "2",
|
|
1036
|
+
strokeLinecap: "round"
|
|
1037
|
+
}
|
|
1038
|
+
)
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1019
1041
|
);
|
|
1020
1042
|
};
|
|
1021
1043
|
var StepItem = (props) => {
|
|
1022
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ jsxs(
|
|
1023
1045
|
Flex,
|
|
1024
1046
|
{
|
|
1025
1047
|
className: " oui-rounded-[12px] oui-w-full oui-overflow-hidden",
|
|
1026
|
-
direction: "column"
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1048
|
+
direction: "column",
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ jsxs(Flex, { className: "oui-bg-base-4 oui-w-full oui-px-3 oui-py-3 oui-gap-[6px]", children: [
|
|
1051
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-80 oui-text-xs oui-w-[18px] oui-h-[18px] oui-rounded-[100%] oui-bg-[linear-gradient(270deg,rgb(var(--oui-gradient-brand-end))_0%,rgb(var(--oui-gradient-brand-start))_100%)] oui-text-center oui-text-base-static-contrast", children: props.index }),
|
|
1052
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-80 oui-text-xs", children: props.title })
|
|
1053
|
+
] }),
|
|
1054
|
+
/* @__PURE__ */ jsx(
|
|
1055
|
+
Flex,
|
|
1056
|
+
{
|
|
1057
|
+
className: cn(
|
|
1058
|
+
"oui-bg-secondary oui-h-[120px] oui-w-full oui-px-6",
|
|
1059
|
+
props.classNames?.content
|
|
1060
|
+
),
|
|
1061
|
+
justify: "center",
|
|
1062
|
+
itemAlign: "center",
|
|
1063
|
+
children: props.content
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1066
|
+
]
|
|
1067
|
+
}
|
|
1041
1068
|
);
|
|
1042
1069
|
};
|
|
1043
1070
|
var OrderlyOSS = "https://oss.orderly.network";
|
|
@@ -1409,25 +1436,30 @@ function useWallet2() {
|
|
|
1409
1436
|
}
|
|
1410
1437
|
function AbstractConnectArea({ connect }) {
|
|
1411
1438
|
const { isMobile } = useScreen();
|
|
1412
|
-
return /* @__PURE__ */
|
|
1413
|
-
"div",
|
|
1414
|
-
{
|
|
1415
|
-
|
|
1416
|
-
" oui-flex oui-flex-1 oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-rounded-[6px] oui-px-2 oui-py-[11px]",
|
|
1417
|
-
isMobile ? "oui-bg-base-5" : "oui-bg-base-10"
|
|
1418
|
-
),
|
|
1419
|
-
onClick: () => connect()
|
|
1420
|
-
},
|
|
1421
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-size-[18px] oui-items-center oui-justify-center" }, /* @__PURE__ */ React19.createElement(
|
|
1422
|
-
"img",
|
|
1439
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1440
|
+
/* @__PURE__ */ jsx("div", { className: "oui-mb-2 oui-text-sm oui-font-semibold oui-text-base-contrast-80", children: "Abstract" }),
|
|
1441
|
+
/* @__PURE__ */ jsx("div", { className: "oui-grid oui-grid-cols-2 oui-gap-2", children: /* @__PURE__ */ jsxs(
|
|
1442
|
+
"div",
|
|
1423
1443
|
{
|
|
1424
|
-
className: cn(
|
|
1425
|
-
|
|
1426
|
-
|
|
1444
|
+
className: cn(
|
|
1445
|
+
" oui-flex oui-flex-1 oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-rounded-[6px] oui-px-2 oui-py-[11px]",
|
|
1446
|
+
isMobile ? "oui-bg-base-5" : "oui-bg-base-10"
|
|
1447
|
+
),
|
|
1448
|
+
onClick: () => connect(),
|
|
1449
|
+
children: [
|
|
1450
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-size-[18px] oui-items-center oui-justify-center", children: /* @__PURE__ */ jsx(
|
|
1451
|
+
"img",
|
|
1452
|
+
{
|
|
1453
|
+
className: cn("oui-size-[12px]"),
|
|
1454
|
+
src: `${PrivyConnectorImagePath}/abstract.png`,
|
|
1455
|
+
alt: "abstract wallet"
|
|
1456
|
+
}
|
|
1457
|
+
) }),
|
|
1458
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-contrast", children: "Abstract" })
|
|
1459
|
+
]
|
|
1427
1460
|
}
|
|
1428
|
-
))
|
|
1429
|
-
|
|
1430
|
-
)));
|
|
1461
|
+
) })
|
|
1462
|
+
] });
|
|
1431
1463
|
}
|
|
1432
1464
|
var RenderLoginMethodsDom = ({
|
|
1433
1465
|
connect,
|
|
@@ -1438,104 +1470,112 @@ var RenderLoginMethodsDom = ({
|
|
|
1438
1470
|
const arr = [];
|
|
1439
1471
|
if (loginMethods?.includes("email")) {
|
|
1440
1472
|
arr.push(
|
|
1441
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ jsxs(
|
|
1442
1474
|
"div",
|
|
1443
1475
|
{
|
|
1444
1476
|
className: cn(
|
|
1445
1477
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border-none oui-px-2 oui-py-[11px]",
|
|
1446
1478
|
"oui-bg-[#333948]"
|
|
1447
1479
|
),
|
|
1448
|
-
onClick: () => connect({ walletType: "privy", extraType: "email" })
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1480
|
+
onClick: () => connect({ walletType: "privy", extraType: "email" }),
|
|
1481
|
+
children: [
|
|
1482
|
+
/* @__PURE__ */ jsx(
|
|
1483
|
+
"img",
|
|
1484
|
+
{
|
|
1485
|
+
src: "https://oss.orderly.network/static/sdk/privy/email.svg",
|
|
1486
|
+
className: "oui-size-[18px]"
|
|
1487
|
+
}
|
|
1488
|
+
),
|
|
1489
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-static", children: t("connector.privy.email") })
|
|
1490
|
+
]
|
|
1491
|
+
}
|
|
1458
1492
|
)
|
|
1459
1493
|
);
|
|
1460
1494
|
}
|
|
1461
1495
|
if (loginMethods?.includes("google")) {
|
|
1462
1496
|
arr.push(
|
|
1463
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ jsxs(
|
|
1464
1498
|
"div",
|
|
1465
1499
|
{
|
|
1466
1500
|
className: cn(
|
|
1467
1501
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border-none oui-px-2 oui-py-[11px]",
|
|
1468
1502
|
"oui-bg-[#335FFC]"
|
|
1469
1503
|
),
|
|
1470
|
-
onClick: () => connect({ walletType: "privy", extraType: "google" })
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1504
|
+
onClick: () => connect({ walletType: "privy", extraType: "google" }),
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ jsx(
|
|
1507
|
+
"img",
|
|
1508
|
+
{
|
|
1509
|
+
src: "https://oss.orderly.network/static/sdk/privy/google.svg",
|
|
1510
|
+
className: "oui-size-[18px]"
|
|
1511
|
+
}
|
|
1512
|
+
),
|
|
1513
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-static", children: t("connector.privy.google") })
|
|
1514
|
+
]
|
|
1515
|
+
}
|
|
1480
1516
|
)
|
|
1481
1517
|
);
|
|
1482
1518
|
}
|
|
1483
1519
|
if (loginMethods?.includes("twitter")) {
|
|
1484
1520
|
arr.push(
|
|
1485
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsxs(
|
|
1486
1522
|
"div",
|
|
1487
1523
|
{
|
|
1488
1524
|
className: cn(
|
|
1489
1525
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border-none oui-px-2 oui-py-[11px]",
|
|
1490
1526
|
"oui-bg-[#07080A]"
|
|
1491
1527
|
),
|
|
1492
|
-
onClick: () => connect({ walletType: "privy", extraType: "twitter" })
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1528
|
+
onClick: () => connect({ walletType: "privy", extraType: "twitter" }),
|
|
1529
|
+
children: [
|
|
1530
|
+
/* @__PURE__ */ jsx(
|
|
1531
|
+
"img",
|
|
1532
|
+
{
|
|
1533
|
+
src: "https://oss.orderly.network/static/sdk/privy/twitter.svg",
|
|
1534
|
+
className: "oui-size-[18px]"
|
|
1535
|
+
}
|
|
1536
|
+
),
|
|
1537
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-static", children: t("connector.privy.twitter") })
|
|
1538
|
+
]
|
|
1539
|
+
}
|
|
1502
1540
|
)
|
|
1503
1541
|
);
|
|
1504
1542
|
}
|
|
1505
1543
|
if (loginMethods?.includes("telegram")) {
|
|
1506
1544
|
arr.push(
|
|
1507
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsxs(
|
|
1508
1546
|
"div",
|
|
1509
1547
|
{
|
|
1510
1548
|
className: cn(
|
|
1511
1549
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border-none oui-px-2 oui-py-[11px]",
|
|
1512
1550
|
"oui-bg-[#3D79A9]"
|
|
1513
1551
|
),
|
|
1514
|
-
onClick: () => connect({ walletType: "privy", extraType: "telegram" })
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1552
|
+
onClick: () => connect({ walletType: "privy", extraType: "telegram" }),
|
|
1553
|
+
children: [
|
|
1554
|
+
/* @__PURE__ */ jsx(
|
|
1555
|
+
"svg",
|
|
1556
|
+
{
|
|
1557
|
+
width: "18",
|
|
1558
|
+
height: "18",
|
|
1559
|
+
viewBox: "0 0 18 18",
|
|
1560
|
+
fill: "none",
|
|
1561
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1562
|
+
children: /* @__PURE__ */ jsx(
|
|
1563
|
+
"path",
|
|
1564
|
+
{
|
|
1565
|
+
d: "M2.652 8.12916L15.0683 4.04929C15.6468 3.87358 16.1499 4.16929 15.9587 4.91069L13.8458 13.3962C13.6898 13.9961 13.2672 14.1461 12.6836 13.859L9.46384 11.8362L7.90929 13.109C7.73824 13.2547 7.59234 13.379 7.2603 13.379L7.4867 10.5891L13.4584 5.99923C13.72 5.80638 13.398 5.69495 13.0559 5.8878L5.68061 9.8434L2.50107 8.99914C1.81687 8.81058 1.80178 8.41201 2.652 8.12916Z",
|
|
1566
|
+
className: "oui-fill-white"
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
}
|
|
1570
|
+
),
|
|
1571
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-static", children: t("connector.privy.telegram") })
|
|
1572
|
+
]
|
|
1573
|
+
}
|
|
1534
1574
|
)
|
|
1535
1575
|
);
|
|
1536
1576
|
}
|
|
1537
1577
|
return arr.map((item, index) => {
|
|
1538
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ jsx("div", { children: item }, index);
|
|
1539
1579
|
});
|
|
1540
1580
|
};
|
|
1541
1581
|
var PrivyConnectAreaMobile = ({
|
|
@@ -1545,7 +1585,10 @@ var PrivyConnectAreaMobile = ({
|
|
|
1545
1585
|
const { isMobile, isDesktop } = useScreen();
|
|
1546
1586
|
const { connectorWalletType, privyConfig } = useWalletConnectorPrivy();
|
|
1547
1587
|
const loginMethods = privyConfig.loginMethods;
|
|
1548
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "oui-w-full", children: [
|
|
1589
|
+
/* @__PURE__ */ jsx(Grid, { cols: 2, rows: 2, className: "oui-w-full", gap: 2, children: /* @__PURE__ */ jsx(RenderLoginMethodsDom, { connect, loginMethods }) }),
|
|
1590
|
+
(!connectorWalletType.disableWagmi || !connectorWalletType.disableSolana) && /* @__PURE__ */ jsx("div", { className: "oui-mt-4 oui-h-px oui-w-full oui-bg-line md:oui-mt-5" })
|
|
1591
|
+
] });
|
|
1549
1592
|
};
|
|
1550
1593
|
var PrivyConnectAreaDesktop = ({
|
|
1551
1594
|
connect
|
|
@@ -1553,16 +1596,19 @@ var PrivyConnectAreaDesktop = ({
|
|
|
1553
1596
|
const { t } = useTranslation();
|
|
1554
1597
|
const { connectorWalletType, privyConfig } = useWalletConnectorPrivy();
|
|
1555
1598
|
const loginMethods = privyConfig.loginMethods;
|
|
1556
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", className: "oui-w-full", children: [
|
|
1600
|
+
/* @__PURE__ */ jsx(Grid, { cols: 1, gap: 2, className: "oui-w-full", children: /* @__PURE__ */ jsx(RenderLoginMethodsDom, { connect, loginMethods }) }),
|
|
1601
|
+
(!connectorWalletType.disableWagmi || !connectorWalletType.disableSolana) && /* @__PURE__ */ jsx("div", { className: "oui-mt-4 oui-h-px oui-w-full oui-bg-line md:oui-mt-5" })
|
|
1602
|
+
] });
|
|
1557
1603
|
};
|
|
1558
1604
|
function PrivyConnectArea({
|
|
1559
1605
|
connect
|
|
1560
1606
|
}) {
|
|
1561
1607
|
const { isDesktop } = useScreen();
|
|
1562
1608
|
if (isDesktop) {
|
|
1563
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx(PrivyConnectAreaDesktop, { connect });
|
|
1564
1610
|
}
|
|
1565
|
-
return /* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ jsx(PrivyConnectAreaMobile, { connect });
|
|
1566
1612
|
}
|
|
1567
1613
|
function RenderPrivyTypeIcon({
|
|
1568
1614
|
type,
|
|
@@ -1570,7 +1616,7 @@ function RenderPrivyTypeIcon({
|
|
|
1570
1616
|
black
|
|
1571
1617
|
}) {
|
|
1572
1618
|
if (type === "email") {
|
|
1573
|
-
return /* @__PURE__ */
|
|
1619
|
+
return /* @__PURE__ */ jsx(
|
|
1574
1620
|
"img",
|
|
1575
1621
|
{
|
|
1576
1622
|
src: `https://oss.orderly.network/static/sdk/privy/email${black ? "-black" : ""}.svg`,
|
|
@@ -1579,7 +1625,7 @@ function RenderPrivyTypeIcon({
|
|
|
1579
1625
|
);
|
|
1580
1626
|
}
|
|
1581
1627
|
if (type === "google_oauth") {
|
|
1582
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ jsx(
|
|
1583
1629
|
"img",
|
|
1584
1630
|
{
|
|
1585
1631
|
src: "https://oss.orderly.network/static/sdk/privy/google.svg",
|
|
@@ -1588,7 +1634,7 @@ function RenderPrivyTypeIcon({
|
|
|
1588
1634
|
);
|
|
1589
1635
|
}
|
|
1590
1636
|
if (type === "twitter_oauth") {
|
|
1591
|
-
return /* @__PURE__ */
|
|
1637
|
+
return /* @__PURE__ */ jsx(
|
|
1592
1638
|
"img",
|
|
1593
1639
|
{
|
|
1594
1640
|
src: `https://oss.orderly.network/static/sdk/privy/twitter${black ? "-black" : ""}.svg`,
|
|
@@ -1597,25 +1643,25 @@ function RenderPrivyTypeIcon({
|
|
|
1597
1643
|
);
|
|
1598
1644
|
}
|
|
1599
1645
|
if (type === "telegram") {
|
|
1600
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx(
|
|
1601
1647
|
"svg",
|
|
1602
1648
|
{
|
|
1603
1649
|
width: size,
|
|
1604
1650
|
height: size,
|
|
1605
1651
|
viewBox: "0 0 18 18",
|
|
1606
1652
|
fill: "none",
|
|
1607
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1653
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1654
|
+
children: /* @__PURE__ */ jsx(
|
|
1655
|
+
"path",
|
|
1656
|
+
{
|
|
1657
|
+
d: "M2.652 8.12916L15.0683 4.04929C15.6468 3.87358 16.1499 4.16929 15.9587 4.91069L13.8458 13.3962C13.6898 13.9961 13.2672 14.1461 12.6836 13.859L9.46384 11.8362L7.90929 13.109C7.73824 13.2547 7.59234 13.379 7.2603 13.379L7.4867 10.5891L13.4584 5.99923C13.72 5.80638 13.398 5.69495 13.0559 5.8878L5.68061 9.8434L2.50107 8.99914C1.81687 8.81058 1.80178 8.41201 2.652 8.12916Z",
|
|
1658
|
+
fill: black ? "black" : "white"
|
|
1659
|
+
}
|
|
1660
|
+
)
|
|
1661
|
+
}
|
|
1616
1662
|
);
|
|
1617
1663
|
}
|
|
1618
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsx(
|
|
1619
1665
|
"img",
|
|
1620
1666
|
{
|
|
1621
1667
|
src: `https://oss.orderly.network/static/sdk/privy/email${black ? "-black" : ""}.svg`,
|
|
@@ -1627,7 +1673,7 @@ function RenderWalletIcon({
|
|
|
1627
1673
|
connector
|
|
1628
1674
|
}) {
|
|
1629
1675
|
const icon = connector.icon ? connector.icon : getWalletIcon(connector.type);
|
|
1630
|
-
return /* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ jsx("div", { className: "oui-w-[18px] oui-h-[18px] oui-flex oui-items-center oui-justify-center", children: /* @__PURE__ */ jsx(
|
|
1631
1677
|
"img",
|
|
1632
1678
|
{
|
|
1633
1679
|
className: cn(
|
|
@@ -1636,7 +1682,7 @@ function RenderWalletIcon({
|
|
|
1636
1682
|
src: icon,
|
|
1637
1683
|
alt: connector.name
|
|
1638
1684
|
}
|
|
1639
|
-
));
|
|
1685
|
+
) });
|
|
1640
1686
|
}
|
|
1641
1687
|
function EVMChainPopover({ children }) {
|
|
1642
1688
|
const { getChainsByNetwork } = useWalletConnectorPrivy();
|
|
@@ -1645,71 +1691,84 @@ function EVMChainPopover({ children }) {
|
|
|
1645
1691
|
const { isMobile } = useScreen();
|
|
1646
1692
|
const [open, setOpen] = useState(false);
|
|
1647
1693
|
if (isMobile) {
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
open,
|
|
1652
|
-
size: "xs",
|
|
1653
|
-
onOpenChange: setOpen,
|
|
1654
|
-
classNames: {
|
|
1655
|
-
content: "oui-p-4 oui-z-[99]",
|
|
1656
|
-
overlay: "oui-z-[99]"
|
|
1657
|
-
},
|
|
1658
|
-
title: t("connector.privy.supportedEvmChain")
|
|
1659
|
-
},
|
|
1660
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-p-1 oui-grid oui-grid-cols-2 oui-gap-x-2 oui-gap-y-3 oui-text-2xs oui-text-base-contrast-54" }, chains.map((item, key) => /* @__PURE__ */ React19.createElement(
|
|
1661
|
-
"div",
|
|
1694
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1695
|
+
/* @__PURE__ */ jsx(
|
|
1696
|
+
SimpleDialog,
|
|
1662
1697
|
{
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1698
|
+
open,
|
|
1699
|
+
size: "xs",
|
|
1700
|
+
onOpenChange: setOpen,
|
|
1701
|
+
classNames: {
|
|
1702
|
+
content: "oui-p-4 oui-z-[99]",
|
|
1703
|
+
overlay: "oui-z-[99]"
|
|
1704
|
+
},
|
|
1705
|
+
title: t("connector.privy.supportedEvmChain"),
|
|
1706
|
+
children: /* @__PURE__ */ jsx("div", { className: "oui-p-1 oui-grid oui-grid-cols-2 oui-gap-x-2 oui-gap-y-3 oui-text-2xs oui-text-base-contrast-54", children: chains.map((item, key) => /* @__PURE__ */ jsxs(
|
|
1707
|
+
"div",
|
|
1708
|
+
{
|
|
1709
|
+
className: "oui-flex oui-items-center oui-justify-start oui-gap-1",
|
|
1710
|
+
children: [
|
|
1711
|
+
/* @__PURE__ */ jsx(ChainIcon, { chainId: item.id, size: "2xs" }),
|
|
1712
|
+
/* @__PURE__ */ jsx("div", { children: item.name })
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1715
|
+
key
|
|
1716
|
+
)) })
|
|
1717
|
+
}
|
|
1718
|
+
),
|
|
1719
|
+
/* @__PURE__ */ jsx("button", { onClick: () => setOpen(true), children })
|
|
1720
|
+
] });
|
|
1670
1721
|
}
|
|
1671
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsx(
|
|
1672
1723
|
Popover,
|
|
1673
1724
|
{
|
|
1674
|
-
content: /* @__PURE__ */
|
|
1675
|
-
"div",
|
|
1676
|
-
{
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1725
|
+
content: /* @__PURE__ */ jsxs("div", { children: [
|
|
1726
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast", children: t("connector.privy.supportedEvmChain") }),
|
|
1727
|
+
/* @__PURE__ */ jsx("div", { className: "oui-mt-3 oui-grid oui-grid-cols-3 oui-gap-x-2 oui-gap-y-3 oui-text-2xs oui-text-base-contrast-54", children: chains.map((item, key) => /* @__PURE__ */ jsxs(
|
|
1728
|
+
"div",
|
|
1729
|
+
{
|
|
1730
|
+
className: "oui-flex oui-items-center oui-justify-start oui-gap-1",
|
|
1731
|
+
children: [
|
|
1732
|
+
/* @__PURE__ */ jsx(ChainIcon, { chainId: item.id, size: "2xs" }),
|
|
1733
|
+
/* @__PURE__ */ jsx("div", { children: item.name })
|
|
1734
|
+
]
|
|
1735
|
+
},
|
|
1736
|
+
key
|
|
1737
|
+
)) })
|
|
1738
|
+
] }),
|
|
1683
1739
|
arrow: true,
|
|
1684
1740
|
contentProps: {
|
|
1685
1741
|
side: "bottom",
|
|
1686
1742
|
align: "center",
|
|
1687
1743
|
className: "oui-p-2 oui-z-[65]"
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1744
|
+
},
|
|
1745
|
+
children: /* @__PURE__ */ jsx("button", { children })
|
|
1746
|
+
}
|
|
1691
1747
|
);
|
|
1692
1748
|
}
|
|
1693
|
-
|
|
1694
|
-
// src/components/renderConnector/solanaConnector.tsx
|
|
1695
1749
|
function SOLConnectArea({
|
|
1696
1750
|
connect
|
|
1697
1751
|
}) {
|
|
1698
1752
|
const { wallets } = useSolanaWallet();
|
|
1699
1753
|
const { isMobile } = useScreen();
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
"div",
|
|
1702
|
-
{
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1754
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1755
|
+
/* @__PURE__ */ jsx("div", { className: "oui-mb-2 oui-text-sm oui-font-semibold oui-text-base-contrast-80", children: "Solana" }),
|
|
1756
|
+
/* @__PURE__ */ jsx("div", { className: "oui-grid oui-grid-cols-2 oui-gap-2", children: wallets.map((item, key) => /* @__PURE__ */ jsxs(
|
|
1757
|
+
"div",
|
|
1758
|
+
{
|
|
1759
|
+
className: cn(
|
|
1760
|
+
" oui-flex oui-flex-1 oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-rounded-[6px] oui-px-2 oui-py-[11px]",
|
|
1761
|
+
isMobile ? "oui-bg-base-5" : "oui-bg-base-10"
|
|
1762
|
+
),
|
|
1763
|
+
onClick: () => connect(item.adapter),
|
|
1764
|
+
children: [
|
|
1765
|
+
/* @__PURE__ */ jsx(RenderWalletIcon, { connector: item.adapter }),
|
|
1766
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-contrast", children: item.adapter.name })
|
|
1767
|
+
]
|
|
1768
|
+
},
|
|
1769
|
+
key
|
|
1770
|
+
)) })
|
|
1771
|
+
] });
|
|
1713
1772
|
}
|
|
1714
1773
|
function EVMConnectArea({
|
|
1715
1774
|
connect
|
|
@@ -1725,22 +1784,25 @@ function EVMConnectArea({
|
|
|
1725
1784
|
}
|
|
1726
1785
|
connect(item);
|
|
1727
1786
|
};
|
|
1728
|
-
return /* @__PURE__ */
|
|
1729
|
-
"div",
|
|
1730
|
-
{
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1787
|
+
return /* @__PURE__ */ jsxs("div", { className: "", children: [
|
|
1788
|
+
/* @__PURE__ */ jsx("div", { className: "oui-mb-2 oui-text-sm oui-font-semibold oui-text-base-contrast-80", children: "EVM" }),
|
|
1789
|
+
/* @__PURE__ */ jsx("div", { className: "oui-grid oui-grid-cols-2 oui-gap-2", children: connectors.map((item, key) => /* @__PURE__ */ jsxs(
|
|
1790
|
+
"div",
|
|
1791
|
+
{
|
|
1792
|
+
className: cn(
|
|
1793
|
+
" oui-flex oui-flex-1 oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-rounded-[6px] oui-px-2 oui-py-[11px]",
|
|
1794
|
+
isMobile ? "oui-bg-base-5" : "oui-bg-base-10"
|
|
1795
|
+
),
|
|
1796
|
+
onClick: () => onConnect(item),
|
|
1797
|
+
children: [
|
|
1798
|
+
/* @__PURE__ */ jsx(RenderWalletIcon, { connector: item }),
|
|
1799
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-contrast", children: item.name })
|
|
1800
|
+
]
|
|
1801
|
+
},
|
|
1802
|
+
key
|
|
1803
|
+
)) })
|
|
1804
|
+
] });
|
|
1741
1805
|
}
|
|
1742
|
-
|
|
1743
|
-
// src/components/renderConnector/index.tsx
|
|
1744
1806
|
function RenderConnector() {
|
|
1745
1807
|
const { connect } = useWallet2();
|
|
1746
1808
|
const {
|
|
@@ -1769,7 +1831,7 @@ function RenderConnector() {
|
|
|
1769
1831
|
if (connectorWalletType.disablePrivy) {
|
|
1770
1832
|
return null;
|
|
1771
1833
|
}
|
|
1772
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ jsx(
|
|
1773
1835
|
PrivyConnectArea,
|
|
1774
1836
|
{
|
|
1775
1837
|
connect: (type) => handleConnect({
|
|
@@ -1786,7 +1848,7 @@ function RenderConnector() {
|
|
|
1786
1848
|
if (!walletChainTypeConfig.hasEvm) {
|
|
1787
1849
|
return null;
|
|
1788
1850
|
}
|
|
1789
|
-
return /* @__PURE__ */
|
|
1851
|
+
return /* @__PURE__ */ jsx(
|
|
1790
1852
|
EVMConnectArea,
|
|
1791
1853
|
{
|
|
1792
1854
|
connect: (connector) => handleConnect({
|
|
@@ -1803,7 +1865,7 @@ function RenderConnector() {
|
|
|
1803
1865
|
if (!walletChainTypeConfig.hasSol) {
|
|
1804
1866
|
return null;
|
|
1805
1867
|
}
|
|
1806
|
-
return /* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ jsx(
|
|
1807
1869
|
SOLConnectArea,
|
|
1808
1870
|
{
|
|
1809
1871
|
connect: (walletAdapter) => handleConnect({
|
|
@@ -1820,7 +1882,7 @@ function RenderConnector() {
|
|
|
1820
1882
|
if (!walletChainTypeConfig.hasAbstract) {
|
|
1821
1883
|
return null;
|
|
1822
1884
|
}
|
|
1823
|
-
return /* @__PURE__ */
|
|
1885
|
+
return /* @__PURE__ */ jsx(
|
|
1824
1886
|
AbstractConnectArea,
|
|
1825
1887
|
{
|
|
1826
1888
|
connect: () => handleConnect({ walletType: "Abstract" /* ABSTRACT */ })
|
|
@@ -1850,7 +1912,10 @@ function RenderConnector() {
|
|
|
1850
1912
|
return null;
|
|
1851
1913
|
}
|
|
1852
1914
|
};
|
|
1853
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ jsx(ScrollArea, { className: "oui-flex oui-grow oui-shrik oui-basis-auto oui-custom-scrollbar", children: /* @__PURE__ */ jsxs("div", { className: cn("oui-flex oui-flex-col oui-gap-4", "md:oui-gap-5"), children: [
|
|
1916
|
+
renderPrivyConnectArea(),
|
|
1917
|
+
orderedWalletKeys.map((key) => /* @__PURE__ */ jsx(React7.Fragment, { children: renderByKey(key) }, key))
|
|
1918
|
+
] }) });
|
|
1854
1919
|
}
|
|
1855
1920
|
function SwitchNetworkTips({
|
|
1856
1921
|
tipsContent
|
|
@@ -1872,22 +1937,27 @@ function SwitchNetworkTips({
|
|
|
1872
1937
|
(error) => void 0
|
|
1873
1938
|
);
|
|
1874
1939
|
};
|
|
1875
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ jsxs(
|
|
1876
1941
|
"div",
|
|
1877
1942
|
{
|
|
1878
1943
|
onClick: onSwitchNetwork,
|
|
1879
|
-
className: "oui-mb-3 oui-flex oui-cursor-pointer oui-items-center oui-justify-between oui-gap-1 oui-rounded-[8px] oui-bg-[rgba(var(--oui-color-warning-darken),0.1)] oui-px-2 oui-py-[6px] "
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1944
|
+
className: "oui-mb-3 oui-flex oui-cursor-pointer oui-items-center oui-justify-between oui-gap-1 oui-rounded-[8px] oui-bg-[rgba(var(--oui-color-warning-darken),0.1)] oui-px-2 oui-py-[6px] ",
|
|
1945
|
+
children: [
|
|
1946
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
|
1947
|
+
/* @__PURE__ */ jsx(
|
|
1948
|
+
ExclamationFillIcon,
|
|
1949
|
+
{
|
|
1950
|
+
size: 14,
|
|
1951
|
+
className: " oui-shrink-0 oui-text-warning-darken"
|
|
1952
|
+
}
|
|
1953
|
+
),
|
|
1954
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-warning-darken", children: t("connector.privy.switchNetwork.tips", {
|
|
1955
|
+
chainName: tipsContent
|
|
1956
|
+
}) })
|
|
1957
|
+
] }),
|
|
1958
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { size: 14, className: "oui-text-warning-darken" })
|
|
1959
|
+
]
|
|
1960
|
+
}
|
|
1891
1961
|
);
|
|
1892
1962
|
}
|
|
1893
1963
|
var StorageChainNotCurrentWalletType = ({
|
|
@@ -1920,7 +1990,7 @@ var StorageChainNotCurrentWalletType = ({
|
|
|
1920
1990
|
}).join("/");
|
|
1921
1991
|
return text;
|
|
1922
1992
|
}, [storageChain, currentWalletType]);
|
|
1923
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ jsx(SwitchNetworkTips, { tipsContent });
|
|
1924
1994
|
};
|
|
1925
1995
|
var getCardBgClassName = (type = "EVM" /* EVM */) => {
|
|
1926
1996
|
const cardBgColorMap = {
|
|
@@ -1944,7 +2014,7 @@ function WalletCard(props) {
|
|
|
1944
2014
|
await navigator.clipboard.writeText(address);
|
|
1945
2015
|
toast.success(t("common.copy.copied"));
|
|
1946
2016
|
};
|
|
1947
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ jsxs(
|
|
1948
2018
|
"div",
|
|
1949
2019
|
{
|
|
1950
2020
|
className: cn(
|
|
@@ -1955,46 +2025,60 @@ function WalletCard(props) {
|
|
|
1955
2025
|
props.isMulti || false,
|
|
1956
2026
|
props.type
|
|
1957
2027
|
)
|
|
1958
|
-
)
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2028
|
+
),
|
|
2029
|
+
children: [
|
|
2030
|
+
/* @__PURE__ */ jsx(
|
|
2031
|
+
"div",
|
|
2032
|
+
{
|
|
2033
|
+
style: {
|
|
2034
|
+
position: "absolute",
|
|
2035
|
+
top: 0,
|
|
2036
|
+
right: -20,
|
|
2037
|
+
background: "url('https://oss.orderly.network/static/sdk/wallet-card-bg.png')",
|
|
2038
|
+
width: "110px",
|
|
2039
|
+
height: "110px",
|
|
2040
|
+
backgroundSize: "contain",
|
|
2041
|
+
backgroundRepeat: "no-repeat",
|
|
2042
|
+
backgroundPosition: "center",
|
|
2043
|
+
zIndex: 0
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
),
|
|
2047
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-relative oui-z-10 oui-flex oui-h-full oui-flex-col oui-justify-between", children: [
|
|
2048
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-between", children: [
|
|
2049
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-sm oui-font-semibold oui-text-secondary", children: formatAddress(props.address) }),
|
|
2050
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-2", children: [
|
|
2051
|
+
/* @__PURE__ */ jsx(Tooltip, { content: t("common.copy"), className: "oui-z-[65]", children: /* @__PURE__ */ jsx(
|
|
2052
|
+
CopyIcon,
|
|
2053
|
+
{
|
|
2054
|
+
size: 16,
|
|
2055
|
+
opacity: 1,
|
|
2056
|
+
className: "oui-cursor-pointer oui-text-secondary/80 hover:oui-text-secondary",
|
|
2057
|
+
onClick: () => copyAddress(props.address)
|
|
2058
|
+
}
|
|
2059
|
+
) }),
|
|
2060
|
+
props.isPrivy ? /* @__PURE__ */ jsx(
|
|
2061
|
+
PrivyWalletHandleOption,
|
|
2062
|
+
{
|
|
2063
|
+
address: props.address,
|
|
2064
|
+
type: props.type
|
|
2065
|
+
}
|
|
2066
|
+
) : /* @__PURE__ */ jsx(NonPrivyWalletHandleOption, { walletType: props.type })
|
|
2067
|
+
] })
|
|
2068
|
+
] }),
|
|
2069
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-between", children: [
|
|
2070
|
+
/* @__PURE__ */ jsx(RenderWalletType, { walletType: props.type }),
|
|
2071
|
+
props.isMulti && /* @__PURE__ */ jsx("div", { className: "[&_button]:oui-border-secondary/80 [&_svg]:oui-text-secondary", children: /* @__PURE__ */ jsx(
|
|
2072
|
+
Checkbox,
|
|
2073
|
+
{
|
|
2074
|
+
checked: props.isActive,
|
|
2075
|
+
onCheckedChange: props.onActiveChange
|
|
2076
|
+
}
|
|
2077
|
+
) })
|
|
2078
|
+
] })
|
|
2079
|
+
] })
|
|
2080
|
+
]
|
|
2081
|
+
}
|
|
1998
2082
|
);
|
|
1999
2083
|
}
|
|
2000
2084
|
function NonPrivyWalletHandleOption({
|
|
@@ -2016,7 +2100,7 @@ function NonPrivyWalletHandleOption({
|
|
|
2016
2100
|
}
|
|
2017
2101
|
disconnect(walletConnectType);
|
|
2018
2102
|
};
|
|
2019
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ jsx("div", { onClick: () => disconnectWallet(), children: /* @__PURE__ */ jsx(DisconnectIcon, { className: "oui-size-4 oui-cursor-pointer oui-text-secondary/80 hover:oui-text-secondary" }) });
|
|
2020
2104
|
}
|
|
2021
2105
|
function PrivyWalletHandleOption({
|
|
2022
2106
|
address,
|
|
@@ -2024,64 +2108,79 @@ function PrivyWalletHandleOption({
|
|
|
2024
2108
|
}) {
|
|
2025
2109
|
const { t } = useTranslation();
|
|
2026
2110
|
const { exportWallet } = usePrivyWallet();
|
|
2027
|
-
return /* @__PURE__ */
|
|
2028
|
-
|
|
2029
|
-
{
|
|
2030
|
-
|
|
2031
|
-
align: "end",
|
|
2032
|
-
side: "top",
|
|
2033
|
-
style: { width: "100px" },
|
|
2034
|
-
className: "oui-z-[65] oui-rounded oui-p-1 oui-font-semibold",
|
|
2035
|
-
sideOffset: 0
|
|
2036
|
-
},
|
|
2037
|
-
/* @__PURE__ */ React19.createElement(
|
|
2038
|
-
DropdownMenuItem,
|
|
2111
|
+
return /* @__PURE__ */ jsxs(DropdownMenuRoot, { children: [
|
|
2112
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { children: /* @__PURE__ */ jsx(MoreIcon, { className: "oui-cursor-pointer oui-text-secondary/80 hover:oui-text-secondary" }) }) }),
|
|
2113
|
+
/* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
|
|
2114
|
+
DropdownMenuContent,
|
|
2039
2115
|
{
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2116
|
+
size: "xl",
|
|
2117
|
+
align: "end",
|
|
2118
|
+
side: "top",
|
|
2119
|
+
style: { width: "100px" },
|
|
2120
|
+
className: "oui-z-[65] oui-rounded oui-p-1 oui-font-semibold",
|
|
2121
|
+
sideOffset: 0,
|
|
2122
|
+
children: /* @__PURE__ */ jsx(
|
|
2123
|
+
DropdownMenuItem,
|
|
2124
|
+
{
|
|
2125
|
+
className: "oui-cursor-pointer oui-px-2 oui-py-1 oui-text-2xs oui-text-base-contrast-54 hover:oui-text-base-contrast",
|
|
2126
|
+
onClick: () => {
|
|
2127
|
+
const ns = type === "EVM" /* EVM */ ? ChainNamespace.evm : ChainNamespace.solana;
|
|
2128
|
+
exportWallet(ns, address);
|
|
2129
|
+
},
|
|
2130
|
+
children: /* @__PURE__ */ jsx("div", { children: t("common.export") })
|
|
2131
|
+
}
|
|
2132
|
+
)
|
|
2133
|
+
}
|
|
2134
|
+
) })
|
|
2135
|
+
] });
|
|
2049
2136
|
}
|
|
2050
2137
|
var RenderWalletType = ({ walletType }) => {
|
|
2051
2138
|
if (walletType === "SOL" /* SOL */) {
|
|
2052
|
-
return /* @__PURE__ */
|
|
2053
|
-
"
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2139
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-start oui-gap-1", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
|
|
2141
|
+
"img",
|
|
2142
|
+
{
|
|
2143
|
+
src: "https://oss.orderly.network/static/sdk/solana-logo.png",
|
|
2144
|
+
className: "oui-w-4"
|
|
2145
|
+
}
|
|
2146
|
+
) }),
|
|
2147
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-secondary", children: "Solana" })
|
|
2148
|
+
] });
|
|
2059
2149
|
}
|
|
2060
2150
|
if (walletType === "Abstract" /* ABSTRACT */) {
|
|
2061
|
-
return /* @__PURE__ */
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2151
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-start oui-gap-[6px]", children: [
|
|
2152
|
+
/* @__PURE__ */ jsx(
|
|
2153
|
+
"img",
|
|
2154
|
+
{
|
|
2155
|
+
src: `${PrivyConnectorImagePath}/abstract-transparent.png`,
|
|
2156
|
+
className: "oui-w-4"
|
|
2157
|
+
}
|
|
2158
|
+
),
|
|
2159
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-secondary", children: "Abstract" })
|
|
2160
|
+
] });
|
|
2068
2161
|
}
|
|
2069
2162
|
if (walletType === "EVM" /* EVM */) {
|
|
2070
|
-
return /* @__PURE__ */
|
|
2071
|
-
"
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
{
|
|
2079
|
-
className: "oui-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2163
|
+
return /* @__PURE__ */ jsx("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1", children: /* @__PURE__ */ jsxs("div", { className: "oui-relative oui-flex oui-items-center oui-justify-center", children: [
|
|
2164
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-h-[18px] oui-items-center oui-justify-center ", children: /* @__PURE__ */ jsx(
|
|
2165
|
+
"img",
|
|
2166
|
+
{
|
|
2167
|
+
src: "https://oss.orderly.network/static/sdk/chains.png",
|
|
2168
|
+
className: "oui-relative oui-z-0 oui-h-[18px] oui-w-[49px]"
|
|
2169
|
+
}
|
|
2170
|
+
) }),
|
|
2171
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-relative oui-left-[-9px] oui-flex oui-items-center oui-justify-center oui-gap-1", children: [
|
|
2172
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-size-[18px] oui-items-center oui-justify-center oui-rounded-full oui-bg-base-5", children: /* @__PURE__ */ jsx(EVMChainPopover, { children: /* @__PURE__ */ jsx(
|
|
2173
|
+
MoreIcon,
|
|
2174
|
+
{
|
|
2175
|
+
className: "oui-relative oui-z-10 oui-size-3 oui-text-secondary/80 hover:oui-text-secondary",
|
|
2176
|
+
style: { zIndex: 1 }
|
|
2177
|
+
}
|
|
2178
|
+
) }) }),
|
|
2179
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-secondary", children: "Evm" })
|
|
2180
|
+
] })
|
|
2181
|
+
] }) });
|
|
2083
2182
|
}
|
|
2084
|
-
return /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
2085
2184
|
};
|
|
2086
2185
|
function AddAbstractWallet() {
|
|
2087
2186
|
const [visible, setVisible] = useState(false);
|
|
@@ -2118,61 +2217,70 @@ function AddAbstractWallet() {
|
|
|
2118
2217
|
}
|
|
2119
2218
|
};
|
|
2120
2219
|
}, [open]);
|
|
2121
|
-
return /* @__PURE__ */
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2125
|
-
open,
|
|
2126
|
-
content: t("connector.privy.addAbstractWallet.tips")
|
|
2127
|
-
},
|
|
2128
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 " }, /* @__PURE__ */ React19.createElement(
|
|
2129
|
-
"img",
|
|
2220
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-rounded-[8px] oui-bg-base-10 oui-px-2 oui-py-[11px]", children: [
|
|
2221
|
+
/* @__PURE__ */ jsx(
|
|
2222
|
+
Tooltip,
|
|
2130
2223
|
{
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2224
|
+
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2225
|
+
open,
|
|
2226
|
+
content: t("connector.privy.addAbstractWallet.tips"),
|
|
2227
|
+
children: /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 ", children: [
|
|
2228
|
+
/* @__PURE__ */ jsx(
|
|
2229
|
+
"img",
|
|
2230
|
+
{
|
|
2231
|
+
src: `${PrivyConnectorImagePath}/abstract-transparent.png`,
|
|
2232
|
+
className: "oui-size-[15px]"
|
|
2233
|
+
}
|
|
2234
|
+
),
|
|
2235
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast-80", children: t("connector.privy.addAbstractWallet") }),
|
|
2236
|
+
/* @__PURE__ */ jsx("button", { onClick: onToggleVisibility, children: visible ? /* @__PURE__ */ jsx(
|
|
2237
|
+
ChevronDownIcon,
|
|
2238
|
+
{
|
|
2239
|
+
size: 16,
|
|
2240
|
+
opacity: 1,
|
|
2241
|
+
className: "oui-text-base-contrast-36"
|
|
2242
|
+
}
|
|
2243
|
+
) : /* @__PURE__ */ jsx(
|
|
2244
|
+
ChevronUpIcon,
|
|
2245
|
+
{
|
|
2246
|
+
size: 16,
|
|
2247
|
+
opacity: 1,
|
|
2248
|
+
className: "oui-text-base-contrast"
|
|
2249
|
+
}
|
|
2250
|
+
) })
|
|
2251
|
+
] })
|
|
2147
2252
|
}
|
|
2148
|
-
)
|
|
2149
|
-
|
|
2150
|
-
"div",
|
|
2151
|
-
{
|
|
2152
|
-
className: cn(
|
|
2153
|
-
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2154
|
-
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2155
|
-
)
|
|
2156
|
-
},
|
|
2157
|
-
/* @__PURE__ */ React19.createElement(
|
|
2253
|
+
),
|
|
2254
|
+
/* @__PURE__ */ jsx(
|
|
2158
2255
|
"div",
|
|
2159
2256
|
{
|
|
2160
|
-
className:
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2257
|
+
className: cn(
|
|
2258
|
+
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2259
|
+
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2260
|
+
),
|
|
2261
|
+
children: /* @__PURE__ */ jsxs(
|
|
2262
|
+
"div",
|
|
2263
|
+
{
|
|
2264
|
+
className: "oui-flex oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-bg-base-9 oui-px-2 oui-py-[11px]",
|
|
2265
|
+
onClick: () => connect({
|
|
2266
|
+
walletType: "Abstract" /* ABSTRACT */
|
|
2267
|
+
}),
|
|
2268
|
+
children: [
|
|
2269
|
+
/* @__PURE__ */ jsx(
|
|
2270
|
+
"img",
|
|
2271
|
+
{
|
|
2272
|
+
className: cn("oui-size-[12px]"),
|
|
2273
|
+
src: `${PrivyConnectorImagePath}/abstract.png`,
|
|
2274
|
+
alt: "abstract wallet"
|
|
2275
|
+
}
|
|
2276
|
+
),
|
|
2277
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-contrast", children: "Abstract" })
|
|
2278
|
+
]
|
|
2279
|
+
}
|
|
2280
|
+
)
|
|
2281
|
+
}
|
|
2174
2282
|
)
|
|
2175
|
-
)
|
|
2283
|
+
] });
|
|
2176
2284
|
}
|
|
2177
2285
|
function AddEvmWallet() {
|
|
2178
2286
|
const { t } = useTranslation();
|
|
@@ -2207,59 +2315,71 @@ function AddEvmWallet() {
|
|
|
2207
2315
|
}
|
|
2208
2316
|
};
|
|
2209
2317
|
}, [open]);
|
|
2210
|
-
return /* @__PURE__ */
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2214
|
-
open,
|
|
2215
|
-
content: t("connector.privy.addEvmWallet.tips")
|
|
2216
|
-
},
|
|
2217
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 " }, /* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1" }, /* @__PURE__ */ React19.createElement("div", { className: "oui-relative oui-flex oui-w-[55px] oui-items-center oui-justify-start" }, /* @__PURE__ */ React19.createElement(
|
|
2218
|
-
"img",
|
|
2219
|
-
{
|
|
2220
|
-
src: "https://oss.orderly.network/static/sdk/chains.png",
|
|
2221
|
-
className: "oui-relative oui-z-0 oui-h-[18px]"
|
|
2222
|
-
}
|
|
2223
|
-
), /* @__PURE__ */ React19.createElement("div", { className: "oui-absolute oui-right-0 oui-flex oui-size-[18px] oui-items-center oui-justify-center oui-rounded-full oui-bg-base-5" }, /* @__PURE__ */ React19.createElement(EVMChainPopover, null, /* @__PURE__ */ React19.createElement(
|
|
2224
|
-
MoreIcon,
|
|
2318
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-rounded-[8px] oui-bg-base-10 oui-px-2 oui-py-[11px]", children: [
|
|
2319
|
+
/* @__PURE__ */ jsx(
|
|
2320
|
+
Tooltip,
|
|
2225
2321
|
{
|
|
2226
|
-
className: "oui-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2322
|
+
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2323
|
+
open,
|
|
2324
|
+
content: t("connector.privy.addEvmWallet.tips"),
|
|
2325
|
+
children: /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 ", children: [
|
|
2326
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1", children: /* @__PURE__ */ jsxs("div", { className: "oui-relative oui-flex oui-w-[55px] oui-items-center oui-justify-start", children: [
|
|
2327
|
+
/* @__PURE__ */ jsx(
|
|
2328
|
+
"img",
|
|
2329
|
+
{
|
|
2330
|
+
src: "https://oss.orderly.network/static/sdk/chains.png",
|
|
2331
|
+
className: "oui-relative oui-z-0 oui-h-[18px]"
|
|
2332
|
+
}
|
|
2333
|
+
),
|
|
2334
|
+
/* @__PURE__ */ jsx("div", { className: "oui-absolute oui-right-0 oui-flex oui-size-[18px] oui-items-center oui-justify-center oui-rounded-full oui-bg-base-5", children: /* @__PURE__ */ jsx(EVMChainPopover, { children: /* @__PURE__ */ jsx(
|
|
2335
|
+
MoreIcon,
|
|
2336
|
+
{
|
|
2337
|
+
className: "oui-relative oui-z-10 oui-size-3 oui-text-base-contrast-54 hover:oui-text-base-contrast",
|
|
2338
|
+
style: { zIndex: 1 }
|
|
2339
|
+
}
|
|
2340
|
+
) }) })
|
|
2341
|
+
] }) }),
|
|
2342
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast-80", children: t("connector.privy.addEvmWallet") }),
|
|
2343
|
+
/* @__PURE__ */ jsx("button", { onClick: () => setVisible(!visible), children: visible ? /* @__PURE__ */ jsx(
|
|
2344
|
+
ChevronDownIcon,
|
|
2345
|
+
{
|
|
2346
|
+
size: 16,
|
|
2347
|
+
opacity: 1,
|
|
2348
|
+
className: "oui-text-base-contrast-36"
|
|
2349
|
+
}
|
|
2350
|
+
) : /* @__PURE__ */ jsx(
|
|
2351
|
+
ChevronUpIcon,
|
|
2352
|
+
{
|
|
2353
|
+
size: 16,
|
|
2354
|
+
opacity: 1,
|
|
2355
|
+
className: "oui-text-base-contrast"
|
|
2356
|
+
}
|
|
2357
|
+
) })
|
|
2358
|
+
] })
|
|
2242
2359
|
}
|
|
2243
|
-
)
|
|
2244
|
-
|
|
2245
|
-
"div",
|
|
2246
|
-
{
|
|
2247
|
-
className: cn(
|
|
2248
|
-
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2249
|
-
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2250
|
-
)
|
|
2251
|
-
},
|
|
2252
|
-
connectors.map((item, index) => /* @__PURE__ */ React19.createElement(
|
|
2360
|
+
),
|
|
2361
|
+
/* @__PURE__ */ jsx(
|
|
2253
2362
|
"div",
|
|
2254
2363
|
{
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2364
|
+
className: cn(
|
|
2365
|
+
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2366
|
+
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2367
|
+
),
|
|
2368
|
+
children: connectors.map((item, index) => /* @__PURE__ */ jsxs(
|
|
2369
|
+
"div",
|
|
2370
|
+
{
|
|
2371
|
+
className: "oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-bg-base-9 oui-px-2 oui-py-[11px] oui-text-2xs",
|
|
2372
|
+
onClick: () => connect({ walletType: "EVM" /* EVM */, connector: item }),
|
|
2373
|
+
children: [
|
|
2374
|
+
/* @__PURE__ */ jsx(RenderWalletIcon, { connector: item }),
|
|
2375
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-base-contrast", children: item.name })
|
|
2376
|
+
]
|
|
2377
|
+
},
|
|
2378
|
+
index
|
|
2379
|
+
))
|
|
2380
|
+
}
|
|
2381
|
+
)
|
|
2382
|
+
] });
|
|
2263
2383
|
}
|
|
2264
2384
|
function AddSolanaWallet() {
|
|
2265
2385
|
const { t } = useTranslation();
|
|
@@ -2297,59 +2417,66 @@ function AddSolanaWallet() {
|
|
|
2297
2417
|
}
|
|
2298
2418
|
};
|
|
2299
2419
|
}, [open]);
|
|
2300
|
-
return /* @__PURE__ */
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2304
|
-
open,
|
|
2305
|
-
content: t("connector.privy.addSolanaWallet.tips")
|
|
2306
|
-
},
|
|
2307
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 " }, /* @__PURE__ */ React19.createElement(
|
|
2308
|
-
"img",
|
|
2309
|
-
{
|
|
2310
|
-
src: "https://oss.orderly.network/static/sdk/solana-logo.png",
|
|
2311
|
-
className: "oui-size-[15px]"
|
|
2312
|
-
}
|
|
2313
|
-
), /* @__PURE__ */ React19.createElement("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast-80" }, t("connector.privy.addSolanaWallet")), /* @__PURE__ */ React19.createElement("button", { onClick: onToggleVisibility }, visible ? /* @__PURE__ */ React19.createElement(
|
|
2314
|
-
ChevronDownIcon,
|
|
2420
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-rounded-[8px] oui-bg-base-10 oui-px-2 oui-py-[11px]", children: [
|
|
2421
|
+
/* @__PURE__ */ jsx(
|
|
2422
|
+
Tooltip,
|
|
2315
2423
|
{
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2424
|
+
className: "oui-z-[65] oui-max-w-[200px] oui-text-warning-darken",
|
|
2425
|
+
open,
|
|
2426
|
+
content: t("connector.privy.addSolanaWallet.tips"),
|
|
2427
|
+
children: /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 ", children: [
|
|
2428
|
+
/* @__PURE__ */ jsx(
|
|
2429
|
+
"img",
|
|
2430
|
+
{
|
|
2431
|
+
src: "https://oss.orderly.network/static/sdk/solana-logo.png",
|
|
2432
|
+
className: "oui-size-[15px]"
|
|
2433
|
+
}
|
|
2434
|
+
),
|
|
2435
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast-80", children: t("connector.privy.addSolanaWallet") }),
|
|
2436
|
+
/* @__PURE__ */ jsx("button", { onClick: onToggleVisibility, children: visible ? /* @__PURE__ */ jsx(
|
|
2437
|
+
ChevronDownIcon,
|
|
2438
|
+
{
|
|
2439
|
+
size: 16,
|
|
2440
|
+
opacity: 1,
|
|
2441
|
+
className: "oui-text-base-contrast-36"
|
|
2442
|
+
}
|
|
2443
|
+
) : /* @__PURE__ */ jsx(
|
|
2444
|
+
ChevronUpIcon,
|
|
2445
|
+
{
|
|
2446
|
+
size: 16,
|
|
2447
|
+
opacity: 1,
|
|
2448
|
+
className: "oui-text-base-contrast"
|
|
2449
|
+
}
|
|
2450
|
+
) })
|
|
2451
|
+
] })
|
|
2326
2452
|
}
|
|
2327
|
-
)
|
|
2328
|
-
|
|
2329
|
-
"div",
|
|
2330
|
-
{
|
|
2331
|
-
className: cn(
|
|
2332
|
-
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2333
|
-
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2334
|
-
)
|
|
2335
|
-
},
|
|
2336
|
-
wallets.map((item, index) => /* @__PURE__ */ React19.createElement(
|
|
2453
|
+
),
|
|
2454
|
+
/* @__PURE__ */ jsx(
|
|
2337
2455
|
"div",
|
|
2338
2456
|
{
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2457
|
+
className: cn(
|
|
2458
|
+
"oui-transition-height oui-grid oui-grid-cols-2 oui-gap-2 oui-overflow-hidden oui-duration-150",
|
|
2459
|
+
visible ? "oui-mt-0 oui-max-h-0" : "oui-mt-3 oui-max-h-[400px]"
|
|
2460
|
+
),
|
|
2461
|
+
children: wallets.map((item, index) => /* @__PURE__ */ jsxs(
|
|
2462
|
+
"div",
|
|
2463
|
+
{
|
|
2464
|
+
className: "oui-flex oui-cursor-pointer oui-items-center oui-justify-start oui-gap-1 oui-bg-base-9 oui-px-2 oui-py-[11px]",
|
|
2465
|
+
onClick: () => connect({
|
|
2466
|
+
walletType: "SOL" /* SOL */,
|
|
2467
|
+
walletAdapter: item.adapter
|
|
2468
|
+
}),
|
|
2469
|
+
children: [
|
|
2470
|
+
/* @__PURE__ */ jsx(RenderWalletIcon, { connector: item.adapter }),
|
|
2471
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-base-contrast", children: item.adapter.name })
|
|
2472
|
+
]
|
|
2473
|
+
},
|
|
2474
|
+
index
|
|
2475
|
+
))
|
|
2476
|
+
}
|
|
2477
|
+
)
|
|
2478
|
+
] });
|
|
2350
2479
|
}
|
|
2351
|
-
|
|
2352
|
-
// src/components/renderNonPrivyWallet/index.tsx
|
|
2353
2480
|
function RenderNonPrivyWallet() {
|
|
2354
2481
|
const [walletList, setWalletList] = useState([]);
|
|
2355
2482
|
const [addWalletList, setAddWalletList] = useState([]);
|
|
@@ -2426,58 +2553,85 @@ function RenderNonPrivyWallet() {
|
|
|
2426
2553
|
walletChainTypeConfig,
|
|
2427
2554
|
connectorWalletType
|
|
2428
2555
|
]);
|
|
2429
|
-
return /* @__PURE__ */
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
{
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2556
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2557
|
+
walletList.length && /* @__PURE__ */ jsx(
|
|
2558
|
+
StorageChainNotCurrentWalletType,
|
|
2559
|
+
{
|
|
2560
|
+
currentWalletType: currentConnectWalletType
|
|
2561
|
+
}
|
|
2562
|
+
),
|
|
2563
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-flex-col oui-gap-5", children: walletList.map((wallet) => /* @__PURE__ */ jsx(
|
|
2564
|
+
WalletCard,
|
|
2565
|
+
{
|
|
2566
|
+
type: wallet.type,
|
|
2567
|
+
address: wallet.address,
|
|
2568
|
+
isActive: isActive(wallet.type),
|
|
2569
|
+
onActiveChange: () => {
|
|
2570
|
+
switchWallet(wallet.type);
|
|
2571
|
+
},
|
|
2572
|
+
isPrivy: false,
|
|
2573
|
+
isMulti: walletList.length > 1
|
|
2443
2574
|
},
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2575
|
+
wallet.type
|
|
2576
|
+
)) }),
|
|
2577
|
+
/* @__PURE__ */ jsx(RenderAddWallet, { addWalletList })
|
|
2578
|
+
] });
|
|
2448
2579
|
}
|
|
2449
2580
|
function RenderAddWallet({ addWalletList }) {
|
|
2450
2581
|
if (addWalletList.length === 0) {
|
|
2451
2582
|
return null;
|
|
2452
2583
|
}
|
|
2453
|
-
return /* @__PURE__ */
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2584
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2585
|
+
/* @__PURE__ */ jsx("div", { className: "oui-my-5 oui-h-px oui-bg-line" }),
|
|
2586
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-flex-col oui-gap-5", children: addWalletList.map((wallet, index) => {
|
|
2587
|
+
if (wallet === "EVM" /* EVM */) {
|
|
2588
|
+
return /* @__PURE__ */ jsx(AddEvmWallet, {}, index);
|
|
2589
|
+
}
|
|
2590
|
+
if (wallet === "SOL" /* SOL */) {
|
|
2591
|
+
return /* @__PURE__ */ jsx(AddSolanaWallet, {}, index);
|
|
2592
|
+
}
|
|
2593
|
+
if (wallet === "Abstract" /* ABSTRACT */) {
|
|
2594
|
+
return /* @__PURE__ */ jsx(AddAbstractWallet, {}, index);
|
|
2595
|
+
}
|
|
2596
|
+
}) })
|
|
2597
|
+
] });
|
|
2464
2598
|
}
|
|
2465
2599
|
function NoWallet() {
|
|
2466
2600
|
const { walletChainType } = useWalletConnectorPrivy();
|
|
2467
2601
|
const { t } = useTranslation();
|
|
2468
|
-
return /* @__PURE__ */
|
|
2469
|
-
"
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2602
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-mt-5 oui-flex oui-w-full oui-flex-col oui-items-center oui-justify-center", children: [
|
|
2603
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-w-full oui-flex-col oui-items-center oui-justify-center oui-gap-3", children: [
|
|
2604
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-w-full oui-flex-col oui-items-center oui-justify-center oui-gap-1 oui-rounded-[8px] oui-border oui-border-line-12 oui-px-2 oui-py-[13px] ", children: [
|
|
2605
|
+
/* @__PURE__ */ jsx(
|
|
2606
|
+
"img",
|
|
2607
|
+
{
|
|
2608
|
+
src: "https://oss.orderly.network/static/sdk/privy/no-wallet.png",
|
|
2609
|
+
className: "oui-size-[64px]"
|
|
2610
|
+
}
|
|
2611
|
+
),
|
|
2612
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-font-semibold oui-text-base-contrast-36", children: t("connector.privy.noWallet") })
|
|
2613
|
+
] }),
|
|
2614
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-start oui-gap-1 oui-rounded-[4px] oui-bg-[rgba(var(--oui-color-warning-darken)/0.15)] oui-px-2 oui-py-[6px] ", children: [
|
|
2615
|
+
/* @__PURE__ */ jsx(
|
|
2616
|
+
ExclamationFillIcon,
|
|
2617
|
+
{
|
|
2618
|
+
size: 10,
|
|
2619
|
+
className: "oui-mt-1 oui-size-[10px] oui-shrink-0 oui-text-warning-darken"
|
|
2620
|
+
}
|
|
2621
|
+
),
|
|
2622
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-text-warning-darken", children: t("connector.privy.noWallet.description") })
|
|
2623
|
+
] })
|
|
2624
|
+
] }),
|
|
2625
|
+
/* @__PURE__ */ jsx("div", { className: "oui-my-5 oui-h-px oui-w-full oui-bg-line" }),
|
|
2626
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-w-full oui-flex-col oui-gap-2", children: [
|
|
2627
|
+
walletChainType === "EVM_SOL" /* EVM_SOL */ && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2628
|
+
/* @__PURE__ */ jsx(CreateEVMWallet, {}),
|
|
2629
|
+
/* @__PURE__ */ jsx(CreateSOLWallet, {})
|
|
2630
|
+
] }),
|
|
2631
|
+
walletChainType === "onlyEVM" /* onlyEVM */ && /* @__PURE__ */ jsx(CreateEVMWallet, {}),
|
|
2632
|
+
walletChainType === "onlySOL" /* onlySOL */ && /* @__PURE__ */ jsx(CreateSOLWallet, {})
|
|
2633
|
+
] })
|
|
2634
|
+
] });
|
|
2481
2635
|
}
|
|
2482
2636
|
function CreateEVMWallet() {
|
|
2483
2637
|
const { t } = useTranslation();
|
|
@@ -2494,29 +2648,35 @@ function CreateEVMWallet() {
|
|
|
2494
2648
|
setLoading(false);
|
|
2495
2649
|
});
|
|
2496
2650
|
};
|
|
2497
|
-
return /* @__PURE__ */
|
|
2498
|
-
"
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
{
|
|
2506
|
-
className: "oui-relative oui-z-10 oui-size-3 oui-text-base-contrast-54 hover:oui-text-base-contrast",
|
|
2507
|
-
style: { zIndex: 1 }
|
|
2508
|
-
}
|
|
2509
|
-
))))), /* @__PURE__ */ React19.createElement(
|
|
2510
|
-
"div",
|
|
2511
|
-
{
|
|
2512
|
-
className: cn(
|
|
2513
|
-
"oui-cursor-pointer oui-text-2xs oui-font-semibold oui-text-base-contrast-80",
|
|
2514
|
-
loading && "oui-opacity-50"
|
|
2651
|
+
return /* @__PURE__ */ jsx("div", { className: "oui-w-full oui-rounded-[8px] oui-bg-base-10 oui-px-2 oui-py-[11px]", children: /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 ", children: [
|
|
2652
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1", children: /* @__PURE__ */ jsxs("div", { className: "oui-relative oui-flex oui-w-[55px] oui-items-center oui-justify-start", children: [
|
|
2653
|
+
/* @__PURE__ */ jsx(
|
|
2654
|
+
"img",
|
|
2655
|
+
{
|
|
2656
|
+
src: "https://oss.orderly.network/static/sdk/chains.png",
|
|
2657
|
+
className: "oui-relative oui-z-0 oui-h-[18px]"
|
|
2658
|
+
}
|
|
2515
2659
|
),
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2660
|
+
/* @__PURE__ */ jsx("div", { className: "oui-absolute oui-right-0 oui-flex oui-size-[18px] oui-items-center oui-justify-center oui-rounded-full oui-bg-base-5", children: /* @__PURE__ */ jsx(EVMChainPopover, { children: /* @__PURE__ */ jsx(
|
|
2661
|
+
MoreIcon,
|
|
2662
|
+
{
|
|
2663
|
+
className: "oui-relative oui-z-10 oui-size-3 oui-text-base-contrast-54 hover:oui-text-base-contrast",
|
|
2664
|
+
style: { zIndex: 1 }
|
|
2665
|
+
}
|
|
2666
|
+
) }) })
|
|
2667
|
+
] }) }),
|
|
2668
|
+
/* @__PURE__ */ jsx(
|
|
2669
|
+
"div",
|
|
2670
|
+
{
|
|
2671
|
+
className: cn(
|
|
2672
|
+
"oui-cursor-pointer oui-text-2xs oui-font-semibold oui-text-base-contrast-80",
|
|
2673
|
+
loading && "oui-opacity-50"
|
|
2674
|
+
),
|
|
2675
|
+
onClick: doCreate,
|
|
2676
|
+
children: t("connector.privy.createEvmWallet")
|
|
2677
|
+
}
|
|
2678
|
+
)
|
|
2679
|
+
] }) });
|
|
2520
2680
|
}
|
|
2521
2681
|
function CreateSOLWallet() {
|
|
2522
2682
|
const { t } = useTranslation();
|
|
@@ -2533,23 +2693,26 @@ function CreateSOLWallet() {
|
|
|
2533
2693
|
setLoading(false);
|
|
2534
2694
|
});
|
|
2535
2695
|
};
|
|
2536
|
-
return /* @__PURE__ */
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2696
|
+
return /* @__PURE__ */ jsx("div", { className: "oui-w-full oui-rounded-[8px] oui-bg-base-10 oui-px-2 oui-py-[11px]", children: /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-center oui-gap-1 ", children: [
|
|
2697
|
+
/* @__PURE__ */ jsx(
|
|
2698
|
+
"img",
|
|
2699
|
+
{
|
|
2700
|
+
src: "https://oss.orderly.network/static/sdk/solana-logo.png",
|
|
2701
|
+
className: "oui-size-[15px]"
|
|
2702
|
+
}
|
|
2703
|
+
),
|
|
2704
|
+
/* @__PURE__ */ jsx(
|
|
2705
|
+
"div",
|
|
2706
|
+
{
|
|
2707
|
+
className: cn(
|
|
2708
|
+
"oui-cursor-pointer oui-text-2xs oui-font-semibold oui-text-base-contrast-80",
|
|
2709
|
+
loading && "oui-opacity-50"
|
|
2710
|
+
),
|
|
2711
|
+
onClick: doCreate,
|
|
2712
|
+
children: t("connector.privy.createSolanaWallet")
|
|
2713
|
+
}
|
|
2714
|
+
)
|
|
2715
|
+
] }) });
|
|
2553
2716
|
}
|
|
2554
2717
|
function RenderPrivyWallet() {
|
|
2555
2718
|
const { t } = useTranslation();
|
|
@@ -2602,50 +2765,58 @@ function RenderPrivyWallet() {
|
|
|
2602
2765
|
if (!showWarning) {
|
|
2603
2766
|
return;
|
|
2604
2767
|
}
|
|
2605
|
-
return /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ jsx("div", { className: "oui-mt-5 oui-border-b oui-border-line oui-pb-5", children: /* @__PURE__ */ jsxs(
|
|
2606
2769
|
"div",
|
|
2607
2770
|
{
|
|
2608
2771
|
className: cn(
|
|
2609
2772
|
"oui-flex oui-items-start oui-justify-center oui-gap-1",
|
|
2610
2773
|
"oui-w-full oui-rounded-[8px] oui-px-2 oui-py-[13px]",
|
|
2611
2774
|
"oui-bg-warning-darken/10"
|
|
2612
|
-
)
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2775
|
+
),
|
|
2776
|
+
children: [
|
|
2777
|
+
/* @__PURE__ */ jsx(
|
|
2778
|
+
ExclamationFillIcon,
|
|
2779
|
+
{
|
|
2780
|
+
size: 14,
|
|
2781
|
+
className: "oui-mt-[2px] oui-size-[14px] oui-shrink-0 oui-text-warning-darken"
|
|
2782
|
+
}
|
|
2783
|
+
),
|
|
2784
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-2xs oui-leading-[18px] oui-text-warning-darken", children: "Abstract Chain access requires Abstract Global Wallet. Privy connection is currently unsupported." })
|
|
2785
|
+
]
|
|
2786
|
+
}
|
|
2787
|
+
) });
|
|
2623
2788
|
}, [targetWalletType]);
|
|
2624
2789
|
const renderWallet = useCallback(() => {
|
|
2625
2790
|
if (loading) {
|
|
2626
2791
|
return;
|
|
2627
2792
|
}
|
|
2628
2793
|
if (!walletList.length) {
|
|
2629
|
-
return /* @__PURE__ */
|
|
2794
|
+
return /* @__PURE__ */ jsx(NoWallet, {});
|
|
2630
2795
|
}
|
|
2631
|
-
return /* @__PURE__ */
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2796
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-mt-5 oui-flex oui-flex-col oui-gap-5", children: [
|
|
2797
|
+
walletList.map((wallet) => /* @__PURE__ */ jsx(
|
|
2798
|
+
WalletCard,
|
|
2799
|
+
{
|
|
2800
|
+
type: wallet.type,
|
|
2801
|
+
address: wallet.address,
|
|
2802
|
+
isActive: isActive(wallet.type, wallet.address),
|
|
2803
|
+
isPrivy: true,
|
|
2804
|
+
isMulti: walletList.length > 1,
|
|
2805
|
+
onActiveChange: () => {
|
|
2806
|
+
const walletNamespace = wallet.type === "EVM" /* EVM */ ? ChainNamespace.evm : ChainNamespace.solana;
|
|
2807
|
+
selectWallet(walletNamespace, wallet.address);
|
|
2808
|
+
if (storageChain?.namespace !== walletNamespace) {
|
|
2809
|
+
switchWallet(wallet.type);
|
|
2810
|
+
}
|
|
2645
2811
|
}
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
|
|
2812
|
+
},
|
|
2813
|
+
wallet.address
|
|
2814
|
+
)),
|
|
2815
|
+
addWallet.map((node, index) => /* @__PURE__ */ jsxs("div", { children: [
|
|
2816
|
+
/* @__PURE__ */ jsx("div", { className: "oui-my-5 oui-h-px oui-w-full oui-bg-line" }),
|
|
2817
|
+
/* @__PURE__ */ jsx("div", { className: "oui-flex oui-w-full oui-flex-col oui-gap-2", children: node })
|
|
2818
|
+
] }, index))
|
|
2819
|
+
] });
|
|
2649
2820
|
}, [
|
|
2650
2821
|
walletList,
|
|
2651
2822
|
addWallet,
|
|
@@ -2676,7 +2847,7 @@ function RenderPrivyWallet() {
|
|
|
2676
2847
|
});
|
|
2677
2848
|
}
|
|
2678
2849
|
} else {
|
|
2679
|
-
tempAddWallet.push(/* @__PURE__ */
|
|
2850
|
+
tempAddWallet.push(/* @__PURE__ */ jsx(CreateEVMWallet, {}));
|
|
2680
2851
|
}
|
|
2681
2852
|
}
|
|
2682
2853
|
if (!connectorWalletType.disableSolana && walletChainTypeConfig.hasSol) {
|
|
@@ -2688,7 +2859,7 @@ function RenderPrivyWallet() {
|
|
|
2688
2859
|
});
|
|
2689
2860
|
}
|
|
2690
2861
|
} else {
|
|
2691
|
-
tempAddWallet.push(/* @__PURE__ */
|
|
2862
|
+
tempAddWallet.push(/* @__PURE__ */ jsx(CreateSOLWallet, {}));
|
|
2692
2863
|
}
|
|
2693
2864
|
}
|
|
2694
2865
|
setWalletList(tempWalletList);
|
|
@@ -2708,20 +2879,31 @@ function RenderPrivyWallet() {
|
|
|
2708
2879
|
});
|
|
2709
2880
|
}
|
|
2710
2881
|
}, [targetWalletType, setTargetWalletType]);
|
|
2711
|
-
return /* @__PURE__ */
|
|
2712
|
-
"div",
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2882
|
+
return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-max-h-[70vh] oui-flex-col oui-overflow-y-auto oui-custom-scrollbar", children: [
|
|
2883
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-between", children: [
|
|
2884
|
+
linkedAccount && /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-start oui-gap-2 oui-text-base-contrast", children: [
|
|
2885
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(RenderPrivyTypeIcon, { type: linkedAccount.type, size: 24 }) }),
|
|
2886
|
+
/* @__PURE__ */ jsx("div", { className: "oui-text-xs", children: linkedAccount.address })
|
|
2887
|
+
] }),
|
|
2888
|
+
/* @__PURE__ */ jsx(
|
|
2889
|
+
"div",
|
|
2890
|
+
{
|
|
2891
|
+
className: "oui-cursor-pointer oui-text-2xs oui-font-semibold oui-text-primary",
|
|
2892
|
+
onClick: () => disconnect("privy" /* PRIVY */),
|
|
2893
|
+
children: t("connector.privy.logout")
|
|
2894
|
+
}
|
|
2895
|
+
)
|
|
2896
|
+
] }),
|
|
2897
|
+
renderWarning(),
|
|
2898
|
+
renderWallet()
|
|
2899
|
+
] });
|
|
2719
2900
|
}
|
|
2720
|
-
|
|
2721
|
-
// src/components/connectDrawer.tsx
|
|
2722
2901
|
function MyWallet() {
|
|
2723
2902
|
const [connectorKey, setConnectorKey] = useLocalStorage(ConnectorKey, "");
|
|
2724
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2904
|
+
connectorKey === "privy" && /* @__PURE__ */ jsx(RenderPrivyWallet, {}),
|
|
2905
|
+
connectorKey !== "privy" && /* @__PURE__ */ jsx(RenderNonPrivyWallet, {})
|
|
2906
|
+
] });
|
|
2725
2907
|
}
|
|
2726
2908
|
function ConnectDrawer(props) {
|
|
2727
2909
|
const { t } = useTranslation();
|
|
@@ -2759,19 +2941,19 @@ function ConnectDrawer(props) {
|
|
|
2759
2941
|
modal.show(PwaDialog);
|
|
2760
2942
|
};
|
|
2761
2943
|
const renderHeader = useCallback(() => {
|
|
2762
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ jsx(
|
|
2763
2945
|
"div",
|
|
2764
2946
|
{
|
|
2765
2947
|
className: cn(
|
|
2766
2948
|
"oui-font-semibold oui-text-base-contrast-80 ",
|
|
2767
2949
|
"oui-pb-2 oui-text-[20px]",
|
|
2768
2950
|
"md:oui-py-0 md:oui-text-base"
|
|
2769
|
-
)
|
|
2770
|
-
|
|
2771
|
-
|
|
2951
|
+
),
|
|
2952
|
+
children: isConnected ? t("connector.privy.myWallet") : t("connector.connectWallet")
|
|
2953
|
+
}
|
|
2772
2954
|
);
|
|
2773
2955
|
}, [isConnected]);
|
|
2774
|
-
return /* @__PURE__ */
|
|
2956
|
+
return /* @__PURE__ */ jsxs(
|
|
2775
2957
|
SimpleSheet,
|
|
2776
2958
|
{
|
|
2777
2959
|
open: props.open,
|
|
@@ -2784,59 +2966,73 @@ function ConnectDrawer(props) {
|
|
|
2784
2966
|
isMobile ? "oui-inset-y-0 oui-right-0 oui-w-[280px] oui-rounded-none !oui-bg-base-8" : "!oui-bottom-[30px] oui-right-3 oui-top-[48px] !oui-h-auto oui-w-[300px] oui-overflow-hidden oui-rounded-[16px] !oui-bg-base-9 "
|
|
2785
2967
|
)
|
|
2786
2968
|
},
|
|
2787
|
-
contentProps: { side: "right", closeable: false }
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
),
|
|
2799
|
-
/* @__PURE__ */ React19.createElement("div", { className: "oui-relative oui-z-10 oui-flex oui-h-full oui-flex-col oui-gap-4 md:oui-gap-5" }, /* @__PURE__ */ React19.createElement("div", { className: "oui-flex oui-flex-none oui-items-center oui-justify-between" }, renderHeader(), /* @__PURE__ */ React19.createElement(
|
|
2800
|
-
CloseSquareFillIcon,
|
|
2801
|
-
{
|
|
2802
|
-
className: "oui-size-5 oui-cursor-pointer oui-text-base-contrast-20 hover:oui-text-base-contrast-80",
|
|
2803
|
-
onClick: () => props.onChangeOpen(false)
|
|
2804
|
-
}
|
|
2805
|
-
)), isConnected ? /* @__PURE__ */ React19.createElement(MyWallet, null) : /* @__PURE__ */ React19.createElement(RenderConnector, null), !isConnected && /* @__PURE__ */ React19.createElement(Flex, { gap: 4, direction: "column" }, isMobile && /* @__PURE__ */ React19.createElement(
|
|
2806
|
-
Flex,
|
|
2807
|
-
{
|
|
2808
|
-
itemAlign: "center",
|
|
2809
|
-
justify: "between",
|
|
2810
|
-
gap: 4,
|
|
2811
|
-
className: "oui-rounded-[8px] oui-px-3 oui-py-2 oui-text-2xs oui-bg-[linear-gradient(270deg,rgba(var(--oui-gradient-brand-end),0.10)_0%,rgba(var(--oui-gradient-brand-start),0.10)_100%)] oui-w-full",
|
|
2812
|
-
onClick: () => showPwaDialog()
|
|
2813
|
-
},
|
|
2814
|
-
/* @__PURE__ */ React19.createElement(Text, { className: "oui-bg-[linear-gradient(270deg,rgb(var(--oui-gradient-brand-end))_0%,rgb(var(--oui-gradient-brand-start))_100%)] oui-bg-clip-text oui-text-transparent" }, t("connector.privy.pwa.title")),
|
|
2815
|
-
/* @__PURE__ */ React19.createElement(
|
|
2816
|
-
ArrowRightLinearGradientIcon,
|
|
2817
|
-
{
|
|
2818
|
-
size: 20,
|
|
2819
|
-
className: "oui-flex-shrink-0"
|
|
2820
|
-
}
|
|
2821
|
-
)
|
|
2822
|
-
), termsOfUse && /* @__PURE__ */ React19.createElement("div", { className: "oui-flex-none oui-text-center oui-text-2xs oui-font-semibold oui-text-base-contrast-80" }, /* @__PURE__ */ React19.createElement(
|
|
2823
|
-
Trans,
|
|
2824
|
-
{
|
|
2825
|
-
i18nKey: "connector.privy.termsOfUse",
|
|
2826
|
-
components: [
|
|
2827
|
-
/* @__PURE__ */ React19.createElement(
|
|
2828
|
-
"a",
|
|
2829
|
-
{
|
|
2830
|
-
key: "termsOfUse",
|
|
2831
|
-
href: termsOfUse,
|
|
2832
|
-
className: "oui-cursor-pointer oui-text-primary oui-underline",
|
|
2833
|
-
target: "_blank",
|
|
2834
|
-
rel: "noreferrer"
|
|
2969
|
+
contentProps: { side: "right", closeable: false },
|
|
2970
|
+
children: [
|
|
2971
|
+
!isMobile && /* @__PURE__ */ jsx(
|
|
2972
|
+
"div",
|
|
2973
|
+
{
|
|
2974
|
+
className: "oui-absolute oui-inset-x-[50px] -oui-top-[calc(100vh/2)] oui-z-0 oui-h-screen",
|
|
2975
|
+
style: {
|
|
2976
|
+
background: "conic-gradient(from -41deg at 40.63% 50.41%, rgba(242, 98, 181, 0.00) 125.17920970916748deg, rgba(95, 197, 255, 0.20) 193.4119462966919deg, rgba(255, 172, 137, 0.20) 216.0206937789917deg, rgba(129, 85, 255, 0.20) 236.0708713531494deg, rgba(120, 157, 255, 0.20) 259.95326042175293deg, rgba(159, 115, 241, 0.00) 311.0780096054077deg)",
|
|
2977
|
+
filter: "blur(50px)"
|
|
2835
2978
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2979
|
+
}
|
|
2980
|
+
),
|
|
2981
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-relative oui-z-10 oui-flex oui-h-full oui-flex-col oui-gap-4 md:oui-gap-5", children: [
|
|
2982
|
+
/* @__PURE__ */ jsxs("div", { className: "oui-flex oui-flex-none oui-items-center oui-justify-between", children: [
|
|
2983
|
+
renderHeader(),
|
|
2984
|
+
/* @__PURE__ */ jsx(
|
|
2985
|
+
CloseSquareFillIcon,
|
|
2986
|
+
{
|
|
2987
|
+
className: "oui-size-5 oui-cursor-pointer oui-text-base-contrast-20 hover:oui-text-base-contrast-80",
|
|
2988
|
+
onClick: () => props.onChangeOpen(false)
|
|
2989
|
+
}
|
|
2990
|
+
)
|
|
2991
|
+
] }),
|
|
2992
|
+
isConnected ? /* @__PURE__ */ jsx(MyWallet, {}) : /* @__PURE__ */ jsx(RenderConnector, {}),
|
|
2993
|
+
!isConnected && /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", children: [
|
|
2994
|
+
isMobile && /* @__PURE__ */ jsxs(
|
|
2995
|
+
Flex,
|
|
2996
|
+
{
|
|
2997
|
+
itemAlign: "center",
|
|
2998
|
+
justify: "between",
|
|
2999
|
+
gap: 4,
|
|
3000
|
+
className: "oui-rounded-[8px] oui-px-3 oui-py-2 oui-text-2xs oui-bg-[linear-gradient(270deg,rgba(var(--oui-gradient-brand-end),0.10)_0%,rgba(var(--oui-gradient-brand-start),0.10)_100%)] oui-w-full",
|
|
3001
|
+
onClick: () => showPwaDialog(),
|
|
3002
|
+
children: [
|
|
3003
|
+
/* @__PURE__ */ jsx(Text, { className: "oui-bg-[linear-gradient(270deg,rgb(var(--oui-gradient-brand-end))_0%,rgb(var(--oui-gradient-brand-start))_100%)] oui-bg-clip-text oui-text-transparent", children: t("connector.privy.pwa.title") }),
|
|
3004
|
+
/* @__PURE__ */ jsx(
|
|
3005
|
+
ArrowRightLinearGradientIcon,
|
|
3006
|
+
{
|
|
3007
|
+
size: 20,
|
|
3008
|
+
className: "oui-flex-shrink-0"
|
|
3009
|
+
}
|
|
3010
|
+
)
|
|
3011
|
+
]
|
|
3012
|
+
}
|
|
3013
|
+
),
|
|
3014
|
+
termsOfUse && /* @__PURE__ */ jsx("div", { className: "oui-flex-none oui-text-center oui-text-2xs oui-font-semibold oui-text-base-contrast-80", children: /* @__PURE__ */ jsx(
|
|
3015
|
+
Trans,
|
|
3016
|
+
{
|
|
3017
|
+
i18nKey: "connector.privy.termsOfUse",
|
|
3018
|
+
components: [
|
|
3019
|
+
/* @__PURE__ */ jsx(
|
|
3020
|
+
"a",
|
|
3021
|
+
{
|
|
3022
|
+
href: termsOfUse,
|
|
3023
|
+
className: "oui-cursor-pointer oui-text-primary oui-underline",
|
|
3024
|
+
target: "_blank",
|
|
3025
|
+
rel: "noreferrer"
|
|
3026
|
+
},
|
|
3027
|
+
"termsOfUse"
|
|
3028
|
+
)
|
|
3029
|
+
]
|
|
3030
|
+
}
|
|
3031
|
+
) })
|
|
3032
|
+
] })
|
|
3033
|
+
] })
|
|
3034
|
+
]
|
|
3035
|
+
}
|
|
2840
3036
|
);
|
|
2841
3037
|
}
|
|
2842
3038
|
var LinkDeviceMobile = (props) => {
|
|
@@ -2853,52 +3049,64 @@ var LinkDeviceMobile = (props) => {
|
|
|
2853
3049
|
const hideDialog = () => {
|
|
2854
3050
|
setOpen(false);
|
|
2855
3051
|
};
|
|
2856
|
-
return /* @__PURE__ */
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
primary: {
|
|
2871
|
-
label: t("connector.disconnect"),
|
|
2872
|
-
onClick: async () => {
|
|
2873
|
-
await onDisconnect();
|
|
2874
|
-
hideDialog();
|
|
3052
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3053
|
+
/* @__PURE__ */ jsx(
|
|
3054
|
+
SimpleDialog,
|
|
3055
|
+
{
|
|
3056
|
+
open,
|
|
3057
|
+
onOpenChange: setOpen,
|
|
3058
|
+
title: t("common.tips"),
|
|
3059
|
+
size: "xs",
|
|
3060
|
+
actions: {
|
|
3061
|
+
secondary: {
|
|
3062
|
+
label: t("common.cancel"),
|
|
3063
|
+
onClick: hideDialog,
|
|
3064
|
+
size: "md",
|
|
3065
|
+
fullWidth: true
|
|
2875
3066
|
},
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
3067
|
+
primary: {
|
|
3068
|
+
label: t("connector.disconnect"),
|
|
3069
|
+
onClick: async () => {
|
|
3070
|
+
await onDisconnect();
|
|
3071
|
+
hideDialog();
|
|
3072
|
+
},
|
|
3073
|
+
size: "md",
|
|
3074
|
+
variant: "outlined",
|
|
3075
|
+
color: "danger"
|
|
3076
|
+
}
|
|
3077
|
+
},
|
|
3078
|
+
children: /* @__PURE__ */ jsx(Text, { intensity: 54, size: "sm", children: t("linkDevice.scanQRCode.connected.description") })
|
|
2880
3079
|
}
|
|
2881
|
-
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
3080
|
+
),
|
|
3081
|
+
/* @__PURE__ */ jsxs(Flex, { className: "oui-gap-[6px]", itemAlign: "center", onClick: showDialog, children: [
|
|
3082
|
+
/* @__PURE__ */ jsxs(
|
|
3083
|
+
Flex,
|
|
3084
|
+
{
|
|
3085
|
+
className: "oui-text-base-contrast",
|
|
3086
|
+
intensity: 500,
|
|
3087
|
+
height: 28,
|
|
3088
|
+
r: "md",
|
|
3089
|
+
children: [
|
|
3090
|
+
/* @__PURE__ */ jsx(DesktopIcon, {}),
|
|
3091
|
+
/* @__PURE__ */ jsx(Dot, {}),
|
|
3092
|
+
/* @__PURE__ */ jsx(LinkIcon, {}),
|
|
3093
|
+
/* @__PURE__ */ jsx(Dot, {}),
|
|
3094
|
+
/* @__PURE__ */ jsx(MobileIcon, {})
|
|
3095
|
+
]
|
|
3096
|
+
}
|
|
3097
|
+
),
|
|
3098
|
+
props.children
|
|
3099
|
+
] })
|
|
3100
|
+
] });
|
|
2897
3101
|
};
|
|
2898
3102
|
var Dot = () => {
|
|
2899
|
-
return /* @__PURE__ */
|
|
3103
|
+
return /* @__PURE__ */ jsxs(Flex, { className: "oui-gap-x-[1px] oui-px-[1px]", children: [
|
|
3104
|
+
/* @__PURE__ */ jsx(DotIcon, {}),
|
|
3105
|
+
/* @__PURE__ */ jsx(DotIcon, {}),
|
|
3106
|
+
/* @__PURE__ */ jsx(DotIcon, {})
|
|
3107
|
+
] });
|
|
2900
3108
|
};
|
|
2901
|
-
var DesktopIcon = (props) => /* @__PURE__ */
|
|
3109
|
+
var DesktopIcon = (props) => /* @__PURE__ */ jsx(
|
|
2902
3110
|
"svg",
|
|
2903
3111
|
{
|
|
2904
3112
|
width: "18",
|
|
@@ -2906,11 +3114,11 @@ var DesktopIcon = (props) => /* @__PURE__ */ React19.createElement(
|
|
|
2906
3114
|
viewBox: "0 0 18 18",
|
|
2907
3115
|
fill: "currentColor",
|
|
2908
3116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2909
|
-
...props
|
|
2910
|
-
|
|
2911
|
-
|
|
3117
|
+
...props,
|
|
3118
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4.5 2.93a2.25 2.25 0 0 0-2.25 2.25v5.25a.75.75 0 0 0-.75.75v1.5c0 1.272.93 2.25 2.25 2.25h10.5c1.318 0 2.25-.978 2.25-2.25v-1.5a.75.75 0 0 0-.75-.75V5.18a2.25 2.25 0 0 0-2.25-2.25zm0 1.5h9a.75.75 0 0 1 .75.75v5.25H3.75V5.18a.75.75 0 0 1 .75-.75M3 11.93h12v.75c0 .46-.277.75-.75.75H3.75c-.474 0-.75-.29-.75-.75z" })
|
|
3119
|
+
}
|
|
2912
3120
|
);
|
|
2913
|
-
var MobileIcon = (props) => /* @__PURE__ */
|
|
3121
|
+
var MobileIcon = (props) => /* @__PURE__ */ jsx(
|
|
2914
3122
|
"svg",
|
|
2915
3123
|
{
|
|
2916
3124
|
width: "18",
|
|
@@ -2918,81 +3126,87 @@ var MobileIcon = (props) => /* @__PURE__ */ React19.createElement(
|
|
|
2918
3126
|
viewBox: "0 0 18 18",
|
|
2919
3127
|
fill: "currentColor",
|
|
2920
3128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2921
|
-
...props
|
|
2922
|
-
|
|
2923
|
-
|
|
3129
|
+
...props,
|
|
3130
|
+
children: /* @__PURE__ */ jsx("path", { d: "M13.498 3.715a2.25 2.25 0 0 0-2.25-2.25h-4.5a2.25 2.25 0 0 0-2.25 2.25v10.5a2.25 2.25 0 0 0 2.25 2.25h4.5a2.25 2.25 0 0 0 2.25-2.25zm-1.5 0v9.75h-6v-9.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 .75.75m-2.25 11.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0" })
|
|
3131
|
+
}
|
|
2924
3132
|
);
|
|
2925
|
-
var LinkIcon = (props) => /* @__PURE__ */
|
|
3133
|
+
var LinkIcon = (props) => /* @__PURE__ */ jsxs(
|
|
2926
3134
|
"svg",
|
|
2927
3135
|
{
|
|
2928
3136
|
width: "12",
|
|
2929
3137
|
height: "12",
|
|
2930
3138
|
viewBox: "0 0 12 12",
|
|
2931
3139
|
fill: "none",
|
|
2932
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
3140
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3141
|
+
children: [
|
|
3142
|
+
/* @__PURE__ */ jsx(
|
|
3143
|
+
"path",
|
|
3144
|
+
{
|
|
3145
|
+
fillRule: "evenodd",
|
|
3146
|
+
clipRule: "evenodd",
|
|
3147
|
+
d: "M1.007 6a5 5 0 1 1 10 0 5 5 0 0 1-10 0m7.486-2.344A.6.6 0 0 1 8.91 3.5c.15 0 .305.048.418.156a.55.55 0 0 1 0 .798L5.254 8.337a.62.62 0 0 1-.837 0L2.67 6.673a.55.55 0 0 1 0-.798.62.62 0 0 1 .837 0l1.329 1.266z",
|
|
3148
|
+
fill: "url(#a)"
|
|
3149
|
+
}
|
|
3150
|
+
),
|
|
3151
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
3152
|
+
"linearGradient",
|
|
3153
|
+
{
|
|
3154
|
+
id: "a",
|
|
3155
|
+
x1: "11.007",
|
|
3156
|
+
y1: "5.999",
|
|
3157
|
+
x2: "1.007",
|
|
3158
|
+
y2: "5.999",
|
|
3159
|
+
gradientUnits: "userSpaceOnUse",
|
|
3160
|
+
children: [
|
|
3161
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "rgb(var(--oui-gradient-brand-end))" }),
|
|
3162
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "rgb(var(--oui-gradient-brand-start))" })
|
|
3163
|
+
]
|
|
3164
|
+
}
|
|
3165
|
+
) })
|
|
3166
|
+
]
|
|
3167
|
+
}
|
|
2956
3168
|
);
|
|
2957
|
-
var DotIcon = (props) => /* @__PURE__ */
|
|
3169
|
+
var DotIcon = (props) => /* @__PURE__ */ jsxs(
|
|
2958
3170
|
"svg",
|
|
2959
3171
|
{
|
|
2960
3172
|
width: "2",
|
|
2961
3173
|
height: "2",
|
|
2962
3174
|
viewBox: "0 0 2 2",
|
|
2963
3175
|
fill: "none",
|
|
2964
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
3176
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3177
|
+
children: [
|
|
3178
|
+
/* @__PURE__ */ jsx(
|
|
3179
|
+
"path",
|
|
3180
|
+
{
|
|
3181
|
+
d: "M.667.334a.667.667 0 1 1 0 1.333.667.667 0 0 1 0-1.333",
|
|
3182
|
+
fill: "url(#a)"
|
|
3183
|
+
}
|
|
3184
|
+
),
|
|
3185
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
3186
|
+
"linearGradient",
|
|
3187
|
+
{
|
|
3188
|
+
id: "a",
|
|
3189
|
+
x1: "1.333",
|
|
3190
|
+
y1: "1.001",
|
|
3191
|
+
x2: "0",
|
|
3192
|
+
y2: "1.001",
|
|
3193
|
+
gradientUnits: "userSpaceOnUse",
|
|
3194
|
+
children: [
|
|
3195
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "rgb(var(--oui-gradient-brand-end))" }),
|
|
3196
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "rgb(var(--oui-gradient-brand-start))" })
|
|
3197
|
+
]
|
|
3198
|
+
}
|
|
3199
|
+
) })
|
|
3200
|
+
]
|
|
3201
|
+
}
|
|
2986
3202
|
);
|
|
2987
|
-
|
|
2988
|
-
// src/components/userCenter.tsx
|
|
2989
3203
|
function UserCenter(props) {
|
|
2990
3204
|
const { accountState: state } = props;
|
|
2991
|
-
return /* @__PURE__ */
|
|
3205
|
+
return /* @__PURE__ */ jsx(RenderUserCenter, { state, disabledConnect: props.disabledConnect });
|
|
2992
3206
|
}
|
|
2993
3207
|
var MwebUserCenter = (props) => {
|
|
2994
3208
|
const { state } = props;
|
|
2995
|
-
return /* @__PURE__ */
|
|
3209
|
+
return /* @__PURE__ */ jsx(RenderUserCenter, { state, disabledConnect: props.disabledConnect });
|
|
2996
3210
|
};
|
|
2997
3211
|
var RenderUserCenter = (props) => {
|
|
2998
3212
|
const { state } = props;
|
|
@@ -3010,17 +3224,17 @@ var RenderUserCenter = (props) => {
|
|
|
3010
3224
|
return account.address;
|
|
3011
3225
|
}, [account, connectedChain, accountState]);
|
|
3012
3226
|
if (state.status === AccountStatusEnum.EnableTradingWithoutConnected) {
|
|
3013
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsx(Flex, { className: "oui-bg-base-5 oui-px-[7px] oui-rounded-[6px] oui-gap-[6px]", children: /* @__PURE__ */ jsx(LinkDeviceMobile, { children: /* @__PURE__ */ jsx(
|
|
3014
3228
|
Text.formatted,
|
|
3015
3229
|
{
|
|
3016
3230
|
rule: "address",
|
|
3017
|
-
className: "oui-text-base-contrast oui-text-xs"
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
)));
|
|
3231
|
+
className: "oui-text-base-contrast oui-text-xs",
|
|
3232
|
+
children: formatAddress(userAddress)
|
|
3233
|
+
}
|
|
3234
|
+
) }) });
|
|
3021
3235
|
}
|
|
3022
3236
|
if (state.status <= AccountStatusEnum.NotConnected || disabled) {
|
|
3023
|
-
return /* @__PURE__ */
|
|
3237
|
+
return /* @__PURE__ */ jsx(
|
|
3024
3238
|
Button,
|
|
3025
3239
|
{
|
|
3026
3240
|
"data-testid": "oui-testid-nav-bar-connectWallet-btn",
|
|
@@ -3036,86 +3250,88 @@ var RenderUserCenter = (props) => {
|
|
|
3036
3250
|
onClick: () => {
|
|
3037
3251
|
connect().then((r) => {
|
|
3038
3252
|
}).catch((e) => void 0);
|
|
3039
|
-
}
|
|
3040
|
-
|
|
3041
|
-
|
|
3253
|
+
},
|
|
3254
|
+
children: isMobile ? t("connector.connect") : t("connector.connectWallet")
|
|
3255
|
+
}
|
|
3042
3256
|
);
|
|
3043
3257
|
}
|
|
3044
3258
|
if (!wallet) {
|
|
3045
3259
|
return;
|
|
3046
3260
|
}
|
|
3047
3261
|
if (isMobile) {
|
|
3048
|
-
return /* @__PURE__ */
|
|
3262
|
+
return /* @__PURE__ */ jsx(
|
|
3049
3263
|
AuthGuard,
|
|
3050
3264
|
{
|
|
3051
3265
|
buttonProps: {
|
|
3052
3266
|
size: "md"
|
|
3053
|
-
}
|
|
3054
|
-
},
|
|
3055
|
-
/* @__PURE__ */ React19.createElement("div", { onClick: () => connect() }, /* @__PURE__ */ React19.createElement(
|
|
3056
|
-
Button,
|
|
3057
|
-
{
|
|
3058
|
-
size: "md",
|
|
3059
|
-
variant: "gradient",
|
|
3060
|
-
angle: 45,
|
|
3061
|
-
"data-testid": "oui-testid-nav-bar-address-btn",
|
|
3062
|
-
className: "oui-px-2 oui-flex oui-items-center oui-justify-center oui-gap-1"
|
|
3063
3267
|
},
|
|
3064
|
-
|
|
3065
|
-
|
|
3268
|
+
children: /* @__PURE__ */ jsx("div", { onClick: () => connect(), children: /* @__PURE__ */ jsxs(
|
|
3269
|
+
Button,
|
|
3066
3270
|
{
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3271
|
+
size: "md",
|
|
3272
|
+
variant: "gradient",
|
|
3273
|
+
angle: 45,
|
|
3274
|
+
"data-testid": "oui-testid-nav-bar-address-btn",
|
|
3275
|
+
className: "oui-px-2 oui-flex oui-items-center oui-justify-center oui-gap-1",
|
|
3276
|
+
children: [
|
|
3277
|
+
linkedAccount && /* @__PURE__ */ jsx(
|
|
3278
|
+
RenderPrivyTypeIcon,
|
|
3279
|
+
{
|
|
3280
|
+
type: linkedAccount.type,
|
|
3281
|
+
size: 14,
|
|
3282
|
+
black: true
|
|
3283
|
+
}
|
|
3284
|
+
),
|
|
3285
|
+
/* @__PURE__ */ jsx(
|
|
3286
|
+
Text.formatted,
|
|
3287
|
+
{
|
|
3288
|
+
rule: "address",
|
|
3289
|
+
className: "oui-text-[rgba(0,0,0,.88)] oui-font-semibold",
|
|
3290
|
+
children: formatAddress(userAddress)
|
|
3291
|
+
}
|
|
3292
|
+
)
|
|
3293
|
+
]
|
|
3070
3294
|
}
|
|
3071
|
-
)
|
|
3072
|
-
|
|
3073
|
-
Text.formatted,
|
|
3074
|
-
{
|
|
3075
|
-
rule: "address",
|
|
3076
|
-
className: "oui-text-[rgba(0,0,0,.88)] oui-font-semibold"
|
|
3077
|
-
},
|
|
3078
|
-
formatAddress(userAddress)
|
|
3079
|
-
)
|
|
3080
|
-
))
|
|
3295
|
+
) })
|
|
3296
|
+
}
|
|
3081
3297
|
);
|
|
3082
3298
|
}
|
|
3083
|
-
return /* @__PURE__ */
|
|
3299
|
+
return /* @__PURE__ */ jsx("div", { onClick: () => connect(), children: /* @__PURE__ */ jsxs(
|
|
3084
3300
|
Button,
|
|
3085
3301
|
{
|
|
3086
3302
|
size: "md",
|
|
3087
3303
|
variant: "gradient",
|
|
3088
3304
|
angle: 45,
|
|
3089
3305
|
"data-testid": "oui-testid-nav-bar-address-btn",
|
|
3090
|
-
className: "oui-flex oui-items-center oui-justify-center oui-gap-2"
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3306
|
+
className: "oui-flex oui-items-center oui-justify-center oui-gap-2",
|
|
3307
|
+
children: [
|
|
3308
|
+
linkedAccount && /* @__PURE__ */ jsx(
|
|
3309
|
+
RenderPrivyTypeIcon,
|
|
3310
|
+
{
|
|
3311
|
+
type: linkedAccount.type,
|
|
3312
|
+
size: 18,
|
|
3313
|
+
black: true
|
|
3314
|
+
}
|
|
3315
|
+
),
|
|
3316
|
+
/* @__PURE__ */ jsx(Text.formatted, { rule: "address", className: "oui-text-[rgba(0,0,0,.88)]", children: formatAddress(userAddress) })
|
|
3317
|
+
]
|
|
3318
|
+
}
|
|
3319
|
+
) });
|
|
3102
3320
|
};
|
|
3103
3321
|
installExtension({
|
|
3104
3322
|
name: "account-menu-privy",
|
|
3105
3323
|
scope: ["*"],
|
|
3106
3324
|
positions: [ExtensionPositionEnum.AccountMenu]
|
|
3107
3325
|
})((props) => {
|
|
3108
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ jsx(UserCenter, { ...props });
|
|
3109
3327
|
});
|
|
3110
3328
|
installExtension({
|
|
3111
3329
|
name: "mobile-account-menu-privy",
|
|
3112
3330
|
scope: ["*"],
|
|
3113
3331
|
positions: [ExtensionPositionEnum.MobileAccountMenu]
|
|
3114
3332
|
})((props) => {
|
|
3115
|
-
return /* @__PURE__ */
|
|
3333
|
+
return /* @__PURE__ */ jsx(MwebUserCenter, { ...props });
|
|
3116
3334
|
});
|
|
3117
|
-
|
|
3118
|
-
// src/main.tsx
|
|
3119
3335
|
var Main = (props) => {
|
|
3120
3336
|
const { headerProps, children } = props;
|
|
3121
3337
|
const { wallet, connectedChain, setChain, namespace, onDisconnect } = useWallet2();
|
|
@@ -3144,14 +3360,17 @@ var Main = (props) => {
|
|
|
3144
3360
|
}),
|
|
3145
3361
|
[connect, setChain, onDisconnect, connectedChain, wallet, namespace]
|
|
3146
3362
|
);
|
|
3147
|
-
return /* @__PURE__ */
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3363
|
+
return /* @__PURE__ */ jsxs(WalletConnectorContext.Provider, { value: memoizedValue, children: [
|
|
3364
|
+
/* @__PURE__ */ jsx(
|
|
3365
|
+
ConnectDrawer,
|
|
3366
|
+
{
|
|
3367
|
+
open: openConnectDrawer,
|
|
3368
|
+
onChangeOpen: setOpenConnectDrawer,
|
|
3369
|
+
headerProps
|
|
3370
|
+
}
|
|
3371
|
+
),
|
|
3372
|
+
children
|
|
3373
|
+
] });
|
|
3155
3374
|
};
|
|
3156
3375
|
var InitAbstractProvider = (props) => {
|
|
3157
3376
|
const { network } = useWalletConnectorPrivy();
|
|
@@ -3161,12 +3380,10 @@ var InitAbstractProvider = (props) => {
|
|
|
3161
3380
|
}
|
|
3162
3381
|
return abstractTestnet;
|
|
3163
3382
|
}, [network]);
|
|
3164
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx(AbstractWalletProvider$1, { chain, children: props.children });
|
|
3165
3384
|
};
|
|
3166
|
-
|
|
3167
|
-
// src/providers/abstractWallet/index.tsx
|
|
3168
3385
|
function AbstractWallet({ children }) {
|
|
3169
|
-
return /* @__PURE__ */
|
|
3386
|
+
return /* @__PURE__ */ jsx(InitAbstractProvider, { children: /* @__PURE__ */ jsx(AbstractWalletProvider, { children }) });
|
|
3170
3387
|
}
|
|
3171
3388
|
function InitPrivyProvider({
|
|
3172
3389
|
privyConfig,
|
|
@@ -3185,29 +3402,59 @@ function InitPrivyProvider({
|
|
|
3185
3402
|
(chain) => !SolanaChains$1.has(chain.id) && !AbstractChains.has(chain.id)
|
|
3186
3403
|
);
|
|
3187
3404
|
const defaultEvmChain = preferredDefaultChain ?? firstEvmChain ?? chains[0];
|
|
3405
|
+
const userConfig = privyConfig.config ?? {};
|
|
3406
|
+
const {
|
|
3407
|
+
supportedChains,
|
|
3408
|
+
defaultChain,
|
|
3409
|
+
loginMethods: userLoginMethods,
|
|
3410
|
+
appearance: userAppearance,
|
|
3411
|
+
embeddedWallets: userEmbedded,
|
|
3412
|
+
externalWallets: userExternal,
|
|
3413
|
+
...rest
|
|
3414
|
+
} = userConfig;
|
|
3415
|
+
const defaultEmbedded = {
|
|
3416
|
+
ethereum: {
|
|
3417
|
+
createOnLogin: "all-users"
|
|
3418
|
+
},
|
|
3419
|
+
solana: {
|
|
3420
|
+
createOnLogin: "all-users"
|
|
3421
|
+
}
|
|
3422
|
+
};
|
|
3423
|
+
const defaultExternal = {
|
|
3424
|
+
walletConnect: {
|
|
3425
|
+
enabled: false
|
|
3426
|
+
}
|
|
3427
|
+
};
|
|
3428
|
+
const embeddedWallets = {
|
|
3429
|
+
...defaultEmbedded,
|
|
3430
|
+
...userEmbedded,
|
|
3431
|
+
ethereum: {
|
|
3432
|
+
...defaultEmbedded.ethereum,
|
|
3433
|
+
...userEmbedded?.ethereum
|
|
3434
|
+
},
|
|
3435
|
+
solana: {
|
|
3436
|
+
...defaultEmbedded.solana,
|
|
3437
|
+
...userEmbedded?.solana
|
|
3438
|
+
}
|
|
3439
|
+
};
|
|
3440
|
+
const externalWallets = {
|
|
3441
|
+
...defaultExternal,
|
|
3442
|
+
...userExternal,
|
|
3443
|
+
walletConnect: {
|
|
3444
|
+
...defaultExternal.walletConnect,
|
|
3445
|
+
...userExternal?.walletConnect,
|
|
3446
|
+
enabled: userExternal?.walletConnect?.enabled ?? defaultExternal.walletConnect?.enabled ?? false
|
|
3447
|
+
}
|
|
3448
|
+
};
|
|
3188
3449
|
return {
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
"google",
|
|
3192
|
-
"twitter"
|
|
3193
|
-
],
|
|
3450
|
+
...rest,
|
|
3451
|
+
loginMethods: userLoginMethods || ["email", "google", "twitter"],
|
|
3194
3452
|
appearance: {
|
|
3195
|
-
...
|
|
3453
|
+
...userAppearance,
|
|
3196
3454
|
walletChainType: "ethereum-and-solana"
|
|
3197
3455
|
},
|
|
3198
|
-
embeddedWallets
|
|
3199
|
-
|
|
3200
|
-
createOnLogin: "all-users"
|
|
3201
|
-
},
|
|
3202
|
-
solana: {
|
|
3203
|
-
createOnLogin: "all-users"
|
|
3204
|
-
}
|
|
3205
|
-
},
|
|
3206
|
-
externalWallets: {
|
|
3207
|
-
walletConnect: {
|
|
3208
|
-
enabled: false
|
|
3209
|
-
}
|
|
3210
|
-
},
|
|
3456
|
+
embeddedWallets,
|
|
3457
|
+
externalWallets,
|
|
3211
3458
|
defaultChain: defaultEvmChain,
|
|
3212
3459
|
supportedChains: chains
|
|
3213
3460
|
};
|
|
@@ -3215,18 +3462,16 @@ function InitPrivyProvider({
|
|
|
3215
3462
|
if (!initChains.length) {
|
|
3216
3463
|
return;
|
|
3217
3464
|
}
|
|
3218
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ jsx(PrivyProvider, { appId: privyConfig.appid, config, children });
|
|
3219
3466
|
}
|
|
3220
|
-
|
|
3221
|
-
// src/providers/privy/index.tsx
|
|
3222
3467
|
function PrivyWallet(props) {
|
|
3223
|
-
return /* @__PURE__ */
|
|
3468
|
+
return /* @__PURE__ */ jsx(
|
|
3224
3469
|
InitPrivyProvider,
|
|
3225
3470
|
{
|
|
3226
3471
|
privyConfig: props.privyConfig,
|
|
3227
|
-
initChains: props.initChains
|
|
3228
|
-
|
|
3229
|
-
|
|
3472
|
+
initChains: props.initChains,
|
|
3473
|
+
children: /* @__PURE__ */ jsx(PrivyWalletProvider, { children: props.children })
|
|
3474
|
+
}
|
|
3230
3475
|
);
|
|
3231
3476
|
}
|
|
3232
3477
|
function InitSolanaProvider({
|
|
@@ -3268,18 +3513,16 @@ function InitSolanaProvider({
|
|
|
3268
3513
|
},
|
|
3269
3514
|
[ee, onError]
|
|
3270
3515
|
);
|
|
3271
|
-
return /* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ jsx(WalletProvider, { wallets, onError: handleOnError, autoConnect: true, children });
|
|
3272
3517
|
}
|
|
3273
|
-
|
|
3274
|
-
// src/providers/solana/index.tsx
|
|
3275
3518
|
function SolanaWallet(props) {
|
|
3276
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsx(
|
|
3277
3520
|
InitSolanaProvider,
|
|
3278
3521
|
{
|
|
3279
3522
|
...props.solanaConfig ?? { wallets: [], onError: () => {
|
|
3280
|
-
} }
|
|
3281
|
-
|
|
3282
|
-
|
|
3523
|
+
} },
|
|
3524
|
+
children: /* @__PURE__ */ jsx(SolanaWalletProvider, { children: props.children })
|
|
3525
|
+
}
|
|
3283
3526
|
);
|
|
3284
3527
|
}
|
|
3285
3528
|
function InitWagmiProvider({
|
|
@@ -3307,22 +3550,18 @@ function InitWagmiProvider({
|
|
|
3307
3550
|
)
|
|
3308
3551
|
})
|
|
3309
3552
|
);
|
|
3310
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsx(WagmiProvider, { config, initialState, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children }) });
|
|
3311
3554
|
}
|
|
3312
|
-
|
|
3313
|
-
// src/providers/wagmi/index.tsx
|
|
3314
3555
|
var WagmiWallet = (props) => {
|
|
3315
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ jsx(
|
|
3316
3557
|
InitWagmiProvider,
|
|
3317
3558
|
{
|
|
3318
3559
|
initChains: props.initChains,
|
|
3319
|
-
wagmiConfig: props.wagmiConfig ?? EMPTY_OBJECT
|
|
3320
|
-
|
|
3321
|
-
|
|
3560
|
+
wagmiConfig: props.wagmiConfig ?? EMPTY_OBJECT,
|
|
3561
|
+
children: /* @__PURE__ */ jsx(WagmiWalletProvider, { children: props.children })
|
|
3562
|
+
}
|
|
3322
3563
|
);
|
|
3323
3564
|
};
|
|
3324
|
-
|
|
3325
|
-
// src/provider.tsx
|
|
3326
3565
|
var testnetChainFallback = [ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo];
|
|
3327
3566
|
var processChainInfo = (chainInfo) => chainInfo.map(
|
|
3328
3567
|
(row) => defineChain({
|
|
@@ -3591,7 +3830,7 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
3591
3830
|
if (!initRef.current) {
|
|
3592
3831
|
return null;
|
|
3593
3832
|
}
|
|
3594
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ jsx(WalletConnectorPrivyContext.Provider, { value, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx(PrivyWallet, { privyConfig: props.privyConfig, initChains, children: /* @__PURE__ */ jsx(WagmiWallet, { wagmiConfig: props.wagmiConfig, initChains, children: /* @__PURE__ */ jsx(SolanaWallet, { solanaConfig: props.solanaConfig, children: /* @__PURE__ */ jsx(AbstractWallet, { children: /* @__PURE__ */ jsx(Main, { headerProps: props.headerProps, children: props.children }) }) }) }) }) }) });
|
|
3595
3834
|
}
|
|
3596
3835
|
|
|
3597
3836
|
// src/index.ts
|