Skip to content

Instantly share code, notes, and snippets.

@cordt-sei
Created August 13, 2024 15:25
Show Gist options
  • Save cordt-sei/14cdfa0c0d397a816dae20e6db676ba9 to your computer and use it in GitHub Desktop.
Save cordt-sei/14cdfa0c0d397a816dae20e6db676ba9 to your computer and use it in GitHub Desktop.

multisend

There are a bunch of different ways to use this depending on what tokens you are sending, and to which addresses. They can be combined if it is multiple coins to a single address.

[
  {
    "coins": [
      {
        "denom": "usei",
        "amount": "10000000000"
      }
    ],
    "address": "sei1sdwkgny20e7t5gv0533w4re5mukuusdkhmy433"
  },
  {
    "coins": [
      {
        "denom": "usei",
        "amount": "15000000000"
      }
    ],
    "address": "sei1x0k7s9w8m6f7fj5l4my0x7d7p8y3h0d9gkj5d7"
  },
  {
    "coins": [
      {
        "denom": "usei",
        "amount": "20000000000"
      }
    ],
    "address": "sei1p7fyktz8a3k5my5hy4m8r0st6u5y5vlkzzxj9f"
  },
  {
    "coins": [
      {
        "denom": "uatom",
        "amount": "5000000"
      }
    ],
    "address": "sei1sdwkgny20e7t5gv0533w4re5mukuusdkhmy433"
  },
  {
    "coins": [
      {
        "denom": "uatom",
        "amount": "10000000"
      }
    ],
    "address": "sei1x0k7s9w8m6f7fj5l4my0x7d7p8y3h0d9gkj5d7"
  },
  {
    "coins": [
      {
        "denom": "uosmo",
        "amount": "2500000000"
      }
    ],
    "address": "sei1p7fyktz8a3k5my5hy4m8r0st6u5y5vlkzzxj9f"
  },
  {
    "coins": [
      {
        "denom": "usei",
        "amount": "5000000000"
      },
      {
        "denom": "uatom",
        "amount": "3000000"
      }
    ],
    "address": "sei1r7dcvne90ljslyskpaf9u3tr5h9qv35g5x88yw"
  }
]

Explanation:

  1. Single Coin to Multiple Addresses:

    • The first three objects send usei to three different addresses with varying amounts.
  2. Different Coins to the Same Addresses:

    • The next three objects send uatom to the same three addresses. Each address receives a different amount of uatom.
  3. Different Coins to Different Addresses:

    • The last object sends both usei and uatom to a different address (sei1r7dcvne90ljslyskpaf9u3tr5h9qv35g5x88yw).
  4. Different Coins to Different Addresses:

    • One object sends uosmo to the third address (sei1p7fyktz8a3k5my5hy4m8r0st6u5y5vlkzzxj9f).

Summary:

  • This JSON structure covers all the scenarios you might need in one transaction: sending the same coin to multiple addresses, sending different coins to the same addresses, and sending different coins to different addresses.
  • The structure is flexible, allowing you to add as many coins and addresses as necessary.
  • The only limit theoretically is the max gas per block allowed by the chain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment