connectSuccess method
A connect event.
features defaults to a plain SendTransaction wallet; pass an explicit
list to model one that advertises more, or less.
Implementation
Map<String, Object?> connectSuccess({
int id = 1,
String? address,
String appName = 'tonkeeper',
List<Map<String, Object?>>? features,
bool withProof = false,
}) => {
'event': 'connect',
'id': id,
'payload': {
'items': [
{
'name': 'ton_addr',
'address': address ?? '0:abc',
'network': '-239',
'publicKey': 'ff',
'walletStateInit': 'te6',
},
if (withProof)
{
'name': 'ton_proof',
'proof': {
'timestamp': '1770000000',
'domain': {'lengthBytes': 11, 'value': 'example.org'},
'signature': 'c2ln',
'payload': 'nonce-1',
},
},
],
'device': {
'platform': 'iphone',
'appName': appName,
'appVersion': '5.0.0',
'maxProtocolVersion': 2,
'features':
features ??
[
{'name': 'SendTransaction', 'maxMessages': 4},
],
},
},
};