forked from tonfactory/tonsdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
583 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,51 @@ | ||
from tonsdk_ng.contract.token.ft import JettonWallet | ||
from tonsdk_ng.utils import to_nano, bytes_to_b64str, Address | ||
from tonsdk_ng.contract.wallet import Wallets, WalletVersionEnum | ||
|
||
from tonsdk_ng.utils import Address, bytes_to_b64str, to_nano | ||
|
||
"""your wallet mnemonics""" | ||
mnemonics = ['always', 'crystal', 'grab', 'glance', 'cause', 'dismiss', 'answer', 'expose', 'once', 'session', | ||
'tunnel', 'topic', 'defense', 'such', 'army', 'smile', 'exhibit', 'misery', 'runway', 'tone', 'want', | ||
'primary', 'piano', 'language'] | ||
mnemonics, pub_k, priv_k, wallet = Wallets.from_mnemonics(mnemonics=mnemonics, version=WalletVersionEnum.v3r2, | ||
workchain=0) | ||
mnemonics = [ | ||
"always", | ||
"crystal", | ||
"grab", | ||
"glance", | ||
"cause", | ||
"dismiss", | ||
"answer", | ||
"expose", | ||
"once", | ||
"session", | ||
"tunnel", | ||
"topic", | ||
"defense", | ||
"such", | ||
"army", | ||
"smile", | ||
"exhibit", | ||
"misery", | ||
"runway", | ||
"tone", | ||
"want", | ||
"primary", | ||
"piano", | ||
"language", | ||
] | ||
mnemonics, pub_k, priv_k, wallet = Wallets.from_mnemonics( | ||
mnemonics=mnemonics, version=WalletVersionEnum.v3r2, workchain=0 | ||
) | ||
|
||
|
||
"""transfer""" | ||
body = JettonWallet().create_transfer_body( | ||
to_address=Address('address'), | ||
jetton_amount=to_nano(float('jettons amount'), 'ton'), | ||
) | ||
to_address=Address("address"), | ||
jetton_amount=to_nano(float("jettons amount"), "ton"), | ||
) | ||
|
||
query = wallet.create_transfer_message(to_addr='your jetton wallet address', | ||
amount=to_nano(0.1, 'ton'), | ||
seqno=int('wallet seqno'), | ||
payload=body) | ||
query = wallet.create_transfer_message( | ||
to_addr="your jetton wallet address", | ||
amount=to_nano(0.1, "ton"), | ||
seqno=int("wallet seqno"), | ||
payload=body, | ||
) | ||
|
||
"""then send boc to blockchain""" | ||
boc = bytes_to_b64str(query["message"].to_boc(False)) |
Oops, something went wrong.