xyqon
v0.4.0
Published
Friendly wallet CLI and JavaScript client for the XYQON network.
Maintainers
Readme
XYQON Client
Friendly wallet CLI and JavaScript client for the live XYQON network.
It can:
- Generate a new XYQON wallet
- Show your public key
- Check your balance from live public nodes
- Send a signed transaction to the network
- Create and send coins on the XYQON network
- Mint and transfer NFTs
- Show currently reachable nodes
You do not need to mine and you do not need to run a full node.
Install
npm install -g xyqonOr run without installing:
npx xyqon helpCreate A Wallet
xyqon wallet new --name CathyThis creates:
xyqon.wallet.jsonKeep this file private. It contains your private key.
Show Your Address
xyqon wallet showCheck Balance
xyqon balanceUse a custom wallet path:
xyqon balance --wallet ./cathy.wallet.jsonSend XYQON
xyqon send \
--to RECIPIENT_PUBLIC_KEY \
--amount 1The transaction is broadcast to reachable public nodes. A miner must include it in a block before the receiver sees the confirmed balance. The client checks the best reachable public chain before broadcasting and refuses sends that exceed the wallet's confirmed XYQON balance.
Create And Send Coins
xyqon coin create \
--symbol GAME \
--name "Game Coin" \
--supply 1000000
xyqon coin send \
--symbol GAME \
--to RECIPIENT_PUBLIC_KEY \
--amount 25Coin creation and coin sends are signed 0 XYQON transactions. A miner must include them before the new coin or transfer appears on-chain. Before broadcasting a coin transfer, the client checks the best reachable public chain and refuses sends that exceed the wallet's confirmed coin balance.
Mint And Send NFTs
xyqon nft mint \
--collection ITEMS \
--token-id sword-001 \
--name "Iron Sword" \
--image-url https://example.com/iron-sword.png
xyqon nft send \
--collection ITEMS \
--token-id sword-001 \
--to RECIPIENT_PUBLIC_KEYShow Nodes
xyqon nodesSeed Nodes
The package starts with these seed nodes:
68.183.98.134:7101
143.244.149.8:7101
147.182.138.183:7101You can override them:
xyqon balance --peer 68.183.98.134:7101 --peer 143.244.149.8:7101JavaScript Usage
import {
createWallet,
loadWallet,
getBalance,
sendTransaction,
createCoin,
sendCoin,
mintNft,
transferNft,
getCreatedCoins,
getCreatedNfts,
getOwnedNfts,
getCoinHoldings
} from 'xyqon';
const wallet = createWallet('Cathy');
console.log(wallet.public_key);
const balance = await getBalance(wallet.public_key);
console.log(balance);
await sendTransaction({
wallet,
recipient: 'RECIPIENT_PUBLIC_KEY',
amount: 1
});
await createCoin({
wallet,
symbol: 'GAME',
name: 'Game Coin',
supply: 1000000
});
await sendCoin({
wallet,
recipient: 'RECIPIENT_PUBLIC_KEY',
symbol: 'GAME',
amount: 25
});
await mintNft({
wallet,
collection: 'ITEMS',
tokenId: 'sword-001',
name: 'Iron Sword',
imageUrl: 'https://example.com/iron-sword.png'
});
await transferNft({
wallet,
recipient: 'RECIPIENT_PUBLIC_KEY',
collection: 'ITEMS',
tokenId: 'sword-001'
});
const createdCoins = await getCreatedCoins(wallet);
const createdNfts = await getCreatedNfts(wallet);
const ownedNfts = await getOwnedNfts(wallet);
const coinHoldings = await getCoinHoldings(wallet);