123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import {
- AccAddress,
- LCDClient,
- MnemonicKey,
- MsgExecute,
- Wallet,
- } from '@initia/initia.js'
- import { InitiaClient } from './InitiaClient'
- import toHex = AccAddress.toHex
- const key = new MnemonicKey({
- mnemonic:
- // 'visual giant rely tooth recall explain vital tunnel snow road airport cake',
- // 'deal earth suggest craft impact vocal outdoor perfect winter nice unhappy lizard',
- 'language tooth rug border arm essence badge rough ahead unaware bag night stay auto spawn february odor equip hub demand three setup used sentence',
- // 'camp rural essay together right oblige shine visa sketch garage legal crush argue calm soup egg forum luxury action cupboard fade myth gospel confirm',
- // 'neutral flight plug goddess marble champion message bottom gentle guilt ketchup way guide obey nominee panda sleep meadow scene sea fine cause upgrade only',
- })
- console.log('mnemonic:', key.mnemonic)
- // mnemonic: beauty sniff protect...
- console.log('account address:', key.accAddress)
- // account address: init10m5nnevplkzvv5svqf0xjx6dc4705u5dxfn2st
- const lcd = new LCDClient('https://api-initia-testnet.whispernode.com/', {
- chainId: 'initiation-1',
- })
- // const wallet = new Wallet(lcd, key)
- // const msg = new MsgExecute(
- // key.accAddress,
- // '0x1',
- // 'dex',
- // 'swap_script',
- // [],
- // [
- // 'sTSuZ4bxDvdClOYn0lGbY7fHQqZzX5hoKSn+qahHRNI=',
- // 'jkczvavPfUr8PRTw3UbJv1L7D86eS5lsk54ZW4vIkdk=',
- // 'QEIPAAAAAAA=',
- // 'AdWGAQAAAAAA',
- // ],
- // )
- async function main() {
- const client = new InitiaClient(key.mnemonic, false)
- // await client.nameRegister()
- // await client.drawFood()
- // const a = await client.newBridge2Miniwasm()
- // console.log(a)
- // await client.transferGas('init1yq7erc0hmemy7exhycdqx8j05jj46g0hgycw5g', 0.2)
- // await client.mintPart()
- const res = await client.week6task1()
- // const res = ((new Date().valueOf() + 1500000) * 1000000).toString()
- console.log(res)
- // console.log(`1718639224520000000`)
- // 1718638714100000000
- }
- const target = '0x76622C9877947A6EEBaBba6898FAf6C57Ea2dfC8'
- async function hex() {
- console.log(toHex(key.accAddress))
- }
- // hex()
- main()
|