Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How do you send jettons programmatically?

How do I send jettons with TonWeb? Is there any other way to do it programmatically?


This question was imported from Telegram Chat: https://t.me/tondev_eng/8976

  
  
Posted one year ago
Votes Newest

Answers


The following is from a test file in tonweb. Here's the entire file. https://github.com/toncenter/tonweb/blob/master/src/test-jetton.js

It should be enough for your needs!

    const transfer = async () => {
        const seqno = (await wallet.methods.seqno().call()) || 0;
        console.log({seqno})

        console.log(
            await wallet.methods.transfer({
                secretKey: keyPair.secretKey,
                toAddress: JETTON_WALLET_ADDRESS,
                amount: TonWeb.utils.toNano('0.05'),
                seqno: seqno,
                payload: await jettonWallet.createTransferBody({
                    jettonAmount: TonWeb.utils.toNano('500'),
                    toAddress: new TonWeb.utils.Address(WALLET2_ADDRESS),
                    forwardAmount: TonWeb.utils.toNano('0.01'),
                    forwardPayload: new TextEncoder().encode('gift'),
                    responseAddress: walletAddress
                }),
                sendMode: 3,
            }).send()
        );
    }
3
3
Posted one year ago
Jeremy
404 × 5 Administrator
1
1

i have tried but always got error from Lite server

Aaron   6 months ago Report
  
  

I meet this problem when testing the code above
"TS2353: Object literal may only specify known properties, and jettonAmount does not exist in type TransferBodyParams"

No Name   3 months ago Report
11K Views
1 Answer
one year ago
one year ago
Tags