wowok
Version:
Wowok Blockchain TypeScript API
1 lines • 2.55 kB
JavaScript
import{ENTRYPOINT}from'../../client/network.js';export var MessageType;(function(a){a[a['PREKEY_MESSAGE']=0x3]='PREKEY_MESSAGE',a[a['NORMAL_MESSAGE']=0x1]='NORMAL_MESSAGE';}(MessageType||(MessageType={})));export var MessageDirection;(function(a){a['SENT']='sent',a['RECEIVED']='received';}(MessageDirection||(MessageDirection={})));export var MessageStatus;(function(a){a['PENDING']='pending',a['CONFIRMED']='confirmed',a['READ']='read',a['FAILED']='failed',a['REJECTED']='rejected',a['DECRYPTED']='decrypted',a['DECRYPT_FAILED']='decrypt_failed';}(MessageStatus||(MessageStatus={})));export const WTS_FILE_BYTES_LIMIT=0x5*0x400*0x400;export const WTS_MAX_MESSAGE_COUNT=0x1f4;export const NORMAL_MESSAGE_BYTES_LIMIT=0xa*0x400;export const DEFAULT_QUERY_LIMIT=0x32;export const MAX_QUERY_LIMIT=0x3e8;export const DEFAULT_DEVICE_ID=0x1;export const SERVER_URL='https://messenger.wowok.net';export const CHAIN_PROOF_TYPE=0x1;export const CURRENT_NETWORK=ENTRYPOINT['Testnet'];export const DEFAULT_MESSENGER_CONFIG={'prekey_count':0x28,'watch_interval_ms':0x3c*0x3e8,'serverUrl':SERVER_URL,'network':CURRENT_NETWORK,'prekeyCheckIntervalMs':0x18*0x3c*0x3c*0x3e8,'defaultQueryLimit':DEFAULT_QUERY_LIMIT,'message_poll_default_interval_ms':0x6*0x3c*0x3e8,'message_poll_fast_interval_ms':0x6*0x3e8,'prekey_poll_default_interval_ms':0x3c*0x3c*0x3e8,'prekey_poll_fast_interval_ms':0x1e*0x3e8,'account_poll_delay_ms':0xc8,'message_poll_consecutive_empty_limit':0x3,'prekey_poll_consecutive_ok_limit':0x3};export var MessengerErrorCode;(function(a){a['PREKEYS_FULL']='PREKEYS_FULL',a['ACCOUNT_NOT_FOUND']='ACCOUNT_NOT_FOUND',a['IDENTITY_NOT_FOUND']='IDENTITY_NOT_FOUND',a['IDENTITY_CONFLICT']='IDENTITY_CONFLICT',a['SESSION_NOT_ESTABLISHED']='SESSION_NOT_ESTABLISHED',a['ENCRYPTION_FAILED']='ENCRYPTION_FAILED',a['DECRYPTION_FAILED']='DECRYPTION_FAILED',a['SERVER_ERROR']='SERVER_ERROR',a['INVALID_PROOF']='INVALID_PROOF',a['NETWORK_ERROR']='NETWORK_ERROR',a['INVALID_INPUT']='INVALID_INPUT',a['FILE_NOT_FOUND']='FILE_NOT_FOUND',a['INVALID_MESSAGE_TYPE']='INVALID_MESSAGE_TYPE',a['MESSAGE_NOT_DECRYPTED']='MESSAGE_NOT_DECRYPTED',a['HASH_MISMATCH']='HASH_MISMATCH',a['ACCOUNT_MESSENGER_NOT_ENABLED']='ACCOUNT_MESSENGER_NOT_ENABLED',a['REGISTRATION_FAILED']='REGISTRATION_FAILED';}(MessengerErrorCode||(MessengerErrorCode={})));export class MessengerError extends Error{['code'];['cause'];constructor(a,b,c){super(b),this['code']=a,this['cause']=c,this['name']='MessengerError';}}export const WTS_SCHEMA_URL='https://github.com/wowok-ai/docs/blob/main/WTS.md';