@orderly.network/wallet-connector-privy 2.7.4 → 2.8.0-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/README.md +8 -0
- package/dist/index.js +62 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -35,6 +35,13 @@ If abstractConfig is not configured, the Abstract Global Wallet connector will b
|
|
|
35
35
|
|
|
36
36
|
At least one of privyConfig, wagmiConfig, or solanaConfig must be provided.
|
|
37
37
|
|
|
38
|
+
**Available Login Methods for Privy:**
|
|
39
|
+
|
|
40
|
+
- `email` - Email/password login
|
|
41
|
+
- `google` - Google OAuth login
|
|
42
|
+
- `twitter` - Twitter OAuth login
|
|
43
|
+
- `telegram` - Telegram login (optional)
|
|
44
|
+
|
|
38
45
|
If customChains only includes a Solana chain, then Privy will only display the Solana injected wallet, and the Wagmi connector will be disabled.
|
|
39
46
|
|
|
40
47
|
If customChains only includes EVM chains, then Privy will only display the EVM injected wallet, and the Solana connector will be disabled.
|
|
@@ -54,6 +61,7 @@ eg:
|
|
|
54
61
|
accentColor: "#181C23",
|
|
55
62
|
logo: "/orderly-logo.svg",
|
|
56
63
|
},
|
|
64
|
+
loginMethods: ["email", "google", "twitter", "telegram"],
|
|
57
65
|
},
|
|
58
66
|
}}
|
|
59
67
|
wagmiConfig={{
|
package/dist/index.js
CHANGED
|
@@ -232,6 +232,8 @@ var PrivyWalletProvider = ({
|
|
|
232
232
|
address = `@${account.username}`;
|
|
233
233
|
} else if (account.type === "google_oauth") {
|
|
234
234
|
address = `@${account.name}`;
|
|
235
|
+
} else if (account.type === "telegram") {
|
|
236
|
+
address = `@${account.username}`;
|
|
235
237
|
}
|
|
236
238
|
return {
|
|
237
239
|
type: account.type,
|
|
@@ -1345,7 +1347,7 @@ var RenderLoginMethodsDom = ({
|
|
|
1345
1347
|
{
|
|
1346
1348
|
className: ui.cn(
|
|
1347
1349
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border oui-border-base-contrast-12 oui-px-2 oui-py-[11px]",
|
|
1348
|
-
|
|
1350
|
+
"oui-border-none oui-bg-[#333948]"
|
|
1349
1351
|
),
|
|
1350
1352
|
onClick: () => connect({ walletType: "privy", extraType: "email" })
|
|
1351
1353
|
},
|
|
@@ -1356,7 +1358,7 @@ var RenderLoginMethodsDom = ({
|
|
|
1356
1358
|
className: "oui-size-[18px]"
|
|
1357
1359
|
}
|
|
1358
1360
|
),
|
|
1359
|
-
|
|
1361
|
+
/* @__PURE__ */ React19__default.default.createElement("div", { className: "oui-text-2xs oui-text-base-contrast" }, t("connector.privy.email"))
|
|
1360
1362
|
)
|
|
1361
1363
|
);
|
|
1362
1364
|
}
|
|
@@ -1367,7 +1369,7 @@ var RenderLoginMethodsDom = ({
|
|
|
1367
1369
|
{
|
|
1368
1370
|
className: ui.cn(
|
|
1369
1371
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border oui-border-base-contrast-12 oui-px-2 oui-py-[11px]",
|
|
1370
|
-
|
|
1372
|
+
"oui-border-none oui-bg-[#335FFC]"
|
|
1371
1373
|
),
|
|
1372
1374
|
onClick: () => connect({ walletType: "privy", extraType: "google" })
|
|
1373
1375
|
},
|
|
@@ -1378,7 +1380,7 @@ var RenderLoginMethodsDom = ({
|
|
|
1378
1380
|
className: "oui-size-[18px]"
|
|
1379
1381
|
}
|
|
1380
1382
|
),
|
|
1381
|
-
|
|
1383
|
+
/* @__PURE__ */ React19__default.default.createElement("div", { className: "oui-text-2xs oui-text-base-contrast" }, t("connector.privy.google"))
|
|
1382
1384
|
)
|
|
1383
1385
|
);
|
|
1384
1386
|
}
|
|
@@ -1389,7 +1391,7 @@ var RenderLoginMethodsDom = ({
|
|
|
1389
1391
|
{
|
|
1390
1392
|
className: ui.cn(
|
|
1391
1393
|
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border oui-border-base-contrast-12 oui-px-2 oui-py-[11px]",
|
|
1392
|
-
|
|
1394
|
+
"oui-border-none oui-bg-[#07080A]"
|
|
1393
1395
|
),
|
|
1394
1396
|
onClick: () => connect({ walletType: "privy", extraType: "twitter" })
|
|
1395
1397
|
},
|
|
@@ -1400,7 +1402,39 @@ var RenderLoginMethodsDom = ({
|
|
|
1400
1402
|
className: "oui-size-[18px]"
|
|
1401
1403
|
}
|
|
1402
1404
|
),
|
|
1403
|
-
|
|
1405
|
+
/* @__PURE__ */ React19__default.default.createElement("div", { className: "oui-text-2xs oui-text-base-contrast" }, t("connector.privy.twitter"))
|
|
1406
|
+
)
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
if (loginMethods?.includes("telegram")) {
|
|
1410
|
+
arr.push(
|
|
1411
|
+
/* @__PURE__ */ React19__default.default.createElement(
|
|
1412
|
+
"div",
|
|
1413
|
+
{
|
|
1414
|
+
className: ui.cn(
|
|
1415
|
+
"oui-flex oui-cursor-pointer oui-items-center oui-justify-center oui-gap-1 oui-rounded-[6px] oui-border oui-border-base-contrast-12 oui-px-2 oui-py-[11px]",
|
|
1416
|
+
"oui-border-none oui-bg-[#3D79A9]"
|
|
1417
|
+
),
|
|
1418
|
+
onClick: () => connect({ walletType: "privy", extraType: "telegram" })
|
|
1419
|
+
},
|
|
1420
|
+
/* @__PURE__ */ React19__default.default.createElement(
|
|
1421
|
+
"svg",
|
|
1422
|
+
{
|
|
1423
|
+
width: "18",
|
|
1424
|
+
height: "18",
|
|
1425
|
+
viewBox: "0 0 18 18",
|
|
1426
|
+
fill: "none",
|
|
1427
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1428
|
+
},
|
|
1429
|
+
/* @__PURE__ */ React19__default.default.createElement(
|
|
1430
|
+
"path",
|
|
1431
|
+
{
|
|
1432
|
+
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",
|
|
1433
|
+
fill: "white"
|
|
1434
|
+
}
|
|
1435
|
+
)
|
|
1436
|
+
),
|
|
1437
|
+
/* @__PURE__ */ React19__default.default.createElement("div", { className: "oui-text-2xs oui-text-base-contrast" }, t("connector.privy.telegram"))
|
|
1404
1438
|
)
|
|
1405
1439
|
);
|
|
1406
1440
|
}
|
|
@@ -1415,7 +1449,7 @@ var PrivyConnectAreaMobile = ({
|
|
|
1415
1449
|
const { isMobile, isDesktop } = ui.useScreen();
|
|
1416
1450
|
const { connectorWalletType, privyConfig } = useWalletConnectorPrivy();
|
|
1417
1451
|
const loginMethods = privyConfig.loginMethods;
|
|
1418
|
-
return /* @__PURE__ */ React19__default.default.createElement(ui.Flex, { direction: "column", className: "oui-w-full" }, /* @__PURE__ */ React19__default.default.createElement(ui.Grid, { cols:
|
|
1452
|
+
return /* @__PURE__ */ React19__default.default.createElement(ui.Flex, { direction: "column", className: "oui-w-full" }, /* @__PURE__ */ React19__default.default.createElement(ui.Grid, { cols: 2, rows: 2, className: "oui-w-full", gap: 2 }, /* @__PURE__ */ React19__default.default.createElement(RenderLoginMethodsDom, { connect, loginMethods })), (!connectorWalletType.disableWagmi || !connectorWalletType.disableSolana) && /* @__PURE__ */ React19__default.default.createElement("div", { className: "oui-mt-4 oui-h-px oui-w-full oui-bg-line md:oui-mt-5" }));
|
|
1419
1453
|
};
|
|
1420
1454
|
var PrivyConnectAreaDesktop = ({
|
|
1421
1455
|
connect
|
|
@@ -1466,6 +1500,25 @@ function RenderPrivyTypeIcon({
|
|
|
1466
1500
|
}
|
|
1467
1501
|
);
|
|
1468
1502
|
}
|
|
1503
|
+
if (type === "telegram") {
|
|
1504
|
+
return /* @__PURE__ */ React19__default.default.createElement(
|
|
1505
|
+
"svg",
|
|
1506
|
+
{
|
|
1507
|
+
width: size,
|
|
1508
|
+
height: size,
|
|
1509
|
+
viewBox: "0 0 18 18",
|
|
1510
|
+
fill: "none",
|
|
1511
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1512
|
+
},
|
|
1513
|
+
/* @__PURE__ */ React19__default.default.createElement(
|
|
1514
|
+
"path",
|
|
1515
|
+
{
|
|
1516
|
+
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",
|
|
1517
|
+
fill: black ? "black" : "white"
|
|
1518
|
+
}
|
|
1519
|
+
)
|
|
1520
|
+
);
|
|
1521
|
+
}
|
|
1469
1522
|
return /* @__PURE__ */ React19__default.default.createElement(
|
|
1470
1523
|
"img",
|
|
1471
1524
|
{
|
|
@@ -2589,7 +2642,7 @@ function ConnectDrawer(props) {
|
|
|
2589
2642
|
}
|
|
2590
2643
|
),
|
|
2591
2644
|
/* @__PURE__ */ React19__default.default.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__default.default.createElement("div", { className: "oui-flex oui-flex-none oui-items-center oui-justify-between" }, renderHeader(), /* @__PURE__ */ React19__default.default.createElement(
|
|
2592
|
-
ui.
|
|
2645
|
+
ui.CloseSquareFillIcon,
|
|
2593
2646
|
{
|
|
2594
2647
|
className: "oui-size-5 oui-cursor-pointer oui-text-base-contrast-20 hover:oui-text-base-contrast-80",
|
|
2595
2648
|
onClick: () => props.onChangeOpen(false)
|
|
@@ -3239,7 +3292,7 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
3239
3292
|
}, [initChains]);
|
|
3240
3293
|
const { data: swapChainInfoRes, isLoading: swapLoading } = hooks.useSWR(
|
|
3241
3294
|
!props.customChains && props.enableSwapDeposit ? "https://fi-api.woo.org/swap_support" : null,
|
|
3242
|
-
|
|
3295
|
+
(url) => fetch(url).then((res) => res.json()),
|
|
3243
3296
|
commonSwrOpts
|
|
3244
3297
|
);
|
|
3245
3298
|
const { data: mainnetChainInfos } = hooks.useSWR(
|