ton-highload-wallet-contract
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

TON Highload Wallet Contract

Go to the documentation for detailed information.

Installation

npm install ton-highload-wallet-contract --save

Usage

The first execution of the sendTransfer will make the wallet code deploy.

import { HighloadWalletContract, HighloadWalletContractV2 } from "ton-highload-wallet-contract";
import { mnemonicToPrivateKey } from "@ton/crypto";

// Create contract
const key = await mnemonicToPrivateKey(mnemonic.split(" "));
const contract = client.open(HighloadWalletContract.create({ publicKey: key.publicKey, workchain: 0 }));

// Send transfer
const seqno = await contract.getSeqno();
await contract.sendTransfer({
  seqno,
  secretKey: key.secretKey,
  messages: [
    internal({
      to: "EQBYivdc0GAk-nnczaMnYNuSjpeXu2nJS3DZ4KqLjosX5sVC",
      value: "0.2",
      body: "test 1",
      bounce: false,
    }),
    internal({
      to: "EQBYivdc0GAk-nnczaMnYNuSjpeXu2nJS3DZ4KqLjosX5sVC",
      value: "0.2",
      body: "test 2",
      bounce: false,
    })
  ],
});

Compile

You will need toncli for compilation.

Execute the commands below to check the compiled code.

toncli build
toncli fift run ./build/print.fif

License

Released under the MIT License.

Package Sidebar

Install

npm i ton-highload-wallet-contract

Weekly Downloads

21

Version

1.0.2

License

MIT

Unpacked Size

25.2 kB

Total Files

17

Last publish

Collaborators

  • ndatg