GG
GGCHAIN SDKv0.1.0
Developer Toolkit
Build on GGCHAIN

Ship your GGCHAIN app
in 10 lines of code.

The official developer SDK for @gghyper/sdk (JS/TS) and gghyper-sdk (Python). RPC, contracts, deployments, multicall, explorer, mining pool, events — all in one tiny package.

npm install @gghyper/sdk GitHub Main Site
CHAIN ID
2121217
RPC
https://rpc.gghyper.net
EXPLORER
explorer.gghyper.net

0. Download SDK Source v0.1.0 · 27 KB

Direct downloads, ready to push to your own GitHub / npm / PyPI.

📦
gghyper-sdk-v0.1.0.zip
JS + Python · Windows-friendly · 21 KB
📦
gghyper-sdk-v0.1.0.tar.gz
JS + Python · Linux/Mac · 27 KB
🔧
Build & publish
cd js && yarn install && yarn build
npm publish --access public

cd ../python
python -m build
twine upload dist/*

1. Install

npm install @gghyper/sdk
# or: yarn add @gghyper/sdk · pnpm add @gghyper/sdk
copy

2. Quick Start read-only · works in browser & Node

import { GGChain } from "@gghyper/sdk";

const gg = new GGChain();

const block = await gg.blockNumber();
const bal   = await gg.getBalance("0xfF3dBbD0...");
console.log("Block", block, "·", bal, "GG");

// Wrap any ERC-20
const t = gg.token("0xE77F05C0...");
console.log(await t.symbol(), await t.balanceOf("0x..."));
copy

3. Signing & sending

const gg = new GGChain({ privateKey: process.env.PK });

await gg.send("0xBob...", "1.5");                              // 1.5 GG
await gg.token("0xE77F05...").transfer("0xBob...", "100");     // 100 bUSDT
await gg.token("0xE77F05...").approve("0xSpender", "max");     // unlimited
const sig = await gg.signMessage("Login at " + Date.now());
copy

4. Deploy a contract

const { address, contract, tx } = await gg.deploy(ABI, BYTECODE, [arg1, arg2]);
console.log("Deployed at", address);
console.log("Tx", tx.hash, "view:", gg.explorer.url(address));
copy

5. Custom contract calls

const c = gg.contract("0xMyContract...", MY_ABI);
const value = await c.someView();             // read
const tx    = await c.someWrite(arg1, arg2);  // write (signer required)
await gg.waitForTx(tx.hash);
copy

6. Mining Pool API

import { Pool } from "@gghyper/sdk";

const s = await gg.pool.stats();
console.log("Hashrate:", Pool.formatHash(s.hashrate));
console.log("Active miners:", s.minersTotal);

const me = await gg.pool.miner("0xfF3dBbD0...");
console.log("Workers:", me.workersOnline, "Pending:", me.stats.balance);
console.log("Stratum:", gg.pool.stratumUrl());
copy

7. Explorer (Blockscout) API

const txs   = await gg.explorer.txList("0xAlice...");
const erc20 = await gg.explorer.tokenTransfers("0xAlice...");
const abi   = await gg.explorer.getContractABI("0xMyContract...");
const url   = gg.explorer.url("0xMyContract...");
copy

8. Live events (WebSocket)

const gg = new GGChain({ ws: "wss://ws.gghyper.net" });
const off = gg.onLogs({ address: "0xMyContract..." }, log => console.log(log));
gg.onBlock(n => console.log("block", n));
// later: off(); await gg.destroy();
copy

9. Add GGCHAIN to MetaMask

import { WALLET_PARAMS } from "@gghyper/sdk";
await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [WALLET_PARAMS],
});
copy

Network Reference

KeyValue
chainId2121217 (0x205C81)
rpchttps://rpc.gghyper.net
wswss://ws.gghyper.net
explorerexplorer.gghyper.net
poolpool.gghyper.net
symbolGG
decimals18