@acala-network/txwrapper-acala 中文文档教程

发布于 3年前 浏览 17 项目主页 更新于 3年前

About

Acala Txwrapper 是一个为 Acala 链生成离线交易的库。

Get Started

yarn add @acala-network/txwrapper-acala
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 });

查看如何使用 txwrapper-acala 的示例

About

Acala Txwrapper is a library for generating offline transactions for the Acala chain.

Get Started

yarn add @acala-network/txwrapper-acala
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

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文