tanX Docupaper
AboutTrade
  • ABOUT
    • πŸ“’tanX Docupaper
  • TECH
    • πŸ‘©β€πŸ’»Tech Docupaper
      • 🏨High level architecture
      • πŸ€”Starkware logic
      • 🌊Transactional flow
        • Off-chain accounts
        • The deposit flow
        • The withdrawal flow
        • The trade flow
        • The transfer flow
        • Full withdrawal
    • πŸ”ŒAPI Documentation
      • πŸ˜‹Getting started
        • Test connectivity
      • πŸ“ˆMarket
        • 24hr Tickers Price
        • K-line/Candlestick data
        • Orderbook
        • Recent trades
      • ↔️Trading
        • Create order
        • Get order
        • List orders
        • Cancel order
        • Bulk Cancel
        • List trades
      • πŸ”Account
        • Generating L2 Key Pairs
        • Login
        • Deposit
        • Withdrawal
        • Profile Information
        • Balance details
        • Profit and loss details
      • 🌏Web-socket stream
        • πŸ—οΈPrivate web-socket connection
        • πŸ‘₯Public websocket connection
      • ✨Internal Transfer
        • Create Internal Transfer
        • Get Internal Transfer
        • Check User Existence
        • List Internal Transfers
      • πŸ§ͺSDK Reference
        • NodeJS SDK
        • Python SDK
  • LEGAL
    • ‼️tanX Disclaimer
Powered by GitBook
On this page

Was this helpful?

  1. TECH
  2. API Documentation
  3. Account

Generating L2 Key Pairs

PreviousAccountNextLogin

Last updated 1 year ago

Was this helpful?

This page helps you generate L2 key pairs either through the or with a code snippet.

To obtain the L2 Key Pair, you can proceed with either of the following methods:

  1. Once the wallet is connected, obtain the Key Pair from the official Account Settings Tab. Please refer to the image below for further guidance: Navigate to Settings -> tanX key -> Show Keys and sign the request to obtain the keys. Copy these keys and securely store them.

import { generateKeyPairFromEthPrivateKey } from '@tanx-libs/tanx-connector'

const keypair = generateKeyPairFromEthPrivateKey(ethPrivateKey, 'testnet') // default is mainnet
const stark_public_key = keypair.getPublic().getX().toString('hex') 
const stark_private_key = keypair.getPrivate().toString('hex')

Generate the L2 key pair using the :

This code snippet demonstrates how to generate L2 key pairs programmatically using the .

πŸ”Œ
πŸ”
tanX Node.js SDK
tanX Node.js SDK
tanX website
tanX website’s