@getpara/react-common 2.0.0-dev.0 → 2.0.0-dev.1

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.
@@ -1,5 +1,9 @@
1
1
  import ParaWeb from '@getpara/web-sdk';
2
2
  export declare class ParaInternal extends ParaWeb {
3
+ setupAfterLogin: ({ temporaryShares, skipSessionRefresh, }?: {
4
+ temporaryShares?: any[];
5
+ skipSessionRefresh?: boolean;
6
+ }) => Promise<void>;
3
7
  getSupportedCreateAuthMethods: () => Promise<Set<import("@getpara/web-sdk").AuthMethod>>;
4
8
  getTransmissionKeyShares: ({ isForNewDevice }?: {
5
9
  isForNewDevice?: boolean;
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ import ParaWeb from "@getpara/web-sdk";
44
44
  var ParaInternal = class extends ParaWeb {
45
45
  constructor() {
46
46
  super(...arguments);
47
+ this.setupAfterLogin = super.setupAfterLogin;
47
48
  this.getSupportedCreateAuthMethods = super.getSupportedCreateAuthMethods;
48
49
  this.getTransmissionKeyShares = super.getTransmissionKeyShares;
49
50
  this.userSetupAfterLogin = super.userSetupAfterLogin;
@@ -383,6 +384,25 @@ var formatBiometricHints = (hints) => {
383
384
  };
384
385
  };
385
386
 
387
+ // src/utils/getExternalWalletDisplayName.ts
388
+ import { truncateAddress, WalletType as WalletType2 } from "@getpara/web-sdk";
389
+ var getExternalWalletDisplayName = ({ address, type }) => {
390
+ const walletType = type;
391
+ let walletTypeDisplay;
392
+ switch (walletType) {
393
+ case WalletType2.EVM:
394
+ walletTypeDisplay = "EVM";
395
+ break;
396
+ case WalletType2.SOLANA:
397
+ walletTypeDisplay = "Solana";
398
+ break;
399
+ case WalletType2.COSMOS:
400
+ walletTypeDisplay = "Cosmos";
401
+ break;
402
+ }
403
+ return `${walletTypeDisplay} ${truncateAddress(address, walletType)}`;
404
+ };
405
+
386
406
  // src/utils/index.ts
387
407
  function getCurrencyCodes({ assetInfo, allowedAssets, defaultOnRampNetwork, defaultOnRampAsset }, {
388
408
  provider,
@@ -1157,6 +1177,7 @@ function defaultDisplayName(authType, identifier) {
1157
1177
  }
1158
1178
  }
1159
1179
  var UserIdentifier = ({ identifier, authType, displayName, pfpUrl }) => {
1180
+ const shouldHideAvatar = authType === "externalWallet";
1160
1181
  let icon;
1161
1182
  switch (authType) {
1162
1183
  case "email":
@@ -1173,7 +1194,7 @@ var UserIdentifier = ({ identifier, authType, displayName, pfpUrl }) => {
1173
1194
  break;
1174
1195
  }
1175
1196
  return /* @__PURE__ */ jsxs5(Container4, { children: [
1176
- /* @__PURE__ */ jsx7(IconContainer, { children: pfpUrl ? /* @__PURE__ */ jsx7(Avatar, { src: pfpUrl, size: "20px" }) : /* @__PURE__ */ jsx7(Icon, { icon, size: authType === "telegram" ? "20px" : "13px" }) }),
1197
+ !shouldHideAvatar && /* @__PURE__ */ jsx7(IconContainer, { children: pfpUrl ? /* @__PURE__ */ jsx7(Avatar, { src: pfpUrl, size: "20px" }) : /* @__PURE__ */ jsx7(Icon, { icon, size: authType === "telegram" ? "20px" : "13px" }) }),
1177
1198
  /* @__PURE__ */ jsx7(IdentifierText, { variant: "bodyS", weight: "medium", children: displayName || defaultDisplayName(authType, identifier) })
1178
1199
  ] });
1179
1200
  };
@@ -1205,9 +1226,35 @@ var Avatar = styled7(CpslAvatar)`
1205
1226
  --container-border-width: 0;
1206
1227
  --container-padding: 0;
1207
1228
  `;
1229
+
1230
+ // src/types/externalWalletCommon.ts
1231
+ var EvmWallet = /* @__PURE__ */ ((EvmWallet2) => {
1232
+ EvmWallet2["METAMASK"] = "METAMASK";
1233
+ EvmWallet2["RAINBOW"] = "RAINBOW";
1234
+ EvmWallet2["COINBASE"] = "COINBASE";
1235
+ EvmWallet2["WALLETCONNECT"] = "WALLETCONNECT";
1236
+ EvmWallet2["ZERION"] = "ZERION";
1237
+ EvmWallet2["RABBY"] = "RABBY";
1238
+ return EvmWallet2;
1239
+ })(EvmWallet || {});
1240
+ var SolanaWallet = /* @__PURE__ */ ((SolanaWallet2) => {
1241
+ SolanaWallet2["PHANTOM"] = "PHANTOM";
1242
+ SolanaWallet2["GLOW"] = "GLOW";
1243
+ SolanaWallet2["BACKPACK"] = "BACKPACK";
1244
+ return SolanaWallet2;
1245
+ })(SolanaWallet || {});
1246
+ var CosmosWallet = /* @__PURE__ */ ((CosmosWallet2) => {
1247
+ CosmosWallet2["KEPLR"] = "KEPLR";
1248
+ CosmosWallet2["LEAP"] = "LEAP";
1249
+ return CosmosWallet2;
1250
+ })(CosmosWallet || {});
1251
+ var ExternalWallet = __spreadValues(__spreadValues(__spreadValues({}, EvmWallet), SolanaWallet), CosmosWallet);
1208
1252
  export {
1209
1253
  CenteredColumnContainer,
1210
1254
  CenteredText,
1255
+ CosmosWallet,
1256
+ EvmWallet,
1257
+ ExternalWallet,
1211
1258
  FilledDisabledInput,
1212
1259
  FullWidthFilledDisabledInput,
1213
1260
  HeaderButton,
@@ -1221,6 +1268,7 @@ export {
1221
1268
  RampEmbed,
1222
1269
  STRIPE_PUBLISHABLE_KEY,
1223
1270
  STRIPE_PUBLISHABLE_KEY_TEST,
1271
+ SolanaWallet,
1224
1272
  SpinnerContainer,
1225
1273
  StripeEmbed,
1226
1274
  TestNetworks,
@@ -1233,6 +1281,7 @@ export {
1233
1281
  getCurrencyCodes,
1234
1282
  getDeviceLogo,
1235
1283
  getDeviceModelName,
1284
+ getExternalWalletDisplayName,
1236
1285
  getNetworkFromChainId,
1237
1286
  getNetworkOrMainNetEquivalent,
1238
1287
  getNetworkTestEquivalent,
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
@@ -48,3 +48,34 @@ export type CommonChain = {
48
48
  id: string | number;
49
49
  name: string;
50
50
  };
51
+ export declare enum EvmWallet {
52
+ METAMASK = "METAMASK",
53
+ RAINBOW = "RAINBOW",
54
+ COINBASE = "COINBASE",
55
+ WALLETCONNECT = "WALLETCONNECT",
56
+ ZERION = "ZERION",
57
+ RABBY = "RABBY"
58
+ }
59
+ export declare enum SolanaWallet {
60
+ PHANTOM = "PHANTOM",
61
+ GLOW = "GLOW",
62
+ BACKPACK = "BACKPACK"
63
+ }
64
+ export declare enum CosmosWallet {
65
+ KEPLR = "KEPLR",
66
+ LEAP = "LEAP"
67
+ }
68
+ export declare const ExternalWallet: {
69
+ KEPLR: CosmosWallet.KEPLR;
70
+ LEAP: CosmosWallet.LEAP;
71
+ PHANTOM: SolanaWallet.PHANTOM;
72
+ GLOW: SolanaWallet.GLOW;
73
+ BACKPACK: SolanaWallet.BACKPACK;
74
+ METAMASK: EvmWallet.METAMASK;
75
+ RAINBOW: EvmWallet.RAINBOW;
76
+ COINBASE: EvmWallet.COINBASE;
77
+ WALLETCONNECT: EvmWallet.WALLETCONNECT;
78
+ ZERION: EvmWallet.ZERION;
79
+ RABBY: EvmWallet.RABBY;
80
+ };
81
+ export type TExternalWallet = keyof typeof ExternalWallet;
@@ -0,0 +1,5 @@
1
+ import { WalletType } from '@getpara/web-sdk';
2
+ export declare const getExternalWalletDisplayName: ({ address, type }: {
3
+ address: string;
4
+ type: WalletType;
5
+ }) => string;
@@ -32,3 +32,4 @@ export * from './getDeviceLogo.js';
32
32
  export * from './getDeviceModelName.js';
33
33
  export * from './getBrowserName.js';
34
34
  export * from './formatBiometricHints.js';
35
+ export * from './getExternalWalletDisplayName.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-common",
3
- "version": "2.0.0-dev.0",
3
+ "version": "2.0.0-dev.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,8 +11,8 @@
11
11
  "*.css"
12
12
  ],
13
13
  "dependencies": {
14
- "@getpara/react-components": "2.0.0-dev.0",
15
- "@getpara/web-sdk": "2.0.0-dev.0",
14
+ "@getpara/react-components": "2.0.0-dev.1",
15
+ "@getpara/web-sdk": "2.0.0-dev.1",
16
16
  "@moonpay/moonpay-react": "^1.8.3",
17
17
  "@ramp-network/ramp-instant-sdk": "^4.0.5",
18
18
  "@stripe/crypto": "^0.0.4",
@@ -42,5 +42,5 @@
42
42
  "resolutions": {
43
43
  "styled-components": "^6"
44
44
  },
45
- "gitHead": "f94ef031ef0e1894f5f0800e55f6ca2904641780"
45
+ "gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
46
46
  }