{"id":13652303,"url":"https://github.com/paritytech/txwrapper","last_synced_at":"2025-04-23T03:30:41.623Z","repository":{"id":36459767,"uuid":"224686349","full_name":"paritytech/txwrapper","owner":"paritytech","description":"Helper funtions for offline transaction generation.","archived":true,"fork":false,"pushed_at":"2021-09-29T09:06:04.000Z","size":3766,"stargazers_count":58,"open_issues_count":9,"forks_count":27,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-17T23:51:05.739Z","etag":null,"topics":["offline","polkadot","tx"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritytech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-28T15:53:49.000Z","updated_at":"2024-08-13T10:58:45.000Z","dependencies_parsed_at":"2022-08-18T20:10:38.264Z","dependency_job_id":null,"html_url":"https://github.com/paritytech/txwrapper","commit_stats":null,"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Ftxwrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Ftxwrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Ftxwrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Ftxwrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritytech","download_url":"https://codeload.github.com/paritytech/txwrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365245,"owners_count":21418654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["offline","polkadot","tx"],"created_at":"2024-08-02T02:00:58.125Z","updated_at":"2025-04-23T03:30:39.569Z","avatar_url":"https://github.com/paritytech.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch1 align=\"center\"\u003e@substrate/txwrapper\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eHelper funtions for offline transaction generation.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@substrate/txwrapper\"\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/@substrate/txwrapper.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/paritytech/txwrapper/actions\"\u003e\n    \u003cimg alt=\"Github Actions\" src=\"https://github.com/paritytech/txwrapper/workflows/pr/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\n    \u003cimg alt=\"apache-2.0\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://david-dm.org/paritytech/txwrapper\"\u003e\n    \u003cimg alt=\"david-dm\" src=\"https://img.shields.io/david/paritytech/txwrapper.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n## DEPRECATION NOTICE\n\nOn 9 June 2021 this repo will stop being supported.\n\nPlease use [`txwrapper-polkadot`](https://github.com/paritytech/txwrapper-core/tree/main/packages/txwrapper-polkadot) instead of this package for long term support and more features. This package will be phased out in the future in favor of the packages in [`txwrapper-core`](https://github.com/paritytech/txwrapper-core/).\n\nIf you are a chain builder looking to build a chain specific `txwrapper` please take a look at [`txwrapper-core`](https://github.com/paritytech/txwrapper-core) and the [guide for chain builders](https://github.com/paritytech/txwrapper-core/blob/main/CHAIN_BUILDER.md). \n\n## Get Started\n\n```bash\nyarn add @substrate/txwrapper\n```\n\nIn a JS/TS file:\n\n```typescript\nimport {\n  createSignedTx,\n  createSigningPayload,\n  methods,\n} from '@substrate/txwrapper';\n\nconst unsigned = methods.balance.transfer(\n  {\n    dest: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP',\n    value: 100,\n  },\n  {\n    // Additional information needed to construct the transaction offline.\n  }\n);\n\nconst signingPayload = createSigningPayload(unsigned, { registry });\n// On your offline device, sign the payload.\nconst signature = myOfflineSigning(signingPayload);\n\n// `tx` is ready to be broadcasted.\nconst tx = createSignedTx(unsigned, signature, { metadataRpc, registry });\n```\n\nHave a look at the [examples](https://github.com/paritytech/txwrapper/tree/master/examples) to see how you can perform the whole lifecycle of a transaction, from generation to signing to broadcast.\n\nGo to [documentation](https://github.com/paritytech/txwrapper/tree/master/docs/globals.md) to see all available functions.\n\n## Contribute\n\nWe welcome contributions. Before submitting your PR, make sure to run the following commands:\n\n- `yarn docs`: Will generate docs based on code comments.\n- `yarn test`: Make sure all tests pass.\n- `yarn lint`: Make sure your code follows our linting rules. You can also run `yarn lint --fix` to automatically fix some of those errors.\n\n### Note for Maintainers\n\nAll the commits in this repo follow the [Conventional Commits spec](https://www.conventionalcommits.org/en/v1.0.0/#summary). When merging a PR, make sure 1/ to\nuse squash merge and 2/ that the title of the PR follows the Conventional Commits spec.\n\nThe history of commits will be used to generate the `CHANGELOG`. To do so, run `yarn deploy` on the master\nbranch. This command will look at all the commits since the latest tag, bump the package version according\nto semver rules, and generate a new `CHANGELOG`.\n\nIf you don't want to follow semver or need to do a dry run, consult the [`standard-version` CLI usage](https://github.com/conventional-changelog/standard-version#cli-usag)\ndocs. Flags for `standard-version` can be passed to `yarn deploy`.\n\n`yarn deploy`, which only does local operations and doesn't push anything, will output more or\nless the following lines:\n\n```bash\n$ yarn deploy\nyarn run v1.21.1\n$ yarn build \u0026\u0026 standard-version -r minor\n$ rimraf lib/ \u0026\u0026 tsc\n✔ bumping version in package.json from 0.3.2 to 0.4.0\n✔ outputting changes to CHANGELOG.md\n✔ committing package.json and CHANGELOG.md\n✔ tagging release v0.4.0\nℹ Run `git push --follow-tags origin master \u0026\u0026 npm publish` to publish\n```\n\nTo publish the new package, run: `git push --follow-tags origin master \u0026\u0026 npm publish.`\nYou must have access to the @substrate organization on npm to publish.\n\n### Roadmap\n\n- API revamp to clarify handling of `registry` and `metadataRpc`.\n\n#### Parachain support\n\n- Factor out utility functions and types (such as `decode`, `getRegistry`, `createMethod` etc) into a library for parachain\nteams that allows them to release and maintain txwrapper libraries specific to their parachains. This could be called\n`@substrate/txwrapper-core`. This lib will allow a parachain team to set up an offline signing lib with unit tests\nquickly and painlessly while allowing users access to a consistent `txwrapper` API across parachains.\n- While the core utility will be factored out to its own dependency, dispatchables from generic substrate methods\nwill be published in a package `@substrate/txwrapper-substrate` and Polkadot/Kusama specific dispatchables will be available in\n`@substrate/txwrapper-polkadot`. (This could be in a mono repo, but separate packages.) Parachains then create\ntheir own txwrapper lib using the `txwrapper-core` and publish it as `@{parachain-name}/txwrapper`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Ftxwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitytech%2Ftxwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Ftxwrapper/lists"}