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

update send txns #334

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion src/pages/mini-apps/commands/send-transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you need `setApprovalForAll` or are working with NFTs please reach out.

<Note type="info">

- Send transaction has a max payload size. Keep your abi small.
- Send transaction has a max payload size of 8kb. Keep your abi to just your function.
- Wrap all your arguments in strings to avoid overflow errors when passing to the SDK. We will auto parse your arguments to match the types in the ABI.

</Note>
Expand All @@ -68,6 +68,8 @@ If you need `setApprovalForAll` or are working with NFTs please reach out.
### Sending the transaction & receiving the response

```tsx {{ title: 'app/page.tsx' }}
// Make sure this is only the function you're calling
// Otherwise you will get an error
import DEXABI from '../../abi/DEX.json'
import { MiniKit } from '@worldcoin/minikit-js'

Expand Down Expand Up @@ -285,6 +287,56 @@ If you need `setApprovalForAll` or are working with NFTs please reach out.

</TabItem>

<TabItem label="ABI">

```tsx
[
{
"inputs": [
{
"components": [
{
"components": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"internalType": "struct ISignatureTransfer.TokenPermissions",
"name": "permitted",
"type": "tuple"
},
{ "internalType": "uint256", "name": "nonce", "type": "uint256" },
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
],
"internalType": "struct ISignatureTransfer.PermitTransferFrom",
"name": "permitTransferFrom",
"type": "tuple"
},
{
"components": [
{ "internalType": "address", "name": "to", "type": "address" },
{
"internalType": "uint256",
"name": "requestedAmount",
"type": "uint256"
}
],
"internalType": "struct ISignatureTransfer.SignatureTransferDetails",
"name": "transferDetails",
"type": "tuple"
},
{ "internalType": "bytes", "name": "signature", "type": "bytes" }
],
"name": "buyNFTWithPermit2",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

```

</TabItem>

</Tabs>

## Alternative: Verifying the transaction
Expand Down
Loading