@@ -474,7 +474,7 @@ private static string ExternalHashToString(string platform, Hash hash, string sy
474
474
result = result . Substring ( 0 , 40 ) ;
475
475
break ;
476
476
477
- case "ethereum" :
477
+ default :
478
478
result = result . Substring ( 0 , 40 ) ;
479
479
break ;
480
480
}
@@ -2293,7 +2293,8 @@ public IAPIResult SettleSwap([APIParameter("Name of platform where swap transact
2293
2293
}
2294
2294
2295
2295
[ APIInfo ( typeof ( SwapResult [ ] ) , "Returns platform swaps for a specific address." , false , 0 , true ) ]
2296
- public IAPIResult GetSwapsForAddress ( [ APIParameter ( "Address or account name" , "helloman" ) ] string account , bool extended = false )
2296
+ public IAPIResult GetSwapsForAddress ( [ APIParameter ( "Address or account name" , "helloman" ) ] string account ,
2297
+ string platform , bool extended = false )
2297
2298
{
2298
2299
if ( TokenSwapper == null )
2299
2300
{
@@ -2302,23 +2303,23 @@ public IAPIResult GetSwapsForAddress([APIParameter("Address or account name", "h
2302
2303
2303
2304
Address address ;
2304
2305
2305
- if ( Address . IsValidAddress ( account ) )
2306
- {
2307
- address = Address . FromText ( account ) ;
2308
- }
2309
- else
2310
- if ( Pay . Chains . NeoWallet . IsValidAddress ( account ) )
2311
- {
2312
- address = Pay . Chains . NeoWallet . EncodeAddress ( account ) ;
2313
- }
2314
- else
2315
- if ( Pay . Chains . EthereumWallet . IsValidAddress ( account ) )
2316
- {
2317
- address = Pay . Chains . EthereumWallet . EncodeAddress ( account ) ;
2318
- }
2319
- else
2306
+ switch ( platform )
2320
2307
{
2321
- address = Nexus . LookUpName ( Nexus . RootStorage , account ) ;
2308
+ case DomainSettings . PlatformName :
2309
+ address = Address . FromText ( account ) ;
2310
+ break ;
2311
+ case Pay . Chains . NeoWallet . NeoPlatform :
2312
+ address = Pay . Chains . NeoWallet . EncodeAddress ( account ) ;
2313
+ break ;
2314
+ case Pay . Chains . EthereumWallet . EthereumPlatform :
2315
+ address = Pay . Chains . EthereumWallet . EncodeAddress ( account ) ;
2316
+ break ;
2317
+ case Pay . Chains . BSCWallet . BSCPlatform :
2318
+ address = Pay . Chains . BSCWallet . EncodeAddress ( account ) ;
2319
+ break ;
2320
+ default :
2321
+ address = Nexus . LookUpName ( Nexus . RootStorage , account ) ;
2322
+ break ;
2322
2323
}
2323
2324
2324
2325
if ( address . IsNull )
0 commit comments