
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
rena-initia-sdk
Advanced tools
A TypeScript SDK for interacting with the Initia blockchain. This SDK provides a simple interface for common blockchain operations such as getting account information, sending tokens, and uploading signatures.
npm install rena-initia-sdk
import { InitiaSDK } from 'rena-initia-sdk';
import dotenv from 'dotenv';
// Load environment variables
dotenv.config();
// Initialize SDK with mnemonic and RPC URL
const sdk = new InitiaSDK(
process.env.MNEMONIC ?? '',
process.env.RPC_URL ?? 'https://rest.testnet.initia.xyz'
);
// Get account information
async function getAccountInfo() {
const address = await sdk.getAccountAddress();
console.log('Account Address:', address);
const balance = await sdk.getAccountBalance(address);
console.log('Account Balance:', balance);
return { address, balance };
}
// Send tokens to another address
async function sendTokens() {
const senderAddress = await sdk.getAccountAddress();
const recipientAddress = 'init1dflp5l3p5y6zhh7tnus60j2w88mqhp6p2tpncs';
const amount = '1000uinit';
// Create send token message
const sendMsg = sendToken(
senderAddress,
recipientAddress,
amount
);
// Create and sign transaction
const signedTx = await sdk.wallet.createAndSignTx({
msgs: [sendMsg],
memo: 'Token transfer',
});
// Broadcast transaction
const result = await sdk.rest.tx.broadcast(signedTx);
console.log('Transaction result:', result);
return result;
}
Create a .env
file in your project root with the following variables:
MNEMONIC='your mnemonic phrase here'
RPC_URL='https://rest.testnet.initia.xyz'
The main class for interacting with the Initia blockchain.
constructor(mnemonic: string, rpcUrl: string)
mnemonic
: The mnemonic phrase for the walletrpcUrl
: The RPC URL for the Initia blockchain (defaults to testnet)getAccountAddress()
: Gets the account address associated with the walletgetAccountBalance(address?)
: Gets the account balance for a given address (defaults to the wallet's address)function sendToken(sender: string, contractAddress: string, amount: string): MsgSend
Creates a message to send tokens to another address.
function uploadSignature(
sender: string,
contractAddress: string,
module: string,
functionName: string,
typeArgs: any[],
args: any[]
): MsgExecute
Creates a message to upload a signature to a smart contract.
function uuidToU256(uuid: string): bigint
Converts a UUID string to a U256 (bigint) representation.
function u256ToUuid(u256: bigint): string
Converts a U256 (bigint) representation back to a UUID string.
MIT
FAQs
SDK for interacting with the Initia blockchain
The npm package rena-initia-sdk receives a total of 2 weekly downloads. As such, rena-initia-sdk popularity was classified as not popular.
We found that rena-initia-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.