@@ -45,7 +45,6 @@ import { DataServiceApiFactory } from '../../dialect-cloud-api/data-service-api-
4545import type { DataServiceApi } from '../../dialect-cloud-api/data-service-api' ;
4646import { DataServiceWalletsApiClientV1 } from '../../dialect-cloud-api/data-service-wallets-api.v1' ;
4747import { AlertsV2DappMessages } from '../dapp/alerts-v2-dapp-messages' ;
48- import type { DataServiceDappsApi } from '../../dialect-cloud-api/data-service-dapps-api' ;
4948import { AppV2Api } from '../../dialect-cloud-api/v2/application-api' ;
5049
5150export class InternalDialectSdk < ChainSdk extends BlockchainSdk >
@@ -235,21 +234,32 @@ export class DialectSdkFactory<ChainSdk extends BlockchainSdk> {
235234 ) : DappMessages {
236235 const dappMessages : DappMessages [ ] = [ ] ;
237236
238- if ( config . dialectCloud . apiVersion === 1 ) {
239- const dataServiceDappMessages = new DataServiceDappMessages (
240- dataServiceApi . dapps ,
241- ) ;
242- dappMessages . push ( dataServiceDappMessages ) ;
243- }
244-
245- if ( config . dialectCloud . apiVersion === 2 ) {
246- const alertsV2DappMessages = new AlertsV2DappMessages ( dappId , appV2Api ) ;
247- dappMessages . push ( alertsV2DappMessages ) ;
237+ const dataServiceDappMessages = new DataServiceDappMessages (
238+ dataServiceApi . dapps ,
239+ ) ;
240+ const alertsV2DappMessages = new AlertsV2DappMessages ( dappId , appV2Api ) ;
241+
242+ switch ( config . dialectCloud . apiVersion ) {
243+ case 1 :
244+ dappMessages . push ( dataServiceDappMessages ) ;
245+ break ;
246+ case 2 :
247+ dappMessages . push ( alertsV2DappMessages ) ;
248+ break ;
249+ case '2_compat' :
250+ dappMessages . push ( dataServiceDappMessages ) ;
251+ dappMessages . push ( alertsV2DappMessages ) ;
252+ break ;
253+ default :
254+ throw new IllegalArgumentError (
255+ `Unknown Dialect Cloud API version: ${ config . dialectCloud . apiVersion } ` ,
256+ ) ;
248257 }
249258
250259 if ( blockchainSdk . dappMessages ) {
251260 dappMessages . push ( blockchainSdk . dappMessages ) ;
252261 }
262+
253263 return new DappMessagesFacade ( dappMessages ) ;
254264 }
255265
@@ -309,19 +319,20 @@ export class DialectSdkFactory<ChainSdk extends BlockchainSdk> {
309319 v2Url : 'https://alerts.dialectapi.to' ,
310320 tokenStore : this . createTokenStore ( ) ,
311321 tokenLifetimeMinutes : this . createTokenLifetime ( ) ,
312- walletCreation : 'implicit ' ,
322+ walletCreation : 'none ' ,
313323 } ;
324+
314325 const environment = this . config . environment ;
315326 if ( environment ) {
316327 baseConfig . environment = environment ;
317328 }
318329 if ( environment === 'production' ) {
319330 baseConfig . url = 'https://dialectapi.to' ;
320- baseConfig . v2Url = 'https://alerts.dialectapi .to' ;
331+ baseConfig . v2Url = 'https://alerts-api.dial .to' ;
321332 }
322333 if ( environment === 'development' ) {
323334 baseConfig . url = 'https://dev.dialectapi.to' ;
324- baseConfig . v2Url = 'https://alerts. dev.dialectapi .to' ;
335+ baseConfig . v2Url = 'https://alerts-api- dev.dial .to' ;
325336 }
326337 if ( environment === 'local-development' ) {
327338 baseConfig . url = 'http://localhost:8080' ;
@@ -333,11 +344,11 @@ export class DialectSdkFactory<ChainSdk extends BlockchainSdk> {
333344 }
334345 if ( dialectCloudEnvironment === 'production' ) {
335346 baseConfig . url = 'https://dialectapi.to' ;
336- baseConfig . v2Url = 'https://alerts.dialectapi .to' ;
347+ baseConfig . v2Url = 'https://alerts-api.dial .to' ;
337348 }
338349 if ( dialectCloudEnvironment === 'development' ) {
339350 baseConfig . url = 'https://dev.dialectapi.to' ;
340- baseConfig . v2Url = 'https://alerts. dev.dialectapi .to' ;
351+ baseConfig . v2Url = 'https://alerts-api- dev.dial .to' ;
341352 }
342353 if ( dialectCloudEnvironment === 'local-development' ) {
343354 baseConfig . url = 'http://localhost:8080' ;
0 commit comments