@zervonexx/baileys 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +4112 -4112
  3. package/WAProto/WAProtoCompile.js +322 -322
  4. package/WAProto/fetcher.js +67 -67
  5. package/WAProto/index.js +95 -95
  6. package/WAProto/parser.js +333 -333
  7. package/lib/Builders/AIRich.js +673 -673
  8. package/lib/Builders/auto.js +49 -49
  9. package/lib/Builders/base.js +144 -144
  10. package/lib/Builders/builders.js +588 -588
  11. package/lib/Builders/index.js +3 -3
  12. package/lib/Defaults/index.js +248 -248
  13. package/lib/Signal/index.js +2 -2
  14. package/lib/Signal/libsignal.js +526 -526
  15. package/lib/Signal/lid-mapping.js +282 -282
  16. package/lib/Socket/Client/index.js +1 -1
  17. package/lib/Socket/Client/types.js +9 -9
  18. package/lib/Socket/Client/websocket.js +83 -83
  19. package/lib/Socket/business.js +151 -151
  20. package/lib/Socket/chats.js +854 -854
  21. package/lib/Socket/communities.js +146 -146
  22. package/lib/Socket/groups.js +293 -293
  23. package/lib/Socket/index.js +14 -14
  24. package/lib/Socket/messages-recv.js +993 -993
  25. package/lib/Socket/messages-send.js +722 -722
  26. package/lib/Socket/mex.js +33 -33
  27. package/lib/Socket/newsletter.js +783 -783
  28. package/lib/Socket/registration.js +154 -154
  29. package/lib/Socket/socket.js +797 -797
  30. package/lib/Socket/spam-report.js +143 -143
  31. package/lib/Socket/username.js +81 -81
  32. package/lib/Socket/zervonex-handler.js +57 -57
  33. package/lib/Store/index.js +6 -6
  34. package/lib/Store/make-cache-manager-store.js +80 -80
  35. package/lib/Store/make-in-memory-store.js +426 -426
  36. package/lib/Store/make-ordered-dictionary.js +81 -81
  37. package/lib/Store/object-repository.js +30 -30
  38. package/lib/Store/reporting-info-store.js +37 -37
  39. package/lib/Types/Auth.js +1 -1
  40. package/lib/Types/Bussines.js +1 -1
  41. package/lib/Types/Call.js +1 -1
  42. package/lib/Types/Chat.js +7 -7
  43. package/lib/Types/Contact.js +1 -1
  44. package/lib/Types/Events.js +1 -1
  45. package/lib/Types/GroupMetadata.js +1 -1
  46. package/lib/Types/Label.js +24 -24
  47. package/lib/Types/LabelAssociation.js +6 -6
  48. package/lib/Types/Message.js +14 -14
  49. package/lib/Types/Newsletter.js +99 -99
  50. package/lib/Types/Product.js +1 -1
  51. package/lib/Types/Signal.js +1 -1
  52. package/lib/Types/Socket.js +14 -14
  53. package/lib/Types/State.js +26 -26
  54. package/lib/Types/USync.js +1 -1
  55. package/lib/Types/index.js +30 -30
  56. package/lib/Utils/auth-utils.js +159 -159
  57. package/lib/Utils/baileys-event-stream.js +32 -32
  58. package/lib/Utils/bot-capabilities.js +40 -40
  59. package/lib/Utils/bot-planning-replay.js +43 -43
  60. package/lib/Utils/browser-utils.js +29 -29
  61. package/lib/Utils/business.js +74 -74
  62. package/lib/Utils/chat-utils.js +316 -316
  63. package/lib/Utils/companion-reg-client-utils.js +19 -19
  64. package/lib/Utils/consumer-application.js +37 -37
  65. package/lib/Utils/crypto.js +52 -52
  66. package/lib/Utils/cstoken.js +14 -14
  67. package/lib/Utils/decode-wa-message.js +199 -199
  68. package/lib/Utils/event-buffer.js +272 -272
  69. package/lib/Utils/extras.js +186 -186
  70. package/lib/Utils/generics.js +194 -194
  71. package/lib/Utils/history.js +50 -50
  72. package/lib/Utils/identity-change-handler.js +18 -18
  73. package/lib/Utils/index.js +40 -40
  74. package/lib/Utils/link-preview.js +50 -50
  75. package/lib/Utils/logger.js +2 -2
  76. package/lib/Utils/lt-hash.js +3 -3
  77. package/lib/Utils/make-mutex.js +15 -15
  78. package/lib/Utils/message-composer.js +61 -61
  79. package/lib/Utils/message-retry-manager.js +47 -47
  80. package/lib/Utils/messages-media.js +501 -501
  81. package/lib/Utils/messages.js +942 -942
  82. package/lib/Utils/meta-ai-msmsg.js +121 -121
  83. package/lib/Utils/meta-compositing.js +74 -74
  84. package/lib/Utils/modern-messages.js +234 -234
  85. package/lib/Utils/native-flow.js +80 -80
  86. package/lib/Utils/noise-handler.js +160 -160
  87. package/lib/Utils/pre-key-manager.js +75 -75
  88. package/lib/Utils/process-message.js +400 -400
  89. package/lib/Utils/reporting-utils.js +170 -170
  90. package/lib/Utils/signal.js +166 -166
  91. package/lib/Utils/spam-report-utils.js +165 -165
  92. package/lib/Utils/sync-action-utils.js +33 -33
  93. package/lib/Utils/tc-token-utils.js +153 -153
  94. package/lib/Utils/use-keyv-auth-state.js +199 -199
  95. package/lib/Utils/use-multi-file-auth-state.js +83 -83
  96. package/lib/Utils/validate-connection.js +171 -171
  97. package/lib/WABinary/constants.js +1320 -1320
  98. package/lib/WABinary/decode.js +151 -151
  99. package/lib/WABinary/encode.js +139 -139
  100. package/lib/WABinary/generic-utils.js +202 -202
  101. package/lib/WABinary/index.js +6 -6
  102. package/lib/WABinary/jid-utils.js +235 -235
  103. package/lib/WABinary/types.js +4 -4
  104. package/lib/WAM/BinaryInfo.js +9 -9
  105. package/lib/WAM/constants.js +22852 -22852
  106. package/lib/WAM/encode.js +149 -149
  107. package/lib/WAM/index.js +3 -3
  108. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +30 -30
  109. package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +48 -48
  110. package/lib/WAUSync/Protocols/USyncContactProtocol.js +23 -23
  111. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +28 -28
  112. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +15 -15
  113. package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +24 -24
  114. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +9 -9
  115. package/lib/WAUSync/Protocols/USyncPictureProtocol.js +21 -21
  116. package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +19 -19
  117. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +19 -19
  118. package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +22 -22
  119. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +16 -16
  120. package/lib/WAUSync/Protocols/index.js +12 -12
  121. package/lib/WAUSync/USyncQuery.js +88 -88
  122. package/lib/WAUSync/USyncUser.js +20 -20
  123. package/lib/WAUSync/index.js +3 -3
  124. package/lib/index.js +66 -66
  125. package/package.json +191 -192
