diff --git a/.gitignore b/.gitignore index fe400dd2..d1efc723 100644 --- a/.gitignore +++ b/.gitignore @@ -17,14 +17,12 @@ !/CHANGELOG.md !/LICENSE !/README.md -!/downloadMappings.sh !/gradle.properties !/gradlew !/gradlew.bat !/main_net_programs.json !/release-please-config.json !/settings.gradle.kts -!/syncMappings.sh # Both reports idl-src-gen emits from one run: the movement events this run saw, and the # standing gap dashboard beside it. The gap file needs its own rule -- it is named by the @@ -35,6 +33,8 @@ !/idl-change-report.txt !/idl-change-report-gap.txt +### ix-mapper mapping configs, projected here by glamsystems/glam's public-repo sync ### + ### CI ### !/.github/ !/.github/** @@ -84,3 +84,5 @@ crash-* Crash_*.java *.hprof hs_err_pid*.log +!/mapping/ +!/mapping/** diff --git a/AGENTS.md b/AGENTS.md index 967b9e44..df6ea527 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,14 +39,19 @@ plus service components for operating against it. (`fulfillment/`), batched SQL (`db/sql/`), and instruction execution (`execution/`). - `examples/` — scratch/example module; not part of the hardening surface. -- `glam/` (untracked) — mapping configs from `glamsystems/ix-mapper-ts` at - the commit `./downloadMappings.sh` pins (`MAPPINGS_REF`); the sdk `jar` task - runs the script itself and embeds `glam/mapping-configs-v1` as - `glam/ix-mappings`, refusing to build or to write an archive without them. - `./syncMappings.sh [sha]` moves the pin; commit the pin change with the - jar it produces. +- `mapping/production/` and `mapping/staging/` (tracked) — the v1 + ix-mapper mapping configs, one file per source program, projected one way + from `glamsystems/glam` (`anchor_v1/ix-mapper`, generated there from the + managed IDL stores) by its public-repo sync, whose commits record the glam + commit. Never edit them here: a change lands in glam and arrives with the + next sync. The sdk's `processResources` embeds both sets as + `glam/ix-mappings/{production,staging}` beside a build-time `index.json`, + `jar` refuses an archive without them, and `EmbeddedMappings` / + `GlamAccounts.createMapper(factory)` read them back, so a consumer supplies + no directory. - `Integ.*` files are git-ignored scratch — present on a dev machine, absent - in CI. Never make anything depend on them. + in CI. Never make anything depend on them. `mapping/SOURCE` beside them names the glam commit + they were projected from; the sync writes it and the build reads it, never git history. ## Build & test @@ -560,10 +565,10 @@ skips it, so the two answer different halves. separate generated trees, and instruction layouts can differ between them. - The generated `gen` trees are large (hundreds of files); searches are much faster when scoped to the hand-written packages (`-not -path '*/gen/*'`). -- The sdk jar embeds the untracked `glam/mapping-configs-v1` directory and - materializes it itself at the pinned ix-mapper-ts commit; a jar without - `glam/ix-mappings/*.json` entries fails the `jar` task rather than - publishing empty, which is what every release before the pin did. +- The sdk jar embeds the tracked `mapping/production` and + `mapping/staging` sets as `glam/ix-mappings/{production,staging}` + with an index; a jar without them fails the `jar` task rather than + publishing empty, which is what every release before the embedding did. - Every long-running `services` loop (`BatchSqlExecutor`, `AccountFetcher`, `GlobalConfigCache`, `StakePoolCache`) takes a trailing `systems.glam.services.LoopHeartbeat` through a factory overload and ticks diff --git a/downloadMappings.sh b/downloadMappings.sh deleted file mode 100755 index b4379686..00000000 --- a/downloadMappings.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# -# Materializes the mapping configs the sdk jar embeds under glam/ix-mappings: a sparse -# checkout of glamsystems/ix-mapper-ts at the commit pinned below, into the untracked -# glam/ directory. The sdk jar task runs this itself, so a fresh clone and CI both build -# the same jar; the pin is what makes that jar a function of this repository's commit -# rather than of whatever ix-mapper-ts main held when the build ran. ./syncMappings.sh -# moves the pin. -# -# Idempotent: a glam/ already at the pinned commit is left alone. - -set -euo pipefail - -readonly MAPPINGS_REPO="https://github.com/glamsystems/ix-mapper-ts.git" -readonly MAPPINGS_REF="e067fb4c01987e25bde5473ec368a62191a758e7" - -cd "$(dirname "${BASH_SOURCE[0]}")" - -if [[ -d glam/mapping-configs-v1 && "$(git -C glam rev-parse HEAD 2>/dev/null || true)" == "$MAPPINGS_REF" ]]; then - exit 0 -fi - -rm -rf glam/ -git clone -q -n --depth=1 --filter=tree:0 "$MAPPINGS_REPO" glam -# GitHub serves any reachable commit by full sha, so the pin needs no branch or tag. -git -C glam fetch -q --depth=1 origin "$MAPPINGS_REF" -git -C glam sparse-checkout set --no-cone /mapping-configs-v1 /mapping-configs-v1-staging -git -C glam checkout -q "$MAPPINGS_REF" diff --git a/mapping/SOURCE b/mapping/SOURCE new file mode 100644 index 00000000..2988d499 --- /dev/null +++ b/mapping/SOURCE @@ -0,0 +1 @@ +glamsystems/glam@facb151c69ce26f8936acabc923fbd076f611b78 diff --git a/mapping/production/11111111111111111111111111111111.json b/mapping/production/11111111111111111111111111111111.json new file mode 100644 index 00000000..ac3208de --- /dev/null +++ b/mapping/production/11111111111111111111111111111111.json @@ -0,0 +1,41 @@ +{ + "program_id": "11111111111111111111111111111111", + "proxy_program_id": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "instructions": [ + { + "src_ix_name": "transfer", + "src_discriminator": [2, 0, 0, 0], + "dst_ix_name": "system_transfer", + "dst_discriminator": [167, 164, 195, 155, 219, 152, 191, 230], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "11111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 4] + } + ] +} diff --git a/mapping/production/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json b/mapping/production/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json new file mode 100644 index 00000000..2f5b0f18 --- /dev/null +++ b/mapping/production/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json @@ -0,0 +1,79 @@ +{ + "program_id": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "proxy_program_id": "G1NTcMDYgNLpDwgnrpSZvoSKQuR9NXG7S3DmtNQCDmrK", + "instructions": [ + { + "src_ix_name": "deposit_for_burn", + "src_discriminator": [215, 60, 61, 46, 114, 55, 128, 176], + "dst_ix_name": "deposit_for_burn", + "dst_discriminator": [215, 60, 61, 46, 114, 55, 128, 176], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC", + "index": 17, + "writable": false, + "signer": false + }, + { + "account": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "index": 18, + "writable": false, + "signer": false + }, + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 19, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, -1, 20, -1 + ] + } + ] +} diff --git a/mapping/production/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json b/mapping/production/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json new file mode 100644 index 00000000..040e79c0 --- /dev/null +++ b/mapping/production/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json @@ -0,0 +1,280 @@ +{ + "program_id": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "proxy_program_id": "G1NTkDEUR3pkEqGCKZtmtmVzCUEdYa86pezHkwYbLyde", + "instructions": [ + { + "src_ix_name": "harvest_reward", + "src_discriminator": [68, 200, 228, 233, 184, 32, 226, 188], + "dst_ix_name": "farms_harvest_reward", + "dst_discriminator": [244, 248, 124, 210, 194, 52, 75, 152], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + "program_id_placeholder_indices": [9] + }, + { + "src_ix_name": "initialize_user", + "src_discriminator": [111, 17, 185, 250, 60, 122, 38, 254], + "dst_ix_name": "farms_initialize_user", + "dst_discriminator": [188, 148, 82, 37, 44, 46, 162, 34], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 9, + "writable": false, + "signer": false + } + ], + "index_map": [-1, -1, -1, -1, 7, 8, -1, -1] + }, + { + "src_ix_name": "stake", + "src_discriminator": [206, 176, 202, 18, 200, 209, 179, 108], + "dst_ix_name": "farms_stake", + "dst_discriminator": [224, 105, 208, 179, 98, 200, 213, 238], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13], + "program_id_placeholder_indices": [6] + }, + { + "src_ix_name": "unstake", + "src_discriminator": [90, 95, 107, 42, 205, 124, 50, 225], + "dst_ix_name": "farms_unstake", + "dst_discriminator": [180, 131, 50, 144, 26, 242, 175, 242], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9], + "program_id_placeholder_indices": [3] + }, + { + "src_ix_name": "withdraw_unstaked_deposits", + "src_discriminator": [36, 102, 187, 49, 220, 36, 132, 67], + "dst_ix_name": "farms_withdraw_unstaked_deposits", + "dst_discriminator": [107, 97, 50, 15, 211, 245, 52, 96], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12] + } + ] +} diff --git a/mapping/production/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json b/mapping/production/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json new file mode 100644 index 00000000..a5976574 --- /dev/null +++ b/mapping/production/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json @@ -0,0 +1,514 @@ +{ + "program_id": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "proxy_program_id": "G1NTkDEUR3pkEqGCKZtmtmVzCUEdYa86pezHkwYbLyde", + "instructions": [ + { + "src_ix_name": "borrow_obligation_liquidity_v2", + "src_discriminator": [161, 128, 143, 245, 171, 199, 194, 6], + "dst_ix_name": "lending_borrow_obligation_liquidity_v2", + "dst_discriminator": [149, 226, 84, 157, 124, 178, 35, 122], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], + "program_id_placeholder_indices": [9, 12, 13] + }, + { + "src_ix_name": "deposit_reserve_liquidity_and_obligation_collateral_v2", + "src_discriminator": [216, 224, 191, 27, 204, 151, 102, 175], + "dst_ix_name": "lending_deposit_reserve_liquidity_and_obligation_collateral_v2", + "dst_discriminator": [33, 146, 50, 121, 127, 94, 92, 192], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 + ], + "program_id_placeholder_indices": [10, 14, 15] + }, + { + "src_ix_name": "init_obligation", + "src_discriminator": [251, 10, 231, 76, 27, 11, 159, 96], + "dst_ix_name": "lending_init_obligation", + "dst_discriminator": [188, 161, 62, 142, 106, 232, 77, 135], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 12, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 6, 7, 8, 9, 10, 11, -1, -1] + }, + { + "src_ix_name": "init_obligation_farms_for_reserve", + "src_discriminator": [136, 63, 15, 186, 211, 152, 168, 164], + "dst_ix_name": "lending_init_obligation_farms_for_reserve", + "dst_discriminator": [3, 234, 110, 39, 12, 147, 175, 185], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 14, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 15, + "writable": false, + "signer": false + } + ], + "index_map": [6, -1, 7, 8, 9, 10, 11, 12, 13, -1, -1] + }, + { + "src_ix_name": "init_user_metadata", + "src_discriminator": [117, 169, 176, 69, 197, 23, 15, 162], + "dst_ix_name": "lending_init_user_metadata", + "dst_discriminator": [68, 236, 138, 146, 124, 228, 247, 241], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 9, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 10, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 6, 7, 8, -1, -1], + "program_id_placeholder_indices": [3] + }, + { + "src_ix_name": "liquidate_obligation_and_redeem_reserve_collateral_v2", + "src_discriminator": [162, 161, 35, 143, 30, 187, 185, 103], + "dst_ix_name": "lending_liquidate_obligation_and_redeem_reserve_collateral_v2", + "dst_discriminator": [179, 45, 146, 167, 246, 239, 18, 242], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 + ], + "program_id_placeholder_indices": [20, 21, 22, 23] + }, + { + "src_ix_name": "repay_obligation_liquidity_v2", + "src_discriminator": [116, 174, 213, 76, 180, 53, 210, 144], + "dst_ix_name": "lending_repay_obligation_liquidity_v2", + "dst_discriminator": [79, 34, 126, 170, 174, 156, 174, 29], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], + "program_id_placeholder_indices": [9, 10] + }, + { + "src_ix_name": "request_elevation_group", + "src_discriminator": [36, 119, 251, 129, 34, 240, 7, 147], + "dst_ix_name": "lending_request_elevation_group", + "dst_discriminator": [162, 119, 197, 54, 246, 84, 55, 153], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8] + }, + { + "src_ix_name": "withdraw_obligation_collateral_and_redeem_reserve_collateral_v2", + "src_discriminator": [235, 52, 119, 152, 149, 197, 20, 7], + "dst_ix_name": "lending_withdraw_obligation_collateral_and_redeem_reserve_collateral_v2", + "dst_discriminator": [217, 223, 173, 35, 64, 225, 161, 222], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 + ], + "program_id_placeholder_indices": [10, 14, 15] + } + ] +} diff --git a/mapping/production/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json b/mapping/production/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json new file mode 100644 index 00000000..d37ffdb7 --- /dev/null +++ b/mapping/production/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json @@ -0,0 +1,115 @@ +{ + "program_id": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "proxy_program_id": "G1NTkDEUR3pkEqGCKZtmtmVzCUEdYa86pezHkwYbLyde", + "instructions": [ + { + "src_ix_name": "deposit", + "src_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dst_ix_name": "vaults_deposit", + "dst_discriminator": [124, 173, 191, 223, 48, 26, 84, 84], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + }, + { + "src_ix_name": "withdraw", + "src_discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "dst_ix_name": "vaults_withdraw", + "dst_discriminator": [12, 8, 236, 92, 134, 144, 196, 87], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 + ] + } + ] +} diff --git a/mapping/production/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json b/mapping/production/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json new file mode 100644 index 00000000..c0c8a1bf --- /dev/null +++ b/mapping/production/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json @@ -0,0 +1,112 @@ +{ + "program_id": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "proxy_program_id": "G1NTsQ36mjPe89HtPYqxKsjY5HmYsDR6CbD2gd2U2pta", + "instructions": [ + { + "src_ix_name": "close_account", + "src_discriminator": [9], + "dst_ix_name": "token_close_account", + "dst_discriminator": [240, 32, 179, 154, 96, 110, 43, 79], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1] + }, + { + "src_ix_name": "transfer_checked", + "src_discriminator": [12], + "dst_ix_name": "token_transfer_checked", + "dst_discriminator": [169, 178, 117, 156, 169, 191, 199, 116], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1] + } + ] +} diff --git a/mapping/production/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json b/mapping/production/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json new file mode 100644 index 00000000..3e62ca4a --- /dev/null +++ b/mapping/production/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json @@ -0,0 +1,112 @@ +{ + "program_id": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "proxy_program_id": "G1NTsQ36mjPe89HtPYqxKsjY5HmYsDR6CbD2gd2U2pta", + "instructions": [ + { + "src_ix_name": "close_account", + "src_discriminator": [9], + "dst_ix_name": "token_close_account", + "dst_discriminator": [240, 32, 179, 154, 96, 110, 43, 79], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1] + }, + { + "src_ix_name": "transfer_checked", + "src_discriminator": [12], + "dst_ix_name": "token_transfer_checked", + "dst_discriminator": [169, 178, 117, 156, 169, 191, 199, 116], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1] + } + ] +} diff --git a/mapping/staging/11111111111111111111111111111111.json b/mapping/staging/11111111111111111111111111111111.json new file mode 100644 index 00000000..5c51c7f4 --- /dev/null +++ b/mapping/staging/11111111111111111111111111111111.json @@ -0,0 +1,41 @@ +{ + "program_id": "11111111111111111111111111111111", + "proxy_program_id": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "instructions": [ + { + "src_ix_name": "transfer", + "src_discriminator": [2, 0, 0, 0], + "dst_ix_name": "system_transfer", + "dst_discriminator": [167, 164, 195, 155, 219, 152, 191, 230], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "11111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 4] + } + ] +} diff --git a/mapping/staging/1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78.json b/mapping/staging/1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78.json new file mode 100644 index 00000000..1173057f --- /dev/null +++ b/mapping/staging/1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78.json @@ -0,0 +1,1017 @@ +{ + "program_id": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "proxy_program_id": "gstgL6y4uWjsfM3Qjs5euoTDmEcXoUjqx8rkYJhYngG", + "instructions": [ + { + "src_ix_name": "borrow_principal", + "src_discriminator": [106, 10, 38, 204, 139, 188, 124, 50], + "dst_ix_name": "borrow_principal", + "dst_discriminator": [106, 10, 38, 204, 139, 188, 124, 50], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 14, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, 13, -1, 15, -1, 16, 17, -1] + }, + { + "src_ix_name": "close_loan", + "src_discriminator": [96, 114, 111, 204, 149, 228, 235, 124], + "dst_ix_name": "close_loan", + "dst_discriminator": [96, 114, 111, 204, 149, 228, 235, 124], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, -1, 9, 10, -1] + }, + { + "src_ix_name": "close_strategy", + "src_discriminator": [56, 247, 170, 246, 89, 221, 134, 200], + "dst_ix_name": "close_strategy", + "dst_discriminator": [56, 247, 170, 246, 89, 221, 134, 200], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 11, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, -1, -1, 12, 13, -1] + }, + { + "src_ix_name": "create_loan", + "src_discriminator": [166, 131, 118, 219, 138, 218, 206, 140], + "dst_ix_name": "create_loan", + "dst_discriminator": [166, 131, 118, 219, 138, 218, 206, 140], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, -1, 9, 10, -1] + }, + { + "src_ix_name": "create_strategy", + "src_discriminator": [152, 160, 107, 148, 245, 190, 127, 224], + "dst_ix_name": "create_strategy", + "dst_discriminator": [152, 160, 107, 148, 245, 190, 127, 224], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, 8, 9, 10, 11, -1, 12, 13, -1] + }, + { + "src_ix_name": "deposit_collateral", + "src_discriminator": [156, 131, 142, 116, 146, 247, 162, 120], + "dst_ix_name": "deposit_collateral", + "dst_discriminator": [156, 131, 142, 116, 146, 247, 162, 120], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 14, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, -1, 13, -1, 15, 16, -1] + }, + { + "src_ix_name": "deposit_strategy", + "src_discriminator": [246, 82, 57, 226, 131, 222, 253, 249], + "dst_ix_name": "deposit_strategy", + "dst_discriminator": [246, 82, 57, 226, 131, 222, 253, 249], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 14, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, 13, -1, -1, 15, 16, -1] + }, + { + "src_ix_name": "deposit_user_vault", + "src_discriminator": [204, 190, 182, 224, 15, 219, 247, 121], + "dst_ix_name": "deposit_user_vault", + "dst_discriminator": [204, 190, 182, 224, 15, 219, 247, 121], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 17, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 18, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, 19, 20, -1 + ] + }, + { + "src_ix_name": "repay_principal", + "src_discriminator": [229, 67, 83, 65, 77, 84, 80, 141], + "dst_ix_name": "repay_principal", + "dst_discriminator": [229, 67, 83, 65, 77, 84, 80, 141], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 14, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, 13, -1, 15, -1, 16, 17, -1] + }, + { + "src_ix_name": "sell_ledger", + "src_discriminator": [55, 17, 153, 148, 120, 242, 80, 5], + "dst_ix_name": "sell_ledger", + "dst_discriminator": [55, 17, 153, 148, 120, 242, 80, 5], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 17, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, 18, 19, 20, 21, -1 + ] + }, + { + "src_ix_name": "stake_user_vault_lp", + "src_discriminator": [114, 132, 194, 209, 208, 149, 43, 136], + "dst_ix_name": "stake_user_vault_lp", + "dst_discriminator": [114, 132, 194, 209, 208, 149, 43, 136], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 16, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 17, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, 18, 19, -1 + ] + }, + { + "src_ix_name": "unstake_user_vault_lp", + "src_discriminator": [83, 78, 230, 123, 226, 40, 158, 97], + "dst_ix_name": "unstake_user_vault_lp", + "dst_discriminator": [83, 78, 230, 123, 226, 40, 158, 97], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 15, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 16, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, 17, 18, -1] + }, + { + "src_ix_name": "update_strategy", + "src_discriminator": [16, 76, 138, 179, 171, 112, 196, 21], + "dst_ix_name": "update_strategy", + "dst_discriminator": [16, 76, 138, 179, 171, 112, 196, 21], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 11, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, -1, -1, 12, 13, 14, -1] + }, + { + "src_ix_name": "update_weight_matrix", + "src_discriminator": [252, 166, 37, 207, 154, 83, 187, 128], + "dst_ix_name": "update_weight_matrix", + "dst_discriminator": [252, 166, 37, 207, 154, 83, 187, 128], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, 8, 9] + }, + { + "src_ix_name": "withdraw_collateral", + "src_discriminator": [115, 135, 168, 106, 139, 214, 138, 150], + "dst_ix_name": "withdraw_collateral", + "dst_discriminator": [115, 135, 168, 106, 139, 214, 138, 150], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, -1, 11, 12, -1, 14, 15, -1] + }, + { + "src_ix_name": "withdraw_strategy", + "src_discriminator": [31, 45, 162, 5, 193, 217, 134, 188], + "dst_ix_name": "withdraw_strategy", + "dst_discriminator": [31, 45, 162, 5, 193, 217, 134, 188], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1, 8, 9, 10, 11, 12, -1, 14, -1, 15, 16, -1] + }, + { + "src_ix_name": "withdraw_user_vault", + "src_discriminator": [9, 80, 134, 138, 212, 20, 61, 42], + "dst_ix_name": "withdraw_user_vault", + "dst_discriminator": [9, 80, 134, 138, 212, 20, 61, 42], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "1oopBoJG58DgkUVKkEzKgyG9dvRmpgeEm1AVjoHkF78", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 17, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 18, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, 19, 20, -1 + ] + } + ] +} diff --git a/mapping/staging/BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU.json b/mapping/staging/BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU.json new file mode 100644 index 00000000..2ad2f051 --- /dev/null +++ b/mapping/staging/BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU.json @@ -0,0 +1,165 @@ +{ + "program_id": "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU", + "proxy_program_id": "gstgNyHgtURH7iuMn19GQczzv6Wc9fhPV2WDySZVyKx", + "instructions": [ + { + "src_ix_name": "close_user_bundle_account", + "src_discriminator": [201, 195, 126, 228, 9, 173, 79, 215], + "dst_ix_name": "close_user_bundle_account", + "dst_discriminator": [201, 195, 126, 228, 9, 173, 79, 215], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8] + }, + { + "src_ix_name": "initialize_bundle_depositor", + "src_discriminator": [126, 6, 242, 36, 22, 209, 35, 2], + "dst_ix_name": "initialize_bundle_depositor", + "dst_discriminator": [126, 6, 242, 36, 22, 209, 35, 2], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, -1, -1, 7, 8] + }, + { + "src_ix_name": "request_deposit", + "src_discriminator": [243, 202, 197, 215, 135, 97, 213, 109], + "dst_ix_name": "request_deposit", + "dst_discriminator": [243, 202, 197, 215, 135, 97, 213, 109], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1] + } + ] +} diff --git a/mapping/staging/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json b/mapping/staging/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json new file mode 100644 index 00000000..09455692 --- /dev/null +++ b/mapping/staging/CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe.json @@ -0,0 +1,79 @@ +{ + "program_id": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "proxy_program_id": "gstgxS9yTioViNKdsM4DC33k1TU9un2VCYDQK8fAeSA", + "instructions": [ + { + "src_ix_name": "deposit_for_burn", + "src_discriminator": [215, 60, 61, 46, 114, 55, 128, 176], + "dst_ix_name": "cctp_deposit_for_burn", + "dst_discriminator": [132, 90, 36, 35, 103, 197, 143, 91], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC", + "index": 17, + "writable": false, + "signer": false + }, + { + "account": "CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe", + "index": 18, + "writable": false, + "signer": false + }, + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 19, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, -1, 20, -1 + ] + } + ] +} diff --git a/mapping/staging/EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy.json b/mapping/staging/EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy.json new file mode 100644 index 00000000..302b28fb --- /dev/null +++ b/mapping/staging/EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy.json @@ -0,0 +1,112 @@ +{ + "program_id": "EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy", + "proxy_program_id": "gstgPL7r9aYedDDsXNtLpr4atYtNvY7zubAWWstqS3L", + "instructions": [ + { + "src_ix_name": "deposit", + "src_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dst_ix_name": "deposit", + "dst_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13] + }, + { + "src_ix_name": "withdraw", + "src_discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "dst_ix_name": "withdraw", + "dst_discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EMBERpYNE6ehWmXymZZS2skiFmCa9V5dp14e1iduM5qy", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13] + } + ] +} diff --git a/mapping/staging/EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih.json b/mapping/staging/EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih.json new file mode 100644 index 00000000..ce950375 --- /dev/null +++ b/mapping/staging/EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih.json @@ -0,0 +1,696 @@ +{ + "program_id": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "proxy_program_id": "gstgPL7r9aYedDDsXNtLpr4atYtNvY7zubAWWstqS3L", + "instructions": [ + { + "src_ix_name": "cancel_all", + "src_discriminator": [98, 191, 75, 220, 115, 40, 71, 237], + "dst_ix_name": "cancel_all", + "dst_discriminator": [98, 191, 75, 220, 115, 40, 71, 237], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "cancel_orders_by_id", + "src_discriminator": [234, 204, 126, 94, 222, 22, 141, 24], + "dst_ix_name": "cancel_orders_by_id", + "dst_discriminator": [234, 204, 126, 94, 222, 22, 141, 24], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "cancel_up_to", + "src_discriminator": [26, 209, 244, 253, 59, 175, 227, 54], + "dst_ix_name": "cancel_up_to", + "dst_discriminator": [26, 209, 244, 253, 59, 175, 227, 54], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "deposit_funds", + "src_discriminator": [202, 39, 52, 211, 53, 20, 250, 88], + "dst_ix_name": "deposit_funds", + "dst_discriminator": [202, 39, 52, 211, 53, 20, 250, 88], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "place_limit_order", + "src_discriminator": [108, 176, 33, 186, 146, 229, 1, 197], + "dst_ix_name": "place_limit_order", + "dst_discriminator": [108, 176, 33, 186, 146, 229, 1, 197], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "place_market_order", + "src_discriminator": [90, 118, 192, 252, 192, 99, 39, 145], + "dst_ix_name": "place_market_order", + "dst_discriminator": [90, 118, 192, 252, 192, 99, 39, 145], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "place_multi_limit_order", + "src_discriminator": [236, 208, 221, 172, 141, 226, 129, 84], + "dst_ix_name": "place_multi_limit_order", + "dst_discriminator": [236, 208, 221, 172, 141, 226, 129, 84], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16] + }, + { + "src_ix_name": "sync_parent_to_child", + "src_discriminator": [175, 137, 217, 11, 235, 39, 150, 19], + "dst_ix_name": "sync_parent_to_child", + "dst_discriminator": [175, 137, 217, 11, 235, 39, 150, 19], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, 11, 12, 13] + }, + { + "src_ix_name": "transfer_collateral", + "src_discriminator": [157, 163, 63, 27, 242, 72, 251, 97], + "dst_ix_name": "transfer_collateral", + "dst_discriminator": [157, 163, 63, 27, 242, 72, 251, 97], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15] + }, + { + "src_ix_name": "transfer_collateral_child_to_parent", + "src_discriminator": [51, 100, 177, 115, 139, 135, 247, 139], + "dst_ix_name": "transfer_collateral_child_to_parent", + "dst_discriminator": [51, 100, 177, 115, 139, 135, 247, 139], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, 11, 12, 13, 14, 15] + }, + { + "src_ix_name": "update_trader_state", + "src_discriminator": [249, 139, 82, 44, 126, 66, 133, 220], + "dst_ix_name": "update_trader_state", + "dst_discriminator": [249, 139, 82, 44, 126, 66, 133, 220], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, 11, 12, 13] + }, + { + "src_ix_name": "withdraw_funds", + "src_discriminator": [241, 36, 29, 111, 208, 31, 104, 217], + "dst_ix_name": "withdraw_funds", + "dst_discriminator": [241, 36, 29, 111, 208, 31, 104, 217], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 10, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18] + } + ] +} diff --git a/mapping/staging/ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7.json b/mapping/staging/ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7.json new file mode 100644 index 00000000..6359d196 --- /dev/null +++ b/mapping/staging/ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7.json @@ -0,0 +1,183 @@ +{ + "program_id": "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7", + "proxy_program_id": "gstgx5AbCFq4mfYKbZP23YDC7XZFUx2EURiG3PcWX6W", + "instructions": [ + { + "src_ix_name": "wrapper_buy_pt", + "src_discriminator": [29], + "dst_ix_name": "wrapper_buy_pt", + "dst_discriminator": [6, 127, 6, 136, 226, 194, 250, 168], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, -1, 14, 15, 16, -1] + }, + { + "src_ix_name": "wrapper_merge", + "src_discriminator": [39], + "dst_ix_name": "wrapper_merge", + "dst_discriminator": [177, 36, 171, 125, 89, 198, 144, 219], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 16, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, 17, 18, -1, 19, -1] + }, + { + "src_ix_name": "wrapper_sell_pt", + "src_discriminator": [30], + "dst_ix_name": "wrapper_sell_pt", + "dst_discriminator": [127, 65, 108, 12, 72, 21, 50, 200], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, -1, 14, 15, 16, -1] + } + ] +} diff --git a/mapping/staging/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json b/mapping/staging/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json new file mode 100644 index 00000000..0bbfb212 --- /dev/null +++ b/mapping/staging/FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.json @@ -0,0 +1,280 @@ +{ + "program_id": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "proxy_program_id": "gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq", + "instructions": [ + { + "src_ix_name": "harvest_reward", + "src_discriminator": [68, 200, 228, 233, 184, 32, 226, 188], + "dst_ix_name": "farms_harvest_reward", + "dst_discriminator": [244, 248, 124, 210, 194, 52, 75, 152], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + "program_id_placeholder_indices": [9] + }, + { + "src_ix_name": "initialize_user", + "src_discriminator": [111, 17, 185, 250, 60, 122, 38, 254], + "dst_ix_name": "farms_initialize_user", + "dst_discriminator": [188, 148, 82, 37, 44, 46, 162, 34], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 9, + "writable": false, + "signer": false + } + ], + "index_map": [-1, -1, -1, -1, 7, 8, -1, -1] + }, + { + "src_ix_name": "stake", + "src_discriminator": [206, 176, 202, 18, 200, 209, 179, 108], + "dst_ix_name": "farms_stake", + "dst_discriminator": [224, 105, 208, 179, 98, 200, 213, 238], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13], + "program_id_placeholder_indices": [6] + }, + { + "src_ix_name": "unstake", + "src_discriminator": [90, 95, 107, 42, 205, 124, 50, 225], + "dst_ix_name": "farms_unstake", + "dst_discriminator": [180, 131, 50, 144, 26, 242, 175, 242], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9], + "program_id_placeholder_indices": [3] + }, + { + "src_ix_name": "withdraw_unstaked_deposits", + "src_discriminator": [36, 102, 187, 49, 220, 36, 132, 67], + "dst_ix_name": "farms_withdraw_unstaked_deposits", + "dst_discriminator": [107, 97, 50, 15, 211, 245, 52, 96], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12] + } + ] +} diff --git a/mapping/staging/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json b/mapping/staging/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json new file mode 100644 index 00000000..d4b23ab6 --- /dev/null +++ b/mapping/staging/KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json @@ -0,0 +1,514 @@ +{ + "program_id": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "proxy_program_id": "gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq", + "instructions": [ + { + "src_ix_name": "borrow_obligation_liquidity_v2", + "src_discriminator": [161, 128, 143, 245, 171, 199, 194, 6], + "dst_ix_name": "lending_borrow_obligation_liquidity_v2", + "dst_discriminator": [149, 226, 84, 157, 124, 178, 35, 122], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], + "program_id_placeholder_indices": [9, 12, 13] + }, + { + "src_ix_name": "deposit_reserve_liquidity_and_obligation_collateral_v2", + "src_discriminator": [216, 224, 191, 27, 204, 151, 102, 175], + "dst_ix_name": "lending_deposit_reserve_liquidity_and_obligation_collateral_v2", + "dst_discriminator": [33, 146, 50, 121, 127, 94, 92, 192], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 + ], + "program_id_placeholder_indices": [10, 14, 15] + }, + { + "src_ix_name": "init_obligation", + "src_discriminator": [251, 10, 231, 76, 27, 11, 159, 96], + "dst_ix_name": "lending_init_obligation", + "dst_discriminator": [188, 161, 62, 142, 106, 232, 77, 135], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 12, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 13, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 6, 7, 8, 9, 10, 11, -1, -1] + }, + { + "src_ix_name": "init_obligation_farms_for_reserve", + "src_discriminator": [136, 63, 15, 186, 211, 152, 168, 164], + "dst_ix_name": "lending_init_obligation_farms_for_reserve", + "dst_discriminator": [3, 234, 110, 39, 12, 147, 175, 185], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 14, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 15, + "writable": false, + "signer": false + } + ], + "index_map": [6, -1, 7, 8, 9, 10, 11, 12, 13, -1, -1] + }, + { + "src_ix_name": "init_user_metadata", + "src_discriminator": [117, 169, 176, 69, 197, 23, 15, 162], + "dst_ix_name": "lending_init_user_metadata", + "dst_discriminator": [68, 236, 138, 146, 124, 228, 247, 241], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 9, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 10, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 6, 7, 8, -1, -1], + "program_id_placeholder_indices": [3] + }, + { + "src_ix_name": "liquidate_obligation_and_redeem_reserve_collateral_v2", + "src_discriminator": [162, 161, 35, 143, 30, 187, 185, 103], + "dst_ix_name": "lending_liquidate_obligation_and_redeem_reserve_collateral_v2", + "dst_discriminator": [179, 45, 146, 167, 246, 239, 18, 242], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 + ], + "program_id_placeholder_indices": [20, 21, 22, 23] + }, + { + "src_ix_name": "repay_obligation_liquidity_v2", + "src_discriminator": [116, 174, 213, 76, 180, 53, 210, 144], + "dst_ix_name": "lending_repay_obligation_liquidity_v2", + "dst_discriminator": [79, 34, 126, 170, 174, 156, 174, 29], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], + "program_id_placeholder_indices": [9, 10] + }, + { + "src_ix_name": "request_elevation_group", + "src_discriminator": [36, 119, 251, 129, 34, 240, 7, 147], + "dst_ix_name": "lending_request_elevation_group", + "dst_discriminator": [162, 119, 197, 54, 246, 84, 55, 153], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8] + }, + { + "src_ix_name": "withdraw_obligation_collateral_and_redeem_reserve_collateral_v2", + "src_discriminator": [235, 52, 119, 152, 149, 197, 20, 7], + "dst_ix_name": "lending_withdraw_obligation_collateral_and_redeem_reserve_collateral_v2", + "dst_discriminator": [217, 223, 173, 35, 64, 225, 161, 222], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 + ], + "program_id_placeholder_indices": [10, 14, 15] + } + ] +} diff --git a/mapping/staging/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json b/mapping/staging/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json new file mode 100644 index 00000000..404870be --- /dev/null +++ b/mapping/staging/KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd.json @@ -0,0 +1,115 @@ +{ + "program_id": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "proxy_program_id": "gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq", + "instructions": [ + { + "src_ix_name": "deposit", + "src_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dst_ix_name": "vaults_deposit", + "dst_discriminator": [124, 173, 191, 223, 48, 26, 84, 84], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + }, + { + "src_ix_name": "withdraw", + "src_discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "dst_ix_name": "vaults_withdraw", + "dst_discriminator": [12, 8, 236, 92, 134, 144, 196, 87], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 + ] + } + ] +} diff --git a/mapping/staging/MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA.json b/mapping/staging/MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA.json new file mode 100644 index 00000000..2ca6805e --- /dev/null +++ b/mapping/staging/MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA.json @@ -0,0 +1,438 @@ +{ + "program_id": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "proxy_program_id": "gstgMghFitRBz2GXKwgpMd7L1JXd1sg59q2v5Y83vSY", + "instructions": [ + { + "src_ix_name": "kamino_deposit", + "src_discriminator": [237, 8, 188, 187, 115, 99, 49, 85], + "dst_ix_name": "kamino_deposit", + "dst_discriminator": [237, 8, 188, 187, 115, 99, 49, 85], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, 8, -1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27 + ], + "program_id_placeholder_indices": [15, 16] + }, + { + "src_ix_name": "kamino_withdraw", + "src_discriminator": [199, 101, 41, 45, 213, 98, 224, 200], + "dst_ix_name": "kamino_withdraw", + "dst_discriminator": [199, 101, 41, 45, 213, 98, 224, 200], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, 8, -1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27 + ], + "program_id_placeholder_indices": [15, 16] + }, + { + "src_ix_name": "lending_account_borrow", + "src_discriminator": [4, 126, 116, 53, 48, 5, 212, 31], + "dst_ix_name": "lending_account_borrow", + "dst_discriminator": [4, 126, 116, 53, 48, 5, 212, 31], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, -1, 9, 10, 11, 12, 13] + }, + { + "src_ix_name": "lending_account_deposit", + "src_discriminator": [171, 94, 235, 103, 82, 64, 212, 140], + "dst_ix_name": "lending_account_deposit", + "dst_discriminator": [171, 94, 235, 103, 82, 64, 212, 140], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, -1, 9, 10, 11, 12] + }, + { + "src_ix_name": "lending_account_repay", + "src_discriminator": [79, 209, 172, 177, 222, 51, 173, 151], + "dst_ix_name": "lending_account_repay", + "dst_discriminator": [79, 209, 172, 177, 222, 51, 173, 151], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, -1, 9, 10, 11, 12] + }, + { + "src_ix_name": "lending_account_withdraw", + "src_discriminator": [36, 72, 74, 19, 210, 210, 192, 192], + "dst_ix_name": "lending_account_withdraw", + "dst_discriminator": [36, 72, 74, 19, 210, 210, 192, 192], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, -1, 9, 10, 11, 12, 13] + }, + { + "src_ix_name": "marginfi_account_close", + "src_discriminator": [186, 221, 93, 34, 50, 97, 194, 241], + "dst_ix_name": "marginfi_account_close", + "dst_discriminator": [186, 221, 93, 34, 50, 97, 194, 241], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1] + }, + { + "src_ix_name": "marginfi_account_initialize_pda", + "src_discriminator": [87, 177, 91, 80, 218, 119, 245, 31], + "dst_ix_name": "marginfi_account_initialize_pda", + "dst_discriminator": [87, 177, 91, 80, 218, 119, 245, 31], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, -1, -1, 9, -1] + } + ] +} diff --git a/mapping/staging/MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD.json b/mapping/staging/MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD.json new file mode 100644 index 00000000..d7b24bc6 --- /dev/null +++ b/mapping/staging/MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD.json @@ -0,0 +1,224 @@ +{ + "program_id": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD", + "proxy_program_id": "gstgmvM2o7h7GcScvXymH1oFgWskukWWxRHC1UJJ9FJ", + "instructions": [ + { + "src_ix_name": "deposit", + "src_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dst_ix_name": "deposit", + "dst_discriminator": [242, 35, 198, 137, 82, 225, 242, 182], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, 11, 12, -1, 13, 14, -1, 15] + }, + { + "src_ix_name": "deposit_stake_account", + "src_discriminator": [110, 130, 115, 41, 164, 102, 2, 59], + "dst_ix_name": "deposit_stake_account", + "dst_discriminator": [110, 130, 115, 41, 164, 102, 2, 59], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 16, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, -1, 11, -1, 12, 13, 14, 15, -1, -1, 17, 18] + }, + { + "src_ix_name": "liquid_unstake", + "src_discriminator": [30, 30, 119, 240, 191, 227, 12, 16], + "dst_ix_name": "liquid_unstake", + "dst_discriminator": [30, 30, 119, 240, 191, 227, 12, 16], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, 11, 12, -1, -1, -1, 13] + }, + { + "src_ix_name": "withdraw_stake_account", + "src_discriminator": [211, 85, 184, 65, 183, 177, 233, 217], + "dst_ix_name": "withdraw_stake_account", + "dst_discriminator": [211, 85, 184, 65, 183, 177, 233, 217], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1, 10, 11, 12, 13, 14, 15, 16, -1, 17, -1, 18, 19] + } + ] +} diff --git a/mapping/staging/Stake11111111111111111111111111111111111111.json b/mapping/staging/Stake11111111111111111111111111111111111111.json new file mode 100644 index 00000000..3a72fbe3 --- /dev/null +++ b/mapping/staging/Stake11111111111111111111111111111111111111.json @@ -0,0 +1,223 @@ +{ + "program_id": "Stake11111111111111111111111111111111111111", + "proxy_program_id": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "instructions": [ + { + "src_ix_name": "authorize", + "src_discriminator": [1, 0, 0, 0], + "dst_ix_name": "stake_authorize", + "dst_discriminator": [127, 247, 88, 164, 201, 0, 79, 7], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "Stake11111111111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + }, + { + "account": "SysvarC1ock11111111111111111111111111111111", + "index": 5, + "writable": false, + "signer": false + } + ], + "index_map": [4, -1, -1] + }, + { + "src_ix_name": "deactivate", + "src_discriminator": [5, 0, 0, 0], + "dst_ix_name": "stake_deactivate", + "dst_discriminator": [224, 10, 93, 175, 175, 145, 237, 169], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": false, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "Stake11111111111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + }, + { + "account": "SysvarC1ock11111111111111111111111111111111", + "index": 5, + "writable": false, + "signer": false + } + ], + "index_map": [4, -1] + }, + { + "src_ix_name": "merge", + "src_discriminator": [7, 0, 0, 0], + "dst_ix_name": "stake_merge", + "dst_discriminator": [46, 181, 125, 12, 51, 179, 134, 176], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "Stake11111111111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + }, + { + "account": "SysvarC1ock11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "SysvarStakeHistory1111111111111111111111111", + "index": 7, + "writable": false, + "signer": false + } + ], + "index_map": [4, 5, -1] + }, + { + "src_ix_name": "split", + "src_discriminator": [3, 0, 0, 0], + "dst_ix_name": "stake_split", + "dst_discriminator": [63, 128, 169, 206, 158, 60, 135, 48], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "Stake11111111111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + } + ], + "index_map": [4, 5, -1] + }, + { + "src_ix_name": "withdraw", + "src_discriminator": [4, 0, 0, 0], + "dst_ix_name": "stake_withdraw", + "dst_discriminator": [199, 13, 168, 20, 92, 151, 29, 56], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + } + ], + "static_accounts": [ + { + "account": "Stake11111111111111111111111111111111111111", + "index": 3, + "writable": false, + "signer": false + }, + { + "account": "SysvarC1ock11111111111111111111111111111111", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "SysvarStakeHistory1111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 7, + "writable": false, + "signer": false + } + ], + "index_map": [4, -1, -1, -1] + } + ] +} diff --git a/mapping/staging/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json b/mapping/staging/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json new file mode 100644 index 00000000..e3245da3 --- /dev/null +++ b/mapping/staging/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.json @@ -0,0 +1,112 @@ +{ + "program_id": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "proxy_program_id": "gstgs9nJgX8PmRHWAAEP9H7xT3ZkaPWSGPYbj3mXdTa", + "instructions": [ + { + "src_ix_name": "close_account", + "src_discriminator": [9], + "dst_ix_name": "token_close_account", + "dst_discriminator": [240, 32, 179, 154, 96, 110, 43, 79], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1] + }, + { + "src_ix_name": "transfer_checked", + "src_discriminator": [12], + "dst_ix_name": "token_transfer_checked", + "dst_discriminator": [169, 178, 117, 156, 169, 191, 199, 116], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1] + } + ] +} diff --git a/mapping/staging/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json b/mapping/staging/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json new file mode 100644 index 00000000..2ea7ed23 --- /dev/null +++ b/mapping/staging/TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.json @@ -0,0 +1,112 @@ +{ + "program_id": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "proxy_program_id": "gstgs9nJgX8PmRHWAAEP9H7xT3ZkaPWSGPYbj3mXdTa", + "instructions": [ + { + "src_ix_name": "close_account", + "src_discriminator": [9], + "dst_ix_name": "token_close_account", + "dst_discriminator": [240, 32, 179, 154, 96, 110, 43, 79], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, -1] + }, + { + "src_ix_name": "transfer_checked", + "src_discriminator": [12], + "dst_ix_name": "token_transfer_checked", + "dst_discriminator": [169, 178, 117, 156, 169, 191, 199, 116], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, -1] + } + ] +} diff --git a/mapping/staging/jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9.json b/mapping/staging/jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9.json new file mode 100644 index 00000000..5900adb0 --- /dev/null +++ b/mapping/staging/jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9.json @@ -0,0 +1,274 @@ +{ + "program_id": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9", + "proxy_program_id": "gstgJbGqoE3p1SdFA2dET9tcaCzNqGcdD8wpbGctnU9", + "instructions": [ + { + "src_ix_name": "mint", + "src_discriminator": [51, 57, 225, 47, 182, 146, 137, 166], + "dst_ix_name": "earn_mint", + "dst_discriminator": [248, 245, 116, 167, 84, 254, 78, 58], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC", + "index": 18, + "writable": true, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 21, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, -1 + ] + }, + { + "src_ix_name": "mint_with_max_assets", + "src_discriminator": [6, 94, 69, 122, 30, 179, 146, 171], + "dst_ix_name": "earn_mint_with_max_assets", + "dst_discriminator": [180, 177, 204, 33, 230, 193, 220, 69], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC", + "index": 18, + "writable": true, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 21, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, -1 + ] + }, + { + "src_ix_name": "redeem", + "src_discriminator": [184, 12, 86, 149, 70, 196, 97, 225], + "dst_ix_name": "earn_redeem", + "dst_discriminator": [93, 162, 58, 1, 75, 18, 212, 66], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC", + "index": 19, + "writable": true, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 22, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, -1, -1 + ] + }, + { + "src_ix_name": "redeem_with_min_amount_out", + "src_discriminator": [235, 189, 237, 56, 166, 180, 184, 149], + "dst_ix_name": "earn_redeem_with_min_amount_out", + "dst_discriminator": [204, 196, 159, 42, 52, 107, 134, 153], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC", + "index": 19, + "writable": true, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 22, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, -1, -1 + ] + } + ] +} diff --git a/mapping/staging/jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi.json b/mapping/staging/jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi.json new file mode 100644 index 00000000..cba482ca --- /dev/null +++ b/mapping/staging/jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi.json @@ -0,0 +1,158 @@ +{ + "program_id": "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi", + "proxy_program_id": "gstgJbGqoE3p1SdFA2dET9tcaCzNqGcdD8wpbGctnU9", + "instructions": [ + { + "src_ix_name": "init_position", + "src_discriminator": [197, 20, 10, 1, 97, 160, 177, 91], + "dst_ix_name": "borrow_init_position", + "dst_discriminator": [92, 209, 176, 14, 75, 243, 107, 230], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 14, + "writable": false, + "signer": false + }, + { + "account": "Sysvar1nstructions1111111111111111111111111", + "index": 15, + "writable": false, + "signer": false + }, + { + "account": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "index": 16, + "writable": false, + "signer": false + }, + { + "account": "SysvarRent111111111111111111111111111111111", + "index": 17, + "writable": false, + "signer": false + } + ], + "index_map": [-1, 7, 8, 9, 10, 11, 12, 13, -1, -1, -1, -1, -1] + }, + { + "src_ix_name": "operate", + "src_discriminator": [217, 106, 208, 99, 116, 151, 42, 135], + "dst_ix_name": "borrow_operate", + "dst_discriminator": [46, 121, 58, 48, 13, 5, 117, 188], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC", + "index": 35, + "writable": false, + "signer": false + }, + { + "account": "jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc", + "index": 36, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 39, + "writable": false, + "signer": false + } + ], + "index_map": [ + -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, -1, 37, 38, -1, -1 + ], + "program_id_placeholder_indices": [3, 4, 5, 26, 27] + } + ] +} diff --git a/mapping/staging/whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc.json b/mapping/staging/whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc.json new file mode 100644 index 00000000..d97566c1 --- /dev/null +++ b/mapping/staging/whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc.json @@ -0,0 +1,497 @@ +{ + "program_id": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "proxy_program_id": "gstgo1EgmTp2PbLSaL6Qg57P7uADx3aiRZrMsewEdSy", + "instructions": [ + { + "src_ix_name": "collect_fees_v2", + "src_discriminator": [207, 117, 95, 191, 229, 180, 226, 15], + "dst_ix_name": "collect_fees_v2", + "dst_discriminator": [207, 117, 95, 191, 229, 180, 226, 15], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + }, + { + "src_ix_name": "collect_reward_v2", + "src_discriminator": [177, 107, 37, 180, 160, 19, 49, 209], + "dst_ix_name": "collect_reward_v2", + "dst_discriminator": [177, 107, 37, 180, 160, 19, 49, 209], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, 8, 9, 10, 11, 12, 13, 14] + }, + { + "src_ix_name": "decrease_liquidity_v2", + "src_discriminator": [58, 127, 188, 62, 79, 82, 196, 96], + "dst_ix_name": "decrease_liquidity_v2", + "dst_discriminator": [58, 127, 188, 62, 79, 82, 196, 96], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + }, + { + "src_ix_name": "increase_liquidity_by_token_amounts_v2", + "src_discriminator": [239, 251, 9, 124, 210, 198, 53, 43], + "dst_ix_name": "increase_liquidity_by_token_amounts_v2", + "dst_discriminator": [239, 251, 9, 124, 210, 198, 53, 43], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + }, + { + "src_ix_name": "increase_liquidity_v2", + "src_discriminator": [133, 29, 89, 223, 69, 238, 176, 10], + "dst_ix_name": "increase_liquidity_v2", + "dst_discriminator": [133, 29, 89, 223, 69, 238, 176, 10], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + }, + { + "src_ix_name": "initialize_tick_array", + "src_discriminator": [11, 188, 193, 214, 141, 91, 149, 184], + "dst_ix_name": "initialize_tick_array", + "dst_discriminator": [11, 188, 193, 214, 141, 91, 149, 184], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, -1, 8, -1] + }, + { + "src_ix_name": "open_position_with_token_extensions", + "src_discriminator": [212, 47, 95, 92, 114, 102, 131, 250], + "dst_ix_name": "open_position_with_token_extensions", + "dst_discriminator": [212, 47, 95, 92, 114, 102, 131, 250], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + }, + { + "account": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "index": 11, + "writable": false, + "signer": false + }, + { + "account": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "index": 12, + "writable": false, + "signer": false + } + ], + "index_map": [-1, -1, 7, 8, 9, 10, -1, -1, -1, 13] + }, + { + "src_ix_name": "reposition_liquidity_v2", + "src_discriminator": [191, 169, 224, 11, 131, 19, 158, 253], + "dst_ix_name": "reposition_liquidity_v2", + "dst_discriminator": [191, 169, 224, 11, 131, 19, 158, 253], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [ + 7, 8, 9, 10, -1, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1 + ] + }, + { + "src_ix_name": "update_fees_and_rewards", + "src_discriminator": [154, 230, 250, 13, 236, 209, 75, 223], + "dst_ix_name": "update_fees_and_rewards", + "dst_discriminator": [154, 230, 250, 13, 236, 209, 75, 223], + "dynamic_accounts": [ + { + "name": "glam_state", + "index": 0, + "writable": true, + "signer": false + }, + { + "name": "glam_vault", + "index": 1, + "writable": true, + "signer": false + }, + { + "name": "glam_signer", + "index": 2, + "writable": true, + "signer": true + }, + { + "name": "integration_authority", + "index": 3, + "writable": false, + "signer": false + } + ], + "static_accounts": [ + { + "account": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", + "index": 4, + "writable": false, + "signer": false + }, + { + "account": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz", + "index": 5, + "writable": false, + "signer": false + }, + { + "account": "11111111111111111111111111111111", + "index": 6, + "writable": false, + "signer": false + } + ], + "index_map": [7, 8, 9, 10] + } + ] +} diff --git a/sdk/build.gradle.kts b/sdk/build.gradle.kts index fddb1d77..eed9f683 100644 --- a/sdk/build.gradle.kts +++ b/sdk/build.gradle.kts @@ -44,36 +44,69 @@ hardening { } } -// The jar embeds the mapping configs under glam/ix-mappings. The source directory is an -// untracked sparse checkout that only ./downloadMappings.sh creates, and `from()` on a -// directory that does not exist copies nothing without a word — every published sdk jar -// before this task shipped empty for exactly that reason. The download is therefore part -// of the jar's own graph, and the archive is checked after it is written. -val downloadMappings = tasks.register("downloadMappings") { - description = "Materializes the pinned ix-mapper-ts mapping configs under the untracked glam/ directory." - workingDir = rootDir - commandLine("./downloadMappings.sh") -} +// The jar embeds the ix-mapper mapping configs under glam/ix-mappings/{production,staging}: +// the two directories at the repository root that glamsystems/glam projects here (its +// anchor_v1/ix-mapper sets, generated from its managed IDL stores). They are copied at +// processResources time, so tests read the bytes the jar ships, beside an index the loader +// reads, since a jar cannot be listed. `from()` on a directory that does not exist copies +// nothing without a word, and every published sdk jar before the embedding shipped empty for +// exactly that reason, so the index task refuses an empty set and the archive is checked +// after it is written. +val mappingSets = linkedMapOf( + "production" to rootDir.resolve("mapping/production"), + "staging" to rootDir.resolve("mapping/staging"), +) -tasks.named("jar") { - dependsOn(downloadMappings) - val mappings = rootDir.resolve("glam/mapping-configs-v1") - from(mappings) { - include("**/*.json") - into("glam/ix-mappings") +// The sync that projects the sets writes the glam commit beside them, in a tracked file the +// build declares as an input: provenance read from the tree, never from git history, so a +// shallow clone and an incremental build agree on it. The first import wrote it by hand. +val mappingsSource = rootDir.resolve("mapping/SOURCE") + +val ixMappingsIndex = tasks.register("ixMappingsIndex") { + description = "Writes glam/ix-mappings/index.json: each environment's embedded config file names and the glam commit they were projected from." + val sets = mappingSets + val sourceFile = mappingsSource + sets.values.forEach { inputs.dir(it) } + inputs.file(sourceFile) + val indexFile = layout.buildDirectory.file("ix-mappings/index.json") + outputs.file(indexFile) + doLast { + check(sourceFile.isFile) { "${sourceFile.name} is missing beside the mapping sets; the sync that projects them writes it." } + val source = sourceFile.readText().trim() + check(Regex("glamsystems/glam@[0-9a-f]{40}").matches(source)) { "${sourceFile.name} holds '$source', not glamsystems/glam@." } + val entries = sets.entries.joinToString(",\n") { (env, dir) -> + val files = dir.listFiles { file -> file.isFile && file.name.endsWith(".json") }.orEmpty().sortedBy { it.name } + check(files.isNotEmpty()) { "No mapping configs under $dir; the sdk jar must not ship without the $env set." } + " \"$env\": [" + files.joinToString(", ") { "\"" + it.name + "\"" } + "]" + } + val file = indexFile.get().asFile + file.parentFile.mkdirs() + file.writeText("{\n \"source\": \"$source\",\n$entries\n}\n") } - doFirst { - val configs = mappings.listFiles { file -> file.isFile && file.name.endsWith(".json") }.orEmpty() - check(configs.isNotEmpty()) { - "No mapping configs under $mappings; the sdk jar must not ship without them (./downloadMappings.sh)." +} + +tasks.named("processResources") { + mappingSets.forEach { (env, dir) -> + from(dir) { + include("*.json") + into("glam/ix-mappings/$env") } } + from(ixMappingsIndex) { + into("glam/ix-mappings") + } +} + +tasks.named("jar") { doLast { ZipFile(archiveFile.get().asFile).use { archive -> - val embedded = archive.entries().asSequence() - .count { entry -> entry.name.startsWith("glam/ix-mappings/") && entry.name.endsWith(".json") } - check(embedded > 0) { "${archiveFile.get().asFile.name} was written without any glam/ix-mappings/*.json entry." } - logger.lifecycle("${archiveFile.get().asFile.name} embeds $embedded mapping config(s) under glam/ix-mappings.") + val entries = archive.entries().asSequence().map { it.name }.toList() + for (env in listOf("production", "staging")) { + val embedded = entries.count { it.startsWith("glam/ix-mappings/$env/") && it.endsWith(".json") } + check(embedded > 0) { "${archiveFile.get().asFile.name} was written without any glam/ix-mappings/$env/*.json entry." } + logger.lifecycle("${archiveFile.get().asFile.name} embeds $embedded $env mapping config(s).") + } + check("glam/ix-mappings/index.json" in entries) { "${archiveFile.get().asFile.name} was written without glam/ix-mappings/index.json." } } } } diff --git a/sdk/src/main/java/systems/glam/sdk/EmbeddedMappings.java b/sdk/src/main/java/systems/glam/sdk/EmbeddedMappings.java new file mode 100644 index 00000000..103079d6 --- /dev/null +++ b/sdk/src/main/java/systems/glam/sdk/EmbeddedMappings.java @@ -0,0 +1,174 @@ +package systems.glam.sdk; + +import software.sava.core.accounts.PublicKey; +import software.sava.core.accounts.meta.AccountMeta; +import systems.comodal.jsoniter.FieldBufferPredicate; +import systems.comodal.jsoniter.JsonIterator; +import systems.glam.ix.proxy.IndexedAccountMeta; +import systems.glam.ix.proxy.ProgramMapConfig; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; + +/// The ix-mapper mapping configs the sdk jar carries: one file per source program under +/// `glam/ix-mappings/production` and `glam/ix-mappings/staging`, the two sets glamsystems/glam +/// generates from its managed IDL stores and projects into this repository, embedded at build +/// time beside an index, because a jar cannot be listed. A consumer reads them through +/// [GlamAccounts#createMapper(systems.glam.sdk.proxy.DynamicGlamAccountFactory)] and supplies +/// no directory. +public final class EmbeddedMappings { + + static final String RESOURCE_ROOT = "glam/ix-mappings/"; + static final String INDEX_RESOURCE = RESOURCE_ROOT + "index.json"; + + /// What the build wrote beside the configs: the glam commit they were projected from, as the + /// sync commit recorded it, and each environment's file names. + public record Index(String source, List production, List staging) { + + public List files(final GlamEnv env) { + return switch (env) { + case PRODUCTION -> production; + case STAGING -> staging; + }; + } + } + + public static Index index() { + return parseIndex(readResource(INDEX_RESOURCE)); + } + + static Index parseIndex(final byte[] json) { + return JsonIterator.parse(json).parseObject(new IndexParser()); + } + + /// The jar directory of an environment's set, as the build writes it: the lowercase name. + static String directory(final GlamEnv env) { + return RESOURCE_ROOT + env.name().toLowerCase(Locale.ROOT) + '/'; + } + + /// Every config embedded for the environment. Each holds to it: a config whose proxy program + /// is not one of the environment's GLAM programs is refused by name, so a production set can + /// never be loaded for a staging vault, or the other way round. + public static List load(final GlamEnv env) { + return load(env, glamPrograms(env.glamAccounts())); + } + + /// The environment whose embedded set serves a protocol program. A program the sdk does not + /// know is refused: the sets carry their environment's proxy ids, so serving staging's set + /// for it, as reading everything but production as staging would, would send instructions + /// to programs the caller never named. + static GlamEnv environmentOf(final PublicKey protocolProgram) { + return GlamEnv.ofProtocolProgram(protocolProgram).orElseThrow(() -> new IllegalArgumentException( + "The sdk jar embeds mapping sets for production and staging only; " + protocolProgram.toBase58() + + " is neither GLAM protocol program. Supply a mappings directory instead." + )); + } + + /// The programs a config of these accounts may proxy through: the protocol program and every + /// integration program the accounts name. + static Set glamPrograms(final GlamAccounts glamAccounts) { + final var programs = new HashSet<>(glamAccounts.integrationAuthorities().keySet()); + programs.add(glamAccounts.protocolProgram()); + return programs; + } + + static List load(final GlamEnv env, final Set glamPrograms) { + return load(index(), env, glamPrograms, EmbeddedMappings::readResource); + } + + /// The loader over any index and resource reader, so a test can hand it a set the jar does + /// not carry and watch each refusal. + static List load(final Index index, + final GlamEnv env, + final Set glamPrograms, + final Function resources) { + final var files = index.files(env); + if (files.isEmpty()) { + throw new IllegalStateException("The sdk jar embeds no " + env + " mapping configs."); + } + final var directory = directory(env); + final var accountMetaCache = new HashMap(256); + final var indexedAccountMetaCache = new HashMap(256); + final var configs = new ArrayList(files.size()); + for (final var file : files) { + final var resource = directory + file; + final var config = ProgramMapConfig.parseConfig( + accountMetaCache, indexedAccountMetaCache, JsonIterator.parse(resources.apply(resource)) + ); + final var proxy = config.invokedProxyProgram(); + if (proxy == null) { + throw new IllegalStateException(resource + " names no proxy program."); + } + if (!glamPrograms.contains(proxy.publicKey())) { + throw new IllegalStateException(String.format( + "%s proxies through %s, which is not a %s GLAM program.", resource, proxy.publicKey().toBase58(), env + )); + } + configs.add(config); + } + return List.copyOf(configs); + } + + static byte[] readResource(final String name) { + try (final var in = EmbeddedMappings.class.getModule().getResourceAsStream(name)) { + if (in == null) { + throw new IllegalStateException("The sdk jar does not carry " + name + '.'); + } + return in.readAllBytes(); + } catch (final IOException e) { + throw new UncheckedIOException(e); + } + } + + /// Every field is required and a field the build does not write is refused, so an index + /// another writer produced cannot load half a set silently. + private static final class IndexParser implements FieldBufferPredicate, Supplier { + + private String source; + private List production; + private List staging; + + @Override + public Index get() { + if (source == null || production == null || staging == null) { + throw new IllegalStateException(INDEX_RESOURCE + " must name source, production and staging."); + } + return new Index(source, List.copyOf(production), List.copyOf(staging)); + } + + private static List fileNames(final JsonIterator ji, final String field) { + final var names = ji.readList(JsonIterator::readString); + for (final var name : names) { + if (name == null || !name.endsWith(".json") || name.contains("/") || name.contains("\\")) { + throw new IllegalStateException(INDEX_RESOURCE + ' ' + field + " names " + name + ", which is not a config file name."); + } + } + return names; + } + + @Override + public boolean test(final char[] buf, final int offset, final int len, final JsonIterator ji) { + if (JsonIterator.fieldEquals("source", buf, offset, len)) { + source = ji.readString(); + } else if (JsonIterator.fieldEquals("production", buf, offset, len)) { + production = fileNames(ji, "production"); + } else if (JsonIterator.fieldEquals("staging", buf, offset, len)) { + staging = fileNames(ji, "staging"); + } else { + throw new IllegalStateException(INDEX_RESOURCE + " declares an unknown field " + new String(buf, offset, len) + '.'); + } + return true; + } + } + + private EmbeddedMappings() { + } +} diff --git a/sdk/src/main/java/systems/glam/sdk/GlamAccounts.java b/sdk/src/main/java/systems/glam/sdk/GlamAccounts.java index 512cc574..a768337c 100644 --- a/sdk/src/main/java/systems/glam/sdk/GlamAccounts.java +++ b/sdk/src/main/java/systems/glam/sdk/GlamAccounts.java @@ -3,11 +3,13 @@ import software.sava.core.accounts.ProgramDerivedAddress; import software.sava.core.accounts.PublicKey; import software.sava.core.accounts.meta.AccountMeta; +import systems.glam.ix.proxy.ProgramMapConfig; import systems.glam.ix.proxy.TransactionMapper; import systems.glam.sdk.idl.programs.glam.mint.gen.GlamMintPDAs; import systems.glam.sdk.proxy.DynamicGlamAccountFactory; import java.nio.file.Path; +import java.util.List; import java.util.Map; public interface GlamAccounts { @@ -30,6 +32,7 @@ public interface GlamAccounts { .policyProgram("po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY") .bridgeIntegrationProgram("gstgxS9yTioViNKdsM4DC33k1TU9un2VCYDQK8fAeSA") .cctpIntegrationProgram("gstgcuRwiX2FpmtigowB1TnVi3fPkZC9TEmVnc5sdxW") + .exponentIntegrationProgram("gstgx5AbCFq4mfYKbZP23YDC7XZFUx2EURiG3PcWX6W") .externalPositionProgram("gstge5RzNEGQwpwBPKTJbP9yczoFEzzm5upSSsie9fX") .jupiterIntegrationProgram("gstgJbGqoE3p1SdFA2dET9tcaCzNqGcdD8wpbGctnU9") .kaminoIntegrationProgram("gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq") @@ -70,6 +73,19 @@ default TransactionMapper createMapper(final Path mappingsDir return GlamVaultAccounts.createMapper(invokedProtocolProgram(), mappingsDirectory, dynamicGlamAccountFactory); } + /// The mapper over the configs the sdk jar embeds for this deployment, production for + /// [#MAIN_NET] and staging for [#MAIN_NET_STAGING], with no directory to supply. The + /// [#createMapper(Path, DynamicGlamAccountFactory)] overload stays for a local set. + default TransactionMapper createMapper(final DynamicGlamAccountFactory dynamicGlamAccountFactory) { + return GlamVaultAccounts.createMapper(invokedProtocolProgram(), embeddedMappingConfigs(), dynamicGlamAccountFactory); + } + + /// The configs the sdk jar embeds for this deployment, each proxying through one of these + /// accounts' GLAM programs. + default List embeddedMappingConfigs() { + return EmbeddedMappings.load(EmbeddedMappings.environmentOf(protocolProgram()), EmbeddedMappings.glamPrograms(this)); + } + Map integrationAuthorities(); AccountMeta readMintIntegrationAuthority(); @@ -88,6 +104,12 @@ default TransactionMapper createMapper(final Path mappingsDir AccountMeta readCctpIntegrationAuthority(); + AccountMeta invokedExponentIntegrationProgram(); + + PublicKey exponentIntegrationProgram(); + + AccountMeta readExponentIntegrationAuthority(); + AccountMeta invokedExternalPositionProgram(); AccountMeta readExternalPositionAuthority(); diff --git a/sdk/src/main/java/systems/glam/sdk/GlamAccountsBuilder.java b/sdk/src/main/java/systems/glam/sdk/GlamAccountsBuilder.java index ff2db557..51b9e3e6 100644 --- a/sdk/src/main/java/systems/glam/sdk/GlamAccountsBuilder.java +++ b/sdk/src/main/java/systems/glam/sdk/GlamAccountsBuilder.java @@ -10,6 +10,7 @@ import systems.glam.sdk.idl.programs.glam.spl.gen.ExtSplPDAs; import systems.glam.sdk.idl.programs.glam.staging.bridge.gen.ExtBridgePDAs; import systems.glam.sdk.idl.programs.glam.staging.cctp.gen.ExtCctpPDAs; +import systems.glam.sdk.idl.programs.glam.staging.exponent.gen.ExtExponentPDAs; import systems.glam.sdk.idl.programs.glam.staging.registered_positions.gen.ExtRpiPDAs; import systems.glam.sdk.idl.programs.glam.staging.jupiter.gen.ExtJupiterPDAs; import systems.glam.sdk.idl.programs.glam.staging.loopscale.gen.ExtLoopscalePDAs; @@ -34,6 +35,7 @@ public final class GlamAccountsBuilder { private PublicKey policyProgram; private PublicKey bridgeIntegrationProgram = PublicKey.NONE; private PublicKey cctpIntegrationProgram = PublicKey.NONE; + private PublicKey exponentIntegrationProgram = PublicKey.NONE; private PublicKey externalPositionProgram = PublicKey.NONE; private PublicKey jupiterIntegrationProgram = PublicKey.NONE; private PublicKey kaminoIntegrationProgram = PublicKey.NONE; @@ -71,13 +73,14 @@ private static AccountMeta putIfNotNull(final Map map, } public GlamAccounts create() { - final var map = HashMap.newHashMap(15); + final var map = HashMap.newHashMap(16); return new GlamAccountsRecord( createInvoked(protocolProgram), configProgram, GlamConfigPDAs.globalConfigPDA(configProgram), policyProgram, putIfNotNull(map, bridgeIntegrationProgram, ExtBridgePDAs::integrationAuthorityPDA), putIfNotNull(map, cctpIntegrationProgram, ExtCctpPDAs::integrationAuthorityPDA), + putIfNotNull(map, exponentIntegrationProgram, ExtExponentPDAs::integrationAuthorityPDA), putIfNotNull(map, externalPositionProgram, ExtRpiPDAs::integrationAuthorityPDA), putIfNotNull(map, jupiterIntegrationProgram, ExtJupiterPDAs::integrationAuthorityPDA), putIfNotNull(map, kaminoIntegrationProgram, ExtKaminoPDAs::integrationAuthorityPDA), @@ -149,6 +152,15 @@ public GlamAccountsBuilder cctpIntegrationProgram(final String cctpIntegrationPr return cctpIntegrationProgram(createKey(cctpIntegrationProgram)); } + public GlamAccountsBuilder exponentIntegrationProgram(final PublicKey exponentIntegrationProgram) { + this.exponentIntegrationProgram = exponentIntegrationProgram; + return this; + } + + public GlamAccountsBuilder exponentIntegrationProgram(final String exponentIntegrationProgram) { + return exponentIntegrationProgram(createKey(exponentIntegrationProgram)); + } + public GlamAccountsBuilder driftIntegrationProgram(final PublicKey driftIntegrationProgram) { return this; } diff --git a/sdk/src/main/java/systems/glam/sdk/GlamAccountsRecord.java b/sdk/src/main/java/systems/glam/sdk/GlamAccountsRecord.java index ae578382..89dfb01f 100644 --- a/sdk/src/main/java/systems/glam/sdk/GlamAccountsRecord.java +++ b/sdk/src/main/java/systems/glam/sdk/GlamAccountsRecord.java @@ -15,6 +15,7 @@ public record GlamAccountsRecord(AccountMeta invokedProtocolProgram, PublicKey policyProgram, AccountMeta invokedBridgeIntegrationProgram, AccountMeta invokedCctpIntegrationProgram, + AccountMeta invokedExponentIntegrationProgram, AccountMeta invokedExternalPositionProgram, AccountMeta invokedJupiterIntegrationProgram, AccountMeta invokedKaminoIntegrationProgram, @@ -66,6 +67,16 @@ public AccountMeta readCctpIntegrationAuthority() { return integrationAuthorities.get(cctpIntegrationProgram()); } + @Override + public PublicKey exponentIntegrationProgram() { + return invokedExponentIntegrationProgram.publicKey(); + } + + @Override + public AccountMeta readExponentIntegrationAuthority() { + return integrationAuthorities.get(exponentIntegrationProgram()); + } + @Override public PublicKey externalPositionProgram() { return invokedExternalPositionProgram.publicKey(); diff --git a/sdk/src/main/java/systems/glam/sdk/GlamEnv.java b/sdk/src/main/java/systems/glam/sdk/GlamEnv.java index a8b79c34..ed3f7cc0 100644 --- a/sdk/src/main/java/systems/glam/sdk/GlamEnv.java +++ b/sdk/src/main/java/systems/glam/sdk/GlamEnv.java @@ -2,6 +2,8 @@ import software.sava.core.accounts.PublicKey; +import java.util.Optional; + public enum GlamEnv { PRODUCTION(GlamAccounts.MAIN_NET), @@ -19,6 +21,17 @@ public static GlamEnv from(final PublicKey protocolProgram) { : STAGING; } + /// The deployment whose protocol program this is, or empty for one the sdk does not know: + /// unlike [#from], which reads anything but production as staging, nothing is assumed. + public static Optional ofProtocolProgram(final PublicKey protocolProgram) { + for (final var env : values()) { + if (env.protocolProgram().equals(protocolProgram)) { + return Optional.of(env); + } + } + return Optional.empty(); + } + public PublicKey protocolProgram() { return glamAccounts.protocolProgram(); } diff --git a/sdk/src/main/java/systems/glam/sdk/GlamVaultAccounts.java b/sdk/src/main/java/systems/glam/sdk/GlamVaultAccounts.java index f6c1ab03..b7acffff 100644 --- a/sdk/src/main/java/systems/glam/sdk/GlamVaultAccounts.java +++ b/sdk/src/main/java/systems/glam/sdk/GlamVaultAccounts.java @@ -84,6 +84,14 @@ static TransactionMapper createMapper(final AccountMeta invok return createMapper(invokedGlamProgram, loadMappingConfigs(mappingsDirectory), dynamicGlamAccountFactory); } + /// The mapper over the configs the sdk jar embeds for the deployment the invoked program + /// belongs to; see [EmbeddedMappings]. + static TransactionMapper createMapper(final AccountMeta invokedGlamProgram, + final DynamicGlamAccountFactory dynamicGlamAccountFactory) { + final var env = EmbeddedMappings.environmentOf(invokedGlamProgram.publicKey()); + return createMapper(invokedGlamProgram, EmbeddedMappings.load(env), dynamicGlamAccountFactory); + } + GlamAccounts glamAccounts(); PublicKey feePayer(); diff --git a/sdk/src/test/java/systems/glam/sdk/EmbeddedMappingsTests.java b/sdk/src/test/java/systems/glam/sdk/EmbeddedMappingsTests.java new file mode 100644 index 00000000..9e896f93 --- /dev/null +++ b/sdk/src/test/java/systems/glam/sdk/EmbeddedMappingsTests.java @@ -0,0 +1,210 @@ +package systems.glam.sdk; + +import org.junit.jupiter.api.Test; +import software.sava.core.accounts.PublicKey; +import software.sava.core.accounts.meta.AccountMeta; +import systems.glam.sdk.proxy.DynamicGlamAccountFactory; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.TreeSet; + +import static org.junit.jupiter.api.Assertions.*; +import static software.sava.core.accounts.PublicKey.fromBase58Encoded; + +/// The configs the jar embeds are the bytes the repository holds, indexed whole, held to +/// their environment, and served by createMapper with no directory. +final class EmbeddedMappingsTests { + + private static final PublicKey SYSTEM_PROGRAM = fromBase58Encoded("11111111111111111111111111111111"); + private static final PublicKey KAMINO_LENDING = fromBase58Encoded("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"); + + private static Path repositorySet(final GlamEnv env) { + // the test runs with the module directory as its working directory + return Path.of("..", "mapping", env == GlamEnv.PRODUCTION ? "production" : "staging"); + } + + @Test + void theIndexNamesEveryEmbeddedFileAndEachOneParses() { + final var index = EmbeddedMappings.index(); + assertFalse(index.production().isEmpty(), "no production configs indexed"); + assertFalse(index.staging().isEmpty(), "no staging configs indexed"); + assertFalse(index.source().isBlank()); + for (final var env : GlamEnv.values()) { + final var configs = EmbeddedMappings.load(env); + assertEquals(index.files(env).size(), configs.size(), env + ": one config per indexed file"); + for (final var config : configs) { + assertFalse(config.ixMapConfigs().isEmpty(), env + ": a config with no instructions"); + } + } + } + + /// The embedded set is the repository set, byte for byte and file for file, in both + /// environments: the index names exactly the repository's files and each resource holds + /// its file's bytes. + @Test + void theEmbeddedSetEqualsTheRepositorySet() throws IOException { + final var index = EmbeddedMappings.index(); + for (final var env : GlamEnv.values()) { + final var directory = repositorySet(env); + final var repositoryFiles = new TreeSet(); + try (final var files = Files.list(directory)) { + files.filter(Files::isRegularFile) + .map(file -> file.getFileName().toString()) + .filter(name -> name.endsWith(".json")) + .forEach(repositoryFiles::add); + } + assertEquals(repositoryFiles, new TreeSet<>(index.files(env)), env + ": the index does not name the repository's files"); + for (final var name : repositoryFiles) { + final var resource = EmbeddedMappings.RESOURCE_ROOT + env.name().toLowerCase(Locale.ROOT) + '/' + name; + assertArrayEquals( + Files.readAllBytes(directory.resolve(name)), + EmbeddedMappings.readResource(resource), + env + ": " + name + " in the jar differs from the repository file" + ); + } + assertEquals( + GlamVaultAccounts.loadMappingConfigs(directory).size(), + EmbeddedMappings.load(env).size(), + env + ": the directory loader and the embedded loader disagree on the count" + ); + } + } + + /// Every config proxies through a GLAM program of its own environment, and the other + /// environment's programs refuse the set by file name: a production set can never be + /// served for a staging vault. + @Test + void eachEnvironmentHoldsToItsOwnGlamPrograms() { + for (final var env : GlamEnv.values()) { + final var own = EmbeddedMappings.glamPrograms(env.glamAccounts()); + for (final var config : EmbeddedMappings.load(env, own)) { + final var proxy = config.invokedProxyProgram(); + assertNotNull(proxy, env + ": a config without a proxy program"); + assertTrue(own.contains(proxy.publicKey()), env + ": " + proxy.publicKey().toBase58() + " is not a GLAM program of this environment"); + } + final var other = env == GlamEnv.PRODUCTION ? GlamEnv.STAGING : GlamEnv.PRODUCTION; + final var refused = assertThrows(IllegalStateException.class, + () -> EmbeddedMappings.load(env, EmbeddedMappings.glamPrograms(other.glamAccounts()))); + assertTrue(refused.getMessage().contains("is not a " + env + " GLAM program"), refused.getMessage()); + assertTrue(refused.getMessage().startsWith(EmbeddedMappings.RESOURCE_ROOT), refused.getMessage()); + } + } + + /// A narrower allowance names the first file that steps outside it. + @Test + void aForeignProxyIsRefusedByName() { + final var protocolOnly = Set.of(GlamAccounts.MAIN_NET.protocolProgram()); + final var refused = assertThrows(IllegalStateException.class, + () -> EmbeddedMappings.load(GlamEnv.PRODUCTION, protocolOnly)); + assertTrue(refused.getMessage().contains(".json proxies through "), refused.getMessage()); + } + + @Test + void createMapperWithoutAPathServesBothEnvironments() { + for (final var env : GlamEnv.values()) { + final var glamAccounts = env.glamAccounts(); + final var factory = DynamicGlamAccountFactory.createFactory(glamAccounts.integrationAuthorities(), 8); + final var mapper = glamAccounts.createMapper(factory); + assertEquals(glamAccounts.protocolProgram(), mapper.invokedProxyProgram()); + assertNotNull(mapper.programProxy(SYSTEM_PROGRAM), env + ": no System program proxy"); + assertNotNull(mapper.programProxy(KAMINO_LENDING), env + ": no Kamino Lending proxy"); + final var viaProgram = GlamVaultAccounts.createMapper(glamAccounts.invokedProtocolProgram(), factory); + assertEquals(mapper.invokedProxyProgram(), viaProgram.invokedProxyProgram()); + assertNotNull(viaProgram.programProxy(SYSTEM_PROGRAM)); + } + } + /// The index records the glam commit the sets were projected from as the tracked + /// mapping/SOURCE states it; a build never consults git history for it. + @Test + void theIndexRecordsTheSourceTheTrackedFileStates() throws IOException { + final var stated = Files.readString(Path.of("..", "mapping", "SOURCE")).trim(); + assertTrue(stated.matches("glamsystems/glam@[0-9a-f]{40}"), stated); + assertEquals(stated, EmbeddedMappings.index().source()); + } + + /// A protocol program the sdk does not know is refused, not served staging's set. + @Test + void anUnknownProtocolProgramIsRefused() { + final var custom = AccountMeta.createInvoked(fromBase58Encoded("So11111111111111111111111111111111111111112")); + final var factory = DynamicGlamAccountFactory.createFactory(GlamAccounts.MAIN_NET.integrationAuthorities(), 8); + final var refused = assertThrows(IllegalArgumentException.class, () -> GlamVaultAccounts.createMapper(custom, factory)); + assertTrue(refused.getMessage().contains(custom.publicKey().toBase58() + " is neither GLAM protocol program"), refused.getMessage()); + final var accounts = GlamAccountsBuilder.builder() + .protocolProgram(custom.publicKey()) + .configProgram(GlamAccounts.MAIN_NET.configProgram()) + .mintProgram(GlamAccounts.MAIN_NET.mintProgram()) + .policyProgram(GlamAccounts.MAIN_NET.policyProgram()) + .create(); + assertThrows(IllegalArgumentException.class, () -> accounts.createMapper(factory)); + assertTrue(GlamEnv.ofProtocolProgram(custom.publicKey()).isEmpty()); + } + private static byte[] utf8(final String text) { + return text.getBytes(java.nio.charset.StandardCharsets.UTF_8); + } + + /// The index names source, production and staging, every one: an index another writer + /// produced without one of them cannot load half a set silently. + @Test + void theIndexParserRefusesAMissingField() { + final var whole = "{\"source\": \"s\", \"production\": [\"a.json\"], \"staging\": [\"b.json\"]}"; + assertEquals(List.of("a.json"), EmbeddedMappings.parseIndex(utf8(whole)).production()); + for (final var missing : List.of("source", "production", "staging")) { + final var json = whole.replaceFirst("\"" + missing + "\": [^,}]+,? ?", "").replace(", }", "}"); + final var refused = assertThrows(IllegalStateException.class, () -> EmbeddedMappings.parseIndex(utf8(json)), json); + assertTrue(refused.getMessage().contains("must name source, production and staging"), refused.getMessage()); + } + } + + @Test + void theIndexParserRefusesAnUnknownField() { + final var refused = assertThrows(IllegalStateException.class, () -> EmbeddedMappings.parseIndex( + utf8("{\"source\": \"s\", \"production\": [], \"staging\": [], \"extra\": 1}"))); + assertTrue(refused.getMessage().contains("declares an unknown field extra"), refused.getMessage()); + } + + /// A file name is a plain `.json`: no path, no other extension, no null. The loader + /// joins it to the environment's directory, so anything else would read outside the set. + @Test + void theIndexParserRefusesANameThatIsNotAConfigFileName() { + for (final var name : List.of("null", "\"x.txt\"", "\"a/b.json\"", "\"a\\\\b.json\"")) { + final var json = "{\"source\": \"s\", \"production\": [" + name + "], \"staging\": []}"; + final var refused = assertThrows(IllegalStateException.class, () -> EmbeddedMappings.parseIndex(utf8(json)), json); + assertTrue(refused.getMessage().contains("which is not a config file name"), refused.getMessage()); + } + } + + @Test + void aMissingResourceIsRefusedByName() { + final var refused = assertThrows(IllegalStateException.class, () -> EmbeddedMappings.readResource("glam/ix-mappings/nope.json")); + assertEquals("The sdk jar does not carry glam/ix-mappings/nope.json.", refused.getMessage()); + } + + /// The set's directory in the jar is the lowercase environment name the build writes; + /// a case-insensitive filesystem would hide a wrong case until the jar is read on Linux. + @Test + void theSetDirectoryIsTheLowercaseEnvironmentName() { + assertEquals("glam/ix-mappings/production/", EmbeddedMappings.directory(GlamEnv.PRODUCTION)); + assertEquals("glam/ix-mappings/staging/", EmbeddedMappings.directory(GlamEnv.STAGING)); + } + + /// An environment the index lists no file for is refused rather than served an empty mapper, + /// and a config that names no proxy program is refused by its resource name. + @Test + void anEmptySetOrAConfigWithoutAProxyIsRefused() { + final var own = EmbeddedMappings.glamPrograms(GlamAccounts.MAIN_NET); + final var empty = new EmbeddedMappings.Index("s", List.of(), List.of("x.json")); + final var none = assertThrows(IllegalStateException.class, + () -> EmbeddedMappings.load(empty, GlamEnv.PRODUCTION, own, EmbeddedMappings::readResource)); + assertEquals("The sdk jar embeds no PRODUCTION mapping configs.", none.getMessage()); + final var index = new EmbeddedMappings.Index("s", List.of("x.json"), List.of()); + final var noProxy = assertThrows(IllegalStateException.class, + () -> EmbeddedMappings.load(index, GlamEnv.PRODUCTION, own, + resource -> utf8("{\"program_id\": \"11111111111111111111111111111111\", \"instructions\": []}"))); + assertEquals("glam/ix-mappings/production/x.json names no proxy program.", noProxy.getMessage()); + } +} diff --git a/sdk/src/test/java/systems/glam/sdk/GlamAccountsTests.java b/sdk/src/test/java/systems/glam/sdk/GlamAccountsTests.java index c7458253..c46a01b3 100644 --- a/sdk/src/test/java/systems/glam/sdk/GlamAccountsTests.java +++ b/sdk/src/test/java/systems/glam/sdk/GlamAccountsTests.java @@ -67,6 +67,9 @@ void absentIntegrationsDefaultToSystemProgram() { assertEquals(invokedSystem, accounts.invokedBridgeIntegrationProgram()); assertEquals(systemProgram, accounts.bridgeIntegrationProgram()); assertNull(accounts.readBridgeIntegrationAuthority()); + assertEquals(invokedSystem, accounts.invokedExponentIntegrationProgram()); + assertEquals(systemProgram, accounts.exponentIntegrationProgram()); + assertNull(accounts.readExponentIntegrationAuthority()); assertEquals(invokedSystem, accounts.invokedExternalPositionProgram()); assertEquals(systemProgram, accounts.externalPositionProgram()); assertNull(accounts.readExternalPositionAuthority()); @@ -175,6 +178,7 @@ private static void assertSameAccounts(final GlamAccounts expected, final GlamAc assertEquals(expected.mintEventAuthority(), actual.mintEventAuthority()); assertEquals(expected.invokedBridgeIntegrationProgram(), actual.invokedBridgeIntegrationProgram()); assertEquals(expected.invokedCctpIntegrationProgram(), actual.invokedCctpIntegrationProgram()); + assertEquals(expected.invokedExponentIntegrationProgram(), actual.invokedExponentIntegrationProgram()); assertEquals(expected.invokedExternalPositionProgram(), actual.invokedExternalPositionProgram()); assertEquals(expected.invokedJupiterIntegrationProgram(), actual.invokedJupiterIntegrationProgram()); assertEquals(expected.invokedKaminoIntegrationProgram(), actual.invokedKaminoIntegrationProgram()); @@ -229,6 +233,7 @@ void stagingBuilderInTest() { .policyProgram("po1iCYakK3gHCLbuju4wGzFowTMpAJxkqK1iwUqMonY") .bridgeIntegrationProgram("gstgxS9yTioViNKdsM4DC33k1TU9un2VCYDQK8fAeSA") .cctpIntegrationProgram("gstgcuRwiX2FpmtigowB1TnVi3fPkZC9TEmVnc5sdxW") + .exponentIntegrationProgram("gstgx5AbCFq4mfYKbZP23YDC7XZFUx2EURiG3PcWX6W") .externalPositionProgram("gstge5RzNEGQwpwBPKTJbP9yczoFEzzm5upSSsie9fX") .jupiterIntegrationProgram("gstgJbGqoE3p1SdFA2dET9tcaCzNqGcdD8wpbGctnU9") .kaminoIntegrationProgram("gstgKa2Gq9wf5hM3DFWx1TvUrGYzDYszyFGq3XBY9Uq") @@ -250,6 +255,7 @@ void stagingBuilderInTest() { .policyProgram(POLICY_PROGRAM) .bridgeIntegrationProgram(GlamAccounts.MAIN_NET_STAGING.bridgeIntegrationProgram()) .cctpIntegrationProgram(GlamAccounts.MAIN_NET_STAGING.cctpIntegrationProgram()) + .exponentIntegrationProgram(GlamAccounts.MAIN_NET_STAGING.exponentIntegrationProgram()) .externalPositionProgram(GlamAccounts.MAIN_NET_STAGING.externalPositionProgram()) .jupiterIntegrationProgram(GlamAccounts.MAIN_NET_STAGING.jupiterIntegrationProgram()) .kaminoIntegrationProgram(GlamAccounts.MAIN_NET_STAGING.kaminoIntegrationProgram()) @@ -272,9 +278,10 @@ void stagingAccounts() { fromBase58Encoded("gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"), staging.protocolProgram() ); - // every staging integration program is present: 14 distinct authorities - assertEquals(14, staging.integrationAuthorities().size()); + // every staging integration program is present: 15 distinct authorities + assertEquals(15, staging.integrationAuthorities().size()); assertNotNull(staging.readBridgeIntegrationAuthority()); + assertNotNull(staging.readExponentIntegrationAuthority()); assertNotNull(staging.readExternalPositionAuthority()); assertNotNull(staging.readJupiterIntegrationAuthority()); assertNotNull(staging.readLoopscaleIntegrationAuthority()); diff --git a/sdk/src/test/resources/fuzz/README.md b/sdk/src/test/resources/fuzz/README.md index 75334209..aa12c35c 100644 --- a/sdk/src/test/resources/fuzz/README.md +++ b/sdk/src/test/resources/fuzz/README.md @@ -9,7 +9,7 @@ Arbitrary bytes parsed as ix-mapper mapping-config JSON, exactly as `RuntimeException` out. Seeds: - `system.json` — the system-program mapping config (inlined, matches the - `glam/mapping-configs-v1` shape). + `glam/mapping/production` shape). - `token.json` — a real multi-instruction config from the download, if present. - `empty-object` / `no-instructions` — minimal shapes pinning the empty-and-absent-instruction paths. diff --git a/services/src/test/java/systems/glam/services/proxy/EmbeddedMapperTests.java b/services/src/test/java/systems/glam/services/proxy/EmbeddedMapperTests.java new file mode 100644 index 00000000..5c3403ac --- /dev/null +++ b/services/src/test/java/systems/glam/services/proxy/EmbeddedMapperTests.java @@ -0,0 +1,159 @@ +package systems.glam.services.proxy; + +import org.junit.jupiter.api.Test; +import software.sava.core.accounts.PublicKey; +import software.sava.core.accounts.SolanaAccounts; +import software.sava.core.accounts.meta.AccountMeta; +import software.sava.core.programs.Discriminator; +import software.sava.core.tx.Instruction; +import software.sava.idl.clients.spl.system.gen.SystemProgram; +import systems.glam.sdk.GlamEnv; +import systems.glam.sdk.GlamVaultAccounts; +import systems.glam.sdk.idl.programs.glam.cctp.gen.ExtCctpProgram; +import systems.glam.sdk.idl.programs.glam.protocol.gen.GlamProtocolProgram; +import systems.glam.sdk.idl.programs.glam.staging.bridge.gen.ExtBridgeProgram; +import systems.glam.sdk.proxy.DynamicGlamAccountFactory; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static software.sava.core.accounts.PublicKey.fromBase58Encoded; +import static software.sava.core.programs.Discriminator.toDiscriminator; + +/// What a service sees with only the sdk on its module path: a mapper built from the configs +/// the jar embeds, with no directory to mount, mapping a native instruction onto the GLAM +/// proxy for both deployments. +final class EmbeddedMapperTests { + + private static final PublicKey FEE_PAYER = fromBase58Encoded("F1oQY1jbdiJyxxeeuMBF2NsUckboyWo6TSXNqzJbrhxs"); + private static final PublicKey STATE_KEY = fromBase58Encoded("9fkan2jCsS7Xq3fLqgxgZT5pDCbj2MhQ5MAoEKSHrcAT"); + private static final PublicKey DESTINATION = fromBase58Encoded("ApgsxNeZbi9P2pCAjzYR8VauqnWZpNkbN1iRWH1QsSwH"); + private static final PublicKey KAMINO_LENDING = fromBase58Encoded("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"); + private static final PublicKey CCTP_TOKEN_MESSENGER = fromBase58Encoded("CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe"); + // the token messenger's deposit_for_burn, as the configs carry it + private static final Discriminator NATIVE_DEPOSIT_FOR_BURN = toDiscriminator(215, 60, 61, 46, 114, 55, 128, 176); + + @Test + void aSystemTransferFromTheVaultMapsOntoTheProtocolProxyInBothEnvironments() { + for (final var env : GlamEnv.values()) { + final var glamAccounts = env.glamAccounts(); + final var vaultAccounts = GlamVaultAccounts.createAccounts(glamAccounts, FEE_PAYER, STATE_KEY); + final var mapper = glamAccounts.createMapper( + DynamicGlamAccountFactory.createFactory(glamAccounts.integrationAuthorities(), 8) + ); + + final var transfer = SystemProgram.transferSol( + SolanaAccounts.MAIN_NET.invokedSystemProgram(), + vaultAccounts.vaultPublicKey(), + DESTINATION, + 1_000L + ); + final var mapped = mapper.mapInstruction(AccountMeta.createWritableSigner(FEE_PAYER), vaultAccounts, transfer); + + assertEquals(glamAccounts.protocolProgram(), mapped.programId().publicKey(), env + ": not sent to the protocol program"); + assertTrue(GlamProtocolProgram.SYSTEM_TRANSFER_DISCRIMINATOR.equals(mapped.data(), 0), env + ": not the system_transfer discriminator"); + final var accounts = mapped.accounts(); + assertEquals(STATE_KEY, accounts.get(0).publicKey(), env + ": glam_state"); + assertEquals(vaultAccounts.vaultPublicKey(), accounts.get(1).publicKey(), env + ": glam_vault"); + assertEquals(FEE_PAYER, accounts.get(2).publicKey(), env + ": glam_signer"); + assertTrue(accounts.get(2).signer(), env + ": glam_signer signs"); + assertEquals(SolanaAccounts.MAIN_NET.systemProgram(), accounts.get(3).publicKey(), env + ": system program"); + assertEquals(DESTINATION, accounts.get(4).publicKey(), env + ": the native destination crosses"); + assertEquals(5, accounts.size(), env + ": account count"); + } + } + + @Test + void theKaminoProxiesAreServedForBothEnvironments() { + for (final var env : GlamEnv.values()) { + final var glamAccounts = env.glamAccounts(); + final var mapper = glamAccounts.createMapper( + DynamicGlamAccountFactory.createFactory(glamAccounts.integrationAuthorities(), 8) + ); + final var proxy = mapper.programProxy(KAMINO_LENDING); + assertNotNull(proxy, env + ": no Kamino Lending proxy"); + assertEquals(KAMINO_LENDING, proxy.cpiProgram(), env + ": the proxy is keyed by the native program"); + } + } + /// CCTP's token messenger is proxied by the program each deployment carries the bridge path + /// in: ext_cctp in production, ext_bridge on staging, where the native deposit_for_burn maps + /// onto cctp_deposit_for_burn and not onto the managed handler. + @Test + void theCctpTokenMessengerIsProxiedByEachDeploymentsBridgeProgram() { + for (final var env : GlamEnv.values()) { + final var glamAccounts = env.glamAccounts(); + final var production = env == GlamEnv.PRODUCTION; + final var config = glamAccounts.embeddedMappingConfigs().stream() + .filter(candidate -> candidate.programs().stream().anyMatch(program -> program.publicKey().equals(CCTP_TOKEN_MESSENGER))) + .findFirst() + .orElseThrow(() -> new AssertionError(env + ": no CCTP token messenger config")); + assertEquals( + production ? glamAccounts.cctpIntegrationProgram() : glamAccounts.bridgeIntegrationProgram(), + config.invokedProxyProgram().publicKey(), + env + ": proxied by the wrong GLAM program" + ); + final var mapper = glamAccounts.createMapper( + DynamicGlamAccountFactory.createFactory(glamAccounts.integrationAuthorities(), 8) + ); + final var proxy = mapper.programProxy(CCTP_TOKEN_MESSENGER); + assertNotNull(proxy, env + ": no CCTP token messenger proxy"); + assertEquals( + production ? ExtCctpProgram.DEPOSIT_FOR_BURN_DISCRIMINATOR : ExtBridgeProgram.CCTP_DEPOSIT_FOR_BURN_DISCRIMINATOR, + proxy.lookupProxyOrThrow(NATIVE_DEPOSIT_FOR_BURN).proxyDiscriminator(), + env + ": deposit_for_burn maps onto the wrong handler" + ); + } + } + private static final PublicKey PHOENIX = fromBase58Encoded("EtrnLzgbS7nMMy5fbD42kXiUzGg8XQzJ972Xtk1cjWih"); + + /// ext_phoenix takes the native accounts as remaining accounts after its own seven and + /// requires the trader wallet to be the vault. The vault PDA cannot sign a transaction, so the + /// mapper seats it at that position without the signer bit and forwards the rest in place; the + /// fee payer is the only signer left. (Review finding on glamsystems/glam#1393: the earlier + /// empty index map forwarded the trader with its signer bit, an unsignable transaction.) + @Test + void aPhoenixDepositSeatsTheVaultAsTheTraderWithoutASignerBit() { + final var glamAccounts = GlamEnv.STAGING.glamAccounts(); + final var vaultAccounts = GlamVaultAccounts.createAccounts(glamAccounts, FEE_PAYER, STATE_KEY); + final var vault = vaultAccounts.vaultPublicKey(); + final var mapper = glamAccounts.createMapper( + DynamicGlamAccountFactory.createFactory(glamAccounts.integrationAuthorities(), 8) + ); + final var other = fromBase58Encoded("So11111111111111111111111111111111111111112"); + // native deposit_funds: phoenix program, log authority, global configuration, trader wallet + // (signer), trader token account, trader account, global vault, token program, global trader + // index, active trader buffer; the client builds it with the vault as the trader + final var deposit = Instruction.createInstruction( + PHOENIX, + List.of( + AccountMeta.createRead(PHOENIX), + AccountMeta.createRead(other), + AccountMeta.createWrite(other), + AccountMeta.createReadOnlySigner(vault), + AccountMeta.createWrite(other), + AccountMeta.createWrite(other), + AccountMeta.createWrite(other), + AccountMeta.createRead(SolanaAccounts.MAIN_NET.tokenProgram()), + AccountMeta.createWrite(other), + AccountMeta.createWrite(other) + ), + new byte[]{(byte) 202, 39, 52, (byte) 211, 53, 20, (byte) 250, 88, 1, 0, 0, 0, 0, 0, 0, 0} + ); + final var mapped = mapper.mapInstruction(AccountMeta.createWritableSigner(FEE_PAYER), vaultAccounts, deposit); + + assertEquals(glamAccounts.phoenixIntegrationProgram(), mapped.programId().publicKey()); + final var seats = mapped.accounts(); + assertEquals(17, seats.size(), "seven extension accounts then the ten native ones"); + assertEquals(vault, seats.get(10).publicKey(), "the trader wallet position carries the vault"); + assertFalse(seats.get(10).signer(), "the vault PDA does not sign; the program signs for it"); + assertEquals(PHOENIX, seats.get(7).publicKey(), "the native accounts forward in place"); + assertEquals(SolanaAccounts.MAIN_NET.tokenProgram(), seats.get(14).publicKey()); + final var signers = new java.util.ArrayList(); + for (int i = 0; i < seats.size(); ++i) { + if (seats.get(i).signer()) { + signers.add(i); + } + } + assertEquals(List.of(2), signers, "the fee payer is the only signer"); + } +} diff --git a/syncMappings.sh b/syncMappings.sh deleted file mode 100755 index 968e1efd..00000000 --- a/syncMappings.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Moves the mapping-config pin in downloadMappings.sh to ix-mapper-ts's current default -# branch head (or to the commit given as the first argument) and re-materializes glam/. -# The pin change is the reviewable diff; commit it with the jar it produces. - -set -euo pipefail - -cd "$(dirname "${BASH_SOURCE[0]}")" - -readonly repo="$(sed -n 's/^readonly MAPPINGS_REPO="\(.*\)"$/\1/p' downloadMappings.sh)" -readonly current="$(sed -n 's/^readonly MAPPINGS_REF="\(.*\)"$/\1/p' downloadMappings.sh)" -if [[ -z "$repo" || -z "$current" ]]; then - echo "syncMappings: could not read MAPPINGS_REPO/MAPPINGS_REF from downloadMappings.sh" >&2 - exit 1 -fi - -if [[ $# -ge 1 ]]; then - target="$1" -else - target="$(git ls-remote "$repo" HEAD | cut -f1)" -fi -if [[ ! "$target" =~ ^[0-9a-f]{40}$ ]]; then - echo "syncMappings: '$target' is not a full commit sha" >&2 - exit 1 -fi - -if [[ "$target" == "$current" ]]; then - echo "syncMappings: already pinned to $current" -else - sed -i.bak "s/^readonly MAPPINGS_REF=\"$current\"$/readonly MAPPINGS_REF=\"$target\"/" downloadMappings.sh - rm -f downloadMappings.sh.bak - echo "syncMappings: pin moved $current -> $target" -fi -./downloadMappings.sh