Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i send ton or jetton to an Uninit address? #76

Open
mideng2 opened this issue Dec 10, 2024 · 0 comments
Open

How can i send ton or jetton to an Uninit address? #76

mideng2 opened this issue Dec 10, 2024 · 0 comments

Comments

@mideng2
Copy link

mideng2 commented Dec 10, 2024

I want to active this 'to' address while i sent ton or token to it.
I can get a neededInit object like { data: Cell, code : Cell }, and send transfer like this code, but the 'to' address still keep uninit state.
image
image

     async sendTonTransfer(wallet, value, to) {
            const init = wallet.contract.init
            const contractDeployed = await tonClient.isContractDeployed(
                Address.parse(to)
            )

            let neededInit = null
            if (init && !contractDeployed) {
                neededInit = init
            }

            let seqno = await wallet.contract.getSeqno()
            let msgItem = internal({
                value,
                to,
                init: neededInit
            })
            await wallet.contract.sendTransfer({
                seqno,
                secretKey: wallet.keyPair.secretKey,
                messages: [msgItem]
            })
            return seqno
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant