{
  "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91",
  "metadata": {
    "name": "rwa_vault",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "RWA vault program (per-asset token + payout custody)"
  },
  "instructions": [
    {
      "name": "approve_trading",
      "docs": [
        "Grant `delegate` (the market Asset PDA) authority to move the vault's RWA + payout",
        "token accounts — the EVM \"Vault approves Market\" allowance. Owner (multisig) only.",
        "Lets the market execute non-custodial buy/sell without custody leaving the vault."
      ],
      "discriminator": [
        250,
        99,
        1,
        208,
        197,
        1,
        134,
        7
      ],
      "accounts": [
        {
          "name": "owner",
          "signer": true
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "vault.mint",
                "account": "Vault"
              }
            ]
          }
        },
        {
          "name": "delegate"
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        }
      ],
      "args": []
    },
    {
      "name": "init_vault",
      "docs": [
        "Create the vault PDA for `mint`, owned by `owner` (the multisig).",
        "Mirrors VaultFactory.createVault(token, vaultOwner)."
      ],
      "discriminator": [
        77,
        79,
        85,
        150,
        33,
        217,
        52,
        106
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "mint"
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "owner",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "owner_withdraw",
      "docs": [
        "Withdraw custodied tokens (RWA inventory or payout liquidity) from a vault-owned",
        "token account to `destination`. Owner (multisig) only. Signed by the vault PDA.",
        "Mirrors VaultUpgradeable.ownerWithdrawPayment."
      ],
      "discriminator": [
        138,
        172,
        103,
        228,
        254,
        96,
        114,
        178
      ],
      "accounts": [
        {
          "name": "owner",
          "signer": true
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "vault.mint",
                "account": "Vault"
              }
            ]
          }
        },
        {
          "name": "token_mint",
          "docs": [
            "Mint of the token being withdrawn (may be the RWA mint OR the payout mint —",
            "a vault custodies both). Distinct from `vault.mint`, which is the vault's identity."
          ]
        },
        {
          "name": "vault_token_account",
          "writable": true
        },
        {
          "name": "destination",
          "writable": true
        },
        {
          "name": "token_program"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "Vault",
      "discriminator": [
        211,
        8,
        232,
        43,
        2,
        152,
        117,
        119
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "Unauthorized",
      "msg": "caller is not the vault owner"
    }
  ],
  "types": [
    {
      "name": "Vault",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    }
  ]
}