@rango-dev/widget-embedded 0.51.1-next.0 → 0.51.1-next.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.51.1-next.0",
3
+ "version": "0.51.1-next.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,14 +25,14 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.11.0",
28
- "@rango-dev/provider-all": "^0.53.0",
28
+ "@rango-dev/provider-all": "^0.53.1-next.0",
29
29
  "@rango-dev/queue-manager-core": "^0.32.0",
30
30
  "@rango-dev/queue-manager-rango-preset": "^0.53.0",
31
31
  "@rango-dev/queue-manager-react": "^0.32.0",
32
32
  "@rango-dev/signer-solana": "^0.44.0",
33
- "@rango-dev/ui": "^0.54.0",
33
+ "@rango-dev/ui": "^0.54.1-next.0",
34
34
  "@rango-dev/wallets-core": "^0.50.0",
35
- "@rango-dev/wallets-react": "^0.37.0",
35
+ "@rango-dev/wallets-react": "^0.37.1-next.0",
36
36
  "@rango-dev/wallets-shared": "^0.51.0",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -5,7 +5,7 @@ import type {
5
5
  WidgetContextInterface,
6
6
  } from './Wallets.types';
7
7
  import type { ProvidersOptions } from '../../utils/providers';
8
- import type { LegacyEventHandler } from '@rango-dev/wallets-core/dist/legacy/mod';
8
+ import type { LegacyEventHandler } from '@rango-dev/wallets-core/legacy';
9
9
  import type { PropsWithChildren } from 'react';
10
10
 
11
11
  import { Provider } from '@rango-dev/wallets-react';
@@ -1,13 +1,18 @@
1
1
  import type { ProviderInterface } from '@rango-dev/wallets-react';
2
2
 
3
+ import { Provider } from '@rango-dev/wallets-core';
4
+
3
5
  export function hashProviders(
4
- providers: (string | ProviderInterface)[]
6
+ providers: (string | ProviderInterface | Provider)[]
5
7
  ): string {
6
8
  return providers
7
9
  .map((provider) => {
8
10
  if (typeof provider === 'string') {
9
11
  return provider;
10
12
  }
13
+ if (provider instanceof Provider) {
14
+ return provider.id;
15
+ }
11
16
  return provider.config.type;
12
17
  })
13
18
  .join('-');
package/src/index.ts CHANGED
@@ -87,6 +87,7 @@ import {
87
87
  WalletEventTypes,
88
88
  WidgetEvents,
89
89
  } from './types';
90
+ import { pickProviderVersionWithFallbackToLegacy } from './utils/providers';
90
91
  import { customizedThemeTokens } from './utils/ui';
91
92
 
92
93
  export const StatefulConnect = {
@@ -182,6 +183,7 @@ export type {
182
183
  // Internal function and enum exports for Rango
183
184
  export {
184
185
  readAccountAddress,
186
+ pickProviderVersionWithFallbackToLegacy,
185
187
  Networks,
186
188
  WalletEvents,
187
189
  WalletTypes,
@@ -1,5 +1,6 @@
1
1
  import type { Language, theme } from '@rango-dev/ui';
2
- import type { LegacyProviderInterface } from '@rango-dev/wallets-core/dist/legacy/mod';
2
+ import type { Provider } from '@rango-dev/wallets-core';
3
+ import type { LegacyProviderInterface } from '@rango-dev/wallets-core/legacy';
3
4
  import type { WalletType } from '@rango-dev/wallets-shared';
4
5
  import type { Asset } from 'rango-sdk';
5
6
  import type { ReactElement } from 'react';
@@ -272,7 +273,7 @@ export type WidgetConfig = {
272
273
  from?: BlockchainAndTokenConfig;
273
274
  to?: BlockchainAndTokenConfig;
274
275
  liquiditySources?: string[];
275
- wallets?: (WalletType | LegacyProviderInterface)[];
276
+ wallets?: (WalletType | LegacyProviderInterface | Provider)[];
276
277
  multiWallets?: boolean;
277
278
  customDestination?: boolean;
278
279
  defaultCustomDestinations?: { [blockchain: string]: string };
@@ -95,7 +95,7 @@ export function matchAndGenerateProviders({
95
95
  return allProviders;
96
96
  }
97
97
 
98
- function pickProviderVersionWithFallbackToLegacy(
98
+ export function pickProviderVersionWithFallbackToLegacy(
99
99
  provider: VersionedProviders
100
100
  ): BothProvidersInterface {
101
101
  try {