OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Issue with Sending Text Message using sendMintNft Function

  • Thread starter Thread starter Volodymyr
  • Start date Start date
V

Volodymyr

Guest
Certainly! Below is a detailed description for Slack explaining the problem you're facing with sending a text message using the provided code, along with the code reference.


Issue with Sending Text Message using sendMintNft Function​


Hey

I am encountering an issue with sending a text message using the sendMintNft function in our smart contract. The function is intended to mint an NFT and send it along with some additional data. However, I am facing difficulties getting the text message to send correctly.

Function Code:​


Code:
async sendMintNft(provider: ContractProvider, via: Sender,
    opts: {
        value: bigint;
        queryId: number;
        amount: bigint;  // to send with nft
        itemIndex: number;
        itemOwnerAddress: Address;
        itemContent: Cell;
    }
) {
    const nftMessage = beginCell();
    nftMessage.storeAddress(opts.itemOwnerAddress)
    nftMessage.storeRef(opts.itemContent)
    await provider.internal(via, {
        value: opts.value,
        sendMode: SendMode.PAY_GAS_SEPARATELY,
        body: beginCell()
            .storeUint(0x05138d91,32)  // operation
            .storeUint(opts.queryId,64)
            .storeUint(opts.itemIndex,64)
            .storeCoins(opts.amount)
            .storeRef(nftMessage)  // body
        .endCell()
    })
}

Description:​


  1. Parameters:
    • provider: The contract provider instance.
    • via: The sender instance.
    • opts: An object containing various options like value, queryId, amount, itemIndex, itemOwnerAddress, and itemContent.

  2. Process:
    • The function begins by creating a cell to store the NFT message.
    • The itemOwnerAddress and itemContent are stored in this cell.
    • It then sends an internal message to the contract using the provider, including the value, send mode, and the body of the message.

  3. Issues Faced:
    • When trying to send a text message, the itemContent (which should include the text) does not seem to be processed or sent correctly.

Request for Assistance:​

  • I need help understanding why the text message is not being sent as expected.

Thank you!



Feel free to adjust the description based on any additional specifics or context you might want to include.

I attempted to use the sendMintNft function to mint an NFT and send a text message along with it. My goal was to include the text message within the itemContent parameter, which is stored as a cell reference in the NFT message.

<p>Certainly! Below is a detailed description for Slack explaining the problem you're facing with sending a text message using the provided code, along with the code reference.</p>
<hr />
<h3>Issue with Sending Text Message using sendMintNft Function</h3>
<p>Hey</p>
<p>I am encountering an issue with sending a text message using the <code>sendMintNft</code> function in our smart contract. The function is intended to mint an NFT and send it along with some additional data. However, I am facing difficulties getting the text message to send correctly.</p>
<h4>Function Code:</h4>
<pre class="lang-js prettyprint-override"><code>async sendMintNft(provider: ContractProvider, via: Sender,
opts: {
value: bigint;
queryId: number;
amount: bigint; // to send with nft
itemIndex: number;
itemOwnerAddress: Address;
itemContent: Cell;
}
) {
const nftMessage = beginCell();
nftMessage.storeAddress(opts.itemOwnerAddress)
nftMessage.storeRef(opts.itemContent)
await provider.internal(via, {
value: opts.value,
sendMode: SendMode.PAY_GAS_SEPARATELY,
body: beginCell()
.storeUint(0x05138d91,32) // operation
.storeUint(opts.queryId,64)
.storeUint(opts.itemIndex,64)
.storeCoins(opts.amount)
.storeRef(nftMessage) // body
.endCell()
})
}
</code></pre>
<h4>Description:</h4>
<ol>
<li><p><strong>Parameters:</strong></p>
<ul>
<li><code>provider</code>: The contract provider instance.</li>
<li><code>via</code>: The sender instance.</li>
<li><code>opts</code>: An object containing various options like value, queryId, amount, itemIndex, itemOwnerAddress, and itemContent.</li>
</ul>
</li>
<li><p><strong>Process:</strong></p>
<ul>
<li>The function begins by creating a cell to store the NFT message.</li>
<li>The <code>itemOwnerAddress</code> and <code>itemContent</code> are stored in this cell.</li>
<li>It then sends an internal message to the contract using the provider, including the value, send mode, and the body of the message.</li>
</ul>
</li>
<li><p><strong>Issues Faced:</strong></p>
<ul>
<li>When trying to send a text message, the <code>itemContent</code> (which should include the text) does not seem to be processed or sent correctly.</li>
</ul>
</li>
</ol>
<h4>Request for Assistance:</h4>
<ul>
<li>I need help understanding why the text message is not being sent as expected.</li>
</ul>
<p>Thank you!</p>
<hr />
<p>Feel free to adjust the description based on any additional specifics or context you might want to include.</p>
<p>I attempted to use the sendMintNft function to mint an NFT and send a text message along with it. My goal was to include the text message within the itemContent parameter, which is stored as a cell reference in the NFT message.</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top