@rango-dev/ui 0.65.1-next.1 → 0.65.1-next.3
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.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/widget/ui/src/components/Wallet/ClickableWallet.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/SelectableWallet.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +2 -2
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.d.ts +1 -1
- package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +2 -1
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/index.d.ts +1 -1
- package/dist/widget/ui/src/types/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/wallet.d.ts +8 -1
- package/dist/widget/ui/src/types/wallet.d.ts.map +1 -1
- package/dist/widget/ui/src/utils/index.d.ts +2 -0
- package/dist/widget/ui/src/utils/index.d.ts.map +1 -0
- package/dist/widget/ui/src/utils/wallet.d.ts +3 -0
- package/dist/widget/ui/src/utils/wallet.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/Wallet/ClickableWallet.tsx +1 -1
- package/src/components/Wallet/SelectableWallet.tsx +1 -1
- package/src/components/Wallet/Wallet.types.ts +5 -2
- package/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.ts +1 -1
- package/src/index.ts +2 -1
- package/src/types/index.ts +1 -1
- package/src/types/wallet.ts +9 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/wallet.ts +33 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickableWallet.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/ClickableWallet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClickableWallet.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/ClickableWallet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,iBAAS,MAAM,CAAC,KAAK,EAAE,eAAe,qBA4DrC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableWallet.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/SelectableWallet.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectableWallet.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/SelectableWallet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,KAAK,mBAAmB,EAAe,MAAM,mBAAmB,CAAC;AAE1E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,qBA4C1D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { InstallObjects } from '../../types/wallet.js';
|
|
2
|
+
import type { LegacyWalletInfo, LegacyWalletType as WalletType } from '@rango-dev/wallets-core/legacy';
|
|
3
3
|
import type { TransactionType } from 'rango-types';
|
|
4
4
|
export declare enum WalletState {
|
|
5
5
|
NOT_INSTALLED = "not_installed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wallet.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Wallet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Wallet.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Wallet.types.ts"],"names":[],"mappings":"AAAA,O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AAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WalletInfo } from '../../components/index.js';
|
|
2
|
-
import type { WalletType } from '@rango-dev/wallets-
|
|
2
|
+
import type { LegacyWalletType as WalletType } from '@rango-dev/wallets-core/legacy';
|
|
3
3
|
export interface ConnectWalletsModalPropTypes {
|
|
4
4
|
open: boolean;
|
|
5
5
|
list: WalletInfo[];
|
package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectWalletsModal.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/ConnectWalletsModal/ConnectWalletsModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConnectWalletsModal.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/ConnectWalletsModal/ConnectWalletsModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAErF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './components/index.js';
|
|
2
2
|
export * from './containers/index.js';
|
|
3
3
|
export * from './theme.js';
|
|
4
|
-
export * from './types/index.js';
|
|
4
|
+
export type * from './types/index.js';
|
|
5
5
|
export * from './hooks/index.js';
|
|
6
6
|
export * from './icons/index.js';
|
|
7
7
|
export * from './constants/index.js';
|
|
8
|
+
export * from './utils/index.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,mBAAmB,kBAAkB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACV,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type { WalletType } from '@rango-dev/wallets-
|
|
1
|
+
import type { LegacyWalletType as WalletType } from '@rango-dev/wallets-core/legacy';
|
|
2
|
+
export type InstallObjects = {
|
|
3
|
+
CHROME?: string;
|
|
4
|
+
FIREFOX?: string;
|
|
5
|
+
EDGE?: string;
|
|
6
|
+
BRAVE?: string;
|
|
7
|
+
DEFAULT: string;
|
|
8
|
+
};
|
|
2
9
|
interface Wallet {
|
|
3
10
|
chain: string;
|
|
4
11
|
address: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/utils/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBzD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAe1E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/ui",
|
|
3
|
-
"version": "0.65.1-next.
|
|
3
|
+
"version": "0.65.1-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@radix-ui/react-select": "^2.0.0",
|
|
54
54
|
"@radix-ui/react-switch": "^1.0.1",
|
|
55
55
|
"@radix-ui/react-tooltip": "^1.0.2",
|
|
56
|
-
"@rango-dev/wallets-
|
|
56
|
+
"@rango-dev/wallets-core": "^0.61.1-next.0",
|
|
57
57
|
"@stitches/react": "^1.2.8",
|
|
58
58
|
"copy-to-clipboard": "^3.3.3",
|
|
59
59
|
"rango-types": "^0.5.0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WalletPropTypes } from './Wallet.types.js';
|
|
2
2
|
|
|
3
|
-
import { detectInstallLink } from '@rango-dev/wallets-shared';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
|
|
5
|
+
import { detectInstallLink } from '../../utils/wallet.js';
|
|
6
6
|
import { Image } from '../common/index.js';
|
|
7
7
|
import { Divider } from '../Divider/index.js';
|
|
8
8
|
import { Skeleton } from '../Skeleton/index.js';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { InstallObjects } from '../../types/wallet.js';
|
|
2
|
+
import type {
|
|
3
|
+
LegacyWalletInfo,
|
|
4
|
+
LegacyWalletType as WalletType,
|
|
5
|
+
} from '@rango-dev/wallets-core/legacy';
|
|
3
6
|
import type { TransactionType } from 'rango-types';
|
|
4
7
|
|
|
5
8
|
export enum WalletState {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WalletInfo } from '../../components/index.js';
|
|
2
|
-
import type { WalletType } from '@rango-dev/wallets-
|
|
2
|
+
import type { LegacyWalletType as WalletType } from '@rango-dev/wallets-core/legacy';
|
|
3
3
|
|
|
4
4
|
export interface ConnectWalletsModalPropTypes {
|
|
5
5
|
open: boolean;
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './components/index.js';
|
|
2
2
|
export * from './containers/index.js';
|
|
3
3
|
export * from './theme.js';
|
|
4
|
-
export * from './types/index.js';
|
|
4
|
+
export type * from './types/index.js';
|
|
5
5
|
export * from './hooks/index.js';
|
|
6
6
|
export * from './icons/index.js';
|
|
7
7
|
export * from './constants/index.js';
|
|
8
|
+
export * from './utils/index.js';
|
package/src/types/index.ts
CHANGED
package/src/types/wallet.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import type { WalletType } from '@rango-dev/wallets-
|
|
1
|
+
import type { LegacyWalletType as WalletType } from '@rango-dev/wallets-core/legacy';
|
|
2
|
+
|
|
3
|
+
export type InstallObjects = {
|
|
4
|
+
CHROME?: string;
|
|
5
|
+
FIREFOX?: string;
|
|
6
|
+
EDGE?: string;
|
|
7
|
+
BRAVE?: string;
|
|
8
|
+
DEFAULT: string;
|
|
9
|
+
};
|
|
2
10
|
|
|
3
11
|
interface Wallet {
|
|
4
12
|
chain: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './wallet.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { InstallObjects } from '../types/wallet.js';
|
|
2
|
+
|
|
3
|
+
function isBrave() {
|
|
4
|
+
let isBrave = false;
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
const nav: any = navigator;
|
|
7
|
+
if (nav.brave && nav.brave.isBrave) {
|
|
8
|
+
nav.brave.isBrave().then((res: boolean) => {
|
|
9
|
+
if (res) {
|
|
10
|
+
isBrave = true;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return isBrave;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function detectInstallLink(install: InstallObjects | string): string {
|
|
19
|
+
if (typeof install !== 'object') {
|
|
20
|
+
return install;
|
|
21
|
+
}
|
|
22
|
+
let link;
|
|
23
|
+
if (isBrave()) {
|
|
24
|
+
link = install.BRAVE;
|
|
25
|
+
} else if (navigator.userAgent?.toLowerCase().indexOf('chrome') !== -1) {
|
|
26
|
+
link = install.CHROME;
|
|
27
|
+
} else if (navigator.userAgent?.toLowerCase().indexOf('firefox') !== -1) {
|
|
28
|
+
link = install.FIREFOX;
|
|
29
|
+
} else if (navigator.userAgent?.toLowerCase().indexOf('edge') !== -1) {
|
|
30
|
+
link = install.EDGE;
|
|
31
|
+
}
|
|
32
|
+
return link || install.DEFAULT;
|
|
33
|
+
}
|