@@ -1,172 +1,172 @@
1
- import { Boom } from '@hapi/boom'
2
- import { createHash } from 'crypto'
3
- import { proto } from '../../WAProto/index.js'
4
- import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults/index.js'
5
- import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary/index.js'
6
- import { Curve, hmacSign } from './crypto.js'
7
- import { encodeBigEndian } from './generics.js'
8
- import { createSignalIdentity } from './signal.js'
9
- import { getPlatformType } from './browser-utils.js'
10
-
11
- const PLATFORM_MAP = {
12
- 'Mac OS': proto.ClientPayload.WebInfo.WebSubPlatform.DARWIN,
13
- 'Windows': proto.ClientPayload.WebInfo.WebSubPlatform.WIN_HYBRID,
14
- 'WindowsStore': proto.ClientPayload.WebInfo.WebSubPlatform.WIN_STORE,
15
- }
16
-
17
- const getUserAgent = (config) => ({
18
- appVersion: {
19
- primary: config.version[0],
20
- secondary: config.version[1],
21
- tertiary: config.version[2],
22
- },
23
- platform: proto.ClientPayload.UserAgent.Platform.WEB,
24
- releaseChannel: proto.ClientPayload.UserAgent.ReleaseChannel.RELEASE,
25
- osVersion: '0.1',
26
- device: 'Desktop',
27
- deviceType: proto.ClientPayload.UserAgent.DeviceType.DESKTOP,
28
- osBuildNumber: '0.1',
29
- localeLanguageIso6391: 'en',
30
- mnc: '000',
31
- mcc: '000',
32
- localeCountryIso31661Alpha2: config.countryCode,
33
- })
34
-
35
- const getWebInfo = (config) => {
36
- let webSubPlatform = proto.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER
37
- if (config.syncFullHistory && PLATFORM_MAP[config.browser[0]] && config.browser[1] === 'Desktop')
38
- webSubPlatform = PLATFORM_MAP[config.browser[0]]
39
- return { webSubPlatform }
40
- }
41
-
42
- const getClientPayload = (config) => {
43
- const payload = {
44
- connectType: proto.ClientPayload.ConnectType.WIFI_UNKNOWN,
45
- connectReason: proto.ClientPayload.ConnectReason.USER_ACTIVATED,
46
- userAgent: getUserAgent(config),
47
- }
48
- if (!config.browser[1].toLowerCase().includes('android')) payload.webInfo = getWebInfo(config)
49
- return payload
50
- }
51
-
52
- const buildHistorySyncConfig = () => {
53
- const fields = proto.DeviceProps.HistorySyncConfig.fields
54
- const config = {}
55
- for (const [name, field] of Object.entries(fields)) {
56
- if (field.type === 'bool') config[name] = true
57
- }
58
- config.storageQuotaMb = 569150
59
- config.supportCallLogHistory = false
60
- config.supportGroupHistory = true
61
- return config
62
- }
63
-
64
- export const generateLoginNode = (userJid, config) => {
65
- const { user, device } = jidDecode(userJid)
66
- return proto.ClientPayload.fromObject({
67
- ...getClientPayload(config),
68
- passive: true,
69
- pull: true,
70
- username: +user,
71
- device,
72
- lidDbMigrated: false, // hard-set; behaviour under true is unknown
73
- })
74
- }
75
-
76
- export const generateRegistrationNode = ({ registrationId, signedPreKey, signedIdentityKey }, config) => {
77
- const appVersionBuf = createHash('md5').update(config.version.join('.')).digest()
78
- const companionProto = proto.DeviceProps.encode({
79
- os: config.browser[0],
80
- platformType: getPlatformType(config.browser[1]),
81
- requireFullSync: config.syncFullHistory,
82
- historySyncConfig: buildHistorySyncConfig(),
83
- version: { primary: config.version[0], secondary: config.version[1], tertiary: config.version[2] },
84
- }).finish()
85
-
86
- return proto.ClientPayload.fromObject({
87
- ...getClientPayload(config),
88
- passive: false,
89
- pull: false,
90
- devicePairingData: {
91
- eRegid: encodeBigEndian(registrationId),
92
- eKeytype: KEY_BUNDLE_TYPE,
93
- eIdent: signedIdentityKey.public,
94
- eSkeyId: encodeBigEndian(signedPreKey.keyId, 3),
95
- eSkeyVal: signedPreKey.keyPair.public,
96
- eSkeySig: signedPreKey.signature,
97
- buildHash: appVersionBuf,
98
- deviceProps: companionProto,
99
- },
100
- })
101
- }
102
-
103
- export const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, signalIdentities }) => {
104
- const msgId = stanza.attrs.id
105
- const pairSuccessNode = getBinaryNodeChild(stanza, 'pair-success')
106
- const deviceIdentityNode = getBinaryNodeChild(pairSuccessNode, 'device-identity')
107
- const platformNode = getBinaryNodeChild(pairSuccessNode, 'platform')
108
- const deviceNode = getBinaryNodeChild(pairSuccessNode, 'device')
109
- const businessNode = getBinaryNodeChild(pairSuccessNode, 'biz')
110
-
111
- if (!deviceIdentityNode || !deviceNode)
112
- throw new Boom('Missing device-identity or device in pair success node', { data: stanza })
113
-
114
- const jid = deviceNode.attrs.jid
115
- const lid = deviceNode.attrs.lid
116
- const bizName = businessNode?.attrs.name
117
-
118
- const { details, hmac, accountType } = proto.ADVSignedDeviceIdentityHMAC.decode(deviceIdentityNode.content)
119
- const hmacPrefix = (accountType !== undefined && accountType === proto.ADVEncryptionType.HOSTED)
120
- ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
121
- : Buffer.from([])
122
-
123
- if (Buffer.compare(hmac, hmacSign(Buffer.concat([hmacPrefix, details]), Buffer.from(advSecretKey, 'base64'))) !== 0)
124
- throw new Boom('Invalid account signature')
125
-
126
- const account = proto.ADVSignedDeviceIdentity.decode(details)
127
- const { accountSignatureKey, accountSignature, details: deviceDetails } = account
128
- const deviceIdentity = proto.ADVDeviceIdentity.decode(deviceDetails)
129
-
130
- const accountSignaturePrefix = deviceIdentity.deviceType === proto.ADVEncryptionType.HOSTED
131
- ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
132
- : WA_ADV_ACCOUNT_SIG_PREFIX
133
-
134
- if (!Curve.verify(accountSignatureKey, Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public]), accountSignature))
135
- throw new Boom('Failed to verify account signature')
136
-
137
- account.deviceSignature = Curve.sign(
138
- signedIdentityKey.private,
139
- Buffer.concat([WA_ADV_DEVICE_SIG_PREFIX, deviceDetails, signedIdentityKey.public, accountSignatureKey])
140
- )
141
-
142
- const identity = createSignalIdentity(lid, accountSignatureKey)
143
- const accountEnc = encodeSignedDeviceIdentity(account, false)
144
-
145
- return {
146
- creds: {
147
- account,
148
- me: { id: jid, name: bizName, lid },
149
- signalIdentities: [...(signalIdentities ?? []), identity],
150
- platform: platformNode?.attrs.name,
151
- },
152
- reply: {
153
- tag: 'iq',
154
- attrs: { to: S_WHATSAPP_NET, type: 'result', id: msgId },
155
- content: [{
156
- tag: 'pair-device-sign',
157
- attrs: {},
158
- content: [{
159
- tag: 'device-identity',
160
- attrs: { 'key-index': deviceIdentity.keyIndex.toString() },
161
- content: accountEnc,
162
- }],
163
- }],
164
- },
165
- }
166
- }
167
-
168
- export const encodeSignedDeviceIdentity = (account, includeSignatureKey) => {
169
- account = { ...account }
170
- if (!includeSignatureKey || !account.accountSignatureKey?.length) account.accountSignatureKey = null
171
- return proto.ADVSignedDeviceIdentity.encode(account).finish()
1
+ import { Boom } from '@hapi/boom'
2
+ import { createHash } from 'crypto'
3
+ import { proto } from '../../WAProto/index.js'
4
+ import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults/index.js'
5
+ import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary/index.js'
6
+ import { Curve, hmacSign } from './crypto.js'
7
+ import { encodeBigEndian } from './generics.js'
8
+ import { createSignalIdentity } from './signal.js'
9
+ import { getPlatformType } from './browser-utils.js'
10
+
11
+ const PLATFORM_MAP = {
12
+ 'Mac OS': proto.ClientPayload.WebInfo.WebSubPlatform.DARWIN,
13
+ 'Windows': proto.ClientPayload.WebInfo.WebSubPlatform.WIN_HYBRID,
14
+ 'WindowsStore': proto.ClientPayload.WebInfo.WebSubPlatform.WIN_STORE,
15
+ }
16
+
17
+ const getUserAgent = (config) => ({
18
+ appVersion: {
19
+ primary: config.version[0],
20
+ secondary: config.version[1],
21
+ tertiary: config.version[2],
22
+ },
23
+ platform: proto.ClientPayload.UserAgent.Platform.WEB,
24
+ releaseChannel: proto.ClientPayload.UserAgent.ReleaseChannel.RELEASE,
25
+ osVersion: '0.1',
26
+ device: 'Desktop',
27
+ deviceType: proto.ClientPayload.UserAgent.DeviceType.DESKTOP,
28
+ osBuildNumber: '0.1',
29
+ localeLanguageIso6391: 'en',
30
+ mnc: '000',
31
+ mcc: '000',
32
+ localeCountryIso31661Alpha2: config.countryCode,
33
+ })
34
+
35
+ const getWebInfo = (config) => {
36
+ let webSubPlatform = proto.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER
37
+ if (config.syncFullHistory && PLATFORM_MAP[config.browser[0]] && config.browser[1] === 'Desktop')
38
+ webSubPlatform = PLATFORM_MAP[config.browser[0]]
39
+ return { webSubPlatform }
40
+ }
41
+
42
+ const getClientPayload = (config) => {
43
+ const payload = {
44
+ connectType: proto.ClientPayload.ConnectType.WIFI_UNKNOWN,
45
+ connectReason: proto.ClientPayload.ConnectReason.USER_ACTIVATED,
46
+ userAgent: getUserAgent(config),
47
+ }
48
+ if (!config.browser[1].toLowerCase().includes('android')) payload.webInfo = getWebInfo(config)
49
+ return payload
50
+ }
51
+
52
+ const buildHistorySyncConfig = () => {
53
+ const fields = proto.DeviceProps.HistorySyncConfig.fields
54
+ const config = {}
55
+ for (const [name, field] of Object.entries(fields)) {
56
+ if (field.type === 'bool') config[name] = true
57
+ }
58
+ config.storageQuotaMb = 569150
59
+ config.supportCallLogHistory = false
60
+ config.supportGroupHistory = true
61
+ return config
62
+ }
63
+
64
+ export const generateLoginNode = (userJid, config) => {
65
+ const { user, device } = jidDecode(userJid)
66
+ return proto.ClientPayload.fromObject({
67
+ ...getClientPayload(config),
68
+ passive: true,
69
+ pull: true,
70
+ username: +user,
71
+ device,
72
+ lidDbMigrated: false, // hard-set; behaviour under true is unknown
73
+ })
74
+ }
75
+
76
+ export const generateRegistrationNode = ({ registrationId, signedPreKey, signedIdentityKey }, config) => {
77
+ const appVersionBuf = createHash('md5').update(config.version.join('.')).digest()
78
+ const companionProto = proto.DeviceProps.encode({
79
+ os: config.browser[0],
80
+ platformType: getPlatformType(config.browser[1]),
81
+ requireFullSync: config.syncFullHistory,
82
+ historySyncConfig: buildHistorySyncConfig(),
83
+ version: { primary: config.version[0], secondary: config.version[1], tertiary: config.version[2] },
84
+ }).finish()
85
+
86
+ return proto.ClientPayload.fromObject({
87
+ ...getClientPayload(config),
88
+ passive: false,
89
+ pull: false,
90
+ devicePairingData: {
91
+ eRegid: encodeBigEndian(registrationId),
92
+ eKeytype: KEY_BUNDLE_TYPE,
93
+ eIdent: signedIdentityKey.public,
94
+ eSkeyId: encodeBigEndian(signedPreKey.keyId, 3),
95
+ eSkeyVal: signedPreKey.keyPair.public,
96
+ eSkeySig: signedPreKey.signature,
97
+ buildHash: appVersionBuf,
98
+ deviceProps: companionProto,
99
+ },
100
+ })
101
+ }
102
+
103
+ export const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, signalIdentities }) => {
104
+ const msgId = stanza.attrs.id
105
+ const pairSuccessNode = getBinaryNodeChild(stanza, 'pair-success')
106
+ const deviceIdentityNode = getBinaryNodeChild(pairSuccessNode, 'device-identity')
107
+ const platformNode = getBinaryNodeChild(pairSuccessNode, 'platform')
108
+ const deviceNode = getBinaryNodeChild(pairSuccessNode, 'device')
109
+ const businessNode = getBinaryNodeChild(pairSuccessNode, 'biz')
110
+
111
+ if (!deviceIdentityNode || !deviceNode)
112
+ throw new Boom('Missing device-identity or device in pair success node', { data: stanza })
113
+
114
+ const jid = deviceNode.attrs.jid
115
+ const lid = deviceNode.attrs.lid
116
+ const bizName = businessNode?.attrs.name
117
+
118
+ const { details, hmac, accountType } = proto.ADVSignedDeviceIdentityHMAC.decode(deviceIdentityNode.content)
119
+ const hmacPrefix = (accountType !== undefined && accountType === proto.ADVEncryptionType.HOSTED)
120
+ ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
121
+ : Buffer.from([])
122
+
123
+ if (Buffer.compare(hmac, hmacSign(Buffer.concat([hmacPrefix, details]), Buffer.from(advSecretKey, 'base64'))) !== 0)
124
+ throw new Boom('Invalid account signature')
125
+
126
+ const account = proto.ADVSignedDeviceIdentity.decode(details)
127
+ const { accountSignatureKey, accountSignature, details: deviceDetails } = account
128
+ const deviceIdentity = proto.ADVDeviceIdentity.decode(deviceDetails)
129
+
130
+ const accountSignaturePrefix = deviceIdentity.deviceType === proto.ADVEncryptionType.HOSTED
131
+ ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
132
+ : WA_ADV_ACCOUNT_SIG_PREFIX
133
+
134
+ if (!Curve.verify(accountSignatureKey, Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public]), accountSignature))
135
+ throw new Boom('Failed to verify account signature')
136
+
137
+ account.deviceSignature = Curve.sign(
138
+ signedIdentityKey.private,
139
+ Buffer.concat([WA_ADV_DEVICE_SIG_PREFIX, deviceDetails, signedIdentityKey.public, accountSignatureKey])
140
+ )
141
+
142
+ const identity = createSignalIdentity(lid, accountSignatureKey)
143
+ const accountEnc = encodeSignedDeviceIdentity(account, false)
144
+
145
+ return {
146
+ creds: {
147
+ account,
148
+ me: { id: jid, name: bizName, lid },
149
+ signalIdentities: [...(signalIdentities ?? []), identity],
150
+ platform: platformNode?.attrs.name,
151
+ },
152
+ reply: {
153
+ tag: 'iq',
154
+ attrs: { to: S_WHATSAPP_NET, type: 'result', id: msgId },
155
+ content: [{
156
+ tag: 'pair-device-sign',
157
+ attrs: {},
158
+ content: [{
159
+ tag: 'device-identity',
160
+ attrs: { 'key-index': deviceIdentity.keyIndex.toString() },
161
+ content: accountEnc,
162
+ }],
163
+ }],
164
+ },
165
+ }
166
+ }
167
+
168
+ export const encodeSignedDeviceIdentity = (account, includeSignatureKey) => {
169
+ account = { ...account }
170
+ if (!includeSignatureKey || !account.accountSignatureKey?.length) account.accountSignatureKey = null
171
+ return proto.ADVSignedDeviceIdentity.encode(account).finish()
172
172
  }