{"id":15292019,"url":"https://github.com/sorbin/tuskscript","last_synced_at":"2026-01-31T06:04:29.194Z","repository":{"id":255436442,"uuid":"849804959","full_name":"Sorbin/tuskscript","owner":"Sorbin","description":"TuskScript is a lightweight TypeScript library that simplifies data storage and retrieval on the Walrus network for both Web2 and Web3 applications.","archived":false,"fork":false,"pushed_at":"2024-08-30T23:40:40.000Z","size":292,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-27T00:19:11.576Z","etag":null,"topics":["data-availability","npm","sui","walrus"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tuskscript","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sorbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-30T09:29:27.000Z","updated_at":"2025-04-02T14:26:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"15bcad57-98d9-4168-a6d1-4847323acff7","html_url":"https://github.com/Sorbin/tuskscript","commit_stats":null,"previous_names":["sorbin/tuskscript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sorbin/tuskscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorbin%2Ftuskscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorbin%2Ftuskscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorbin%2Ftuskscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorbin%2Ftuskscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sorbin","download_url":"https://codeload.github.com/Sorbin/tuskscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sorbin%2Ftuskscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28931091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-availability","npm","sui","walrus"],"created_at":"2024-09-30T16:16:12.034Z","updated_at":"2026-01-31T06:04:29.177Z","avatar_url":"https://github.com/Sorbin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/SovaSniper/tuskscript/master/icon.png\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n# tuskscript\n\n\u003ca href=\"https://www.npmjs.com/package/tuskscript\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/tuskscript.svg\" alt=\"npm version\" height=\"18\"\u003e\n\u003c/a\u003e\n\n`tuskscript` is a TypeScript-based npm package that simplifies development for the Walrus network. It provides an easy-to-use API for storing and retrieving data, allowing seamless integration with both Web2 and Web3 applications. Whether you are building decentralized apps (dApps) or traditional applications, TuskScript enables you to leverage the power of the Walrus network with minimal effort.\n\n## Installation\n\nUse the package manager npm to install `tuskscript`.\n\n```bash\nnpm i tuskscript\n```\n\n## Usage\n\nBelow is a quick example of how to use TuskScript to store and retrieve data on the Walrus network.\n\n### Storing Data\n\nStart by creating a new instance of `WalrusClient`. You can store any JavaScript object, and the API will return details about the stored blob. If the data is new, it returns a `NewBlob`. If the data has been previously stored, it returns an `ExistingBlob`.\n\n```typescript\nimport { \n  WalrusClient,\n  NewBlob,\n  ExistingBlob\n} from \"tuskscript\";\n\nconst client = new WalrusClient();\n// const publisher = \"...\"\n// const aggregator = \"...\";\n// const client = new WalrusClient(publisher, aggregator);\n\nconst data = {\n  name: \"Walrus\",\n  language: \"Move\",\n  chain: \"Sui\",\n};\n\n// Store data as a new blob\nconst result: NewBlob = await client.store(data);\nconsole.log(result);\n/*\n{\n    newlyCreated: {\n        blobObject: {\n            id: '0xd3ee449b225ae4bfdd3f361982883b1f6312ab25a512a431bad99c87ff12c844',\n            storedEpoch: 0,\n            blobId: 'BmDTorm0NtVbVZcFXlQaKQ2xLiJ7HvxPuoIoE3hC0Pk',\n            size: 49,\n            erasureCodeType: 'RedStuff',\n            certifiedEpoch: 0,\n            storage: {}\n        },\n        encodedSize: 65023000,\n        cost: 3175000\n    }\n}\n*/\n\n// Storing the same data again returns an ExistingBlob\nconst existingResult: ExistingBlob = await client.store(data);\nconsole.log(existingResult);\n/*\n{\n    alreadyCertified: {\n        blobId: 'BmDTorm0NtVbVZcFXlQaKQ2xLiJ7HvxPuoIoE3hC0Pk',\n        event: {\n            txDigest: 'EW7pCYu7DNfPYpS5j3c8gVA2w3hNiP7dyYARbAxCSSbK',\n            eventSeq: '0'\n        },\n        endEpoch: 1\n    }\n}\n*/\n```\n\n### Retrieving Data\n\nYou can retrieve stored data by its `blobId`. By default, data is retrieved as a `Blob`, but you can also parse it directly into TypeScript types.\n\n```typescript\nimport { WalrusClient } from \"tuskscript\";\n\nconst client = new WalrusClient();\nconst blobId = \"BmDTorm0NtVbVZcFXlQaKQ2xLiJ7HvxPuoIoE3hC0Pk\";\n\n// Retrieve data as a Blob object\nconst blob: Blob = await client.retrieve(blobId);\nconst data = JSON.parse(await blob.text());\nconsole.log(data);\n/*\n{\n    \"name\": \"Walrus\",\n    \"language\": \"Move\",\n    \"chain\": \"Sui\"\n}\n*/\n\n// Retrieve data directly as a JavaScript object\nconst directData = await client.retrieve(blobId, { asBlob: false });\nconsole.log(directData);\n/*\n{\n    \"name\": \"Walrus\",\n    \"language\": \"Move\",\n    \"chain\": \"Sui\"\n}\n*/\n\n// Retrieve data with specified content type\nconst jsonBlob = await client.retrieve(blobId, { type: \"application/json\" });\n```\n\n### Low-Level Services\n\nIf you need more granular control over the data storage and retrieval process, you can use the low-level `store` and `retrieve` functions:\n\n```typescript\nimport { store, retrieve } from \"tuskscript\";\n\nconst publisher = \"...\";\nconst aggregator = \"...\";\n\nconst data = {\n  name: \"Walrus\",\n  language: \"Move\",\n  chain: \"Sui\",\n};\n\n// Store data with additional options\nconst result = await store({\n  publisher,\n  data,\n  epoch: 5\n});\n\n// Retrieve data using low-level retrieval\nconst blobId = \"BmDTorm0NtVbVZcFXlQaKQ2xLiJ7HvxPuoIoE3hC0Pk\";\nconst retrievedData = await retrieve({\n  aggregator,\n  id: blobId,\n});\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorbin%2Ftuskscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorbin%2Ftuskscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorbin%2Ftuskscript/lists"}