Sign In

@crypax/js

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crypax/js

Crypax payment SDK for browsers

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
21
2000%
Maintainers
1
Weekly downloads
 
Created
Source

English | 한국어

@crypax/js

Core SDK for Crypax — crypto payment gateway for any EVM chain.

Provides a payment modal with built-in wallet connection (MetaMask, Pexus, etc.) using the Stripe PaymentIntent pattern.

Install

npm install @crypax/js

Usage

import { Crypax } from '@crypax/js'

const crypax = new Crypax('pk_live_xxxxx')

// clientSecret comes from your server via @crypax/node
const result = await crypax.confirmPayment(clientSecret)

if (result.status === 'confirmed') {
  console.log('Paid!', result.txHash)
} else if (result.status === 'cancelled') {
  console.log('User cancelled')
}

API

new Crypax(publishableKey, config?)

OptionTypeDefaultDescription
apiUrlstringhttps://api.crypax.ioCrypax API endpoint
theme'light' | 'dark' | 'auto''auto'Modal theme
locale'ko' | 'en''ko'Modal language
chainIdnumber41956Target chain ID
rpcUrlstringPlumise MainnetRPC endpoint
chainNamestring'Plumise Mainnet'Chain display name
explorerUrlstringPlumise ExplorerBlock explorer URL
nativeCurrencyobject{ name: 'PLM', symbol: 'PLM', decimals: 18 }Native currency info

crypax.confirmPayment(clientSecret): Promise<PaymentResult>

Opens the payment modal, connects wallet, sends TX, and polls until confirmed.

interface PaymentResult {
  status: 'confirmed' | 'cancelled' | 'expired' | 'failed'
  paymentId?: string
  txHash?: string
  blockNumber?: number
  error?: string
}

crypax.getWallet(): Promise<WalletInfo>

Detects connected wallet without triggering connection.

crypax.on(event, callback): () => void

Subscribe to events. Returns an unsubscribe function.

Events: status_change, wallet_detected, tx_submitted, tx_confirmed, error

crypax.destroy()

Clean up modal and event listeners.

Payment Status Flow

idle → loading → ready → connecting → switching_chain → awaiting_approval → submitted → confirmed
                                                                                      → failed
                                                                          → cancelled
                                                                          → expired

License

MIT

Keywords

crypax

FAQs

Package last updated on 19 Feb 2026

Did you know?

Socket

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.

Install

Related posts