Handle browser/node envs
Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { Transaction } from '@xo/primitives';
|
||||
import { BlockchainLocal, WalletP2PKH } from '@xo/wallet';
|
||||
import {
|
||||
BlockchainLocal,
|
||||
StorageMemory,
|
||||
WalletP2PKH,
|
||||
StorageSQLite,
|
||||
} from '@xo/wallet';
|
||||
|
||||
const blockchainLocal = new BlockchainLocal();
|
||||
await blockchainLocal.start();
|
||||
@@ -52,3 +57,19 @@ console.log(
|
||||
);
|
||||
|
||||
console.log(blockchainLocal.deriveUtxoSet());
|
||||
|
||||
const storageMemory = new StorageMemory();
|
||||
await storageMemory.start();
|
||||
|
||||
await storageMemory.set('test', {
|
||||
isItWorking: true,
|
||||
});
|
||||
|
||||
console.log(storageMemory.storage);
|
||||
|
||||
const storageIDB = new StorageSQLite();
|
||||
await storageIDB.start();
|
||||
|
||||
await storageIDB.set('test', {
|
||||
thisShouldNotWork: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user