entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
7 stars 0 forks source link

Trouble requiring #313

Open mixmix opened 2 months ago

mixmix commented 2 months ago

Doesn't work

const Entropy = require('@entropyxyz/sdk')

Have to use:

const Entropy = require('@entropyxyz/sdk').default

Test code:

const Entropy = require('@entropyxyz/sdk').default
const { getWallet } = require('@entropyxyz/sdk/dist/keys/index.js')

async function start () {
  // get a Signer object from seed using util function
  const seed = '98fb1f513a1d979aab3e77e4cb447fc7b0d724924314af4fb8f12e0140adc584'
  const signer = await getWallet(seed)

  // const entropyAccount: EntropyAccount = {
  const entropyAccount = {
    sigRequestKey: signer,
    programModKey: signer
  }

  const entropy = new Entropy({ account: entropyAccount })
  await entropy.ready

  console.log('DONE')
}

start()
mixmix commented 2 months ago

I'd like to make a test in so we can confirm that our build step is making a module that can be reliably required