Go to the documentation for detailed information.
npm install ton-highload-wallet-contract --save
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,
})
],
});
You will need toncli for compilation.
Execute the commands below to check the compiled code.
toncli build
toncli fift run ./build/print.fif
Released under the MIT License.