ton-org / blueprint

TON development for professionals - all-in-one tool for writing, testing and deploying smart contracts
486 stars 97 forks source link

`Proveder.internal` dosen't send txn for wallet approvel #8

Closed anstill closed 1 year ago

anstill commented 1 year ago

Code example:

import { Address, toNano } from "ton-core";
import { NetworkProvider } from "@ton-community/blueprint";

export async function run(network: NetworkProvider) {
  const provider = network.provider(Address.parse("EQCsRPdF0OBVT9PqMuYIF9GQSoJjxTVEt1CyEYt2lDiofL9P"));
  const sender = network.sender();

  let args = {
    value: toNano("0.05"),
  };

  provider.internal(sender, args);
}

Console log:

yarn deploy
yarn run v1.22.19
$ cd src && blueprint run
? Choose file to use 
? Choose file to use test
? Which network do you want to use? 
  mainnet 
? Which network do you want to use? testnet
? Which wallet are you using? (Use arrow keys)
❯ TON Connect compatible mobile wallet (example: Tonkeeper) 
? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper)
Connected to wallet at address: EQBqZ484AjxqZ3GeRr7nEGA4a-7ig3U9X44P2fwX2_uz7Yyb
Sending transaction. Approve in your wallet...

✨  Done in 10.87s.

On Sending transaction. Approve in your wallet... txn should appear in Tonkeeper wallet but does not appear and the script ends automatically without waiting for confirmation. The same thing with the TonHub wallet.

Version: 0.2.0

krigga commented 1 year ago

Try adding await before provider.internal

anstill commented 1 year ago

Thanks, it's working, my bad