{"_id":"@ambrus-toth/abi-explorer-share-link","_rev":"2-a97e0c511155080578fa99560ee71fac","name":"@ambrus-toth/abi-explorer-share-link","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@ambrus-toth/abi-explorer-share-link","version":"0.1.0","keywords":["abi","struct","layout","url","fragment","share"],"license":"Apache-2.0","_id":"@ambrus-toth/abi-explorer-share-link@0.1.0","maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"homepage":"https://abiexplorer.org","bugs":{"url":"https://github.com/tothambrus11/abi-explorer-2/issues"},"dist":{"shasum":"3c9228b042a322b8d33b5c34df72e9cecc62b61a","tarball":"https://registry.npmjs.org/@ambrus-toth/abi-explorer-share-link/-/abi-explorer-share-link-0.1.0.tgz","fileCount":33,"integrity":"sha512-ATnPAYE0n1goMo8dHIC+5eBrW1AMkfyqmvTtfEpw6iZg2I6ivSYu7rq3sEjmoa7uuPCgSQQIi7Qt8Cfs8XrJug==","signatures":[{"sig":"MEQCIGdbar0lHC1K2hML+BJ5viaHtcgDbrqEyMMWI9EoF0RLAiAZbQlgamlivlyvVW1fgGPPZLD/ck89g2wjftrmAAjT+Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42253},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./v1":{"types":"./dist/v1.d.ts","default":"./dist/v1.js"},"./v2":{"types":"./dist/v2.d.ts","default":"./dist/v2.js"},"./v3":{"types":"./dist/v3.d.ts","default":"./dist/v3.js"},"./decode":{"types":"./dist/decode.d.ts","default":"./dist/decode.js"},"./encode":{"types":"./dist/encode.d.ts","default":"./dist/encode.js"},"./envelope":{"types":"./dist/envelope.d.ts","default":"./dist/envelope.js"}},"gitHead":"98e57af6625dbeb8d064607289b24ff0326b6170","scripts":{"test":"vitest run --config vitest.config.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","prepack":"npm run build"},"_npmUser":{"name":"processeus","email":"ambrus@johetajava.hu"},"repository":{"url":"git+https://github.com/tothambrus11/abi-explorer-2.git","type":"git","directory":"packages/share-link"},"_npmVersion":"11.12.1","description":"The URL fragment an ABI Explorer link shares a session in: the state, every version of the wire, the envelopes, and one reader for them all.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/abi-explorer-share-link_0.1.0_1788647862752_0.367884012484194","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ambrus-toth/abi-explorer-share-link","version":"0.1.1","description":"The URL fragment an ABI Explorer link shares a session in: the state, every version of the wire, the envelopes, and one reader for them all.","license":"Apache-2.0","type":"module","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./encode":{"types":"./dist/encode.d.ts","default":"./dist/encode.js"},"./decode":{"types":"./dist/decode.d.ts","default":"./dist/decode.js"},"./envelope":{"types":"./dist/envelope.d.ts","default":"./dist/envelope.js"},"./v1":{"types":"./dist/v1.d.ts","default":"./dist/v1.js"},"./v2":{"types":"./dist/v2.d.ts","default":"./dist/v2.js"},"./v3":{"types":"./dist/v3.d.ts","default":"./dist/v3.js"}},"scripts":{"build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","test":"vitest run --config vitest.config.ts","prepack":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/tothambrus11/abi-explorer-2.git","directory":"packages/share-link"},"homepage":"https://abiexplorer.org","keywords":["abi","struct","layout","url","fragment","share"],"publishConfig":{"access":"public","provenance":true},"devDependencies":{"typescript":"^6.0.3","vitest":"^4.1.10"},"gitHead":"d36017a40eeae6116b30ff98f60dd1591ab45a98","_id":"@ambrus-toth/abi-explorer-share-link@0.1.1","bugs":{"url":"https://github.com/tothambrus11/abi-explorer-2/issues"},"_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-WbrPvjDBz5fOCIkwzoujtq+h+Zq/2uoNRVhRL+WR2r9Q+QAmgCO9Mox0AcgQ72cSken9ZrlEPSRPHXFXaxAjXA==","shasum":"d1e0ec14a91d01d24a152c9b25dce7d93dbb7ef6","tarball":"https://registry.npmjs.org/@ambrus-toth/abi-explorer-share-link/-/abi-explorer-share-link-0.1.1.tgz","fileCount":33,"unpackedSize":42277,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ambrus-toth%2fabi-explorer-share-link@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCoEtaYmc0xQwx8D6DseqHgRrFuLFlsullatK0lC3l8gwIgaS3L8fjKpiibbrIFlxLg3A0EqusZ6LePz7Sks2bqcGA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:792e58c5-3a10-4081-98a3-7d5f0612a2b7"}},"directories":{},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/abi-explorer-share-link_0.1.1_1788649333015_0.17091247540777155"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-05T22:37:42.565Z","modified":"2026-09-05T23:02:13.532Z","0.1.0":"2026-09-05T22:37:42.888Z","0.1.1":"2026-09-05T23:02:13.156Z"},"bugs":{"url":"https://github.com/tothambrus11/abi-explorer-2/issues"},"license":"Apache-2.0","homepage":"https://abiexplorer.org","keywords":["abi","struct","layout","url","fragment","share"],"repository":{"type":"git","url":"git+https://github.com/tothambrus11/abi-explorer-2.git","directory":"packages/share-link"},"description":"The URL fragment an ABI Explorer link shares a session in: the state, every version of the wire, the envelopes, and one reader for them all.","maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"readme":"# @ambrus-toth/abi-explorer-share-link\n\nThe URL fragment an [ABI Explorer](https://abiexplorer.org) link shares a\nsession in: the session state (`ShareState`), every version of the wire\nformat it travels as (`WireV1`, `WireV2`, `WireV3`; `Wire` is their union),\nthe envelopes a wire travels in, and one reader for all of it. No\ndependencies; runs anywhere `CompressionStream`, `btoa` and `TextEncoder`\nexist (browsers, Node 18+, Deno, Bun).\n\n```ts\nimport { encode, decode } from '@ambrus-toth/abi-explorer-share-link';\n\nconst url = `https://abiexplorer.org/#${await encode(state)}`;\nconst back = await decode(location.hash); // ShareState | null\n```\n\nA program that only writes links imports `./encode` and carries no reader;\none that only reads imports `./decode` and carries no writer:\n\n```ts\nimport { encode } from '@ambrus-toth/abi-explorer-share-link/encode';\nimport { decode } from '@ambrus-toth/abi-explorer-share-link/decode';\n```\n\n## The pieces\n\n`encode` is `toWireV3` in the smallest envelope the runtime can write;\n`decode` is `decodeFragment` then `fromWire`. Each piece is exported for a\nprogram that writes an older version, or reads a wire it got some other way.\n\n| Wire | Shape                                                                      |\n| ---- | -------------------------------------------------------------------------- |\n| V1   | one source and its options at the top level; the plain-envelope era        |\n| V2   | the same, numbered for the compressed envelope (abiexplorer.org, Sep 2026) |\n| V3   | `bs`: every source with its own options; `vw` the view; `ly` the desk      |\n\n`v` tells wires apart; a wire without one, or with one the reader does not\nknow, is read as V1, the oldest and most lenient. `toWireV1` and `toWireV2`\ncarry a state's first buffer only.\n\n| Envelope | Form                                  |\n| -------- | ------------------------------------- |\n| 1        | `base64url(JSON)`                     |\n| 2        | `\"2.\" + base64url(deflate-raw(JSON))` |\n\nA wire of any version travels in either envelope; `decodeFragment` tells them\napart by the prefix.\n\n## What the readers promise\n\n- They never throw; anything that is not a link is `null`.\n- Every field of what they return has the right shape: strings where strings\n  go, a known `pack`, a triple that is a plain token, booleans for the\n  toggles, at most eight buffers, names of at most forty characters, a\n  `layout` only when it has the shape of one.\n- What the values _mean_ is the reader's to decide: which standards a\n  language has, and which triple stands for which ABI, change with the\n  compilers an app ships, so an unknown `lang`, `std` or `triple` comes\n  through as it was written (or `''` when it was not a string) rather than\n  being replaced with a default.\n","readmeFilename":"README.md"}