Files
pwap/check-balances.mjs
T
pezkuwichain 5686386ef6 chore: Add utility scripts for DEX pool management
- check-asset-state.mjs: Asset state verification
- check-balances.mjs: Balance checking utilities
- check-founder-balances.mjs: Founder account balance checks
- check-hez-balance.mjs: HEZ token balance verification
- check-pool-balances-detailed.mjs: Detailed pool balance analysis
- create-all-pools.mjs: Automated pool creation
- create-pez-wusdt-pool.mjs: PEZ/wUSDT pool setup
- mint-and-create-pools.mjs: Mint tokens and create pools
- mint-whez.mjs: wHEZ minting utility
- verify-pool-state.mjs: Pool state verification
- wrap-hez-and-create-all-pools.mjs: HEZ wrapping and pool setup

These scripts support DEX pool management and testing for beta testnet.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 12:55:15 +03:00

40 lines
1.6 KiB
JavaScript

import { ApiPromise, WsProvider } from '@polkadot/api';
import { Keyring } from '@polkadot/keyring';
import { cryptoWaitReady } from '@polkadot/util-crypto';
async function main() {
await cryptoWaitReady();
const wsProvider = new WsProvider('ws://127.0.0.1:9944');
const api = await ApiPromise.create({ provider: wsProvider });
const keyring = new Keyring({ type: 'sr25519' });
const founder = keyring.addFromUri('skill dose toward always latin fish film cabbage praise blouse kingdom depth');
console.log('Founder address:', founder.address);
console.log('\nChecking balances...');
const whezBal = await api.query.assets.account(0, founder.address);
const pezBal = await api.query.assets.account(1, founder.address);
const wusdtBal = await api.query.assets.account(2, founder.address);
console.log(' wHEZ:', whezBal.isSome ? whezBal.unwrap().balance.toHuman() : '0');
console.log(' PEZ:', pezBal.isSome ? pezBal.unwrap().balance.toHuman() : '0');
console.log(' wUSDT:', wusdtBal.isSome ? wusdtBal.unwrap().balance.toHuman() : '0');
console.log('\nChecking pools...');
const pool1 = await api.query.assetConversion.pools([0, 1]);
const pool2 = await api.query.assetConversion.pools([0, 2]);
const pool3 = await api.query.assetConversion.pools([1, 2]);
console.log(' wHEZ/PEZ pool exists:', pool1.isSome);
console.log(' wHEZ/wUSDT pool exists:', pool2.isSome);
console.log(' PEZ/wUSDT pool exists:', pool3.isSome);
if (pool1.isSome) {
console.log('\nwHEZ/PEZ pool details:', pool1.unwrap().toHuman());
}
await api.disconnect();
}
main().catch(console.error);