{
  "address": "Fy28CqdB1WtDJLdc18fDGKqvpG8HxtSiSG5HChdhR4nU",
  "metadata": {
    "name": "wormhole",
    "version": "0.0.0",
    "spec": "0.1.0"
  },
  "instructions": [
    {
      "name": "initialize",
      "docs": [
        "Initializes the `oracle_wormhole` account. Creates `oracle_wormhole` PDA and sets the `core_bridge_id`.",
        "`oracle_wormhole` PDA is used to store the chain identifier, the owner address, and the Wormhole core bridge program id."
      ],
      "discriminator": [
        175,
        175,
        109,
        31,
        13,
        152,
        155,
        237
      ],
      "accounts": [
        {
          "name": "deployer",
          "writable": true,
          "signer": true
        },
        {
          "name": "chain_id"
        },
        {
          "name": "oracle_wormhole",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101
                ]
              }
            ]
          }
        },
        {
          "name": "intents_protocol_program",
          "address": "LiFixdGLT5CMdLsHBvaijTXpPy4Uux9Y53SXkuR4HaK"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "core_bridge_id",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "receive",
      "docs": [
        "Receive attestation proofs from a remote oracle and register them",
        "locally by creating `attestation` accounts.",
        "Remaining accounts: exactly one writable destination attestation PDA per decoded VAA payload, in decoded payload order. No remaining-account signers or refund slots; the named signer funds account creation.",
        "Derive each address with the intents protocol program ID and seeds, in order: UTF-8 'attestation'; this program's oracle_wormhole state PDA (the attestator); the canonical chain ID as u128 little-endian, obtained by mapping the VAA emitter chain through the chain_mapping account (not the raw Wormhole chain ID); the 32-byte VAA emitter address (source); the 32-byte application from the decoded message; keccak256 of that payload."
      ],
      "discriminator": [
        86,
        17,
        255,
        171,
        17,
        17,
        187,
        219
      ],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "oracle_wormhole",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101
                ]
              }
            ]
          }
        },
        {
          "name": "core_bridge_program"
        },
        {
          "name": "posted_vaa"
        },
        {
          "name": "chain_mapping"
        },
        {
          "name": "intents_protocol_program",
          "address": "LiFixdGLT5CMdLsHBvaijTXpPy4Uux9Y53SXkuR4HaK"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "set_chain_mapping",
      "docs": [
        "Maps wormhole chain id to a configured custom chain id.",
        "Can only be called by the owner of the `oracle_wormhole` account.",
        "Each mapping may only be set once."
      ],
      "discriminator": [
        174,
        145,
        44,
        171,
        203,
        101,
        230,
        130
      ],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "oracle_wormhole",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101
                ]
              }
            ]
          }
        },
        {
          "name": "chain_mapping",
          "writable": true
        },
        {
          "name": "intents_protocol_program",
          "address": "LiFixdGLT5CMdLsHBvaijTXpPy4Uux9Y53SXkuR4HaK"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "protocol_chain_id",
          "type": "u128"
        },
        {
          "name": "chain_id",
          "type": "u128"
        }
      ]
    },
    {
      "name": "submit",
      "docs": [
        "Validates the proofs and posts a message via Wormhole.",
        "Remaining accounts: exactly [local_attestation_0, rent_refund_0, ..., local_attestation_N-1, rent_refund_N-1] in fill_descriptions order. Payloads must not be empty. Both accounts in every pair must be writable; no additional remaining-account signers.",
        "Each rent_refund must be the attestation's stored recipient. Executable recipients defer reclamation; keep both writable. The named submitter and fresh post_message account must sign; there is no additional filler-signature requirement."
      ],
      "discriminator": [
        88,
        166,
        102,
        181,
        162,
        127,
        170,
        48
      ],
      "accounts": [
        {
          "name": "submitter",
          "writable": true,
          "signer": true
        },
        {
          "name": "oracle_wormhole",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  119,
                  111,
                  114,
                  109,
                  104,
                  111,
                  108,
                  101
                ]
              }
            ]
          }
        },
        {
          "name": "post_message",
          "docs": [
            "Fresh client-generated account that the Wormhole core bridge creates and",
            "owns during the CPI. The core bridge requires the message account to sign,",
            "so it is declared as a `Signer`. Using a unique account per submit (instead",
            "of a shared, sequence-derived PDA) guarantees that independent or concurrent",
            "submits can never collide on the same address."
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "intents_protocol_program",
          "address": "LiFixdGLT5CMdLsHBvaijTXpPy4Uux9Y53SXkuR4HaK"
        },
        {
          "name": "core_bridge_program"
        },
        {
          "name": "wormhole_config",
          "writable": true
        },
        {
          "name": "wormhole_sequence",
          "writable": true
        },
        {
          "name": "wormhole_fee_collector",
          "writable": true
        },
        {
          "name": "clock",
          "address": "SysvarC1ock11111111111111111111111111111111"
        },
        {
          "name": "rent",
          "address": "SysvarRent111111111111111111111111111111111"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "source",
          "type": "pubkey"
        },
        {
          "name": "fill_descriptions",
          "type": {
            "vec": "bytes"
          }
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "ChainId",
      "discriminator": [
        203,
        146,
        201,
        161,
        230,
        71,
        157,
        218
      ]
    },
    {
      "name": "ChainMapping",
      "discriminator": [
        81,
        78,
        77,
        209,
        44,
        206,
        85,
        169
      ]
    },
    {
      "name": "OracleWormhole",
      "discriminator": [
        218,
        207,
        238,
        190,
        98,
        163,
        3,
        199
      ]
    }
  ],
  "errors": [
    {
      "code": 6800,
      "name": "WrongProgram",
      "msg": "Wrong program"
    },
    {
      "code": 6801,
      "name": "InvalidPostedVaa",
      "msg": "Invalid posted VAA data"
    },
    {
      "code": 6802,
      "name": "InvalidChainId",
      "msg": "Invalid chain id"
    },
    {
      "code": 6803,
      "name": "Unauthorized",
      "msg": "Unauthorized mapping creation"
    }
  ],
  "types": [
    {
      "name": "ChainId",
      "docs": [
        "Type used to store the chain id of the chain."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "chain_id",
            "type": "u128"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "ChainMapping",
      "docs": [
        "Type used to map a protocol chain identifier to a custom configured chain identifier."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "chain_id",
            "type": "u128"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "OracleWormhole",
      "docs": [
        "Represents the `Wormhole` oracle implementation type.",
        "Implements the `OracleBaseTrait`, `InputOracleBaseTrait` and `OutputOracleBaseTrait` traits.",
        "`core_bridge_id` is the program id of the Wormhole core bridge program.",
        "`owner` is the owner of the WormholeOracle. The only address to create mappings."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "core_bridge_id",
            "type": "pubkey"
          },
          {
            "name": "chain_id",
            "type": "u128"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "OutputProvenEvent",
      "docs": [
        "IDL-only mirror of the event emitted by `oracle_base`.",
        "",
        "The event is emitted from inside `oracle_base` (see `base.rs`), but",
        "Anchor's IDL generator only collects `#[event]` structs defined in the",
        "program crate itself, so without this mirror the event is silently absent",
        "from the published IDL. Anchor identifies an event by its name-derived",
        "discriminator (`sha256(\"event:<Name>\")[..8]`) and its borsh field layout,",
        "so an identical copy here yields the exact IDL entry for the event the",
        "base crate emits. The test below pins the mirror to the base-crate",
        "original byte-for-byte."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "chain_id",
            "type": "u128"
          },
          {
            "name": "remote_identifier",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "application",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "payload_hash",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          }
        ]
      }
    }
  ],
  "events": [
    {
      "name": "OutputProvenEvent",
      "discriminator": [
        85,
        190,
        185,
        8,
        90,
        48,
        3,
        214
      ]
    }
  ]
}
