File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import asyncio
2+ from pytoniq import LiteBalancer
3+ from pytoniq_core import begin_cell , Address
4+ from pytoniq .contract .wallets .wallet import WalletV4R2
5+
6+
7+ async def main ():
8+ async with LiteBalancer .from_testnet_config (trust_level = 2 ) as client :
9+ mnemo = []
10+ wallet = await WalletV4R2 .from_mnemonic (client , mnemo )
11+
12+ # deploy wallet if needed
13+ await wallet .deploy_via_external ()
14+
15+ await wallet .transfer (
16+ destination = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c' ,
17+ body = 'comment' ,
18+ amount = 1 * 10 ** 8 # 0.1 TON
19+ )
20+
21+ # or create message separately and then sign and send it
22+ message = wallet .create_wallet_internal_message (
23+ destination = Address ('EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c' ),
24+ send_mode = 3 ,
25+ body = begin_cell ().store_uint (0 , 32 ).store_snake_string ('comment' ).end_cell (),
26+ value = 1 * 10 ** 8 # 0.1 TON
27+ )
28+
29+ await wallet .raw_transfer (msgs = [message ])
30+
31+
32+ if __name__ == '__main__' :
33+ asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments