swapTester.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { LCDClient, MnemonicKey, MsgExecute, Wallet } from '@initia/initia.js'
  2. import { InitiaClient } from './InitiaClient'
  3. const key = new MnemonicKey({
  4. mnemonic:
  5. // 'deal earth suggest craft impact vocal outdoor perfect winter nice unhappy lizard',
  6. 'language tooth rug border arm essence badge rough ahead unaware bag night stay auto spawn february odor equip hub demand three setup used sentence',
  7. })
  8. console.log('mnemonic:', key.mnemonic)
  9. // mnemonic: beauty sniff protect...
  10. console.log('account address:', key.accAddress)
  11. // account address: init10m5nnevplkzvv5svqf0xjx6dc4705u5dxfn2st
  12. const lcd = new LCDClient('https://api-initia-testnet.whispernode.com/', {
  13. chainId: 'initiation-1',
  14. })
  15. // const wallet = new Wallet(lcd, key)
  16. // const msg = new MsgExecute(
  17. // key.accAddress,
  18. // '0x1',
  19. // 'dex',
  20. // 'swap_script',
  21. // [],
  22. // [
  23. // 'sTSuZ4bxDvdClOYn0lGbY7fHQqZzX5hoKSn+qahHRNI=',
  24. // 'jkczvavPfUr8PRTw3UbJv1L7D86eS5lsk54ZW4vIkdk=',
  25. // 'QEIPAAAAAAA=',
  26. // 'AdWGAQAAAAAA',
  27. // ],
  28. // )
  29. async function main() {
  30. const client = new InitiaClient(key.mnemonic,false)
  31. // await client.nameRegister()
  32. await client.getXpAmount()
  33. // await client.mintPart()
  34. }
  35. main()