Skip to content

Bulk importing actions

noah edited this page Apr 4, 2023 · 11 revisions

To bulk import actions, you can use the Bulk Import Actions action in the Advanced category: image

The JSON file (with extension .json) must be formatted with one top-level actions key, which is an array of actions, like this:

{
  "actions": [
    // INSERT ACTIONS HERE
  ]
}

An action looks like this:

{
  "key": "<ACTION KEY>",
  "data": {
    // INSERT ACTION DATA HERE
  }
}

The action keys can be found in @dao-dao/types/actions.ts in the CoreActionKey and AdapterActionKey enums. For example:

  • spend
  • mintNft
  • execute
  • mint

The data for an action is defined in its README.md, and the actions can be found in the following places:

Here are some common ones:

spend

For sending money from the treasury. amount and denom are in the base unit with no decimals. For example, if you want to spend 1 JUNO, since JUNO has 6 decimals, then amount should be "1000000" and denom should be ujuno. If this is confusing, please ask for help!

{
  "to": "<RECIPIENT ADDRESS>",
  "amount": "<TOKEN AMOUNT>",
  "denom": "<TOKEN DENOM>"
}

mintNft

For minting an NFT in a collection the DAO controls.

{
  "contractChosen": true,
  "collectionAddress": "<NFT COLLECTION ADDRESS>",
  "mintMsg": {
    "owner": "<RECIPIENT ADDRESS>",
    "token_id": "<UNIQUE TOKEN ID>",
    "token_uri": "<JSON METADATA URL>"
  }
}

mint

For minting governance tokens in a token-based DAO. amount is in the base unit with no decimals. For example, if you want to mint 1 governance token, and your governance token has 6 decimals (most likely it has 6), then amount should be "1000000". If this is confusing, please ask for help!

{
  "to": "<RECIPIENT ADDRESS>",
  "amount": "<TOKEN AMOUNT>"
}