{"_id":"@acta-team/did-stellar","_rev":"3-83ef328e809e545e7a4dd3af5901b501","name":"@acta-team/did-stellar","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@acta-team/did-stellar","version":"0.1.0","keywords":["did","did-stellar","did-resolver","stellar","soroban","self-sovereign-identity","ssi","w3c","verifiable-credentials","decentralized-identity","dif"],"author":{"name":"ACTA"},"license":"MIT","_id":"@acta-team/did-stellar@0.1.0","maintainers":[{"name":"danielcotoj","email":"dannyc0902@gmail.com"},{"name":"brenes30","email":"josuebrenes3005@gmail.com"}],"homepage":"https://github.com/ACTA-Team/did-stellar/tree/main/packages/resolver","bugs":{"url":"https://github.com/ACTA-Team/did-stellar/issues"},"dist":{"shasum":"44c99c1f51c4b7c420a85f7c3bb536ca3cb8d2ea","tarball":"https://registry.npmjs.org/@acta-team/did-stellar/-/did-stellar-0.1.0.tgz","fileCount":26,"integrity":"sha512-9DCv6DdZdVYOr9y++dWxphEd2vdiZp9QXwwn2v6i8uzVL61m4+Z9Tj9IkZatx/K4EklobAYej7uHPhMUt14ptg==","signatures":[{"sig":"MEQCIA4EMBmtoAo0jr/OiIRinqEx4Glmp2uAkve+6Mc0sq1uAiBPYDubZ9ZgPhuPJnyE9Dv8SSyyGbgCZbRvjXYIf6iaYg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":982310},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=22.22.0 <25"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./resolver":{"types":"./dist/resolver/index.d.ts","import":"./dist/resolver/index.mjs","require":"./dist/resolver/index.js"},"./package.json":"./package.json"},"gitHead":"85ba55f7dd364d5fa94c8ebddcf18e54ff99021c","scripts":{"lint":"eslint . --max-warnings=0","test":"vitest run","build":"tsup","clean":"rimraf dist .turbo coverage","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","build:watch":"tsup --watch","test:coverage":"vitest run --coverage","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"brenes30","email":"josuebrenes3005@gmail.com"},"repository":{"url":"git+https://github.com/ACTA-Team/did-stellar.git","type":"git","directory":"packages/resolver"},"_npmVersion":"11.12.1","description":"Official TypeScript SDK for the did:stellar v0.1 method. DIF did-resolver compatible, prepare/submit XDR helpers, and W3C-compliant DID Document construction.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"axios":"^1.15.2","@scure/base":"^1.1.9","@noble/ed25519":"^2.1.0","@stellar/stellar-sdk":"^15.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","rimraf":"^6.0.1","vitest":"^2.1.0","typescript":"^5.7.0","@types/react":"^18.3.0","@vitest/coverage-v8":"^2.1.0"},"peerDependencies":{"react":">=18.0.0 <20.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/did-stellar_0.1.0_1779834197798_0.13108053987077506","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@acta-team/did-stellar","version":"0.1.1","keywords":["did","did-stellar","did-resolver","stellar","soroban","self-sovereign-identity","ssi","w3c","verifiable-credentials","decentralized-identity","dif"],"author":{"name":"ACTA"},"license":"MIT","_id":"@acta-team/did-stellar@0.1.1","maintainers":[{"name":"danielcotoj","email":"dannyc0902@gmail.com"},{"name":"brenes30","email":"josuebrenes3005@gmail.com"}],"homepage":"https://github.com/ACTA-Team/did-stellar/tree/main/packages/resolver","bugs":{"url":"https://github.com/ACTA-Team/did-stellar/issues"},"dist":{"shasum":"725bf6941d7ba5f4548d9bc7eb6b7d13b74a8e47","tarball":"https://registry.npmjs.org/@acta-team/did-stellar/-/did-stellar-0.1.1.tgz","fileCount":26,"integrity":"sha512-JeUGub4XIR2udc+NUtNqcWIUxjvOicfqdYXy1FDbh/ZHbT5Nc/wBqo4QatDPpdus2BOb2nchy+KWKp7UZYO/PQ==","signatures":[{"sig":"MEUCIE9xqoZ3m25oy00CqdXEkyr/Vj0I8ifMzV8maZCxnLh7AiEA8mZtFdAi7/qvCSrV63ERqT8ypsY/47YWsAKzcdrFE6g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":979759},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=22.22.1 <25"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./resolver":{"types":"./dist/resolver/index.d.ts","import":"./dist/resolver/index.mjs","require":"./dist/resolver/index.js"},"./package.json":"./package.json"},"gitHead":"e7f6f0cc8bba8bec4a73a1c3b71dc42c117eb0fa","scripts":{"lint":"eslint . --max-warnings=0","test":"vitest run","build":"tsup","clean":"rimraf dist .turbo coverage","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","build:watch":"tsup --watch","test:coverage":"vitest run --coverage","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"brenes30","email":"josuebrenes3005@gmail.com"},"repository":{"url":"git+https://github.com/ACTA-Team/did-stellar.git","type":"git","directory":"packages/resolver"},"_npmVersion":"11.12.1","description":"Official TypeScript SDK for the did:stellar v0.1 method. DIF did-resolver compatible, prepare/submit XDR helpers, and W3C-compliant DID Document construction.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"axios":"^1.15.2","@scure/base":"^1.1.9","@noble/ed25519":"^2.1.0","@stellar/stellar-sdk":"^15.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","rimraf":"^6.0.1","vitest":"^2.1.0","typescript":"^5.7.0","@types/react":"^18.3.0","@vitest/coverage-v8":"^2.1.0"},"peerDependencies":{"react":">=18.0.0 <20.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/did-stellar_0.1.1_1782852956741_0.295811379295259","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@acta-team/did-stellar","version":"0.1.2","description":"Official TypeScript SDK for the did:stellar v0.1 method. DIF did-resolver compatible, prepare/submit XDR helpers, and W3C-compliant DID Document construction.","type":"commonjs","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./resolver":{"types":"./dist/resolver/index.d.ts","import":"./dist/resolver/index.mjs","require":"./dist/resolver/index.js"},"./hooks":{"types":"./dist/hooks/index.d.ts","import":"./dist/hooks/index.mjs","require":"./dist/hooks/index.js"},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"tsup","build:watch":"tsup --watch","typecheck":"tsc --noEmit","lint":"eslint . --max-warnings=0","lint:fix":"eslint . --fix","test":"vitest run","test:coverage":"vitest run --coverage","test:watch":"vitest","clean":"rimraf dist .turbo coverage","prepublishOnly":"pnpm run build"},"keywords":["did","did-stellar","did-resolver","stellar","soroban","self-sovereign-identity","ssi","w3c","verifiable-credentials","decentralized-identity","dif"],"author":{"name":"ACTA"},"license":"Apache-2.0","homepage":"https://github.com/ACTA-Team/did-stellar/tree/main/packages/resolver","repository":{"type":"git","url":"git+https://github.com/ACTA-Team/did-stellar.git","directory":"packages/resolver"},"bugs":{"url":"https://github.com/ACTA-Team/did-stellar/issues"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"peerDependencies":{"react":">=18.0.0 <20.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"dependencies":{"@noble/ed25519":"^2.1.0","@scure/base":"^1.1.9","@stellar/stellar-sdk":"^15.0.0","axios":"^1.18.0"},"devDependencies":{"@types/react":"^18.3.0","@vitest/coverage-v8":"^4.1.10","rimraf":"^6.0.1","tsup":"^8.3.0","typescript":"^5.7.0","vite":"^7.1.12","vitest":"^4.1.10"},"engines":{"node":">=22.22.1 <25"},"gitHead":"da815bc00dd7bcf0186453f2df39cf035de5f6c1","_id":"@acta-team/did-stellar@0.1.2","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-RX9aGxaVu1XTA4/oF8ptIR0Cwkgl7T09CXfFs/d6uMoMLmFefZNzL0V0DJ1A5Plf+/nes5EL3dbCikBWHJpczg==","shasum":"15ecfb34476e20a55667cbe07973a3996aae17be","tarball":"https://registry.npmjs.org/@acta-team/did-stellar/-/did-stellar-0.1.2.tgz","fileCount":27,"unpackedSize":1000150,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCvkSubS4dDmW0qKsJodk981652JUsSb+ygUi1ZeTL2dgIhALfkgba4PFR6DXnSNq2sfeZg44rV/Phe7wvqpujcsqsm"}]},"_npmUser":{"name":"brenes30","email":"josuebrenes3005@gmail.com"},"directories":{},"maintainers":[{"name":"danielcotoj","email":"dannyc0902@gmail.com"},{"name":"brenes30","email":"josuebrenes3005@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/did-stellar_0.1.2_1785193649515_0.5197194246060592"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-26T22:23:17.678Z","modified":"2026-07-27T23:07:29.914Z","0.1.0":"2026-05-26T22:23:17.987Z","0.1.1":"2026-06-30T20:55:56.908Z","0.1.2":"2026-07-27T23:07:29.694Z"},"bugs":{"url":"https://github.com/ACTA-Team/did-stellar/issues"},"author":{"name":"ACTA"},"license":"Apache-2.0","homepage":"https://github.com/ACTA-Team/did-stellar/tree/main/packages/resolver","keywords":["did","did-stellar","did-resolver","stellar","soroban","self-sovereign-identity","ssi","w3c","verifiable-credentials","decentralized-identity","dif"],"repository":{"type":"git","url":"git+https://github.com/ACTA-Team/did-stellar.git","directory":"packages/resolver"},"description":"Official TypeScript SDK for the did:stellar v0.1 method. DIF did-resolver compatible, prepare/submit XDR helpers, and W3C-compliant DID Document construction.","maintainers":[{"name":"danielcotoj","email":"dannyc0902@gmail.com"},{"name":"brenes30","email":"josuebrenes3005@gmail.com"}],"readme":"# `@acta-team/did-stellar`\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![DIF compliant](https://img.shields.io/badge/DIF-did--resolver-blue.svg)](https://github.com/decentralized-identity/did-resolver)\n\nOfficial TypeScript SDK for the [`did:stellar` v0.1 method](https://github.com/ACTA-Team/contracts-acta/blob/main/docs/did-spec/did-stellar-v0.1.md).\n\n| | |\n|---|---|\n| **DID method** | `did:stellar` |\n| **Networks** | `mainnet`, `testnet` |\n| **Testnet registry** | `CB7ATU7SF5QUKJMSULJDJVWJZVDXC23HTZX6NFUDTSFPVT6MA575NNZJ` |\n| **Spec** | [v0.1](https://github.com/ACTA-Team/contracts-acta/blob/main/docs/did-spec/did-stellar-v0.1.md) |\n| **DIF compatibility** | Drop-in driver for [`did-resolver`](https://www.npmjs.com/package/did-resolver) |\n\n## What's inside\n\n- **Resolver** — `resolveDidStellar(did)` reads the on-chain `DidRecord`\n  via Stellar RPC and returns a W3C DID Document.\n- **DIF driver** — `getResolver()` plugs straight into\n  `new Resolver({...})` from `did-resolver`.\n- **Prepare / submit** — four mutation helpers\n  (`prepareRegisterDidXdr`, `prepareUpdateDidXdr`,\n  `prepareTransferControllerXdr`, `prepareDeactivateDidXdr`) that build\n  unsigned XDRs, plus `submitSignedXdr` to deliver them.\n- **Proof of control** — JCS-canonicalised challenges, `buildChallenge`,\n  `verifyProofOfControl` (Ed25519, ±5 min replay window).\n- **Optional HTTP client** — `ActaDidClient` for integrators that\n  prefer talking to [`did.acta.build`](https://did.acta.build) rather than wiring a Stellar RPC\n  themselves.\n- **React hook** — `useDid()` (subpath `@acta-team/did-stellar/hooks`)\n  for browser apps.\n- **Typed errors** — every failure is a `DidError` with a stable\n  `code` string (`did_not_found`, `version_mismatch`, `signature_invalid`, …).\n\nThe SDK has **zero ACTA-hosted dependencies** in its hot path. You can\nresolve any `did:stellar:...` with just a Stellar RPC URL.\n\n## Install\n\n```bash\nnpm install @acta-team/did-stellar\n# peer (only if you use the ./hooks entrypoint):\nnpm install react\n```\n\n## Quickstart — resolve\n\n```ts\nimport { resolveDidStellar } from '@acta-team/did-stellar';\n\nconst { didDocument, didDocumentMetadata } = await resolveDidStellar(\n  'did:stellar:testnet:aaaqeayeaudaocajbifqydiob4'\n);\nconsole.log(didDocument);\n```\n\nDefaults: SDF public RPC (`https://soroban-testnet.stellar.org`) + the\ncanonical registry contract ID. Override either via `{ rpcUrl,\nregistryContractId }`.\n\n## Quickstart — DIF driver\n\n```ts\nimport { Resolver } from 'did-resolver';\nimport { getResolver } from '@acta-team/did-stellar/resolver';\n\nconst resolver = new Resolver({ ...getResolver() });\nconst result = await resolver.resolve('did:stellar:testnet:aaaqeayeaudaocajbifqydiob4');\n```\n\n## Quickstart — register a DID\n\n```ts\nimport {\n  generateDidId,\n  buildDidStellar,\n  prepareRegisterDidXdr,\n  submitSignedXdr,\n} from '@acta-team/did-stellar';\n\nconst didId = generateDidId();\nconst did = buildDidStellar('testnet', didId);\n\nconst prepared = await prepareRegisterDidXdr({\n  did,\n  sourcePublicKey: 'G...',\n  record: {\n    controller: 'G...',\n    authentication: [{ publicKeyMultibase: 'z6Mk...' }],\n    assertionMethod: [{ publicKeyMultibase: 'z6Mk...' }],\n    keyAgreement: [],\n    services: [],\n  },\n});\n\n// Sign with Freighter / Albedo / Hana / server-side key ...\nconst signedXdr = await signWithWallet(prepared.xdr, {\n  networkPassphrase: prepared.networkPassphrase,\n});\n\nconst { txId } = await submitSignedXdr({\n  signedXdr,\n  network: prepared.network,\n});\n```\n\n## Quickstart — proof of control\n\n```ts\nimport {\n  buildChallenge,\n  generateNonce,\n  jcsCanonicalize,\n  resolveDidStellar,\n  verifyProofOfControl,\n} from '@acta-team/did-stellar';\n\n// Verifier issues the challenge:\nconst challenge = buildChallenge({\n  did: 'did:stellar:testnet:aaaqeayeaudaocajbifqydiob4',\n  domain: 'verifier.example.com',\n  nonce: generateNonce(),\n});\nconst message = jcsCanonicalize(challenge);\n// → present `challenge` + `message` to the wallet for Ed25519 signing.\n\n// Wallet returns signature (base64url, no padding):\nconst signature = '...';\n\n// Verifier:\nconst { didDocument } = await resolveDidStellar(challenge.did);\nconst result = await verifyProofOfControl({\n  challenge,\n  signature,\n  didDocument: didDocument!,\n  expectedDomain: 'verifier.example.com',\n  isNonceFresh: (nonce, did) => myRedis.setnx(`pc:${did}:${nonce}`, '1', 'EX', 300),\n});\nif (!result.valid) throw result.reason;\n```\n\n## Error handling\n\nEvery SDK function rejects with `DidError`. Branch on `code`:\n\n```ts\nimport { DidError } from '@acta-team/did-stellar';\n\ntry {\n  await prepareUpdateDidXdr({ ... });\n} catch (err) {\n  if (DidError.is(err) && err.code === 'version_mismatch') {\n    // re-read the record, rebuild, retry\n  } else {\n    throw err;\n  }\n}\n```\n\nSee [`src/errors.ts`](./src/errors.ts) for the full `DidErrorCode` union.\n\n## Spec conformance\n\nThe package ships [vectors A.1–A.3](./tests/fixtures/vectors.json) from\nthe spec and `pnpm test` verifies the DID Document builder produces\nbit-identical output. Adding new functionality without updating the\nspec is intentionally a CI failure surface.\n\n## License\n\n[Apache-2.0](./LICENSE). See also [NOTICE](./NOTICE).\n","readmeFilename":"README.md"}