{"library":"scrypt-ts-transpiler","title":"sCrypt TypeScript Transpiler","description":"Transpiler that compiles TypeScript smart contracts for Bitcoin SV into sCrypt bytecode. Current stable version is 1.2.29, updated periodically. Key differentiator: enables writing Bitcoin smart contracts entirely in TypeScript, leveraging its tooling and type safety, while outputting efficient on-chain bytecode. Requires TypeScript ~5.3.0 as a peer dependency and Node.js >=16.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install scrypt-ts-transpiler"],"cli":{"name":"scrypt-ts-transpiler","version":null}},"imports":["import { transpile } from 'scrypt-ts-transpiler'","import { CompileError } from 'scrypt-ts-transpiler'","import type { TranspileOptions } from 'scrypt-ts-transpiler'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { transpile } from 'scrypt-ts-transpiler';\nimport { writeFileSync } from 'fs';\n\nconst source = `\nexport class Counter extends SmartContract {\n    @prop()\n    readonly count: bigint;\n\n    constructor(count: bigint) {\n        super(...arguments);\n        this.count = count;\n    }\n\n    @method()\n    public increment() {\n        this.count++;\n    }\n}`;\n\nconst result = transpile(source, {\n    artifactPath: './artifacts',\n    sourceMap: true\n});\n\nwriteFileSync('artifacts/counter.scrypt', result.bytecode);\nconsole.log('Bytecode compiled successfully');","lang":"typescript","description":"Compile a simple sCrypt TypeScript smart contract into bytecode and save the artifact.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}