• Creates a Wallet V4 instance and provides a function to send transactions.

    This function initializes a Wallet V4 smart contract instance using the provided mnemonic and connects it to the specified TON network (mainnet or testnet). It also provides a send function to facilitate transaction execution.

    Parameters

    • tonClient: TonClient | TonClient4

      The TON client instance used to interact with the blockchain.

    • mnemonic: string[]

      The mnemonic phrase used to derive the wallet key pair.

    • network: "mainnet" | "testnet"

      The network where the wallet should be deployed.

    Returns Promise<
        {
            keyPair: KeyPair;
            send: (
                args: SenderArguments | SenderArguments[],
                options?: { sendMode?: SendMode; seqno?: number; timeout?: number },
            ) => Promise<string>;
            wallet: OpenedContract<WalletContractV4>;
        },
    >

    • An object containing:
      • keyPair: The derived key pair from the mnemonic.
      • wallet: The initialized Wallet V4 contract instance.
      • send: A function to send transactions using the wallet.
    const tonClient = new TonClient({endpoint: '...'});
    const wallet = await createWalletV4(tonClient, mnemonic, 'mainnet');
    const txHash = await wallet.send({ to: recipient, value: '1000000000' });