blyz-sdk
v1.0.0
Published
Minimal TypeScript SDK that signs and launches tokens via the Blyz v4 Fair Launch Factory contract.
Readme
BLYZ SDK
Minimal TypeScript SDK that signs and launches tokens via the Blyz v4 Fair Launch Factory contract.
Requirements
- Node.js 18+ and Yarn 1.22
- Access to a Base RPC endpoint (Sepolia or Mainnet) and a funded deployer wallet
- Sufficient funds on that wallet (gas + launch capital)
- Blyz v4 Fair Launch Factory contract address for the network you plan to target
Install
Install dependencies with Yarn (recommended) or npm:
# Yarn
yarn install
# npm
npm installConfigure environment variables
- Copy the template and adjust the values:
cp .env.example .env - Edit
.envand provide the secrets:PRIVATE_KEY– 32-byte hex string (with0xprefix) for the deployer wallet that will pay gas. Keep it safe.BASE_RPC_URL– HTTPS RPC endpoint for the Base network you target. The example uses Sepolia.BLYZ_TOKEN_PROTOCOL_ADDRESS– Blyz v4 Fair Launch Factory contract address supplied by the Blyz team for the selected network.
Configure BlyzTokenV4
Open src/index.ts and adjust the tokenConfig passed to new BlyzTokenV4(...) before running the script. Each field maps directly to the on-chain deployment payload:
| Field | Description |
| --- | --- |
| name | Full ERC20 name (e.g. Example Token). |
| symbol | Short uppercase ticker (e.g. EXT). |
| metadataCid | IPFS CID of the token artwork stored on IPFS (image file). |
| initialTick | Starting tick on the Blyz pool curve. |
| creatorAddress | Address registered as the project creator and payout recipient (not necessarily the actual author). |
| pairToken | Address of the asset you pair against (WETH, USDC, etc.); use the zero address to pair with native ETH. |
| amountIn | BigInt representing how much of the pairToken (in wei) you deposit when creating the pool. |
Run the sample deployment
- Ensure the
.envfile is ready and thetokenConfigpassed tonew BlyzTokenV4(...)contains your data. - Execute the script:
The# Yarn yarn start # npm npm run startstartscript invokests-node src/index.ts, instantiatesBlyz, and submitsBlyzTokenV4to the factory defined in.env. - For production builds, compile the SDK and import the generated code from
dist/:# Yarn yarn build # npm npm run build
Example run
$ npm run start
> [email protected] start
> ts-node src/index.ts
Loading Blyz configuration
Configuration ready
signer: 0xdDEA2b19867531c5fa7003E6d83f6ab37E8872Dd
factoryAddress: 0xfCA4A96066D1039676B48915901ba400197AB1a6
Blyz client initialized
Deploying token
name: Example Token
symbol: EXT
Transaction broadcasted
transactionHash: 0xf01ac218f61c7591483b60650d2107e8436c21fc88d7071b4a9e888486ec1862
Deployment confirmed
tokenAddress: 0x7455ED2D8913F218e2Ec659fd017CFD0D6C19eD3
blockNumber: 33372096
gasUsed: 2342787Tip: keep a separate
.envper environment (e.g..env.sepolia,.env.mainnet) and export the right one before running the script.
TODO:
- Solve all TODOs in code
- Export as a npm package
- More detailed documentation on initialTick
- Add CLI
- Add Tests
- Add more functions like claim/harvest (anything else?)
