https://github.com/acalanetwork/txwrapper
https://github.com/acalanetwork/txwrapper
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/acalanetwork/txwrapper
- Owner: AcalaNetwork
- License: apache-2.0
- Created: 2021-06-25T06:27:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T03:14:14.000Z (almost 2 years ago)
- Last Synced: 2025-02-21T01:46:36.245Z (3 months ago)
- Language: TypeScript
- Size: 1010 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Acala Txwrapper is a library for generating offline transactions for the Acala chain.
## Get Started
```sh
yarn add @acala-network/txwrapper-acala
``````ts
import {
construct,
methods,
} from '@acala-network/txwrapper-acala';const unsigned = methods.currencies.transfer(
{
dest: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
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);// Construct signed transaction ready to be broadcasted.
const tx = construct.signedTx(unsigned, signature, { metadataRpc, registry });
```[See examples of how to use txwrapper-acala](https://github.com/AcalaNetwork/txwrapper/blob/master/examples/README.md)