getContractFields method
Future<(Map<String, dynamic> ?, FullContractState?)>
getContractFields({
- required Address address,
- required String contractAbi,
- FullContractState? cachedState,
override
Get contract fields of address
and return (Map<String, dynamic>, state)
or throw error.
This method automatically loads state by calling getFullContractState if
cachedState
is null.
Implementation
@override
Future<(Map<String, dynamic>?, FullContractState?)> getContractFields({
required Address address,
required String contractAbi,
FullContractState? cachedState,
}) async {
if (_disposed) throw TransportCallAfterDisposeError();
final state = cachedState ?? await getFullContractState(address);
if (state == null) {
return (null, null);
}
return (
await unpackContractFields(
contractAbi: contractAbi,
boc: state.boc,
allowPartial: true,
),
state,
);
}