OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet / deprecated / bug-reports / bug-report / minimal-wdk-test.js

42 lines · javascript ref:
#!/usr/bin/env node
// minimal-wdk-test.js - Minimal WDK Test Case
//
// This is the SMALLEST possible code that demonstrates the Pear runtime issue.
// Tests basic WDK functionality: seed phrase generation and wallet initialization.

import WDK from '@tetherto/wdk'

async function test() {
  console.log('🧪 Minimal WDK Test')
  console.log('==================')
  console.log('')

  try {
    // Step 1: Generate seed phrase
    console.log('Step 1: Generating seed phrase...')
    const seedPhrase = WDK.getRandomSeedPhrase()
    console.log('✅ Success:', seedPhrase.split(' ').length, 'words')
    console.log('')

    // Step 2: Initialize WDK
    console.log('Step 2: Initializing WDK...')
    const wdk = new WDK(seedPhrase)
    console.log('✅ Success: WDK instance created')
    console.log('')

    console.log('🎉 ALL TESTS PASSED')
    process.exit(0)

  } catch (error) {
    console.error('❌ TEST FAILED')
    console.error('')
    console.error('Error:', error.message)
    console.error('')
    console.error('Stack trace:')
    console.error(error.stack)
    process.exit(1)
  }
}

test()