@deleekat/wallet-sdk
v1.0.0
Published
DeLeeKat Wallet SDK for JavaScript
Downloads
6
Maintainers
Readme
🪙 DeLeeKat Wallet SDK
JavaScript SDK for interacting with DeLeeKat blockchain.
🚀 Installation
npm install deleekat-wallet-sdk📖 Quick Start
Create a new wallet
const DeLeeKatWallet = require('deleekat-wallet-sdk');
const wallet = new DeLeeKatWallet({
rpcUrl: 'https://rpc.deleekat.com',
chainId: 7777
});
// Generate new wallet
const newWallet = wallet.generate();
console.log('Address:', newWallet.address);
console.log('Seed Phrase:', newWallet.mnemonic);Import existing wallet
// From seed phrase
wallet.importFromMnemonic('your twelve word seed phrase here');
// From private key
wallet.importFromPrivateKey('0xYourPrivateKey');Check balance
const balance = await wallet.getBalance();
console.log('Balance:', balance, 'DKT');
// Check any address
const otherBalance = await wallet.getBalance('0xOtherAddress');Send DKT
const tx = await wallet.send('0xRecipientAddress', '10.5');
console.log('Transaction Hash:', tx.txHash);
console.log('Block Number:', tx.blockNumber);Get transaction history
const history = await wallet.getTransactionHistory();
history.forEach(tx => {
console.log(`${tx.type}: ${tx.value} DKT - ${tx.hash}`);
});Network information
const info = await wallet.getNetworkInfo();
console.log('Chain ID:', info.chainId);
console.log('Current Block:', info.currentBlock);
console.log('Gas Price:', info.gasPrice);Sign messages
const signature = await wallet.signMessage('Hello DeLeeKat!');
console.log('Signature:', signature);
// Verify signature
const signer = wallet.verifyMessage('Hello DeLeeKat!', signature);
console.log('Signer:', signer);🔧 API Reference
Constructor
new DeLeeKatWallet(config)Config options:
rpcUrl(string): RPC endpoint - Default:'https://rpc.deleekat.com'chainId(number): Chain ID - Default:7777
Methods
generate()
Generates a new wallet with seed phrase.
Returns: { address, mnemonic, privateKey }
importFromMnemonic(mnemonic)
Imports wallet from 12-word seed phrase.
Returns: { address }
importFromPrivateKey(privateKey)
Imports wallet from private key.
Returns: { address }
getBalance(address?)
Gets DKT balance for an address.
Parameters:
address(string, optional): Address to check. Uses wallet address if not provided.
Returns: string - Balance in DKT
send(toAddress, amount)
Sends DKT to an address.
Parameters:
toAddress(string): Recipient addressamount(string|number): Amount in DKT
Returns: { txHash, blockNumber, from, to, gasUsed }
getTransactionHistory(address?, limit?)
Gets transaction history.
Parameters:
address(string, optional): Address to get history forlimit(number, optional): Max number of transactions - Default: 10
Returns: Array of transactions
getNetworkInfo()
Gets network information.
Returns: { chainId, name, currentBlock, gasPrice }
signMessage(message)
Signs a message.
Returns: string - Signature
verifyMessage(message, signature)
Verifies a message signature.
Returns: string - Signer address
export()
Exports wallet information.
Returns: { address, privateKey }
🌐 Network Details
- Network Name: DeLeeKat MainNet
- RPC URL: https://rpc.deleekat.com
- Chain ID: 7777
- Currency Symbol: DKT
- Block Explorer: https://explorer.deleekat.com
📱 Examples
E-commerce Integration
const wallet = new DeLeeKatWallet();
await wallet.importFromPrivateKey(process.env.MERCHANT_KEY);
// Check for payment
const balance = await wallet.getBalance();
console.log('Merchant balance:', balance, 'DKT');
// Process refund
await wallet.send(customerAddress, refundAmount);Gaming Integration
// Player purchases in-game item
const playerWallet = new DeLeeKatWallet();
playerWallet.importFromMnemonic(playerSeedPhrase);
await playerWallet.send(gameContractAddress, itemPrice);🔒 Security Best Practices
- Never expose private keys or seed phrases
- Use environment variables for sensitive data
- Implement rate limiting for production apps
- Use HTTPS for RPC connections
- Validate all addresses before sending
- Store seed phrases encrypted in secure storage
📄 License
MIT
🤝 Contributing
Contributions welcome! Please open an issue or PR.
🔗 Links
💬 Support
For support, email [email protected] or join our Discord.
