The WalletService is the heart of our sdk. Almost everything should be done through instances of this class.
To not have too much information together we have split this service in different parts. Here we will only view the constructor and the synchronization.
// The connectionService and a mnemonic are mandatory// walletState is useful if you will close the instance and want to sync from a given state// onSync method is called when sync finished. Useful to persist current state// onSyncStart is called when a synchronization start// It throws an error when mnemonic is invalidconstructor( connectionService: ConnectionService, mnemo: string, walletState?: WalletState, onSync?: (walletState:WalletState) =>Promise<void>, onSyncStart?: () =>void,);// Gets current wallet stategetWalletState(): WalletState;// Synchronizes and returns new wallet state// Calls onSyncStart at start and and onSync when finishesasync synchronize(): Promise<WalletState>;