Skip to content

Commit

Permalink
starknet: remove account contract get_nonce when provider.getNonce …
Browse files Browse the repository at this point in the history
…fail (#318)
  • Loading branch information
ptisserand authored and PaulRbl committed Sep 16, 2024
1 parent aa0b900 commit cab0622
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions packages/starknet/lib/src/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,9 @@ class Account {
contractAddress: accountAddress,
);
return (response.when(
error: (error) async {
// fallback to account contract call
final response = await provider.call(
request: FunctionCall(
contractAddress: accountAddress,
entryPointSelector: getSelectorByName("get_nonce"),
calldata: [],
),
blockId: blockId,
);
return (response.when(
error: (error) {
throw Exception(
"Error retrieving nonce (${error.code}): ${error.message}");
},
result: (result) => result[0],
));
error: (error) {
throw Exception(
"Error retrieving nonce (${error.code}): ${error.message}");
},
result: (result) => result,
));
Expand Down

0 comments on commit cab0622

Please sign in to comment.