{
  "address": "LiFixdGLT5CMdLsHBvaijTXpPy4Uux9Y53SXkuR4HaK",
  "metadata": {
    "name": "intents_protocol",
    "version": "0.0.0",
    "spec": "0.1.0"
  },
  "instructions": [
    {
      "name": "consume_local_attestation",
      "docs": [
        "Consume a local attestation, returning rent immediately unless its",
        "recorded recipient is executable. In that case preserve a consumed",
        "account for separate cleanup. Callable only by the consumer committed in the",
        "attestation's PDA seeds (directly, or via its local-consumer PDA when",
        "the committed consumer is a program id), and only with the exact",
        "`data_hash` and `timestamp` the attestation commits to — consuming an",
        "attestation therefore also validates it."
      ],
      "discriminator": [
        161,
        130,
        104,
        3,
        101,
        250,
        155,
        239
      ],
      "accounts": [
        {
          "name": "authority",
          "docs": [
            "The committed consumer, or its program's canonical local-consumer PDA."
          ],
          "signer": true
        },
        {
          "name": "local_attestation",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  99,
                  97,
                  108,
                  95,
                  97,
                  116,
                  116,
                  101,
                  115,
                  116,
                  97,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "arg",
                "path": "attestator"
              },
              {
                "kind": "arg",
                "path": "consumer"
              },
              {
                "kind": "arg",
                "path": "data_hash"
              }
            ]
          }
        },
        {
          "name": "rent_refund",
          "docs": [
            "client and CPI interfaces; executable recipients are never modified."
          ],
          "writable": true
        }
      ],
      "args": [
        {
          "name": "attestator",
          "type": "pubkey"
        },
        {
          "name": "consumer",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "data_hash",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "timestamp",
          "type": "u32"
        }
      ]
    },
    {
      "name": "create_attestation",
      "docs": [
        "Create an attestation for a remote chain."
      ],
      "discriminator": [
        49,
        24,
        67,
        80,
        12,
        249,
        96,
        239
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "attestator",
          "signer": true
        },
        {
          "name": "attestation",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  97,
                  116,
                  116,
                  101,
                  115,
                  116,
                  97,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "attestator"
              },
              {
                "kind": "arg",
                "path": "chain_id"
              },
              {
                "kind": "arg",
                "path": "source"
              },
              {
                "kind": "arg",
                "path": "application"
              },
              {
                "kind": "arg",
                "path": "payload_hash"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "chain_id",
          "type": "u128"
        },
        {
          "name": "source",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "application",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "payload_hash",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        }
      ]
    },
    {
      "name": "create_local_attestation",
      "docs": [
        "Create a local attestation based on the attestation data. The payer is",
        "recorded as the rent refund destination for later consumption."
      ],
      "discriminator": [
        80,
        127,
        2,
        116,
        84,
        21,
        190,
        38
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "attestator",
          "signer": true
        },
        {
          "name": "local_attestation",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  99,
                  97,
                  108,
                  95,
                  97,
                  116,
                  116,
                  101,
                  115,
                  116,
                  97,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "attestator"
              },
              {
                "kind": "arg",
                "path": "consumer"
              },
              {
                "kind": "arg",
                "path": "data_hash"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "consumer",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "data_hash",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "timestamp",
          "type": "u32"
        }
      ]
    },
    {
      "name": "reclaim_local_attestation_rent",
      "docs": [
        "Reclaim deferred rent from a consumed attestation. Anyone may call this;",
        "rent goes to the recorded payer unless that payer signs to authorize",
        "another destination. The destination must be non-executable."
      ],
      "discriminator": [
        124,
        240,
        79,
        198,
        173,
        188,
        63,
        76
      ],
      "accounts": [
        {
          "name": "local_attestation",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  99,
                  97,
                  108,
                  95,
                  97,
                  116,
                  116,
                  101,
                  115,
                  116,
                  97,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "arg",
                "path": "attestator"
              },
              {
                "kind": "arg",
                "path": "consumer"
              },
              {
                "kind": "arg",
                "path": "data_hash"
              }
            ]
          }
        },
        {
          "name": "rent_refund",
          "writable": true
        },
        {
          "name": "rent_refund_authority",
          "docs": [
            "Required only when returning rent to an address other than the payer.",
            "A payer converted into a program can still sign using its original key."
          ],
          "signer": true,
          "optional": true
        }
      ],
      "args": [
        {
          "name": "attestator",
          "type": "pubkey"
        },
        {
          "name": "consumer",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        },
        {
          "name": "data_hash",
          "type": {
            "array": [
              "u8",
              32
            ]
          }
        }
      ]
    },
    {
      "name": "set_chain_id",
      "docs": [
        "Set the chain id of the chain."
      ],
      "discriminator": [
        57,
        174,
        29,
        202,
        84,
        216,
        7,
        148
      ],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "chain_id",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  104,
                  97,
                  105,
                  110,
                  95,
                  105,
                  100
                ]
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "chain_id",
          "type": "u128"
        }
      ]
    },
    {
      "name": "set_chain_mapping",
      "docs": [
        "Set the real chain id for a protocol chain id.",
        "Dev:",
        "`protocol_chain_id` is the protocol chain identifier.",
        "`chain_id` is the real chain identifier."
      ],
      "discriminator": [
        174,
        145,
        44,
        171,
        203,
        101,
        230,
        130
      ],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "oracle",
          "signer": true
        },
        {
          "name": "chain_mapping",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  104,
                  97,
                  105,
                  110,
                  95,
                  109,
                  97,
                  112,
                  112,
                  105,
                  110,
                  103
                ]
              },
              {
                "kind": "account",
                "path": "oracle"
              },
              {
                "kind": "arg",
                "path": "protocol_chain_id"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "protocol_chain_id",
          "type": "u128"
        },
        {
          "name": "chain_id",
          "type": "u128"
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "Attestation",
      "discriminator": [
        152,
        125,
        183,
        86,
        36,
        146,
        121,
        73
      ]
    },
    {
      "name": "ChainId",
      "discriminator": [
        203,
        146,
        201,
        161,
        230,
        71,
        157,
        218
      ]
    },
    {
      "name": "ChainMapping",
      "discriminator": [
        81,
        78,
        77,
        209,
        44,
        206,
        85,
        169
      ]
    },
    {
      "name": "LocalAttestation",
      "discriminator": [
        173,
        247,
        101,
        168,
        96,
        238,
        17,
        22
      ]
    }
  ],
  "events": [
    {
      "name": "AttestationCreatedEvent",
      "discriminator": [
        157,
        10,
        208,
        90,
        87,
        62,
        175,
        26
      ]
    },
    {
      "name": "ChainIdConfiguredEvent",
      "discriminator": [
        92,
        39,
        243,
        11,
        30,
        97,
        80,
        219
      ]
    },
    {
      "name": "ChainMapConfiguredEvent",
      "discriminator": [
        157,
        35,
        137,
        206,
        200,
        100,
        92,
        171
      ]
    },
    {
      "name": "LocalAttestationConsumedEvent",
      "discriminator": [
        238,
        77,
        179,
        71,
        131,
        58,
        164,
        104
      ]
    },
    {
      "name": "LocalAttestationCreatedEvent",
      "discriminator": [
        173,
        59,
        45,
        101,
        206,
        241,
        125,
        25
      ]
    },
    {
      "name": "LocalAttestationRentDeferredEvent",
      "discriminator": [
        20,
        52,
        250,
        84,
        165,
        187,
        163,
        219
      ]
    },
    {
      "name": "LocalAttestationRentReclaimedEvent",
      "discriminator": [
        142,
        21,
        161,
        230,
        143,
        239,
        210,
        124
      ]
    }
  ],
  "errors": [
    {
      "code": 6100,
      "name": "InvalidOracle",
      "msg": "Invalid oracle"
    },
    {
      "code": 6101,
      "name": "InvalidLocalAttestationTimestamp",
      "msg": "Invalid local attestation timestamp"
    },
    {
      "code": 6102,
      "name": "InvalidChainMappingAccount",
      "msg": "Invalid chain mapping account"
    },
    {
      "code": 6103,
      "name": "InvalidLocalAttestationAccount",
      "msg": "Invalid local attestation account"
    },
    {
      "code": 6104,
      "name": "InvalidAttestationAccount",
      "msg": "Invalid attestation account"
    },
    {
      "code": 6105,
      "name": "InvalidChainIdAccount",
      "msg": "Invalid chain id account"
    },
    {
      "code": 6106,
      "name": "UnauthorizedLocalAttestationConsumer",
      "msg": "Signer is not the attestation's committed consumer"
    },
    {
      "code": 6107,
      "name": "InvalidRentRefundAccount",
      "msg": "Rent refund account does not match the stored rent refund"
    },
    {
      "code": 6108,
      "name": "LocalAttestationAlreadyConsumed",
      "msg": "Local attestation has already been consumed"
    },
    {
      "code": 6109,
      "name": "ExecutableRentRefundAccount",
      "msg": "Rent refund recipient is still executable"
    },
    {
      "code": 6110,
      "name": "LocalAttestationNotConsumed",
      "msg": "Local attestation has not been consumed"
    }
  ],
  "types": [
    {
      "name": "Attestation",
      "docs": [
        "Type used to indicate that some data from another chain data has been attested.",
        "It is derived from the attestation data as seeds"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "AttestationCreatedEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "attestator",
            "type": "pubkey"
          },
          {
            "name": "chain_id",
            "type": "u128"
          },
          {
            "name": "source",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "application",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "payload_hash",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          }
        ]
      }
    },
    {
      "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": "ChainIdConfiguredEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "chain_id_account_address",
            "type": "pubkey"
          },
          {
            "name": "chain_id",
            "type": "u128"
          }
        ]
      }
    },
    {
      "name": "ChainMapConfiguredEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "oracle",
            "type": "pubkey"
          },
          {
            "name": "protocol_chain_id",
            "type": "u128"
          },
          {
            "name": "chain_id",
            "type": "u128"
          }
        ]
      }
    },
    {
      "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": "LocalAttestation",
      "docs": [
        "Type used to indicate that some data has been attested by an attestator.",
        "It is derived from the local attestation data as seeds",
        "`timestamp` is the timestamp of the local attestation was created at.",
        "It is stored within the account since it cannot be known before creation.",
        "`rent_refund` is the payer that funded the account; it receives the lamports",
        "when consumed, or during deferred cleanup if that payer is executable."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "timestamp",
            "type": "u32"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "rent_refund",
            "type": "pubkey"
          },
          {
            "name": "consumed",
            "docs": [
              "Consumed proofs retain their rent until cleanup when the payer is executable."
            ],
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "LocalAttestationConsumedEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "attestator",
            "type": "pubkey"
          },
          {
            "name": "consumer",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "data_hash",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "rent_refund",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "LocalAttestationCreatedEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "attestator",
            "type": "pubkey"
          },
          {
            "name": "consumer",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "timestamp",
            "type": "u32"
          },
          {
            "name": "data_hash",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          }
        ]
      }
    },
    {
      "name": "LocalAttestationRentDeferredEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "local_attestation",
            "type": "pubkey"
          },
          {
            "name": "rent_refund",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "LocalAttestationRentReclaimedEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "local_attestation",
            "type": "pubkey"
          },
          {
            "name": "rent_refund",
            "type": "pubkey"
          }
        ]
      }
    }
  ]
}
