Node Support for integration 3Box.js
kamescg opened this issue · 3 comments
kamescg commented
Describe the bug
Add support for 3box.js
- the current window
dependency breaks build.
(node:55098) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined
Example code
/* --------------- */
/* Initialize Identity Wallet
/* A new identity walley is initialied to issue claims.
/* --------------- */
const seed = process.env.PRIVATE_KEY
const wallet = new IdentityWallet({ seed })
const DID = 'did:ethr:'
/* --------------- */
/* Initialize Box Storage
/* Connect to the server DID storage and messaging.
/* --------------- */
let provider = await ethers.getDefaultProvider()
const BoxServer = await Box.openBox(wallet, provider)
BREAKs HERE
oed commented
With the new releases of 3box and identity-wallet you can do the following:
const wallet = new IdentityWallet({ seed })
const provider = wallet.get3idProvider()
const BoxServer = await Box.openBox(null, provider)
Let me know if this works for you!
oed commented
This should work fine now. Please create a new issue if you encounter other issues!