@@ -27,22 +27,22 @@ public class RpcNep17Transfers
2727
2828 public JObject ToJson ( ProtocolSettings protocolSettings )
2929 {
30- JObject json = new ( ) ;
31- json [ "sent" ] = Sent . Select ( p => p . ToJson ( protocolSettings ) ) . ToArray ( ) ;
32- json [ "received" ] = Received . Select ( p => p . ToJson ( protocolSettings ) ) . ToArray ( ) ;
33- json [ "address" ] = UserScriptHash . ToAddress ( protocolSettings . AddressVersion ) ;
34- return json ;
30+ return new ( )
31+ {
32+ [ "sent" ] = Sent . Select ( p => p . ToJson ( protocolSettings ) ) . ToArray ( ) ,
33+ [ "received" ] = Received . Select ( p => p . ToJson ( protocolSettings ) ) . ToArray ( ) ,
34+ [ "address" ] = UserScriptHash . ToAddress ( protocolSettings . AddressVersion )
35+ } ;
3536 }
3637
3738 public static RpcNep17Transfers FromJson ( JObject json , ProtocolSettings protocolSettings )
3839 {
39- RpcNep17Transfers transfers = new ( )
40+ return new ( )
4041 {
4142 Sent = ( ( JArray ) json [ "sent" ] ) . Select ( p => RpcNep17Transfer . FromJson ( ( JObject ) p , protocolSettings ) ) . ToList ( ) ,
4243 Received = ( ( JArray ) json [ "received" ] ) . Select ( p => RpcNep17Transfer . FromJson ( ( JObject ) p , protocolSettings ) ) . ToList ( ) ,
4344 UserScriptHash = json [ "address" ] . ToScriptHash ( protocolSettings )
4445 } ;
45- return transfers ;
4646 }
4747 }
4848
@@ -64,15 +64,16 @@ public class RpcNep17Transfer
6464
6565 public JObject ToJson ( ProtocolSettings protocolSettings )
6666 {
67- JObject json = new ( ) ;
68- json [ "timestamp" ] = TimestampMS ;
69- json [ "assethash" ] = AssetHash . ToString ( ) ;
70- json [ "transferaddress" ] = UserScriptHash ? . ToAddress ( protocolSettings . AddressVersion ) ;
71- json [ "amount" ] = Amount . ToString ( ) ;
72- json [ "blockindex" ] = BlockIndex ;
73- json [ "transfernotifyindex" ] = TransferNotifyIndex ;
74- json [ "txhash" ] = TxHash . ToString ( ) ;
75- return json ;
67+ return new ( )
68+ {
69+ [ "timestamp" ] = TimestampMS ,
70+ [ "assethash" ] = AssetHash . ToString ( ) ,
71+ [ "transferaddress" ] = UserScriptHash ? . ToAddress ( protocolSettings . AddressVersion ) ,
72+ [ "amount" ] = Amount . ToString ( ) ,
73+ [ "blockindex" ] = BlockIndex ,
74+ [ "transfernotifyindex" ] = TransferNotifyIndex ,
75+ [ "txhash" ] = TxHash . ToString ( )
76+ } ;
7677 }
7778
7879 public static RpcNep17Transfer FromJson ( JObject json , ProtocolSettings protocolSettings )
0 commit comments