# @substrate/txwrapper-polkadot

> Helper functions for Polkadot, Kusama, Paseo and Westend offline transaction generation.

Latest version **7.5.3** (published 2024-11-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @substrate/txwrapper-polkadot
pnpm add @substrate/txwrapper-polkadot
yarn add @substrate/txwrapper-polkadot
bun add @substrate/txwrapper-polkadot
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 7.5.3 |
| Published | 2024-11-26 |
| First published | 2021-02-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 62.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | Parity Technologies |
| Maintainers | bee344, tarikgul, marshacb, imod7 |

## Links

- npm: https://www.npmjs.com/package/@substrate/txwrapper-polkadot
- Repository: https://github.com/paritytech/txwrapper-core
- Homepage: https://github.com/paritytech/txwrapper-core/tree/master/packages/txwrapper-polkadot#readme
- Issues: https://github.com/paritytech/txwrapper-core/issues
- npm.io page: https://npm.io/package/@substrate/txwrapper-polkadot

## Dependencies (2)

- [@substrate/txwrapper-core](https://npm.io/package/@substrate/txwrapper-core.md) ^7.5.3
- [@substrate/txwrapper-substrate](https://npm.io/package/@substrate/txwrapper-substrate.md) ^7.5.3

## Recent versions

- 7.5.3 (latest) — 2024-11-26
- 0.1.1-beta.43 (canary) — 2021-02-15
- 7.5.2 — 2024-10-15
- 7.5.1 — 2024-06-18
- 7.5.0 — 2024-06-11
- 7.4.0 — 2024-04-25
- 7.3.0 — 2024-03-19
- 7.2.1 — 2024-02-29
- 7.2.0 — 2023-12-19
- 7.1.1 — 2023-10-23
- 7.1.0 — 2023-10-16
- 7.0.1 — 2023-07-04
- 7.0.0 — 2023-07-03
- 6.0.1 — 2023-05-25
- 6.0.0 — 2023-05-08
- … 75 more at https://npm.io/package/@substrate/txwrapper-polkadot/versions

## README

<br /><br />

<h1 align="center">@substrate/txwrapper-polkadot</h1>
<h4 align="center">Helper functions for Polkadot, Kusama, Paseo and Westend offline transaction generation.</h4>

<p align="center">
  <a href="https://www.npmjs.com/package/@substrate/txwrapper-polkadot">
    <img alt="npm" src="https://img.shields.io/npm/v/@substrate/txwrapper-polkadot.svg" />
  </a>
  <a href="https://github.com/paritytech/txwrapper-core/actions">
    <img alt="Github Actions" src="https://github.com/paritytech/txwrapper-core/workflows/pr/badge.svg" />
  </a>
  <a href="https://david-dm.org/paritytech/txwrapper-core">
    <img alt="david-dm" src="https://img.shields.io/david/paritytech/txwrapper-core.svg" />
  </a>
</p>

<br /><br />

# About

Txwrapper library for polkadot relay and system chains; specifically Polkadot, Kusama, Paseo, Westend, Asset Hub Polkadot and Asset Hub Kusama.

Note: not all methods available apply to all supported chains. To check what methods are supported by a chain consult the pallets included in chain's runtime.


## Get Started

```bash
yarn add @substrate/txwrapper-polkadot
```

In a JS/TS file:

```typescript
import {
  construct,
  methods,
} from '@substrate/txwrapper-polkadot';

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

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

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

Have a look at the [examples](/packages/txwrapper-examples/README.md) to see how you can perform the whole lifecycle of a transaction, from generation to signing to broadcast.

---
_Source: https://npm.io/package/@substrate/txwrapper-polkadot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
