All Projects → paritytech → txwrapper

paritytech / txwrapper

Licence: Apache-2.0 license
Helper funtions for offline transaction generation.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to txwrapper

mapsforge flutter
Offline maps as pure flutter code
Stars: ✭ 30 (-49.15%)
Mutual labels:  offline
ngx-online-status
🔛 Angular 5+ Detect online/offline state
Stars: ✭ 23 (-61.02%)
Mutual labels:  offline
picovoice
The end-to-end platform for building voice products at scale
Stars: ✭ 316 (+435.59%)
Mutual labels:  offline
react-rxdb-example
Anonymous chat app built with React, RxDB and PouchDB that works offline.
Stars: ✭ 37 (-37.29%)
Mutual labels:  offline
iot-edge-offline-dashboarding
Azure IoT Edge offline dashboarding/reporting sample. Guidance and sample dashboards
Stars: ✭ 31 (-47.46%)
Mutual labels:  offline
Husky
k8s 离线部署脚本
Stars: ✭ 33 (-44.07%)
Mutual labels:  offline
subwasm
Subwasm is a cli utility to help you know more about WASM Runtimes. It help downloading, inspecting and comparing Substrate based chains such as Polkadot or Kusama.
Stars: ✭ 53 (-10.17%)
Mutual labels:  polkadot
zx-ip-address
Deprecated
Stars: ✭ 96 (+62.71%)
Mutual labels:  offline
Acria-Oracle-Node-Qt
Acria Oracle Node Client implemented in C++/Qt
Stars: ✭ 15 (-74.58%)
Mutual labels:  polkadot
laravel-coming-soon
Laravel package to display Coming Soon page
Stars: ✭ 19 (-67.8%)
Mutual labels:  offline
vscode-move-ide
📝 Diem's Move language in VSCode
Stars: ✭ 23 (-61.02%)
Mutual labels:  polkadot
mapsplit
A fast way to split OSM data in to a portable tiled format
Stars: ✭ 55 (-6.78%)
Mutual labels:  offline
VSHD
No description or website provided.
Stars: ✭ 105 (+77.97%)
Mutual labels:  offline
polkascan-os
Polkascan Open Source
Stars: ✭ 52 (-11.86%)
Mutual labels:  polkadot
WindFarm
Information the Wind concept, spec and upcoming events
Stars: ✭ 23 (-61.02%)
Mutual labels:  offline
SwaggerOfflineDoc
基于SpringBoot和Swagger2生成离线文档:PDF和Html5格式
Stars: ✭ 42 (-28.81%)
Mutual labels:  offline
ares
Completely decentralized oracle protocol
Stars: ✭ 51 (-13.56%)
Mutual labels:  polkadot
universal-react-starter-kit
Universal React Starter Kit is an universal web application framework using koa, react, redux and webpack.
Stars: ✭ 13 (-77.97%)
Mutual labels:  offline
KeenASR-Android-PoC
A proof-of-concept app using KeenASR SDK on Android. WE ARE HIRING: https://keenresearch.com/careers.html
Stars: ✭ 21 (-64.41%)
Mutual labels:  offline
awesome-rhasspy
Carefully curated list of projects and resources for the voice assistant Rhasspy
Stars: ✭ 50 (-15.25%)
Mutual labels:  offline



@substrate/txwrapper

Helper funtions for offline transaction generation.

npm Github Actions apache-2.0 david-dm



DEPRECATION NOTICE

On 9 June 2021 this repo will stop being supported.

Please use 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.

If you are a chain builder looking to build a chain specific txwrapper please take a look at txwrapper-core and the guide for chain builders.

Get Started

yarn add @substrate/txwrapper

In a JS/TS file:

import {
  createSignedTx,
  createSigningPayload,
  methods,
} from '@substrate/txwrapper';

const unsigned = methods.balance.transfer(
  {
    dest: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP',
    value: 100,
  },
  {
    // Additional information needed to construct the transaction offline.
  }
);

const signingPayload = createSigningPayload(unsigned, { registry });
// On your offline device, sign the payload.
const signature = myOfflineSigning(signingPayload);

// `tx` is ready to be broadcasted.
const tx = createSignedTx(unsigned, signature, { metadataRpc, registry });

Have a look at the examples to see how you can perform the whole lifecycle of a transaction, from generation to signing to broadcast.

Go to documentation to see all available functions.

Contribute

We welcome contributions. Before submitting your PR, make sure to run the following commands:

  • yarn docs: Will generate docs based on code comments.
  • yarn test: Make sure all tests pass.
  • yarn lint: Make sure your code follows our linting rules. You can also run yarn lint --fix to automatically fix some of those errors.

Note for Maintainers

All the commits in this repo follow the Conventional Commits spec. When merging a PR, make sure 1/ to use squash merge and 2/ that the title of the PR follows the Conventional Commits spec.

The history of commits will be used to generate the CHANGELOG. To do so, run yarn deploy on the master branch. This command will look at all the commits since the latest tag, bump the package version according to semver rules, and generate a new CHANGELOG.

If you don't want to follow semver or need to do a dry run, consult the standard-version CLI usage docs. Flags for standard-version can be passed to yarn deploy.

yarn deploy, which only does local operations and doesn't push anything, will output more or less the following lines:

$ yarn deploy
yarn run v1.21.1
$ yarn build && standard-version -r minor
$ rimraf lib/ && tsc
✔ bumping version in package.json from 0.3.2 to 0.4.0
✔ outputting changes to CHANGELOG.md
✔ committing package.json and CHANGELOG.md
✔ tagging release v0.4.0
ℹ Run `git push --follow-tags origin master && npm publish` to publish

To publish the new package, run: git push --follow-tags origin master && npm publish. You must have access to the @substrate organization on npm to publish.

Roadmap

  • API revamp to clarify handling of registry and metadataRpc.

Parachain support

  • Factor out utility functions and types (such as decode, getRegistry, createMethod etc) into a library for parachain teams that allows them to release and maintain txwrapper libraries specific to their parachains. This could be called @substrate/txwrapper-core. This lib will allow a parachain team to set up an offline signing lib with unit tests quickly and painlessly while allowing users access to a consistent txwrapper API across parachains.
  • While the core utility will be factored out to its own dependency, dispatchables from generic substrate methods will be published in a package @substrate/txwrapper-substrate and Polkadot/Kusama specific dispatchables will be available in @substrate/txwrapper-polkadot. (This could be in a mono repo, but separate packages.) Parachains then create their own txwrapper lib using the txwrapper-core and publish it as @{parachain-name}/txwrapper.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].