Skip to content

ApeX-Protocol/apex-api-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apex API Demo — zk Signing Examples (Go · Python · Node.js)

Minimal, runnable examples showing how to perform zk signing and call onboarding-related endpoints across Go, Python, and Node.js. Each demo derives seeds → initializes a ZkLink signer → computes l2Key / pubKeyHash → generates apiKeyHash + apiSignature for /v3/new-onboarding.

These are reference examples to help you integrate quickly. Adapt endpoints, providers, and error handling for production use.


What’s inside

  • go/ — zk signing + /v3/generate-nonce/v3/new-onboarding example
  • python/ — same flow using the official Python SDK where applicable
  • nodejs/ — browser/Node-compatible flow with zklink web SDK (wasm) and ethers

Each language outputs (to stdout) the core artifacts:

  • seeds (hex, lowercased, no 0x)
  • l2Key (ZK public key)
  • pubKeyHash
  • apiKeyHash (bn1|signMsg)
  • apiSignature (MuSig result for APEX-SIGNATURE header)

Prerequisites

  • Environment

    • APEX_ENVMAIN or TEST
    • APEX_PRIVATE_KEY — your Ethereum private key (0x-prefixed)
    • APEX_ADDRESS — your Ethereum address (optional; will be derived if omitted)
    • APEX_CHAIN_ID — target chain id (e.g., 84532)
  • Toolchains

    • Go 1.20+ · Python 3.9+ · Node.js 18+
    • Internet access to install deps (or use vendored modules)

Security: never commit secrets. Use a .env/.env.local or a secure secrets manager.


Notes


License

MIT (examples only). See individual files for any third-party licenses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •