mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: native-mobile-api
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { randomBytes } from 'crypto'
|
||||
import NodeCache from 'node-cache'
|
||||
import type { Logger } from 'pino'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { DEFAULT_CACHE_TTLS } from '../Defaults'
|
||||
import type { AuthenticationCreds, CacheStore, SignalDataSet, SignalDataTypeMap, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '../Types'
|
||||
import { Curve, signedKeyPair } from './crypto'
|
||||
@@ -202,6 +203,13 @@ export const initAuthCreds = (): AuthenticationCreds => {
|
||||
accountSyncCounter: 0,
|
||||
accountSettings: {
|
||||
unarchiveChats: false
|
||||
}
|
||||
},
|
||||
// mobile creds
|
||||
deviceId: Buffer.from(uuidv4().replace(/-/g, ''), 'hex').toString('base64url'),
|
||||
phoneId: uuidv4(),
|
||||
identityId: randomBytes(20),
|
||||
registered: false,
|
||||
backupToken: randomBytes(20),
|
||||
registration: {} as RegistrationOptions
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user