getCode method

Future<Uint8List> getCode(
  1. XCBAddress address, {
  2. BlockNum? atBlock,
})

Gets the code of a contract at the specified address

This function allows specifying a custom block mined in the past to get historical data. By default, BlockNum.current will be used.

Implementation

Future<Uint8List> getCode(XCBAddress address, {BlockNum? atBlock}) {
  return _makeRPCCall<String>('xcb_getCode', [
    address.hexNo0x,
    _getBlockParam(atBlock),
  ]).then(hexToBytes);
}