How to set Contract Address in Ton Jetton transaction ? #4179
-
Discussed in #4171 |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 7 replies
-
Hi @devanshu6198, you don't need to specify the jetton master address explicitly, but your jetton wallet address as To convert your main TON address to a jetton wallet address, you can use val mainAddress = "UQBjKqthWBE6GEcqb_epTRFrQ1niS6Z1Z1MHMwR-mnAYRoYr" // Your main TON address
val mainAddressBoc = TONAddressConverter.toBoc(mainAddress)
assertEquals(mainAddressBoc, "te6cckEBAQEAJAAAQ4AMZVVsKwInQwjlTf71KaItaGs8SXTOrOpg5mCP004DCNAptHQU")
// Call `get_wallet_address` of the NOT Jetton contract (`EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT`):
// curl --location 'https://toncenter.com/api/v2/runGetMethod' --header 'Content-Type: application/json' --data \
// '{"address":"EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT","method":"get_wallet_address","method":"get_wallet_address","stack":[["tvm.Slice","te6cckEBAQEAJAAAQ4AMZVVsKwInQwjlTf71KaItaGs8SXTOrOpg5mCP004DCNAptHQU"]]}'
// Parse the `get_wallet_address` RPC response.
val jettonAddressBocEncoded = "te6cckEBAQEAJAAAQ4AFvT5rqwxcbKfITqnkwL+go4Zi9bulRHAtLt4cjjFdK7B8L+Cq"
val jettonAddress = TONAddressConverter.fromBoc(jettonAddressBocEncoded)
assertEquals(jettonAddress, "UQAt6fNdWGLjZT5CdU8mBf0FHDMXrd0qI4FpdvDkcYrpXV5H") |
Beta Was this translation helpful? Give feedback.
-
Here My Transaction is Continue failing toOwner = "UQAyi5L7thM59vwciZTIuhnD2WPOjmdmBSJcWb0xDpujdnpa" (Receiver). it is correct ? |
Beta Was this translation helpful? Give feedback.
-
val myJettonAddr = getJettonWalletAddr(myTonAddr)
val toOwnerJettonAddr = getJettonWalletAddr(toOwnerTonAddr)
val jettonTransfer = TheOpenNetwork.JettonTransfer.newBuilder()
.setJettonAmount(500 * 1000 * 1000)
.setToOwner(toOwnerJettonAddr)
.setResponseAddress(myTonAddr)
.setForwardAmount(1)
.build()
val transfer = TheOpenNetwork.Transfer.newBuilder()
.setDest(myJettonAddr)
.setAmount(100 * 1000 * 1000)
.setMode(TheOpenNetwork.SendMode.PAY_FEES_SEPARATELY_VALUE or TheOpenNetwork.SendMode.IGNORE_ACTION_PHASE_ERRORS_VALUE)
.setComment("test comment")
.setBounceable(true)
.setJettonTransfer(jettonTransfer) |
Beta Was this translation helpful? Give feedback.
-
Is there any method for first time send jetton token to new receiver address ? |
Beta Was this translation helpful? Give feedback.
-
@devanshu6198 I think there is no need to handle new receiver address specifically. Please test it carefully before delivering to the production |
Beta Was this translation helpful? Give feedback.
-
Can please you tell me what is problem in this transaction ? |
Beta Was this translation helpful? Give feedback.
-
JettonTransfer's destination is 0:328b92fbb61339f6fc1c8994c8ba19c3d963ce8e676605225c59bd310e9ba376, however it's a TON wallet, not a Jetton wallet |
Beta Was this translation helpful? Give feedback.
-
Thank You for your support |
Beta Was this translation helpful? Give feedback.
Hi @devanshu6198, you don't need to specify the jetton master address explicitly, but your jetton wallet address as
SigningInput.dest
. Please note thatJettonTransfer.toOwner
should be a recipient's jetton wallet address as well.To convert your main TON address to a jetton wallet address, you can use
TONConverter
module as at the example: