
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
@coolwallet/iotx
Advanced tools
This is a typescript library with support for the integration of IoTex for third party application, include the functionalities of generation of addresses and signed transactions.
npm install @coolwallet/iotx
import Iotx, { Options } from '@coolwallet/iotx';
import { crypto } from '@coolwallet/core';
import { createTransport } from '@coolwallet/transport-web-ble';
const appId = 'appId that had been registered by wallet';
const transport = await createTransport();
const { privateKey: appPrivateKey } = crypto.key.generateKeyPair();
// Initialize
const iotx = new Iotx();
// Get Address
const addressIndex = 0;
const address = await iotx.getAddress(transport, appPrivateKey, appId, addressIndex);
// Sign Transaction
const options: Options = { transport, appPrivateKey, appId };
const transaction = {
addressIndex,
nonce: 1,
gasLimit: 10000,
gasPrice: '1000000000000',
amount: '10000000000000000',
recipient: 'io13nq26mfmse47uk8rgakld34yqrghgnl5hklnnc',
};
const signedTx = await iotx.signTransaction(transaction, options);
The address generated is compatible to BIP44 with account and change set to 0, which means calling getAddress with addressIndex = i will get the address of folllowing BIP44 path:
m/44'/304'/0'/0/{i}
async getAddress(
transport: types.Transport,
appPrivateKey: string,
appId: string,
addressIndex: number
): Promise<string>
For transferring IOTX tokens.
type Integer = string | number;
interface Options {
transport: Transport;
appPrivateKey: string;
appId: string;
confirmCB?: Function;
authorizedCB?: Function;
}
interface BaseTransaction {
addressIndex: number;
nonce: Integer;
gasLimit: Integer;
gasPrice: Integer;
}
interface Transfer extends BaseTransaction {
amount: Integer;
recipient: string;
payload?: string;
}
async signTransaction(
transaction: Transfer,
options: Options
): Promise<string> {
For EVM transaction.
interface Execution extends BaseTransaction {
amount: Integer;
contract: string;
data?: string;
}
async signExecution(
transaction: Execution,
options: Options
): Promise<string> {
For creating bucket for voting.
interface StakeCreate extends BaseTransaction {
candidateName: string;
amount: Integer;
duration: Integer;
isAuto: boolean;
}
async signStakeCreate(
transaction: StakeCreate,
options: Options
): Promise<string> {
For releasing a over-time bucket.
interface StakeUnstake extends BaseTransaction {
bucketIndex: Integer;
}
async signStakeUnstake(
transaction: StakeUnstake,
options: Options
): Promise<string> {
For withdraw IOTX from a released bucket
interface StakeWithdraw extends BaseTransaction {
bucketIndex: Integer;
}
async signStakeWithdraw(
transaction: StakeWithdraw,
options: Options
): Promise<string> {
FAQs
Coolwallet IoTex sdk
The npm package @coolwallet/iotx receives a total of 2 weekly downloads. As such, @coolwallet/iotx popularity was classified as not popular.
We found that @coolwallet/iotx demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.