Skip to content

ZKEX/zkex-mm-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This tool is used to help market maker users to initialize zkex account and activate zk layer2 account before submitting an application to the ZKEX team to obtain your market maker api-key and api-secret.

Quick Overview (features)

  • Register zkex account
  • Active layer2 account
  • Get testnet token from faucet

How to build

  • Update configure file and set layer2 endpoint to L2_HOST in conf/index.ts

    export const L2_HOST = 'http://xxx.xxx.xxx.xxx:yyyy'
  • Update configure file and set zkex api endpoint to ZKEX_API_URL in conf/index.ts

    export const ZKEX_API_URL = 'http://xxx.xxx.xxx.xxx:yyyy'
  • Install nvm

  • Install node >= 14.16.0

    nvm install 14.16.0
    nvm use 14.16.0
  • Install yarn

    npm install -g yarn
  • Build

    yarn 

Register and Active Interaction

  • Run yarn dev

  • Enter your PrivateKey

    ERROR You must be import web3 wallet first.
    Secret file saved /Users/zkex/Projects/zkex-mm-tools/.secret.json
    Enter your PrivateKey
    
    
    !!! Input your privateKey and Press Enter.

    !!! Attention: Please ensure the private key of the wallet address is securely backed up, to avoid the potential loss of access to your assets in your wallet.

  • Load account state

    Load account state ...
    Account id is null, deposit first.
    
    
    !!! This account is not actived on layer2, you should deposit tokens to your layer2 account and active it first.
  • Choose a network (Support "Polygon Mumbai Testnet" and "AVAX Testnet")

    Choose a network (Use arrow keys)
    > Polygon
      Avalanche
      < back
    
    !!! Avalanche is strongly recommended, Choose it. 
  • Check gas balance

    Insufficient gas balances.
    Choose a network (Use arrow keys)
    > Polygon
      Avalanche
      < back
    
    !!! If gas balances is insufficient, transfer AVAX to this address until you can check your AVAX balance.
  • Choose a token

    Choose a token (Use arrow keys)
    > AVAX
      JOE
      USDC
    
    !!! Select JOE and press enter
  • Check token balance (if no balance, go to mint)

    Choose a token JOE
    Selected JOE 0x7f8e17f6f6ed8ca649abe28f7236f6b08b6a14e1
    Load token balances ...
    Insufficient balances. Send mint transactions now. Please wait ...
    Mint tx hash 0x54318818bf07e859907b04bf2e595140fc017e378ae2cdc6ce06dab99e80bdd8
    JOE balances 100000000000000000000000000
  • Enter a amount to deposit

    Enter a amount to deposit:
    
    !!! Press 10000000 and Enter
    
    Send transaction request ...
    Transaction sended, wait receipt ...
    Deposit success.
  • Activate (if L2 received token)

    Account is locked, activate now, wait ...
    ZKEX trading enabled. ZKEX Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHhmNzBkMmRiZWRlM2U1MjFkMzE4YWFkOGQ1ZDkxYjczNWZhN2Q2MmQ4IiwiZXhwaXJlZEF0IjoxNjU5NjY4ODQzLCJpZCI6MzIsInB1YmtleSI6IjQ2NmNiMWEzNzFiYTE3YjZlYjJjNTUzYzdjYTZhMjBhMTgxNTk2ZjViODM1MDZiNWI5ZmQ3ODE4Y2IwYWY2OTMifQ.IfBkR0jI-FWOGweJTjHPRPZalTx9bGJ0wqGlz0-ojIc

Check and Query Interaction

  • Run yarn dev

    Choose a action. (Current: 0xf70d2dBeDe3E521D318aad8D5d91B735Fa7d62d8) (Use arrow keys)
    > 1) Your Wallets
      2) Account Doctor
      3) Account Info
      4) Balances
      5) Deposit
  • Choose a wallet (Use arrow keys)

    Choose a wallet (Use arrow keys)
    > 0xf70d2dBeDe3E521D318aad8D5d91B735Fa7d62d8
      New Wallet
      < back
    
    !!! Choose another wallet or create a new wallet.
  • Account Doctor

    Load account state ...
    Account is deposited.
    Account is activated.
    ZKEX trading enabled. ZKEX Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHhmNzBkMmRiZWRlM2U1MjFkMzE4YWFkOGQ1ZDkxYjczNWZhN2Q2MmQ4IiwiZXhwaXJlZEF0IjoxNjU5NjY5NzMxLCJpZCI6MzIsInB1YmtleSI6IjQ2NmNiMWEzNzFiYTE3YjZlYjJjNTUzYzdjYTZhMjBhMTgxNTk2ZjViODM1MDZiNWI5ZmQ3ODE4Y2IwYWY2OTMifQ.kNO4hx4dqhtVLpQIjwRDp6Jk3GNU3eW228r-LukR6EM
    
    !!! Check account state in layer2, and query account login jwt-token in zkex
  • Account Info

    ┌───────────────┬─────────────────────────────────────────────────┐
    │    (index)    │                     Values                      │
    ├───────────────┼─────────────────────────────────────────────────┤
    │   AccountId   │                       12                        │
    │  PubKeyHash   │ 'sync:fbb9c3a1db37b5db5a6a57b4a59a5ace4c751919' │
    │ AccountStatus │                   'Activated'                   │
    └───────────────┴─────────────────────────────────────────────────┘
    
    !!! Check account state and query account id in layer2
  • Balances

    ┌───────────────┬──────────────────────────────┐
    │    (index)    │             JOE              │
    ├───────────────┼──────────────────────────────┤
    │ ZKEX Balances │ '10000000000000000000000000' │
    └───────────────┴──────────────────────────────┘
    
    !!! Query account token balances in layer2
  • Deposit

    !!! Choose network and token and then deposit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published