@rango-dev/widget-embedded 0.64.4-next.4 → 0.64.4-next.6
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 +3 -3
- package/dist/index.js.map +3 -3
- package/dist/store/slices/config.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/store/slices/config.ts +23 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/store/slices/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAEV,kCAAkC,EACnC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/store/slices/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAEV,kCAAkC,EACnC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA4B7C,eAAO,MAAM,cAAc,EAAE,kCAO5B,CAAC;AAEF,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAUD,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,kCAAkC,CAAC;IAC3C,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,mBAAmB,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC,2BAA2B,EAAE,MAAM,MAAM,EAAE,CAAC;IAC5C,uBAAuB,EAAE,MAAM,OAAO,CAAC;IACvC,YAAY,EAAE,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI,CAAC;IACnE,kBAAkB,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EAC/C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KACnB,IAAI,CAAC;IAEV,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAC1C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KACpB,IAAI,CAAC;IACV,YAAY,EAAE,QAAQ,EAAE,CAAC;IACzB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,qBAAqB,EAAE,MAAM,QAAQ,EAAE,CAAC;CACzC;AAqCD,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,kCAAkC,EAClC,WAAW,GAAG,aAAa,GAAG,SAAS,EACvC,WAAW,CA4HZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.64.4-next.
|
|
3
|
+
"version": "0.64.4-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@lingui/react": "4.2.1",
|
|
30
30
|
"@rango-dev/internal-blockchains": "^0.2.2-next.2",
|
|
31
31
|
"@rango-dev/logging-core": "^0.15.1-next.0",
|
|
32
|
-
"@rango-dev/provider-all": "^0.66.4-next.
|
|
32
|
+
"@rango-dev/provider-all": "^0.66.4-next.6",
|
|
33
33
|
"@rango-dev/queue-manager-core": "^0.35.1-next.0",
|
|
34
34
|
"@rango-dev/queue-manager-rango-preset": "^0.65.2-next.3",
|
|
35
35
|
"@rango-dev/queue-manager-react": "^0.35.1-next.0",
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
|
|
15
15
|
import { cacheService } from '../../services/cacheService';
|
|
16
16
|
import {
|
|
17
|
-
configWalletsToWalletName,
|
|
18
17
|
matchAndGenerateProviders,
|
|
19
18
|
type ProvidersOptions,
|
|
20
19
|
} from '../../utils/providers';
|
|
@@ -41,14 +40,6 @@ export const DEFAULT_CONFIG: WidgetConfigWithoutLegacyProviders = {
|
|
|
41
40
|
excludeLiquiditySources: true,
|
|
42
41
|
customDestination: true,
|
|
43
42
|
variant: 'default',
|
|
44
|
-
trezorManifest: {
|
|
45
|
-
appUrl: 'https://widget.rango.exchange/',
|
|
46
|
-
email: 'hi+trezorwidget@rango.exchange',
|
|
47
|
-
},
|
|
48
|
-
tonConnect: {
|
|
49
|
-
manifestUrl:
|
|
50
|
-
'https://raw.githubusercontent.com/rango-exchange/assets/refs/heads/main/manifests/tonconnect/manifest.json',
|
|
51
|
-
},
|
|
52
43
|
};
|
|
53
44
|
|
|
54
45
|
interface IframeConfigs {
|
|
@@ -97,20 +88,33 @@ function generateProviders(
|
|
|
97
88
|
const allProviders = getAllProviders();
|
|
98
89
|
const allBuiltProviders = allProviders.map((build) => build());
|
|
99
90
|
|
|
100
|
-
|
|
91
|
+
return allBuiltProviders.filter((provider) =>
|
|
92
|
+
hasRequiredConfig(provider.id, config)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
101
95
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
const REQUIRED_CONFIG_BY_WALLET: Partial<
|
|
97
|
+
Record<string, keyof WidgetConfigWithoutLegacyProviders>
|
|
98
|
+
> = {
|
|
99
|
+
[WalletTypes.LEDGER_WALLET]: 'ledgerWallet',
|
|
100
|
+
[WalletTypes.TREZOR]: 'trezorManifest',
|
|
101
|
+
[WalletTypes.TON_CONNECT]: 'tonConnect',
|
|
102
|
+
[WalletTypes.WALLET_CONNECT_2]: 'walletConnectProjectId',
|
|
103
|
+
};
|
|
109
104
|
|
|
105
|
+
function hasRequiredConfig(
|
|
106
|
+
walletId: string,
|
|
107
|
+
config: WidgetConfigWithoutLegacyProviders
|
|
108
|
+
): boolean {
|
|
109
|
+
const requiredKey = REQUIRED_CONFIG_BY_WALLET[walletId];
|
|
110
|
+
if (!requiredKey || config[requiredKey]) {
|
|
110
111
|
return true;
|
|
111
|
-
}
|
|
112
|
+
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
console.warn(
|
|
115
|
+
`${walletId} is listed in config wallets but ${requiredKey} config is not provided!`
|
|
116
|
+
);
|
|
117
|
+
return false;
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
export const createConfigSlice: StateCreatorWithInitialData<
|