npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@super-susliki/intmax2-client-sdk

v1.2.4

Published

Client SDK for Intmax2

Readme

INTMAX2-CLIENT-SDK

This SDK is a client library for the INTMAX API. It is designed to help you integrate INTMAX services into your applications.

Installation for browser

  npm install intmax2-client-sdk

or

  pnpm install intmax2-client-sdk

or

  yarn add intmax2-client-sdk

Interface

export interface INTMAXClient {
  // properties
  tokenBalances: TokenBalance[] | undefined;
  address: string; // IntMax public_key
  isLoggedIn: boolean;

  // account
  fetchTokenBalances: () => Promise<TokenBalancesResponse>;
  getPrivateKey: () => Promise<string | undefined>;
  signMessage: (message: string) => Promise<SignMessageResponse>;
  verifySignature: (signature: SignMessageResponse, message: string | Uint8Array) => Promise<boolean>;

  // transaction
  fetchTransactions: (params: FetchTransactionsRequest) => Promise<Transaction[]>;
  broadcastTransaction: (
    rawTransfers: BroadcastTransactionRequest[],
    isWithdrawal: boolean,
  ) => Promise<BroadcastTransactionResponse>;
  waitForTransactionConfirmation: (
    params: WaitForTransactionConfirmationRequest,
  ) => Promise<WaitForTransactionConfirmationResponse>;

  // deposit
  deposit: (params: PrepareDepositTransactionRequest) => Promise<PrepareDepositTransactionResponse>;
  fetchDeposits: (params: FetchTransactionsRequest) => Promise<(Transaction | null)[]>;

  // withdrawal
  fetchPendingWithdrawals: (params: FetchWithdrawalsRequest) => Promise<FetchWithdrawalsResponse>;
  withdraw: (params: WithdrawRequest) => Promise<WithdrawalResponse>;
  claimWithdrawal: (params: ContractWithdrawal[]) => Promise<ClaimWithdrawalTransactionResponse>;

  // Fees
  getTransferFee: () => Promise<FeeResponse>;
  getWithdrawalFee: (token: Token) => Promise<FeeResponse>;
  getClaimFee: () => Promise<FeeResponse>;

  // additional services
  login: () => Promise<LoginResponse>;
  logout: () => Promise<void>;
  getTokensList: () => Promise<Token[]>;
}

Usage

Initialization

import { IntmaxClient } from 'intmax2-client-sdk';

const intmaxClient = IntmaxClient.init({
  environment: 'testnet', //  'mainnet' | 'devnet' | 'testnet'
});

Login to get wallet

Here you should sign two message, they will be appeared in the popup window automatically.:

  1. Sign the message confirm your ETH wallet address.
  2. Sign the message with challenge string.
await intmaxClient.login();
const address = this.intmaxClient.address; // Public key of the wallet
const privateKey = this.intmaxClient.getPrivateKey(); // Private key of the wallet. Here you should sign message.

Sign message

const message = 'Hello, World!';
const signature = await intmaxClient.signMessage(message);

Verify signature

const message = 'Hello, World!';
const signature = await intmaxClient.signMessage(message);

const isVerified = await intmaxClient.verifySignature(signature, message);
console.log(isVerified); // true

const isFakeMessageVerify = await intmaxClient.verifySignature(signature, 'Another message');
console.log(isFakeMessageVerify); // false

const isFakeSignatureVerify = await intmaxClient.verifySignature('Another signature', message);
console.log(isFakeSignatureVerify); // false

Get tokens list

const tokens = await intmaxClient.getTokensList();
// tokens: {
//    contractAddress: string;
//    decimals?: number;
//    image?: string;
//    price: number;
//    symbol?: string;
//    tokenIndex: number;
//    tokenType: TokenType;
// }[]

Get token balances

const { balances } = await intmaxClient.fetchTokenBalances();
// balances: {
//    token: Token; // Check get tokens list response
//    amount: bigint;
// }

Deposit Native Token (ETH)

const amount = 0.1; // Amount of the token
const tokens = await intmaxClient.getTokensList(); // Get list of the tokens
let token = tokens.find((token) => token.tokenIndex === 0); // Find token by symbol

if (token) {
  token = {
    ...token,
    tokenType: TokenType.NATIVE,
  };
}

// Estimate gas
const gas = await intmaxClient.estimateDepositGas({
  amount,
  token,
  address, // Your public key of the IntMax wallet or any other IntMax wallet public key
  isGasEstimation: true,
});

// Deposit
const deposit = await intmaxClient.deposit({
  amount,
  token,
  address,
});
// Deposit response
// {
//  txHash: `0x${string}`;
//  status: TransactionStatus;
// }

Deposit ERC20

const amount = 0.1; // Amount of the token
const tokens = await intmaxClient.getTokensList(); // Get list of the tokens
let token = tokens.find((token) => token.tokenIndex === 0); // Find token by symbol

if (!token) {
  token = {
    decimals: 18, // Decimals of the token
    tokenType: TokenType.ERC20,
    contractAddress: '0x....', // Your Token address if not exist on token list
  };
} else {
  token = {
    ...token,
    tokenType: TokenType.ERC20,
  };
}

// Estimate gas if need to show for user
const gas = await intmaxClient.estimateDepositGas({
  amount,
  token,
  address, // Your public key of the IntMax wallet or any other IntMax wallet public key
  isGasEstimation: true,
});

// Deposit
const deposit = await intmaxClient.deposit({
  amount,
  token,
  address,
});
// Deposit response
// {
//  txHash: `0x${string}`;
//  status: TransactionStatus;
// }

Deposit ERC721 / ERC1155

const amount = 1; // Amount of the token for erc721 should be 1, for erc1155 can be more than 1
const token = {
  tokenIndex: 1, // Nft id in contract
  tokenType: TokenType.ERC721, // or TokenType.ERC1155
  contractAddress: '0x....', // Your Token address if not exist on token list
};

// Estimate gas if need to show for user
const gas = await intmaxClient.estimateDepositGas({
  amount,
  token,
  address, // Your public key of the IntMax wallet or any other IntMax wallet public key
  isGasEstimation: true,
});

// Deposit
const deposit = await intmaxClient.deposit({
  amount,
  token,
  address,
});
// Deposit response
// {
//  txHash: `0x${string}`;
//  status: TransactionStatus;
// }

Withdraw

const amount = 0.1; // Amount of the token, for erc721 should be 1, for erc1155 can be more than 1
const { balances } = await intmaxClient.fetchTokenBalances(); // fetch token balances

// You can change filtration by tokenIndex or tokenAddress
const token = balances.find((b) => b.token.tokenIndex === 0).token;

// Withdraw
const withdraw = await intmaxClient.withdraw({
  amount,
  token,
  address, // Your public key of ETH wallet
});
// Withdraw response
// {
//   txTreeRoot: string;
//   transferDigests: string[];
// }

Fetch withdrawals (needToClaim, etc.)

const withdrawals = await intmaxClient.fetchPendingWithdrawals(); // Record<WithdrawalsStatus, ContractWithdrawal[]>

Claim withdrawals

const withdrawals = await intmaxClient.fetchPendingWithdrawals(); // Record<WithdrawalsStatus, ContractWithdrawal[]>
const claim = await intmaxClient.claimWithdrawal(withdrawals.needClaim); // Claim response (should be add additional check for receiver address you can claim withdrawals only for your address)
// {
//   txHash: `0x${string}`;
//   status: TransactionStatus;
// }

Logout

await intmaxClient.logout();