@@ -635,7 +635,10 @@ impl ToriiClient {
635
635
. collect :: < Result < Vec < _ > , _ > > ( )
636
636
. map_err ( |e| JsValue :: from ( format ! ( "failed to parse contract addresses: {e}" ) ) ) ?;
637
637
638
- let token_ids = token_ids. into_iter ( ) . map ( |t| U256 :: from_be_hex ( & t) ) . collect :: < Vec < _ > > ( ) ;
638
+ let token_ids = token_ids
639
+ . into_iter ( )
640
+ . map ( |t| U256 :: from_be_hex ( t. trim_start_matches ( "0x" ) ) )
641
+ . collect :: < Vec < _ > > ( ) ;
639
642
640
643
let tokens = self
641
644
. inner
@@ -673,7 +676,10 @@ impl ToriiClient {
673
676
} )
674
677
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
675
678
676
- let token_ids = token_ids. into_iter ( ) . map ( |t| U256 :: from_be_hex ( & t) ) . collect :: < Vec < _ > > ( ) ;
679
+ let token_ids = token_ids
680
+ . into_iter ( )
681
+ . map ( |t| U256 :: from_be_hex ( t. trim_start_matches ( "0x" ) ) )
682
+ . collect :: < Vec < _ > > ( ) ;
677
683
678
684
let subscription_id = Arc :: new ( AtomicU64 :: new ( 0 ) ) ;
679
685
let ( trigger, tripwire) = Tripwire :: new ( ) ;
@@ -746,7 +752,10 @@ impl ToriiClient {
746
752
. collect :: < Result < Vec < _ > , _ > > ( )
747
753
. map_err ( |e| JsValue :: from ( format ! ( "failed to parse contract addresses: {e}" ) ) ) ?;
748
754
749
- let token_ids = token_ids. into_iter ( ) . map ( |t| U256 :: from_be_hex ( & t) ) . collect :: < Vec < _ > > ( ) ;
755
+ let token_ids = token_ids
756
+ . into_iter ( )
757
+ . map ( |t| U256 :: from_be_hex ( t. trim_start_matches ( "0x" ) ) )
758
+ . collect :: < Vec < _ > > ( ) ;
750
759
751
760
let token_balances = self
752
761
. inner
@@ -1166,7 +1175,10 @@ impl ToriiClient {
1166
1175
} )
1167
1176
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
1168
1177
1169
- let token_ids = token_ids. into_iter ( ) . map ( |t| U256 :: from_be_hex ( & t) ) . collect :: < Vec < _ > > ( ) ;
1178
+ let token_ids = token_ids
1179
+ . into_iter ( )
1180
+ . map ( |t| U256 :: from_be_hex ( t. trim_start_matches ( "0x" ) ) )
1181
+ . collect :: < Vec < _ > > ( ) ;
1170
1182
1171
1183
let subscription_id = Arc :: new ( AtomicU64 :: new ( 0 ) ) ;
1172
1184
let ( trigger, tripwire) = Tripwire :: new ( ) ;
@@ -1251,7 +1263,10 @@ impl ToriiClient {
1251
1263
} )
1252
1264
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
1253
1265
1254
- let token_ids = token_ids. into_iter ( ) . map ( |t| U256 :: from_be_hex ( & t) ) . collect :: < Vec < _ > > ( ) ;
1266
+ let token_ids = token_ids
1267
+ . into_iter ( )
1268
+ . map ( |t| U256 :: from_be_hex ( t. trim_start_matches ( "0x" ) ) )
1269
+ . collect :: < Vec < _ > > ( ) ;
1255
1270
1256
1271
self . inner
1257
1272
. update_token_balance_subscription (
0 commit comments