@rango-dev/widget-embedded 0.28.2-next.0 → 0.28.2
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/components/BlockchainList/BlockchainList.helpers.d.ts +2 -1
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -1
- package/dist/constants/fonts.d.ts +0 -5
- package/dist/constants/fonts.d.ts.map +1 -1
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/common.d.ts +0 -3
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +1 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +0 -2
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +7 -8
- package/src/components/BlockchainList/BlockchainList.helpers.ts +25 -6
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +4 -4
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +1 -1
- package/src/components/Quote/Quote.styles.ts +1 -1
- package/src/components/Slippage/Slippage.tsx +1 -1
- package/src/constants/fonts.ts +0 -84
- package/src/containers/WidgetProvider/WidgetProvider.tsx +2 -20
- package/src/globalStyles.ts +3 -1
- package/src/hooks/useBootstrap/useBootstrap.ts +1 -1
- package/src/hooks/useTheme.ts +1 -1
- package/src/index.ts +0 -2
- package/src/pages/SelectBlockchainPage.tsx +3 -3
- package/src/pages/WalletsPage.tsx +2 -34
- package/src/types/config.ts +1 -6
- package/src/utils/common.ts +0 -29
- package/src/utils/configs.ts +1 -0
- package/src/utils/wallets.ts +2 -53
- package/dist/hooks/useFontLoader.d.ts +0 -5
- package/dist/hooks/useFontLoader.d.ts.map +0 -1
- package/src/hooks/useFontLoader.ts +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA8BxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,sBAqG1B"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type WidgetColors = {
|
|
|
25
25
|
* radius, width, and height.
|
|
26
26
|
* @property {'auto' | 'light' | 'dark'} mode - The mode property is used to specify the default theme for
|
|
27
27
|
* the widget.
|
|
28
|
-
* @property {string} fontFamily - The font family to be used in the widget.
|
|
28
|
+
* @property {string} fontFamily - The font family to be used in the widget.
|
|
29
29
|
* @property {{ light?: WidgetColors; dark?: WidgetColors }} colors - The `colors` property is a sub-property of the `WidgetTheme` object that
|
|
30
30
|
* defines the color scheme for the widget. It is of type `Colors`, which is likely another object that
|
|
31
31
|
* contains specific color values for various parts of the widget (e.g. background color, text color,
|
|
@@ -102,9 +102,6 @@ export type BlockchainAndTokenConfig = {
|
|
|
102
102
|
[blockchain: string]: Tokens;
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
-
export type SignersConfig = {
|
|
106
|
-
customSolanaRPC?: string;
|
|
107
|
-
};
|
|
108
105
|
/**
|
|
109
106
|
* `Features`
|
|
110
107
|
*
|
|
@@ -199,6 +196,5 @@ export type WidgetConfig = {
|
|
|
199
196
|
features?: Features;
|
|
200
197
|
variant?: WidgetVariant;
|
|
201
198
|
enableCentralizedSwappers?: boolean;
|
|
202
|
-
signers?: SignersConfig;
|
|
203
199
|
};
|
|
204
200
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACv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|
1
1
|
import type { Token } from 'rango-sdk';
|
|
2
|
-
import { TransactionType } from 'rango-sdk';
|
|
3
2
|
export declare function removeDuplicateFrom<T>(array: T[]): T[];
|
|
4
3
|
export declare function areEqual(array1: (number | string)[], array2: (number | string)[]): boolean;
|
|
5
4
|
export declare function debounce(fn: Function, time: number): (...args: any) => void;
|
|
@@ -9,6 +8,4 @@ export declare function startWithText(text: string, searchText: string): boolean
|
|
|
9
8
|
export declare const getContainer: () => HTMLElement;
|
|
10
9
|
export declare const getExpanded: () => HTMLElement;
|
|
11
10
|
export declare function compareWithSearchFor(tokenA: Token, tokenB: Token, searchFor?: string): number;
|
|
12
|
-
export declare const isBlockchainTypeInCategory: (blockchainType: TransactionType, category: string) => boolean;
|
|
13
|
-
export declare const getFontUrlByName: (fontName: string) => string | undefined;
|
|
14
11
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAWvC,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAK5B;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAGvB,GAAG,UAS9B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED,eAAO,MAAM,YAAY,mBACyC,CAAC;AAEnE,eAAO,MAAM,WAAW,mBAC8C,CAAC;AAsDvE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,KAAK,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CA0GR"}
|
package/dist/utils/configs.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare function setConfig(name: keyof Configs, value: any): any;
|
|
|
15
15
|
export declare function initConfig(nextConfigs: Configs): Configs;
|
|
16
16
|
export declare const DEFAULT_PRIMARY_RADIUS = 20;
|
|
17
17
|
export declare const DEFAULT_SECONDARY_RADIUS = 25;
|
|
18
|
+
export declare const DEFAULT_FONT_FAMILY = "Roboto";
|
|
18
19
|
export declare const THEME_CLASS_NAME_PREFIX = "theme-widget";
|
|
19
20
|
export declare const isTokenExcludedInConfig: (token: Token | null, tokensConfig?: TokensConfig) => boolean;
|
|
20
21
|
export declare const isBlockchainExcludedInConfig: (blockchain: BlockchainMeta | null, blockchainsConfig?: string[]) => boolean | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAM9D,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,YAAY,GACb,KAAK,EAAE,GACP;IACE,CAAC,UA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AI,sBACb,MAAM,EAAE,+BAO7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,kBACf,OAAO,sBACF,OAAO,YACjB,aAAa,YAMxB,CAAC"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -33,6 +33,4 @@ export declare function createTokenHash(token: Asset): TokenHash;
|
|
|
33
33
|
export declare function makeTokensBalance(connectedWallets: ConnectedWallet[]): TokensBalance;
|
|
34
34
|
export declare const isFetchingBalance: (connectedWallets: ConnectedWallet[], blockchain: string) => boolean;
|
|
35
35
|
export declare function hashWalletsState(walletsInfo: ModalWalletInfo[]): string;
|
|
36
|
-
export declare function filterBlockchainsByWalletTypes(wallets: ModalWalletInfo[], blockchains: BlockchainMeta[]): BlockchainMeta[];
|
|
37
|
-
export declare function filterWalletsByCategory(wallets: WalletInfoWithNamespaces[], category: string): WalletInfoWithNamespaces[];
|
|
38
36
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EACV,OAAO,EACP,aAAa,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AG,MAAM,GAAG,SAAS,CAMrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,iBAmCpE;AAED,eAAO,MAAM,iBAAiB,qBACV,eAAe,EAAE,cACvB,MAAM,YAIjB,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,eAAe,EAAE,UAE9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.28.2
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -24,15 +24,14 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@lingui/core": "4.2.1",
|
|
26
26
|
"@lingui/react": "4.2.1",
|
|
27
|
-
"@rango-dev/logging-core": "^0.3.
|
|
28
|
-
"@rango-dev/provider-all": "^0.33.2
|
|
27
|
+
"@rango-dev/logging-core": "^0.3.0",
|
|
28
|
+
"@rango-dev/provider-all": "^0.33.2",
|
|
29
29
|
"@rango-dev/queue-manager-core": "^0.26.0",
|
|
30
|
-
"@rango-dev/queue-manager-rango-preset": "^0.33.2
|
|
30
|
+
"@rango-dev/queue-manager-rango-preset": "^0.33.2",
|
|
31
31
|
"@rango-dev/queue-manager-react": "^0.26.0",
|
|
32
|
-
"@rango-dev/
|
|
33
|
-
"@rango-dev/
|
|
34
|
-
"@rango-dev/wallets-
|
|
35
|
-
"@rango-dev/wallets-shared": "^0.33.1-next.0",
|
|
32
|
+
"@rango-dev/ui": "^0.34.0",
|
|
33
|
+
"@rango-dev/wallets-react": "^0.19.0",
|
|
34
|
+
"@rango-dev/wallets-shared": "^0.33.0",
|
|
36
35
|
"bignumber.js": "^9.1.1",
|
|
37
36
|
"copy-to-clipboard": "^3.3.3",
|
|
38
37
|
"dayjs": "^1.11.7",
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockchainCategories } from '@rango-dev/ui';
|
|
2
|
+
import { type BlockchainMeta, TransactionType } from 'rango-sdk';
|
|
2
3
|
|
|
3
|
-
import { containsText
|
|
4
|
+
import { containsText } from '../../utils/common';
|
|
5
|
+
|
|
6
|
+
export const filterByType = (
|
|
7
|
+
blockchain: BlockchainMeta,
|
|
8
|
+
type: string
|
|
9
|
+
): boolean => {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case BlockchainCategories.ALL:
|
|
12
|
+
return true;
|
|
13
|
+
case BlockchainCategories.UTXO:
|
|
14
|
+
return blockchain.type === TransactionType.TRANSFER;
|
|
15
|
+
case BlockchainCategories.OTHER:
|
|
16
|
+
return (
|
|
17
|
+
blockchain.type !== TransactionType.TRANSFER &&
|
|
18
|
+
blockchain.type !== TransactionType.COSMOS &&
|
|
19
|
+
blockchain.type !== TransactionType.EVM
|
|
20
|
+
);
|
|
21
|
+
default:
|
|
22
|
+
return blockchain.type === type;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
4
25
|
|
|
5
26
|
export const filterBlockchains = (
|
|
6
27
|
list: BlockchainMeta[],
|
|
7
28
|
searchedFor: string,
|
|
8
|
-
|
|
29
|
+
blockchainType: string
|
|
9
30
|
) =>
|
|
10
31
|
list
|
|
11
|
-
.filter((blockchain) =>
|
|
12
|
-
isBlockchainTypeInCategory(blockchain.type, blockchainCategory)
|
|
13
|
-
)
|
|
32
|
+
.filter((blockchain) => filterByType(blockchain, blockchainType))
|
|
14
33
|
.filter(
|
|
15
34
|
(blockchain) =>
|
|
16
35
|
containsText(blockchain.name, searchedFor) ||
|
|
@@ -34,7 +34,7 @@ export const WalletButton = styled('button', {
|
|
|
34
34
|
position: 'relative',
|
|
35
35
|
|
|
36
36
|
'&:hover': {
|
|
37
|
-
$$color: '$colors$
|
|
37
|
+
$$color: '$colors$info100',
|
|
38
38
|
[`.${darkTheme} &`]: {
|
|
39
39
|
$$color: '$colors$neutral100',
|
|
40
40
|
},
|
|
@@ -42,7 +42,7 @@ export const WalletButton = styled('button', {
|
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
'&:focus-visible': {
|
|
45
|
-
$$color: '$colors$
|
|
45
|
+
$$color: '$colors$info100',
|
|
46
46
|
[`.${darkTheme} &`]: {
|
|
47
47
|
$$color: '$colors$info700',
|
|
48
48
|
},
|
|
@@ -138,14 +138,14 @@ export const CustomDestinationButton = styled('div', {
|
|
|
138
138
|
borderBottomRightRadius: '0',
|
|
139
139
|
borderBottomLeftRadius: '0',
|
|
140
140
|
'&:hover': {
|
|
141
|
-
$$color: '$colors$
|
|
141
|
+
$$color: '$colors$info100',
|
|
142
142
|
[`.${darkTheme} &`]: {
|
|
143
143
|
$$color: '$colors$neutral100',
|
|
144
144
|
},
|
|
145
145
|
backgroundColor: '$$color',
|
|
146
146
|
},
|
|
147
147
|
'&:focus-visible': {
|
|
148
|
-
$$background: '$colors$
|
|
148
|
+
$$background: '$colors$info100',
|
|
149
149
|
[`.${darkTheme} &`]: {
|
|
150
150
|
$$background: '$colors$info700',
|
|
151
151
|
},
|
package/src/constants/fonts.ts
CHANGED
|
@@ -1,85 +1 @@
|
|
|
1
1
|
export const DEFAULT_FONT_FAMILY = 'Roboto';
|
|
2
|
-
|
|
3
|
-
export const SUPPORTED_FONTS = [
|
|
4
|
-
{
|
|
5
|
-
name: 'Roboto',
|
|
6
|
-
value: 'Roboto',
|
|
7
|
-
url: '',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
name: 'Times New Roman',
|
|
11
|
-
value: 'Times New Roman',
|
|
12
|
-
url: 'https://fonts.cdnfonts.com/css/times-new-roman',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Arial',
|
|
16
|
-
value: 'Arial',
|
|
17
|
-
url: '',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Open Sans',
|
|
21
|
-
value: 'Open Sans',
|
|
22
|
-
url: 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Noto Sans',
|
|
26
|
-
value: 'Noto Sans',
|
|
27
|
-
url: 'https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Montserrat',
|
|
31
|
-
value: 'Montserrat',
|
|
32
|
-
url: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Poppins',
|
|
36
|
-
value: 'Poppins',
|
|
37
|
-
url: 'https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Roboto Condensed',
|
|
41
|
-
value: 'Roboto Condensed',
|
|
42
|
-
url: 'https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap',
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
name: 'Roboto Mono',
|
|
47
|
-
value: 'Roboto Mono',
|
|
48
|
-
url: 'https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'Oswald',
|
|
52
|
-
value: 'Oswald',
|
|
53
|
-
url: 'https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'Raleway',
|
|
57
|
-
value: 'Raleway',
|
|
58
|
-
url: 'https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'Sedan',
|
|
62
|
-
value: 'Sedan',
|
|
63
|
-
url: 'https://fonts.googleapis.com/css2?family=Sedan:ital@0;1&display=swap',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'Inter',
|
|
67
|
-
value: 'Inter',
|
|
68
|
-
url: 'https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'Rubik',
|
|
72
|
-
value: 'Rubik',
|
|
73
|
-
url: 'https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'Lora',
|
|
77
|
-
value: 'Lora',
|
|
78
|
-
url: 'https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'Barlow Condensed',
|
|
82
|
-
value: 'Barlow Condensed',
|
|
83
|
-
url: 'https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap',
|
|
84
|
-
},
|
|
85
|
-
];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { PropTypes } from './WidgetProvider.types';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import React, { useEffect } from 'react';
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
6
5
|
|
|
7
6
|
import { DEFAULT_BASE_URL, RANGO_PUBLIC_API_KEY } from '../../constants';
|
|
8
|
-
import useFontLoader from '../../hooks/useFontLoader';
|
|
9
7
|
import QueueManager from '../../QueueManager';
|
|
10
8
|
import { initConfig } from '../../utils/configs';
|
|
11
9
|
import { WidgetWallets } from '../Wallets';
|
|
@@ -14,29 +12,13 @@ import { WidgetInfo } from '../WidgetInfo';
|
|
|
14
12
|
export function WidgetProvider(props: PropsWithChildren<PropTypes>) {
|
|
15
13
|
const { onUpdateState, config } = props;
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const { handleLoadCustomFont } = useFontLoader();
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (fontFamily) {
|
|
23
|
-
handleLoadCustomFont(fontFamily);
|
|
24
|
-
}
|
|
25
|
-
}, [fontFamily]);
|
|
26
|
-
|
|
27
|
-
useEffect(() => {
|
|
15
|
+
useMemo(() => {
|
|
28
16
|
initConfig({
|
|
29
17
|
API_KEY: config?.apiKey || RANGO_PUBLIC_API_KEY,
|
|
30
18
|
BASE_URL: config?.apiUrl || DEFAULT_BASE_URL,
|
|
31
19
|
});
|
|
32
20
|
}, [config.apiKey, config.apiUrl]);
|
|
33
21
|
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (props.config?.signers?.customSolanaRPC) {
|
|
36
|
-
setSolanaSignerConfig('customRPC', props.config.signers.customSolanaRPC);
|
|
37
|
-
}
|
|
38
|
-
}, [props.config?.signers?.customSolanaRPC]);
|
|
39
|
-
|
|
40
22
|
return (
|
|
41
23
|
<WidgetWallets config={config} onUpdateState={onUpdateState}>
|
|
42
24
|
<QueueManager apiKey={config.apiKey}>
|
package/src/globalStyles.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { globalCss } from '@rango-dev/ui';
|
|
|
2
2
|
|
|
3
3
|
export const globalFont = () =>
|
|
4
4
|
globalCss({
|
|
5
|
-
'@import':
|
|
5
|
+
'@import': [
|
|
6
6
|
"url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')",
|
|
7
|
+
"url('https://fonts.cdnfonts.com/css/times-new-roman')",
|
|
8
|
+
],
|
|
7
9
|
})();
|
|
@@ -16,8 +16,8 @@ import { useForceAutoConnect } from '../useForceAutoConnect';
|
|
|
16
16
|
import { useSubscribeToWidgetEvents } from '../useSubscribeToWidgetEvents';
|
|
17
17
|
|
|
18
18
|
export function useBootstrap() {
|
|
19
|
-
useForceAutoConnect();
|
|
20
19
|
globalFont();
|
|
20
|
+
useForceAutoConnect();
|
|
21
21
|
useSubscribeToWidgetEvents();
|
|
22
22
|
const blockchains = useAppStore().blockchains();
|
|
23
23
|
const { canSwitchNetworkTo } = useWallets();
|
package/src/hooks/useTheme.ts
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from '@rango-dev/ui';
|
|
7
7
|
import { useEffect, useState } from 'react';
|
|
8
8
|
|
|
9
|
-
import { DEFAULT_FONT_FAMILY } from '../constants/fonts';
|
|
10
9
|
import { useAppStore } from '../store/AppStore';
|
|
11
10
|
import { type WidgetTheme } from '../types';
|
|
12
11
|
import {
|
|
12
|
+
DEFAULT_FONT_FAMILY,
|
|
13
13
|
DEFAULT_PRIMARY_RADIUS,
|
|
14
14
|
DEFAULT_SECONDARY_RADIUS,
|
|
15
15
|
} from '../utils/configs';
|
package/src/index.ts
CHANGED
|
@@ -59,7 +59,6 @@ import { Networks, WalletTypes } from '@rango-dev/wallets-shared';
|
|
|
59
59
|
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
60
60
|
|
|
61
61
|
import { WIDGET_UI_ID as UI_ID } from './constants';
|
|
62
|
-
import { SUPPORTED_FONTS } from './constants/fonts';
|
|
63
62
|
import { WidgetWallets } from './containers/Wallets';
|
|
64
63
|
import { Widget } from './containers/Widget';
|
|
65
64
|
import { useWidget } from './containers/WidgetInfo';
|
|
@@ -114,7 +113,6 @@ export {
|
|
|
114
113
|
StepExecutionEventStatus,
|
|
115
114
|
StepExecutionBlockedEventStatus,
|
|
116
115
|
UI_ID,
|
|
117
|
-
SUPPORTED_FONTS,
|
|
118
116
|
};
|
|
119
117
|
|
|
120
118
|
// Internal type exports for Rango
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
2
|
import {
|
|
3
3
|
Divider,
|
|
4
|
-
|
|
4
|
+
getCountCategories,
|
|
5
5
|
SelectableCategoryList,
|
|
6
6
|
} from '@rango-dev/ui';
|
|
7
7
|
import React, { useState } from 'react';
|
|
@@ -30,9 +30,9 @@ export function SelectBlockchainPage(props: PropTypes) {
|
|
|
30
30
|
type,
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const countActiveCategories = getCountCategories(blockchains);
|
|
34
34
|
|
|
35
|
-
const showCategory =
|
|
35
|
+
const showCategory = countActiveCategories !== 1;
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<Layout
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { Namespace, WalletType } from '@rango-dev/wallets-shared';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import {
|
|
5
|
-
Divider,
|
|
6
|
-
getCategoriesCount,
|
|
7
|
-
SelectableCategoryList,
|
|
8
|
-
styled,
|
|
9
|
-
Typography,
|
|
10
|
-
Wallet,
|
|
11
|
-
WalletState,
|
|
12
|
-
} from '@rango-dev/ui';
|
|
4
|
+
import { styled, Typography, Wallet, WalletState } from '@rango-dev/ui';
|
|
13
5
|
import React, { useState } from 'react';
|
|
14
6
|
|
|
15
7
|
import { Layout, PageContainer } from '../components/Layout';
|
|
@@ -19,10 +11,6 @@ import { useWalletList } from '../hooks/useWalletList';
|
|
|
19
11
|
import { useAppStore } from '../store/AppStore';
|
|
20
12
|
import { useUiStore } from '../store/ui';
|
|
21
13
|
import { getContainer } from '../utils/common';
|
|
22
|
-
import {
|
|
23
|
-
filterBlockchainsByWalletTypes,
|
|
24
|
-
filterWalletsByCategory,
|
|
25
|
-
} from '../utils/wallets';
|
|
26
14
|
|
|
27
15
|
interface NamespacesModalState {
|
|
28
16
|
providerType: string;
|
|
@@ -49,9 +37,6 @@ export const TIME_TO_IGNORE_MODAL = 300;
|
|
|
49
37
|
|
|
50
38
|
export function WalletsPage() {
|
|
51
39
|
const { fetchStatus: fetchMetaStatus } = useAppStore();
|
|
52
|
-
const [blockchainCategory, setBlockchainCategory] = useState<string>('ALL');
|
|
53
|
-
const blockchains = useAppStore().blockchains();
|
|
54
|
-
|
|
55
40
|
const [openModal, setOpenModal] = useState(false);
|
|
56
41
|
const [namespacesModalState, setNamespacesModalState] =
|
|
57
42
|
useState<NamespacesModalState | null>(null);
|
|
@@ -89,34 +74,17 @@ export function WalletsPage() {
|
|
|
89
74
|
const selectedWalletState =
|
|
90
75
|
selectedWallet?.state || WalletState.NOT_INSTALLED;
|
|
91
76
|
|
|
92
|
-
const filteredBlockchains = filterBlockchainsByWalletTypes(list, blockchains);
|
|
93
|
-
const activeCategoriesCount = getCategoriesCount(filteredBlockchains);
|
|
94
|
-
const showCategory = activeCategoriesCount !== 1;
|
|
95
|
-
|
|
96
|
-
const filteredWallets = filterWalletsByCategory(list, blockchainCategory);
|
|
97
|
-
|
|
98
77
|
return (
|
|
99
78
|
<Layout
|
|
100
79
|
header={{
|
|
101
80
|
title: i18n.t('Connect Wallets'),
|
|
102
81
|
}}>
|
|
103
82
|
<Container>
|
|
104
|
-
{showCategory && (
|
|
105
|
-
<>
|
|
106
|
-
<SelectableCategoryList
|
|
107
|
-
setCategory={setBlockchainCategory}
|
|
108
|
-
category={blockchainCategory}
|
|
109
|
-
blockchains={filteredBlockchains}
|
|
110
|
-
isLoading={fetchMetaStatus === 'loading'}
|
|
111
|
-
/>
|
|
112
|
-
<Divider size={24} />
|
|
113
|
-
</>
|
|
114
|
-
)}
|
|
115
83
|
<Typography variant="title" size="xmedium" align="center">
|
|
116
84
|
{i18n.t('Choose a wallet to connect.')}
|
|
117
85
|
</Typography>
|
|
118
86
|
<ListContainer>
|
|
119
|
-
{
|
|
87
|
+
{list.map((wallet, index) => {
|
|
120
88
|
const key = `wallet-${index}-${wallet.type}`;
|
|
121
89
|
return (
|
|
122
90
|
<Wallet
|
package/src/types/config.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type WidgetColors = {
|
|
|
28
28
|
* radius, width, and height.
|
|
29
29
|
* @property {'auto' | 'light' | 'dark'} mode - The mode property is used to specify the default theme for
|
|
30
30
|
* the widget.
|
|
31
|
-
* @property {string} fontFamily - The font family to be used in the widget.
|
|
31
|
+
* @property {string} fontFamily - The font family to be used in the widget.
|
|
32
32
|
* @property {{ light?: WidgetColors; dark?: WidgetColors }} colors - The `colors` property is a sub-property of the `WidgetTheme` object that
|
|
33
33
|
* defines the color scheme for the widget. It is of type `Colors`, which is likely another object that
|
|
34
34
|
* contains specific color values for various parts of the widget (e.g. background color, text color,
|
|
@@ -103,10 +103,6 @@ export type BlockchainAndTokenConfig = {
|
|
|
103
103
|
tokens?: Asset[] | { [blockchain: string]: Tokens };
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
export type SignersConfig = {
|
|
107
|
-
customSolanaRPC?: string;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
106
|
/**
|
|
111
107
|
* `Features`
|
|
112
108
|
*
|
|
@@ -213,5 +209,4 @@ export type WidgetConfig = {
|
|
|
213
209
|
features?: Features;
|
|
214
210
|
variant?: WidgetVariant;
|
|
215
211
|
enableCentralizedSwappers?: boolean;
|
|
216
|
-
signers?: SignersConfig;
|
|
217
212
|
};
|
package/src/utils/common.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Token } from 'rango-sdk';
|
|
2
2
|
|
|
3
|
-
import { BlockchainCategories } from '@rango-dev/ui';
|
|
4
|
-
import { TransactionType } from 'rango-sdk';
|
|
5
|
-
|
|
6
3
|
import { WIDGET_UI_ID } from '../constants';
|
|
7
|
-
import { SUPPORTED_FONTS } from '../constants/fonts';
|
|
8
4
|
import {
|
|
9
5
|
MIN_LENGTH_SYMBOL_CONTAINS,
|
|
10
6
|
MIN_LENGTH_SYMBOL_START_WITH,
|
|
@@ -222,28 +218,3 @@ export function compareWithSearchFor(
|
|
|
222
218
|
|
|
223
219
|
return 0;
|
|
224
220
|
}
|
|
225
|
-
|
|
226
|
-
export const isBlockchainTypeInCategory = (
|
|
227
|
-
blockchainType: TransactionType,
|
|
228
|
-
category: string
|
|
229
|
-
): boolean => {
|
|
230
|
-
switch (category) {
|
|
231
|
-
case BlockchainCategories.ALL:
|
|
232
|
-
return true;
|
|
233
|
-
case BlockchainCategories.UTXO:
|
|
234
|
-
return blockchainType === TransactionType.TRANSFER;
|
|
235
|
-
case BlockchainCategories.OTHER:
|
|
236
|
-
return (
|
|
237
|
-
blockchainType !== TransactionType.TRANSFER &&
|
|
238
|
-
blockchainType !== TransactionType.COSMOS &&
|
|
239
|
-
blockchainType !== TransactionType.EVM
|
|
240
|
-
);
|
|
241
|
-
default:
|
|
242
|
-
return blockchainType === category;
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
export const getFontUrlByName = (fontName: string) => {
|
|
247
|
-
const font = SUPPORTED_FONTS.find((font) => font.value === fontName);
|
|
248
|
-
return font?.url;
|
|
249
|
-
};
|
package/src/utils/configs.ts
CHANGED