{"_id":"@black-market/sdk","name":"@black-market/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@black-market/sdk","version":"0.1.0","description":"Canonical TypeScript SDK for the Black Market protocol on Robinhood Chain (Abyss DEX, Atomic launches, lending market).","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"sideEffects":false,"engines":{"node":">=20"},"packageManager":"pnpm@10.11.0","publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsc -p tsconfig.json","dev":"tsc -p tsconfig.json --watch","examples":"pnpm build && node examples/quickstart.mjs","lint":"tsc -p tsconfig.json --noEmit","prepublishOnly":"pnpm build","test":"pnpm build && node --test test/*.test.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"dependencies":{"viem":"^2.31.0"},"devDependencies":{"@types/node":"^22.15.29","typescript":"^5.8.3"},"keywords":["black-market","abyss","robinhood-chain","defi","viem"],"gitHead":"04b0680290c70b3bdeafefcc8f93d98b1e11341a","_id":"@black-market/sdk@0.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-3SASpKAqpV1nkVMOvkYzwVm1gFNvorpRvCQljCTgEj+hw+7NPq+sge65hTfOVkQtr1V1abvMRP8Bex1OrpZmrA==","shasum":"42b65d6bc0647145953014fb42c5c8dec7430855","tarball":"https://registry.npmjs.org/@black-market/sdk/-/sdk-0.1.0.tgz","fileCount":48,"unpackedSize":680466,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDYt3W/Tg+cba9Als7KMcTKbXUVM+lDiwpLufzxUAfUWwIgbcGOMTGAntqQpKFevN89dPD7NB/ZMA62thMz7KIkl9A="}]},"_npmUser":{"name":"abysshopper","email":"theabysshopper@gmail.com"},"directories":{},"maintainers":[{"name":"abysshopper","email":"theabysshopper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1788741055757_0.31389527237568515"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-07T00:30:55.538Z","0.1.0":"2026-09-07T00:30:55.909Z","modified":"2026-09-07T00:30:56.404Z"},"maintainers":[{"name":"abysshopper","email":"theabysshopper@gmail.com"}],"description":"Canonical TypeScript SDK for the Black Market protocol on Robinhood Chain (Abyss DEX, Atomic launches, lending market).","keywords":["black-market","abyss","robinhood-chain","defi","viem"],"license":"MIT","readme":"![Abyss header](assets/abyss-header.png)\n\n# @black-market/sdk\n\nCanonical TypeScript SDK for the Black Market protocol on [Robinhood Chain](https://robinhoodchain.blockscout.com) — Abyss DEX infrastructure, Atomic token launches, and the lending market.\n\nBuilt on [viem](https://viem.sh). ESM-only, Node 20+.\n\n## Install\n\n```sh\nnpm install @black-market/sdk viem\n# or\npnpm add @black-market/sdk viem\n```\n\n## Quick start\n\n```ts\nimport { createProtocolPublicClient, getAddresses, robinhoodMainnet } from \"@black-market/sdk\";\n\nconst client = createProtocolPublicClient({ chainId: 4663 });\nconst addresses = getAddresses(4663); // canonical Robinhood mainnet deployment\n```\n\n### Wallet client (signing)\n\n```ts\nimport { createProtocolWalletClient } from \"@black-market/sdk\";\n\nconst wallet = createProtocolWalletClient({\n  privateKey: process.env.PRIVATE_KEY as `0x${string}`,\n  chainId: 4663,\n});\n```\n\n### Atomic launches\n\n```ts\nimport {\n  LAUNCH_TEMPLATES,\n  deriveAtomicLaunchPoolRecipe,\n  estimateAtomicLaunchInitialBuy,\n  buildAtomicLaunchCalldata,\n  DEFAULT_ATOMIC_LAUNCH_TARGET_MARKET_CAP_USD,\n} from \"@black-market/sdk\";\n\n// Derive the one-sided launch position from a target FDV.\nconst recipe = deriveAtomicLaunchPoolRecipe({\n  /* … */\n});\n\n// Encode an Atomic launch request for the AtomicLaunchFactory.\nconst calldata = buildAtomicLaunchCalldata(request, nativeBuyAmount);\n```\n\n### Networks\n\n| Chain ID | Network                       |\n| -------: | ----------------------------- |\n|    `4663` | Robinhood Chain mainnet       |\n|   `46631` | Black Market workbench (fork) |\n|   `31337` | Local Anvil                   |\n\n`getAddresses()` defaults to the workbench chain (`46631`); pass `4663` for the canonical mainnet deployment or `31337` for a local Anvil fork.\n\nDeployment addresses can be overridden with environment variables, evaluated once at module load. Where an override applies, the bare name wins, then `VITE_`, then `NEXT_PUBLIC_` (e.g. `ABYSS_ROUTER` > `VITE_ABYSS_ROUTER` > `NEXT_PUBLIC_ABYSS_ROUTER`). Overrides apply to the launch-application addresses on every chain, to the Abyss infrastructure addresses on `31337` and `46631` (mainnet `4663` always uses the canonical deployment), and to the lending-market addresses on `31337` (bare + `VITE_` + `NEXT_PUBLIC_`) and `46631` (`VITE_`/`NEXT_PUBLIC_` only). The workbench RPC URL reads `VITE_RPC_URL`, then `NEXT_PUBLIC_RPC_URL`, then `RPC_URL`.\n\n## Package layout\n\n| Module         | Contents                                                              |\n| -------------- | --------------------------------------------------------------------- |\n| `addresses`    | Chain definitions, canonical deployment addresses, env overrides      |\n| `abis`         | Lending-market ABIs (pool, data providers, lens, oracle, vesting, …)  |\n| `abyss`        | Abyss DEX ABIs and launch-module ABIs, pool profiles, fee tiers       |\n| `auction`      | Atomic launch supply constants and paired-asset (quote) catalog       |\n| `launch`       | Launch templates, Atomic launch recipe derivation, calldata building  |\n| `live`         | Reserve/user position normalization from lens & data-provider rows    |\n| `format`       | RAY/WAD math, health-factor and units formatting helpers              |\n| `client`       | viem public/wallet client factories                                   |\n\n## Examples\n\nRunnable offline scripts live in [`examples/`](examples/) — no RPC endpoint or wallet required. They import the built package output, so build first:\n\n```sh\npnpm examples   # pnpm build && node examples/quickstart.mjs\n```\n\n## Development\n\n```sh\npnpm install\npnpm build      # tsc → dist/\npnpm test       # build + node:test suite\npnpm typecheck\n```\n\n## Releasing\n\nReleases are published to npm by GitHub Actions with [trusted publishing (OIDC)](https://docs.npmjs.com/trusted-publishers) — no npm tokens are stored in this repository.\n\n1. Bump `version` in `package.json` and merge to `main`.\n2. Cut a matching git tag (e.g. `v0.1.0`) and create a GitHub Release from it.\n3. The [`publish` workflow](.github/workflows/publish.yml) runs on the `release: published` event (or via manual `workflow_dispatch` with a `version` input): it builds, tests, verifies the release tag / input version equals `package.json`'s `version`, dry-run checks the tarball contents, then publishes with `npm publish --provenance --access public`.\n\nThe publish job declares `environment: npm` and `permissions: id-token: write`. Configure the **`npm` environment** in the repository settings (Settings → Environments) with required reviewers so every publish needs approval, and register this repository + workflow as a trusted publisher on npmjs.com for the `@black-market/sdk` package.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-d01cef724485152b9e1f917c4f5fe538"}